From af38e1b307cfec61fe404863a90ef371fefea44b Mon Sep 17 00:00:00 2001 From: Emily Underhill Date: Mon, 26 Feb 2024 13:06:16 +0000 Subject: [PATCH 1/4] yaml updated --- swagger/api.yml | 104 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 99 insertions(+), 5 deletions(-) diff --git a/swagger/api.yml b/swagger/api.yml index b1705df..07a0e67 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: | + The contract information and status of a hosted booking identified using the channel_tenant_id. + type: object + properties: + tenant_name: + type: string + description: Full name of the user whom initialised the booking + channel_tenant_id: + type: string + description: Identifier provided in the redirect URL when the tenant initialised the booking + unique_channel_tenant_id: + type: string + description: Generated unique identifier, this will be the same as the channel_tenant_id unless the same identifier has been provided for multiple bookings. + tenant_email: + type: string + description: Email address of the user whom initialised the booking + tenant_phone: + type: string + description: Phone number of the user whom initialised the booking + guarantor_required: + type: number + 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: Date that the contract has started + contract_end_date: + type: string + description: Date that the contract has ended + contract_length: + type: number + 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: number + description: Number of tenants included in the booking + rent_installnents: + type: number + description: Number of rent installments due throughout the duration of the contract + created_date: + type: string + description: Date that the contract was created + booking_status: + type: string + description: Status of the booking + booking_expiry: + type: string + description: Date that the booking will expire if not signed by the tenant \ No newline at end of file From d1cc10cf6fc507f27b7cf1b5a4e291d16c409a83 Mon Sep 17 00:00:00 2001 From: Emily Underhill Date: Tue, 27 Feb 2024 09:13:41 +0000 Subject: [PATCH 2/4] Booking status model created and api docs updated for booking status endpoint --- src/Models/BookingStatus.php | 570 ++++++++++++++++++++++++++++++ src/Requests/GetBookingStatus.php | 41 +++ swagger/api.yml | 32 +- 3 files changed, 627 insertions(+), 16 deletions(-) create mode 100644 src/Models/BookingStatus.php create mode 100644 src/Requests/GetBookingStatus.php diff --git a/src/Models/BookingStatus.php b/src/Models/BookingStatus.php new file mode 100644 index 0000000..fdc9fc5 --- /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 07a0e67..4ac0c11 100644 --- a/swagger/api.yml +++ b/swagger/api.yml @@ -1478,24 +1478,24 @@ definitions: type: string BookingStatus: description: | - The contract information and status of a hosted booking identified using the channel_tenant_id. + Basic contract information and booking status. type: object properties: tenant_name: type: string - description: Full name of the user whom initialised the booking - channel_tenant_id: + description: Full name of the user who initiated the booking + tenant_id: type: string - description: Identifier provided in the redirect URL when the tenant initialised the booking - unique_channel_tenant_id: + 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 channel_tenant_id unless the same identifier has been provided for multiple bookings. + 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 whom initialised the booking + description: Email address of the user who initiated the booking tenant_phone: type: string - description: Phone number of the user whom initialised the booking + description: Phone number of the user who initiated the booking guarantor_required: type: number description: 1|0, indicates whether the contract requires a guarantor @@ -1507,10 +1507,10 @@ definitions: description: Address of the property used in the booking contract_start_date: type: string - description: Date that the contract has started + description: Start date of the contract contract_end_date: type: string - description: Date that the contract has ended + description: End date of the contract contract_length: type: number description: Total contract duration in days @@ -1529,15 +1529,15 @@ definitions: tenancy_size: type: number description: Number of tenants included in the booking - rent_installnents: + rent_instalments: type: number - description: Number of rent installments due throughout the duration of the contract - created_date: + description: Number of rent instalments due throughout the duration of the contract + created_datetime: type: string - description: Date that the contract was created + description: Date and time that the contract was created booking_status: type: string description: Status of the booking - booking_expiry: + booking_expiry_datetime: type: string - description: Date that the booking will expire if not signed by the tenant \ No newline at end of file + description: Date and time that the booking will expire if not signed by the tenant \ No newline at end of file From db96887537921a1043bcdbccaad8c48d884c65d9 Mon Sep 17 00:00:00 2001 From: Emily Underhill Date: Tue, 27 Feb 2024 14:56:48 +0000 Subject: [PATCH 3/4] floats updated to integers --- src/Models/BookingStatus.php | 12 ++++++------ swagger/api.yml | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Models/BookingStatus.php b/src/Models/BookingStatus.php index fdc9fc5..d5a3be2 100644 --- a/src/Models/BookingStatus.php +++ b/src/Models/BookingStatus.php @@ -40,9 +40,9 @@ class BookingStatus extends SwaggerModel /** * 1|0, indicates whether the contract requires a guarantor - * @var float + * @var int */ - protected $guarantor_required = 0.0; + protected $guarantor_required = 0; /** * Name of the booking's property manager @@ -70,9 +70,9 @@ class BookingStatus extends SwaggerModel /** * Total contract duration in days - * @var float + * @var int */ - protected $contract_length = 0.0; + protected $contract_length = 0; /** * Total rent per person per week @@ -100,9 +100,9 @@ class BookingStatus extends SwaggerModel /** * Number of tenants included in the booking - * @var float + * @var int */ - protected $tenancy_size = 0.0; + protected $tenancy_size = 0; /** * Number of rent instalments due throughout the duration of the contract diff --git a/swagger/api.yml b/swagger/api.yml index 4ac0c11..66000ac 100644 --- a/swagger/api.yml +++ b/swagger/api.yml @@ -1497,7 +1497,7 @@ definitions: type: string description: Phone number of the user who initiated the booking guarantor_required: - type: number + type: integer description: 1|0, indicates whether the contract requires a guarantor property_manager_name: type: string @@ -1512,7 +1512,7 @@ definitions: type: string description: End date of the contract contract_length: - type: number + type: integer description: Total contract duration in days rent_pppw: type: number @@ -1527,10 +1527,10 @@ definitions: type: number description: Total monetary value of the contract tenancy_size: - type: number + type: integer description: Number of tenants included in the booking rent_instalments: - type: number + type: integer description: Number of rent instalments due throughout the duration of the contract created_datetime: type: string From b293cfaa9a242aa1ddaa3acb91bd192a3c0be740 Mon Sep 17 00:00:00 2001 From: Emily Underhill Date: Tue, 27 Feb 2024 17:04:54 +0000 Subject: [PATCH 4/4] rent instalments updated to integer --- src/Models/BookingStatus.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Models/BookingStatus.php b/src/Models/BookingStatus.php index d5a3be2..098f821 100644 --- a/src/Models/BookingStatus.php +++ b/src/Models/BookingStatus.php @@ -106,9 +106,9 @@ class BookingStatus extends SwaggerModel /** * Number of rent instalments due throughout the duration of the contract - * @var float + * @var int */ - protected $rent_instalments = 0.0; + protected $rent_instalments = 0; /** * Date and time that the contract was created