diff --git a/src/Models/BookingStatus.php b/src/Models/BookingStatus.php index 098f821..6fade35 100644 --- a/src/Models/BookingStatus.php +++ b/src/Models/BookingStatus.php @@ -8,144 +8,79 @@ */ class BookingStatus extends SwaggerModel { - /** - * Full name of the user who initiated the booking - * @var string - */ - protected $tenant_name = ''; - /** * Identifier provided in the redirect URL when the user initiated the booking * @var string + * @required */ - protected $tenant_id = ''; - - /** - * Generated unique identifier, this will be the same as the tenant_id unless the same identifier has been provided for multiple bookings. - * @var string - */ - protected $unique_tenant_id = ''; + protected $booking_id; /** - * Email address of the user who initiated the booking + * Generated unique identifier, this will be the same as the booking_id unless the same identifier has been provided for multiple bookings. * @var string + * @required */ - protected $tenant_email = ''; + protected $unique_booking_id; /** - * Phone number of the user who initiated the booking + * Status of the booking * @var string + * @required */ - protected $tenant_phone = ''; - - /** - * 1|0, indicates whether the contract requires a guarantor - * @var int - */ - protected $guarantor_required = 0; + protected $booking_status; /** - * Name of the booking's property manager - * @var string + * Details of the booking's property manager + * @var BookingStatusPropertyManager + * @required */ - protected $property_manager_name = ''; + protected $property_manager; /** * Address of the property used in the booking - * @var string - */ - protected $property_address = ''; - - /** - * Start date of the contract - * @var string - */ - protected $contract_start_date = ''; - - /** - * End date of the contract - * @var string - */ - protected $contract_end_date = ''; - - /** - * Total contract duration in days - * @var int - */ - protected $contract_length = 0; - - /** - * Total rent per person per week - * @var float - */ - protected $rent_pppw = 0.0; - - /** - * Title of the availability selected for the booking - * @var string + * @var BookingStatusAddress + * @required */ - protected $booking_option = ''; + protected $property_address; /** * Contract's currency code * @var string + * @required */ - protected $currency = ''; + protected $currency; /** - * Total monetary value of the contract - * @var float + * List of users involved in booking + * @var BookingStatusTenant[] + * @required */ - protected $total_contract_value = 0.0; + protected $tenants; /** - * Number of tenants included in the booking - * @var int + * @var ?BookingStatusTenancy + * @required */ - protected $tenancy_size = 0; - - /** - * Number of rent instalments due throughout the duration of the contract - * @var int - */ - protected $rent_instalments = 0; - - /** - * Date and time that the contract was created - * @var string - */ - protected $created_datetime = ''; - - /** - * Status of the booking - * @var string - */ - protected $booking_status = ''; - - /** - * Date and time that the booking will expire if not signed by the tenant - * @var string - */ - protected $booking_expiry_datetime = ''; + protected $tenancy; /** * @return string */ - public function getTenantName() + public function getBookingId() { - return $this->tenant_name; + return $this->booking_id; } /** - * @param string $tenant_name + * @param string $booking_id * * @return $this */ - public function setTenantName($tenant_name) + public function setBookingId($booking_id) { - $this->tenant_name = $tenant_name; + $this->booking_id = $booking_id; return $this; } @@ -154,20 +89,20 @@ public function setTenantName($tenant_name) /** * @return string */ - public function getTenantId() + public function getUniqueBookingId() { - return $this->tenant_id; + return $this->unique_booking_id; } /** - * @param string $tenant_id + * @param string $unique_booking_id * * @return $this */ - public function setTenantId($tenant_id) + public function setUniqueBookingId($unique_booking_id) { - $this->tenant_id = $tenant_id; + $this->unique_booking_id = $unique_booking_id; return $this; } @@ -176,115 +111,49 @@ public function setTenantId($tenant_id) /** * @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() + public function getBookingStatus() { - return $this->guarantor_required; + return $this->booking_status; } /** - * @param float $guarantor_required + * @param string $booking_status * * @return $this */ - public function setGuarantorRequired($guarantor_required) + public function setBookingStatus($booking_status) { - $this->guarantor_required = $guarantor_required; + $this->booking_status = $booking_status; return $this; } /** - * @return string + * @return BookingStatusPropertyManager */ - public function getPropertyManagerName() + public function getPropertyManager() { - return $this->property_manager_name; + return $this->property_manager; } /** - * @param string $property_manager_name + * @param BookingStatusPropertyManager $property_manager * * @return $this */ - public function setPropertyManagerName($property_manager_name) + public function setPropertyManager(BookingStatusPropertyManager $property_manager) { - $this->property_manager_name = $property_manager_name; + $this->property_manager = $property_manager; return $this; } /** - * @return string + * @return BookingStatusAddress */ public function getPropertyAddress() { @@ -293,11 +162,11 @@ public function getPropertyAddress() /** - * @param string $property_address + * @param BookingStatusAddress $property_address * * @return $this */ - public function setPropertyAddress($property_address) + public function setPropertyAddress(BookingStatusAddress $property_address) { $this->property_address = $property_address; @@ -305,116 +174,6 @@ public function setPropertyAddress($property_address) } - /** - * @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 */ @@ -438,132 +197,57 @@ public function setCurrency($currency) /** - * @return float + * @return BookingStatusTenant[] */ - public function getTotalContractValue() + public function getTenants() { - return $this->total_contract_value; + return $this->tenants; } /** - * @param float $total_contract_value + * @param BookingStatusTenant[] $tenants * * @return $this */ - public function setTotalContractValue($total_contract_value) + public function setTenants(array $tenants) { - $this->total_contract_value = $total_contract_value; + $this->tenants = $tenants; 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 + * @param BookingStatusTenant $tenant * * @return $this */ - public function setCreatedDatetime($created_datetime) + public function addTenant(BookingStatusTenant $tenant) { - $this->created_datetime = $created_datetime; + $this->tenants[] = $tenant; 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 + * @return ?BookingStatusTenancy */ - public function getBookingExpiryDatetime() + public function getTenancy() { - return $this->booking_expiry_datetime; + return $this->tenancy; } /** - * @param string $booking_expiry_datetime + * @param ?BookingStatusTenancy $tenancy * * @return $this */ - public function setBookingExpiryDatetime($booking_expiry_datetime) + public function setTenancy(?BookingStatusTenancy $tenancy) { - $this->booking_expiry_datetime = $booking_expiry_datetime; + $this->tenancy = $tenancy; return $this; } diff --git a/src/Models/BookingStatusAddress.php b/src/Models/BookingStatusAddress.php new file mode 100644 index 0000000..46ed190 --- /dev/null +++ b/src/Models/BookingStatusAddress.php @@ -0,0 +1,153 @@ +name; + } + + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + + /** + * @return string + */ + public function getNumber() + { + return $this->number; + } + + + /** + * @param string $number + * + * @return $this + */ + public function setNumber($number) + { + $this->number = $number; + + return $this; + } + + + /** + * @return string + */ + public function getStreet() + { + return $this->street; + } + + + /** + * @param string $street + * + * @return $this + */ + public function setStreet($street) + { + $this->street = $street; + + return $this; + } + + + /** + * @return string + */ + public function getCity() + { + return $this->city; + } + + + /** + * @param string $city + * + * @return $this + */ + public function setCity($city) + { + $this->city = $city; + + return $this; + } + + + /** + * @return string + */ + public function getPostcode() + { + return $this->postcode; + } + + + /** + * @param string $postcode + * + * @return $this + */ + public function setPostcode($postcode) + { + $this->postcode = $postcode; + + return $this; + } +} diff --git a/src/Models/BookingStatusPropertyManager.php b/src/Models/BookingStatusPropertyManager.php new file mode 100644 index 0000000..0a97e46 --- /dev/null +++ b/src/Models/BookingStatusPropertyManager.php @@ -0,0 +1,66 @@ +id; + } + + + /** + * @param string $id + * + * @return $this + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } +} diff --git a/src/Models/BookingStatusTenancy.php b/src/Models/BookingStatusTenancy.php new file mode 100644 index 0000000..aee682b --- /dev/null +++ b/src/Models/BookingStatusTenancy.php @@ -0,0 +1,269 @@ +created_datetime; + } + + + /** + * @param string $created_datetime + * + * @return $this + */ + public function setCreatedDatetime($created_datetime) + { + $this->created_datetime = $created_datetime; + + 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 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 ?int + */ + public function getContractLength() + { + return $this->contract_length; + } + + + /** + * @param ?int $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 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 int + */ + public function getTenancySize() + { + return $this->tenancy_size; + } + + + /** + * @param int $tenancy_size + * + * @return $this + */ + public function setTenancySize($tenancy_size) + { + $this->tenancy_size = $tenancy_size; + + 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/Models/BookingStatusTenant.php b/src/Models/BookingStatusTenant.php new file mode 100644 index 0000000..7695b47 --- /dev/null +++ b/src/Models/BookingStatusTenant.php @@ -0,0 +1,298 @@ +title; + } + + + /** + * @param string $title + * + * @return $this + */ + public function setTitle($title) + { + $this->title = $title; + + return $this; + } + + + /** + * @return string + */ + public function getFirstName() + { + return $this->first_name; + } + + + /** + * @param string $first_name + * + * @return $this + */ + public function setFirstName($first_name) + { + $this->first_name = $first_name; + + return $this; + } + + + /** + * @return string + */ + public function getLastName() + { + return $this->last_name; + } + + + /** + * @param string $last_name + * + * @return $this + */ + public function setLastName($last_name) + { + $this->last_name = $last_name; + + return $this; + } + + + /** + * @return string + */ + public function getEmail() + { + return $this->email; + } + + + /** + * @param string $email + * + * @return $this + */ + public function setEmail($email) + { + $this->email = $email; + + return $this; + } + + + /** + * @return string + */ + public function getPhone() + { + return $this->phone; + } + + + /** + * @param string $phone + * + * @return $this + */ + public function setPhone($phone) + { + $this->phone = $phone; + + return $this; + } + + + /** + * @return ?bool + */ + public function getGuarantorRequired() + { + return $this->guarantor_required; + } + + + /** + * @param ?bool $guarantor_required + * + * @return $this + */ + public function setGuarantorRequired($guarantor_required) + { + $this->guarantor_required = $guarantor_required; + + return $this; + } + + + /** + * @return ?float + */ + public function getRentPw() + { + return $this->rent_pw; + } + + + /** + * @param ?float $rent_pw + * + * @return $this + */ + public function setRentPw($rent_pw) + { + $this->rent_pw = $rent_pw; + + return $this; + } + + + /** + * @return ?float + */ + public function getTotalRent() + { + return $this->total_rent; + } + + + /** + * @param ?float $total_rent + * + * @return $this + */ + public function setTotalRent($total_rent) + { + $this->total_rent = $total_rent; + + return $this; + } + + + /** + * @return ?int + */ + public function getRentInstalments() + { + return $this->rent_instalments; + } + + + /** + * @param ?int $rent_instalments + * + * @return $this + */ + public function setRentInstalments($rent_instalments) + { + $this->rent_instalments = $rent_instalments; + + return $this; + } + + + /** + * @return ?string + */ + public function getSignedDatetime() + { + return $this->signed_datetime; + } + + + /** + * @param ?string $signed_datetime + * + * @return $this + */ + public function setSignedDatetime($signed_datetime) + { + $this->signed_datetime = $signed_datetime; + + return $this; + } +} diff --git a/swagger/api.yml b/swagger/api.yml index 66000ac..2f9a5a5 100644 --- a/swagger/api.yml +++ b/swagger/api.yml @@ -665,7 +665,7 @@ paths: Auth: [] parameters: - in: query - name: tenant_id + name: booking_id type: string required: true description: Unique booking identifier provided in the redirect URL @@ -675,9 +675,7 @@ paths: '200': description: Booking status and basic contract information schema: - type: array - items: - $ref: '#/definitions/BookingStatus' + $ref: '#/definitions/BookingStatus' '401': $ref: '#/definitions/AuthError' '404': @@ -1476,68 +1474,178 @@ definitions: properties: error: type: string - BookingStatus: - description: | - Basic contract information and booking status. + BookingStatusPropertyManager: type: object + required: + - id + - name properties: - tenant_name: + id: type: string - description: Full name of the user who initiated the booking - tenant_id: + description: ID of the property manager + name: type: string - description: Identifier provided in the redirect URL when the user initiated the booking - unique_tenant_id: + description: Name of the property manager + BookingStatusAddress: + type: object + required: + - name + - number + - street + - city + - postcode + properties: + name: 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: + description: Name of the address + number: type: string - description: Email address of the user who initiated the booking - tenant_phone: + description: Number of the address + street: + type: string + description: Street of the address + city: type: string - description: Phone number of the user who initiated the booking + description: City of the address + postcode: + type: string + description: Postcode of the address + BookingStatusTenant: + type: object + required: + - title + - first_name + - last_name + - email + - phone + - guarantor_required + - rent_pw + - total_rent + - rent_instalments + - signed_datetime + properties: + title: + type: string + description: Title of the user + first_name: + type: string + description: First name of the user + last_name: + type: string + description: Last name of the user + email: + type: string + description: Email address of the user + phone: + type: string + description: Phone number of the user guarantor_required: + type: boolean + nullable: true + description: Indicates whether the user requires a guarantor + rent_pw: + type: number + format: double + nullable: true + description: Rent per week + total_rent: + type: number + format: double + nullable: true + description: Total rent + rent_instalments: type: integer - description: 1|0, indicates whether the contract requires a guarantor - property_manager_name: + nullable: true + description: Number of rent instalments due throughout the duration of the contract + signed_datetime: type: string - description: Name of the booking's property manager - property_address: + nullable: true + description: Date and time that the tenant signed the tenancy + BookingStatusTenancy: + type: object + required: + - created_datetime + - booking_option + - contract_start_date + - contract_end_date + - contract_length + - rent_pppw + - total_contract_value + - tenancy_size + - booking_expiry_datetime + properties: + created_datetime: type: string - description: Address of the property used in the booking + description: Date and time that the contract was created + booking_option: + type: string + nullable: true + description: Title of the availability selected for the booking contract_start_date: type: string description: Start date of the contract contract_end_date: type: string + nullable: true description: End date of the contract contract_length: type: integer + nullable: true description: Total contract duration in days rent_pppw: type: number + format: double 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 + format: double 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: + booking_expiry_datetime: type: string - description: Date and time that the contract was created + nullable: true + description: Date and time that the booking will expire if not signed by the tenant + BookingStatus: + description: | + Basic contract information and booking status. + type: object + required: + - booking_id + - unique_booking_id + - booking_status + - property_manager + - property_address + - currency + - tenants + - tenancy + properties: + booking_id: + type: string + description: Identifier provided in the redirect URL when the user initiated the booking + unique_booking_id: + type: string + description: Generated unique identifier, this will be the same as the booking_id unless the same identifier has been provided for multiple bookings. booking_status: type: string description: Status of the booking - booking_expiry_datetime: + property_manager: + description: Details of the booking's property manager + $ref: '#/definitions/BookingStatusPropertyManager' + property_address: + description: Address of the property used in the booking + $ref: '#/definitions/BookingStatusAddress' + currency: type: string - description: Date and time that the booking will expire if not signed by the tenant \ No newline at end of file + description: Contract's currency code + tenants: + type: array + description: List of users involved in booking + items: + $ref: '#/definitions/BookingStatusTenant' + tenancy: + description: Details of tenancy created from booking + nullable: true + allOf: + - $ref: '#/definitions/BookingStatusTenancy' \ No newline at end of file