diff --git a/src/Models/BookingStatus.php b/src/Models/BookingStatus.php new file mode 100644 index 0000000..098f821 --- /dev/null +++ b/src/Models/BookingStatus.php @@ -0,0 +1,570 @@ +tenant_name; + } + + + /** + * @param string $tenant_name + * + * @return $this + */ + public function setTenantName($tenant_name) + { + $this->tenant_name = $tenant_name; + + return $this; + } + + + /** + * @return string + */ + public function getTenantId() + { + return $this->tenant_id; + } + + + /** + * @param string $tenant_id + * + * @return $this + */ + public function setTenantId($tenant_id) + { + $this->tenant_id = $tenant_id; + + return $this; + } + + + /** + * @return string + */ + public function getUniqueTenantId() + { + return $this->unique_tenant_id; + } + + + /** + * @param string $unique_tenant_id + * + * @return $this + */ + public function setUniqueTenantId($unique_tenant_id) + { + $this->unique_tenant_id = $unique_tenant_id; + + return $this; + } + + + /** + * @return string + */ + public function getTenantEmail() + { + return $this->tenant_email; + } + + + /** + * @param string $tenant_email + * + * @return $this + */ + public function setTenantEmail($tenant_email) + { + $this->tenant_email = $tenant_email; + + return $this; + } + + + /** + * @return string + */ + public function getTenantPhone() + { + return $this->tenant_phone; + } + + + /** + * @param string $tenant_phone + * + * @return $this + */ + public function setTenantPhone($tenant_phone) + { + $this->tenant_phone = $tenant_phone; + + return $this; + } + + + /** + * @return float + */ + public function getGuarantorRequired() + { + return $this->guarantor_required; + } + + + /** + * @param float $guarantor_required + * + * @return $this + */ + public function setGuarantorRequired($guarantor_required) + { + $this->guarantor_required = $guarantor_required; + + return $this; + } + + + /** + * @return string + */ + public function getPropertyManagerName() + { + return $this->property_manager_name; + } + + + /** + * @param string $property_manager_name + * + * @return $this + */ + public function setPropertyManagerName($property_manager_name) + { + $this->property_manager_name = $property_manager_name; + + return $this; + } + + + /** + * @return string + */ + public function getPropertyAddress() + { + return $this->property_address; + } + + + /** + * @param string $property_address + * + * @return $this + */ + public function setPropertyAddress($property_address) + { + $this->property_address = $property_address; + + return $this; + } + + + /** + * @return string + */ + public function getContractStartDate() + { + return $this->contract_start_date; + } + + + /** + * @param string $contract_start_date + * + * @return $this + */ + public function setContractStartDate($contract_start_date) + { + $this->contract_start_date = $contract_start_date; + + return $this; + } + + + /** + * @return string + */ + public function getContractEndDate() + { + return $this->contract_end_date; + } + + + /** + * @param string $contract_end_date + * + * @return $this + */ + public function setContractEndDate($contract_end_date) + { + $this->contract_end_date = $contract_end_date; + + return $this; + } + + + /** + * @return float + */ + public function getContractLength() + { + return $this->contract_length; + } + + + /** + * @param float $contract_length + * + * @return $this + */ + public function setContractLength($contract_length) + { + $this->contract_length = $contract_length; + + return $this; + } + + + /** + * @return float + */ + public function getRentPppw() + { + return $this->rent_pppw; + } + + + /** + * @param float $rent_pppw + * + * @return $this + */ + public function setRentPppw($rent_pppw) + { + $this->rent_pppw = $rent_pppw; + + return $this; + } + + + /** + * @return string + */ + public function getBookingOption() + { + return $this->booking_option; + } + + + /** + * @param string $booking_option + * + * @return $this + */ + public function setBookingOption($booking_option) + { + $this->booking_option = $booking_option; + + return $this; + } + + + /** + * @return string + */ + public function getCurrency() + { + return $this->currency; + } + + + /** + * @param string $currency + * + * @return $this + */ + public function setCurrency($currency) + { + $this->currency = $currency; + + return $this; + } + + + /** + * @return float + */ + public function getTotalContractValue() + { + return $this->total_contract_value; + } + + + /** + * @param float $total_contract_value + * + * @return $this + */ + public function setTotalContractValue($total_contract_value) + { + $this->total_contract_value = $total_contract_value; + + return $this; + } + + + /** + * @return float + */ + public function getTenancySize() + { + return $this->tenancy_size; + } + + + /** + * @param float $tenancy_size + * + * @return $this + */ + public function setTenancySize($tenancy_size) + { + $this->tenancy_size = $tenancy_size; + + return $this; + } + + + /** + * @return float + */ + public function getRentInstalments() + { + return $this->rent_instalments; + } + + + /** + * @param float $rent_instalments + * + * @return $this + */ + public function setRentInstalments($rent_instalments) + { + $this->rent_instalments = $rent_instalments; + + return $this; + } + + + /** + * @return string + */ + public function getCreatedDatetime() + { + return $this->created_datetime; + } + + + /** + * @param string $created_datetime + * + * @return $this + */ + public function setCreatedDatetime($created_datetime) + { + $this->created_datetime = $created_datetime; + + return $this; + } + + + /** + * @return string + */ + public function getBookingStatus() + { + return $this->booking_status; + } + + + /** + * @param string $booking_status + * + * @return $this + */ + public function setBookingStatus($booking_status) + { + $this->booking_status = $booking_status; + + return $this; + } + + + /** + * @return string + */ + public function getBookingExpiryDatetime() + { + return $this->booking_expiry_datetime; + } + + + /** + * @param string $booking_expiry_datetime + * + * @return $this + */ + public function setBookingExpiryDatetime($booking_expiry_datetime) + { + $this->booking_expiry_datetime = $booking_expiry_datetime; + + return $this; + } +} diff --git a/src/Requests/GetBookingStatus.php b/src/Requests/GetBookingStatus.php new file mode 100644 index 0000000..1a46bcd --- /dev/null +++ b/src/Requests/GetBookingStatus.php @@ -0,0 +1,41 @@ +tenant_id = $tenant_id; + } + + + /** + * @param SwaggerClient $client + * @return SwaggerModel + */ + public function sendWith(SwaggerClient $client) + { + return $client->make($this, [ + '200' => '\SturentsLib\Api\Models\BookingStatus::class', + '401' => '\SturentsLib\Api\Models\AuthError::class', + '404' => '\SturentsLib\Api\Models\GetError::class', + 'default' => '\SturentsLib\Api\Models\Error::class' + ]); + } +} diff --git a/swagger/api.yml b/swagger/api.yml index b1705df..66000ac 100644 --- a/swagger/api.yml +++ b/swagger/api.yml @@ -655,6 +655,35 @@ paths: $ref: '#/definitions/Error' default: $ref: '#/definitions/Error' + /booking-status: + get: + summary: | + Provides the booking status and basic contract information for a hosted booking + security: + - Channel: [] + Timestamp: [] + Auth: [] + parameters: + - in: query + name: tenant_id + type: string + required: true + description: Unique booking identifier provided in the redirect URL + tags: + - Contracts + responses: + '200': + description: Booking status and basic contract information + schema: + type: array + items: + $ref: '#/definitions/BookingStatus' + '401': + $ref: '#/definitions/AuthError' + '404': + $ref: '#/definitions/GetError' + default: + $ref: '#/definitions/Error' definitions: GetError: description: | @@ -1129,8 +1158,8 @@ definitions: book_now_url: type: string description: | - A URL where the property may be booked online using this contract. - Will be blank if the property is not set up for this feature + A URL where the property may be booked online using this contract. + Will be blank if the property is not set up for this feature prices: type: array description: | @@ -1428,17 +1457,17 @@ definitions: type: string description: Link to the property profile page on StuRents RoomSaved: - properties: + properties: room_id: type: string description: Unique reference to the Room on StuRents ContractSaved: - properties: + properties: contract_id: type: string description: Unique reference to the Contract on StuRents MediaSaved: - properties: + properties: media_id: type: string description: Unique reference to the Media item on StuRents @@ -1447,3 +1476,68 @@ definitions: properties: error: type: string + BookingStatus: + description: | + Basic contract information and booking status. + type: object + properties: + tenant_name: + type: string + description: Full name of the user who initiated the booking + tenant_id: + type: string + description: Identifier provided in the redirect URL when the user initiated the booking + unique_tenant_id: + type: string + description: Generated unique identifier, this will be the same as the tenant_id unless the same identifier has been provided for multiple bookings. + tenant_email: + type: string + description: Email address of the user who initiated the booking + tenant_phone: + type: string + description: Phone number of the user who initiated the booking + guarantor_required: + type: integer + description: 1|0, indicates whether the contract requires a guarantor + property_manager_name: + type: string + description: Name of the booking's property manager + property_address: + type: string + description: Address of the property used in the booking + contract_start_date: + type: string + description: Start date of the contract + contract_end_date: + type: string + description: End date of the contract + contract_length: + type: integer + description: Total contract duration in days + rent_pppw: + type: number + description: Total rent per person per week + booking_option: + type: string + description: Title of the availability selected for the booking + currency: + type: string + description: Contract's currency code + total_contract_value: + type: number + description: Total monetary value of the contract + tenancy_size: + type: integer + description: Number of tenants included in the booking + rent_instalments: + type: integer + description: Number of rent instalments due throughout the duration of the contract + created_datetime: + type: string + description: Date and time that the contract was created + booking_status: + type: string + description: Status of the booking + booking_expiry_datetime: + type: string + description: Date and time that the booking will expire if not signed by the tenant \ No newline at end of file