From b63be9757ed274151f299891f700f802b99dce71 Mon Sep 17 00:00:00 2001 From: Freddie Millman Date: Tue, 2 Apr 2024 12:19:26 +0100 Subject: [PATCH 1/4] C18-228 Add nullable types to fields where all fields supplied in response --- src/Models/BookingStatus.php | 406 ++++------------------------ src/Models/BookingStatusTenancy.php | 240 ++++++++++++++++ src/Models/BookingStatusTenant.php | 298 ++++++++++++++++++++ swagger/api.yml | 136 +++++++--- 4 files changed, 701 insertions(+), 379 deletions(-) create mode 100644 src/Models/BookingStatusTenancy.php create mode 100644 src/Models/BookingStatusTenant.php diff --git a/src/Models/BookingStatus.php b/src/Models/BookingStatus.php index 098f821..d8d3484 100644 --- a/src/Models/BookingStatus.php +++ b/src/Models/BookingStatus.php @@ -8,144 +8,87 @@ */ 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 = ''; + protected $booking_id; /** - * Generated unique identifier, this will be the same as the tenant_id unless the same identifier has been provided for multiple bookings. + * 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 $unique_tenant_id = ''; + protected $unique_booking_id; /** - * Email address of the user who initiated the booking + * Date and time that the contract was created * @var string + * @required */ - protected $tenant_email = ''; + protected $created_datetime; /** - * 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 + * @required */ - protected $property_manager_name = ''; + protected $property_manager_name; /** * Address of the property used in the booking * @var string + * @required */ - 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 - */ - protected $booking_option = ''; + protected $property_address; /** * Contract's currency code * @var string + * @required */ - protected $currency = ''; - - /** - * Total monetary value of the contract - * @var float - */ - protected $total_contract_value = 0.0; - - /** - * Number of tenants included in the booking - * @var int - */ - 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 = ''; + protected $currency; /** - * Status of the booking - * @var string + * List of users involved in booking + * @var BookingStatusTenant[] + * @required */ - protected $booking_status = ''; + protected $tenants; /** - * Date and time that the booking will expire if not signed by the tenant - * @var string + * Details of tenancy created from booking + * @var BookingStatusTenancy + * @required */ - 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 +97,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,42 +119,20 @@ 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() + public function getCreatedDatetime() { - return $this->tenant_email; + return $this->created_datetime; } /** - * @param string $tenant_email + * @param string $created_datetime * * @return $this */ - public function setTenantEmail($tenant_email) + public function setCreatedDatetime($created_datetime) { - $this->tenant_email = $tenant_email; + $this->created_datetime = $created_datetime; return $this; } @@ -220,42 +141,20 @@ public function setTenantEmail($tenant_email) /** * @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; } @@ -305,116 +204,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 +227,57 @@ public function setCurrency($currency) /** - * @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 + * @return BookingStatusTenant[] */ - public function getTenancySize() + public function getTenants() { - return $this->tenancy_size; + return $this->tenants; } /** - * @param float $tenancy_size + * @param BookingStatusTenant[] $tenants * * @return $this */ - public function setTenancySize($tenancy_size) + public function setTenants(array $tenants) { - $this->tenancy_size = $tenancy_size; + $this->tenants = $tenants; return $this; } /** - * @return float - */ - public function getRentInstalments() - { - return $this->rent_instalments; - } - - - /** - * @param float $rent_instalments + * @param BookingStatusTenant $tenant * * @return $this */ - public function setRentInstalments($rent_instalments) + public function addTenant(BookingStatusTenant $tenant) { - $this->rent_instalments = $rent_instalments; + $this->tenants[] = $tenant; 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 + * @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/BookingStatusTenancy.php b/src/Models/BookingStatusTenancy.php new file mode 100644 index 0000000..e575483 --- /dev/null +++ b/src/Models/BookingStatusTenancy.php @@ -0,0 +1,240 @@ +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 integer + */ + public function getContractLength() + { + return $this->contract_length; + } + + + /** + * @param integer $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 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 integer + */ + public function getTenancySize() + { + return $this->tenancy_size; + } + + + /** + * @param integer $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..3c7f5e3 --- /dev/null +++ b/src/Models/BookingStatusTenant.php @@ -0,0 +1,298 @@ +name; + } + + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $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 boolean + */ + public function getGuarantorRequired() + { + return $this->guarantor_required; + } + + + /** + * @param boolean $guarantor_required + * + * @return $this + */ + public function setGuarantorRequired($guarantor_required) + { + $this->guarantor_required = $guarantor_required; + + 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 integer + */ + public function getContractLength() + { + return $this->contract_length; + } + + + /** + * @param integer $contract_length + * + * @return $this + */ + public function setContractLength($contract_length) + { + $this->contract_length = $contract_length; + + 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 integer + */ + public function getRentInstalments() + { + return $this->rent_instalments; + } + + + /** + * @param integer $rent_instalments + * + * @return $this + */ + public function setRentInstalments($rent_instalments) + { + $this->rent_instalments = $rent_instalments; + + return $this; + } +} diff --git a/swagger/api.yml b/swagger/api.yml index 66000ac..4ac7665 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,140 @@ definitions: properties: error: type: string - BookingStatus: - description: | - Basic contract information and booking status. + BookingStatusTenant: type: object + required: + - name + - email + - phone + - guarantor_required + - contract_start_date + - contract_end_date + - contract_length + - rent_pw + - total_rent + - rent_instalments properties: - tenant_name: + 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: + description: Full name of the user + email: 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: + description: Email address of the user + phone: type: string - description: Phone number of the user who initiated the booking + description: Phone number of the user guarantor_required: - type: integer - description: 1|0, indicates whether the contract requires a guarantor - property_manager_name: + type: boolean + nullable: true + description: Indicates whether the user requires a guarantor + contract_start_date: type: string - description: Name of the booking's property manager - property_address: + nullable: true + description: Start date of the contract + contract_end_date: type: string - description: Address of the property used in the booking + nullable: true + description: End date of the contract + contract_length: + type: integer + nullable: true + description: Total contract duration in days + rent_pw: + type: number + nullable: true + description: Rent per week + total_rent: + type: number + nullable: true + description: Total rent + rent_instalments: + type: integer + nullable: true + description: Number of rent instalments due throughout the duration of the contract + BookingStatusTenancy: + type: object + required: + - contract_start_date + - contract_end_date + - contract_length + - rent_pppw + - booking_option + - total_contract_value + - tenancy_size + - booking_expiry_datetime + properties: 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 description: Total rent per person per week booking_option: type: string + nullable: true 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 + booking_expiry_datetime: + type: string + 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 + - created_datetime + - booking_status + - property_manager_name + - 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. 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: + 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 + 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 + allOf: + - nullable: true + - $ref: '#/definitions/BookingStatusTenancy' \ No newline at end of file From 6fd6fcfa9038153b1d4f20857097863031d214ad Mon Sep 17 00:00:00 2001 From: Freddie Millman Date: Tue, 2 Apr 2024 13:27:33 +0100 Subject: [PATCH 2/4] C18-228 Move created date to tenancy --- src/Models/BookingStatus.php | 29 ----------------------------- src/Models/BookingStatusTenancy.php | 29 +++++++++++++++++++++++++++++ swagger/api.yml | 8 ++++---- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/Models/BookingStatus.php b/src/Models/BookingStatus.php index d8d3484..25154ca 100644 --- a/src/Models/BookingStatus.php +++ b/src/Models/BookingStatus.php @@ -22,13 +22,6 @@ class BookingStatus extends SwaggerModel */ protected $unique_booking_id; - /** - * Date and time that the contract was created - * @var string - * @required - */ - protected $created_datetime; - /** * Status of the booking * @var string @@ -116,28 +109,6 @@ public function setUniqueBookingId($unique_booking_id) } - /** - * @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 */ diff --git a/src/Models/BookingStatusTenancy.php b/src/Models/BookingStatusTenancy.php index e575483..bc4c85d 100644 --- a/src/Models/BookingStatusTenancy.php +++ b/src/Models/BookingStatusTenancy.php @@ -6,6 +6,13 @@ */ class BookingStatusTenancy extends SwaggerModel { + /** + * Date and time that the contract was created + * @var string + * @required + */ + protected $created_datetime; + /** * Start date of the contract * @var string @@ -63,6 +70,28 @@ class BookingStatusTenancy extends SwaggerModel protected $booking_expiry_datetime; + /** + * @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 */ diff --git a/swagger/api.yml b/swagger/api.yml index 4ac7665..09e218c 100644 --- a/swagger/api.yml +++ b/swagger/api.yml @@ -1528,6 +1528,7 @@ definitions: BookingStatusTenancy: type: object required: + - created_datetime - contract_start_date - contract_end_date - contract_length @@ -1537,6 +1538,9 @@ definitions: - tenancy_size - booking_expiry_datetime properties: + created_datetime: + type: string + description: Date and time that the contract was created contract_start_date: type: string description: Start date of the contract @@ -1572,7 +1576,6 @@ definitions: required: - booking_id - unique_booking_id - - created_datetime - booking_status - property_manager_name - property_address @@ -1586,9 +1589,6 @@ definitions: 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. - created_datetime: - type: string - description: Date and time that the contract was created booking_status: type: string description: Status of the booking From bf4b3ab5029a794ec63667bff1d2fe1b0a81e892 Mon Sep 17 00:00:00 2001 From: Freddie Millman Date: Tue, 2 Apr 2024 17:22:35 +0100 Subject: [PATCH 3/4] C18-228 Update schema with landlord ID, tenant name split, and address handling --- src/Models/BookingStatus.php | 26 ++-- src/Models/BookingStatusAddress.php | 153 ++++++++++++++++++++ src/Models/BookingStatusPropertyManager.php | 66 +++++++++ src/Models/BookingStatusTenancy.php | 58 ++++---- src/Models/BookingStatusTenant.php | 142 +++++++++--------- swagger/api.yml | 96 ++++++++---- 6 files changed, 399 insertions(+), 142 deletions(-) create mode 100644 src/Models/BookingStatusAddress.php create mode 100644 src/Models/BookingStatusPropertyManager.php diff --git a/src/Models/BookingStatus.php b/src/Models/BookingStatus.php index 25154ca..ffc9f6d 100644 --- a/src/Models/BookingStatus.php +++ b/src/Models/BookingStatus.php @@ -30,15 +30,15 @@ class BookingStatus extends SwaggerModel 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 + * @var BookingStatusAddress * @required */ protected $property_address; @@ -132,29 +132,29 @@ public function setBookingStatus($booking_status) /** - * @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() { @@ -163,11 +163,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; 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 index bc4c85d..161e808 100644 --- a/src/Models/BookingStatusTenancy.php +++ b/src/Models/BookingStatusTenancy.php @@ -13,6 +13,13 @@ class BookingStatusTenancy extends SwaggerModel */ protected $created_datetime; + /** + * Title of the availability selected for the booking + * @var string + * @required + */ + protected $booking_option; + /** * Start date of the contract * @var string @@ -41,13 +48,6 @@ class BookingStatusTenancy extends SwaggerModel */ protected $rent_pppw; - /** - * Title of the availability selected for the booking - * @var string - * @required - */ - protected $booking_option; - /** * Total monetary value of the contract * @var float @@ -92,6 +92,28 @@ public function setCreatedDatetime($created_datetime) } + /** + * @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 */ @@ -180,28 +202,6 @@ public function setRentPppw($rent_pppw) } - /** - * @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 float */ diff --git a/src/Models/BookingStatusTenant.php b/src/Models/BookingStatusTenant.php index 3c7f5e3..d354c2c 100644 --- a/src/Models/BookingStatusTenant.php +++ b/src/Models/BookingStatusTenant.php @@ -7,53 +7,46 @@ class BookingStatusTenant extends SwaggerModel { /** - * Full name of the user + * Title of the user * @var string * @required */ - protected $name; + protected $title; /** - * Email address of the user + * First name of the user * @var string * @required */ - protected $email; + protected $first_name; /** - * Phone number of the user + * Last name of the user * @var string * @required */ - protected $phone; - - /** - * Indicates whether the user requires a guarantor - * @var boolean - * @required - */ - protected $guarantor_required; + protected $last_name; /** - * Start date of the contract + * Email address of the user * @var string * @required */ - protected $contract_start_date; + protected $email; /** - * End date of the contract + * Phone number of the user * @var string * @required */ - protected $contract_end_date; + protected $phone; /** - * Total contract duration in days - * @var integer + * Indicates whether the user requires a guarantor + * @var boolean * @required */ - protected $contract_length; + protected $guarantor_required; /** * Rent per week @@ -76,46 +69,31 @@ class BookingStatusTenant extends SwaggerModel */ protected $rent_instalments; - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - - /** - * @param string $name - * - * @return $this + * Date and time that the tenant signed the tenancy + * @var string + * @required */ - public function setName($name) - { - $this->name = $name; - - return $this; - } + protected $signed_datetime; /** * @return string */ - public function getEmail() + public function getTitle() { - return $this->email; + return $this->title; } /** - * @param string $email + * @param string $title * * @return $this */ - public function setEmail($email) + public function setTitle($title) { - $this->email = $email; + $this->title = $title; return $this; } @@ -124,42 +102,42 @@ public function setEmail($email) /** * @return string */ - public function getPhone() + public function getFirstName() { - return $this->phone; + return $this->first_name; } /** - * @param string $phone + * @param string $first_name * * @return $this */ - public function setPhone($phone) + public function setFirstName($first_name) { - $this->phone = $phone; + $this->first_name = $first_name; return $this; } /** - * @return boolean + * @return string */ - public function getGuarantorRequired() + public function getLastName() { - return $this->guarantor_required; + return $this->last_name; } /** - * @param boolean $guarantor_required + * @param string $last_name * * @return $this */ - public function setGuarantorRequired($guarantor_required) + public function setLastName($last_name) { - $this->guarantor_required = $guarantor_required; + $this->last_name = $last_name; return $this; } @@ -168,20 +146,20 @@ public function setGuarantorRequired($guarantor_required) /** * @return string */ - public function getContractStartDate() + public function getEmail() { - return $this->contract_start_date; + return $this->email; } /** - * @param string $contract_start_date + * @param string $email * * @return $this */ - public function setContractStartDate($contract_start_date) + public function setEmail($email) { - $this->contract_start_date = $contract_start_date; + $this->email = $email; return $this; } @@ -190,42 +168,42 @@ public function setContractStartDate($contract_start_date) /** * @return string */ - public function getContractEndDate() + public function getPhone() { - return $this->contract_end_date; + return $this->phone; } /** - * @param string $contract_end_date + * @param string $phone * * @return $this */ - public function setContractEndDate($contract_end_date) + public function setPhone($phone) { - $this->contract_end_date = $contract_end_date; + $this->phone = $phone; return $this; } /** - * @return integer + * @return boolean */ - public function getContractLength() + public function getGuarantorRequired() { - return $this->contract_length; + return $this->guarantor_required; } /** - * @param integer $contract_length + * @param boolean $guarantor_required * * @return $this */ - public function setContractLength($contract_length) + public function setGuarantorRequired($guarantor_required) { - $this->contract_length = $contract_length; + $this->guarantor_required = $guarantor_required; return $this; } @@ -295,4 +273,26 @@ public function setRentInstalments($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 09e218c..2f9a5a5 100644 --- a/swagger/api.yml +++ b/swagger/api.yml @@ -1474,23 +1474,65 @@ definitions: properties: error: type: string - BookingStatusTenant: + BookingStatusPropertyManager: + type: object + required: + - id + - name + properties: + id: + type: string + description: ID of the property manager + name: + type: string + description: Name of the property manager + BookingStatusAddress: type: object required: - name + - number + - street + - city + - postcode + properties: + name: + type: string + description: Name of the address + number: + type: string + description: Number of the address + street: + type: string + description: Street of the address + city: + type: string + 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 - - contract_start_date - - contract_end_date - - contract_length - rent_pw - total_rent - rent_instalments + - signed_datetime properties: - name: + title: + type: string + description: Title of the user + first_name: type: string - description: Full name of the user + 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 @@ -1501,39 +1543,33 @@ definitions: type: boolean nullable: true description: Indicates whether the user requires a guarantor - contract_start_date: - type: string - nullable: true - 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_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 nullable: true description: Number of rent instalments due throughout the duration of the contract + signed_datetime: + type: string + 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 - - booking_option - total_contract_value - tenancy_size - booking_expiry_datetime @@ -1541,6 +1577,10 @@ definitions: created_datetime: type: string 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 @@ -1554,13 +1594,11 @@ definitions: description: Total contract duration in days rent_pppw: type: number + format: double description: Total rent per person per week - booking_option: - type: string - nullable: true - description: Title of the availability selected for the booking total_contract_value: type: number + format: double description: Total monetary value of the contract tenancy_size: type: integer @@ -1577,7 +1615,7 @@ definitions: - booking_id - unique_booking_id - booking_status - - property_manager_name + - property_manager - property_address - currency - tenants @@ -1592,12 +1630,12 @@ definitions: booking_status: type: string description: Status of the booking - property_manager_name: - type: string - description: Name of the booking's property manager + property_manager: + description: Details of the booking's property manager + $ref: '#/definitions/BookingStatusPropertyManager' property_address: - type: string description: Address of the property used in the booking + $ref: '#/definitions/BookingStatusAddress' currency: type: string description: Contract's currency code @@ -1608,6 +1646,6 @@ definitions: $ref: '#/definitions/BookingStatusTenant' tenancy: description: Details of tenancy created from booking + nullable: true allOf: - - nullable: true - $ref: '#/definitions/BookingStatusTenancy' \ No newline at end of file From c7d31a820b72155eb43d28805800ec2cd5ac67bd Mon Sep 17 00:00:00 2001 From: Freddie Millman Date: Tue, 2 Apr 2024 19:13:09 +0100 Subject: [PATCH 4/4] C18-228 Utilise nullable definitions --- src/Models/BookingStatus.php | 9 ++++----- src/Models/BookingStatusTenancy.php | 30 ++++++++++++++--------------- src/Models/BookingStatusTenant.php | 30 ++++++++++++++--------------- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/src/Models/BookingStatus.php b/src/Models/BookingStatus.php index ffc9f6d..6fade35 100644 --- a/src/Models/BookingStatus.php +++ b/src/Models/BookingStatus.php @@ -58,8 +58,7 @@ class BookingStatus extends SwaggerModel protected $tenants; /** - * Details of tenancy created from booking - * @var BookingStatusTenancy + * @var ?BookingStatusTenancy * @required */ protected $tenancy; @@ -233,7 +232,7 @@ public function addTenant(BookingStatusTenant $tenant) /** - * @return BookingStatusTenancy + * @return ?BookingStatusTenancy */ public function getTenancy() { @@ -242,11 +241,11 @@ public function getTenancy() /** - * @param BookingStatusTenancy $tenancy + * @param ?BookingStatusTenancy $tenancy * * @return $this */ - public function setTenancy(BookingStatusTenancy $tenancy) + public function setTenancy(?BookingStatusTenancy $tenancy) { $this->tenancy = $tenancy; diff --git a/src/Models/BookingStatusTenancy.php b/src/Models/BookingStatusTenancy.php index 161e808..aee682b 100644 --- a/src/Models/BookingStatusTenancy.php +++ b/src/Models/BookingStatusTenancy.php @@ -15,7 +15,7 @@ class BookingStatusTenancy extends SwaggerModel /** * Title of the availability selected for the booking - * @var string + * @var ?string * @required */ protected $booking_option; @@ -29,14 +29,14 @@ class BookingStatusTenancy extends SwaggerModel /** * End date of the contract - * @var string + * @var ?string * @required */ protected $contract_end_date; /** * Total contract duration in days - * @var integer + * @var ?int * @required */ protected $contract_length; @@ -57,14 +57,14 @@ class BookingStatusTenancy extends SwaggerModel /** * Number of tenants included in the booking - * @var integer + * @var int * @required */ protected $tenancy_size; /** * Date and time that the booking will expire if not signed by the tenant - * @var string + * @var ?string * @required */ protected $booking_expiry_datetime; @@ -93,7 +93,7 @@ public function setCreatedDatetime($created_datetime) /** - * @return string + * @return ?string */ public function getBookingOption() { @@ -102,7 +102,7 @@ public function getBookingOption() /** - * @param string $booking_option + * @param ?string $booking_option * * @return $this */ @@ -137,7 +137,7 @@ public function setContractStartDate($contract_start_date) /** - * @return string + * @return ?string */ public function getContractEndDate() { @@ -146,7 +146,7 @@ public function getContractEndDate() /** - * @param string $contract_end_date + * @param ?string $contract_end_date * * @return $this */ @@ -159,7 +159,7 @@ public function setContractEndDate($contract_end_date) /** - * @return integer + * @return ?int */ public function getContractLength() { @@ -168,7 +168,7 @@ public function getContractLength() /** - * @param integer $contract_length + * @param ?int $contract_length * * @return $this */ @@ -225,7 +225,7 @@ public function setTotalContractValue($total_contract_value) /** - * @return integer + * @return int */ public function getTenancySize() { @@ -234,7 +234,7 @@ public function getTenancySize() /** - * @param integer $tenancy_size + * @param int $tenancy_size * * @return $this */ @@ -247,7 +247,7 @@ public function setTenancySize($tenancy_size) /** - * @return string + * @return ?string */ public function getBookingExpiryDatetime() { @@ -256,7 +256,7 @@ public function getBookingExpiryDatetime() /** - * @param string $booking_expiry_datetime + * @param ?string $booking_expiry_datetime * * @return $this */ diff --git a/src/Models/BookingStatusTenant.php b/src/Models/BookingStatusTenant.php index d354c2c..7695b47 100644 --- a/src/Models/BookingStatusTenant.php +++ b/src/Models/BookingStatusTenant.php @@ -43,35 +43,35 @@ class BookingStatusTenant extends SwaggerModel /** * Indicates whether the user requires a guarantor - * @var boolean + * @var ?bool * @required */ protected $guarantor_required; /** * Rent per week - * @var float + * @var ?float * @required */ protected $rent_pw; /** * Total rent - * @var float + * @var ?float * @required */ protected $total_rent; /** * Number of rent instalments due throughout the duration of the contract - * @var integer + * @var ?int * @required */ protected $rent_instalments; /** * Date and time that the tenant signed the tenancy - * @var string + * @var ?string * @required */ protected $signed_datetime; @@ -188,7 +188,7 @@ public function setPhone($phone) /** - * @return boolean + * @return ?bool */ public function getGuarantorRequired() { @@ -197,7 +197,7 @@ public function getGuarantorRequired() /** - * @param boolean $guarantor_required + * @param ?bool $guarantor_required * * @return $this */ @@ -210,7 +210,7 @@ public function setGuarantorRequired($guarantor_required) /** - * @return float + * @return ?float */ public function getRentPw() { @@ -219,7 +219,7 @@ public function getRentPw() /** - * @param float $rent_pw + * @param ?float $rent_pw * * @return $this */ @@ -232,7 +232,7 @@ public function setRentPw($rent_pw) /** - * @return float + * @return ?float */ public function getTotalRent() { @@ -241,7 +241,7 @@ public function getTotalRent() /** - * @param float $total_rent + * @param ?float $total_rent * * @return $this */ @@ -254,7 +254,7 @@ public function setTotalRent($total_rent) /** - * @return integer + * @return ?int */ public function getRentInstalments() { @@ -263,7 +263,7 @@ public function getRentInstalments() /** - * @param integer $rent_instalments + * @param ?int $rent_instalments * * @return $this */ @@ -276,7 +276,7 @@ public function setRentInstalments($rent_instalments) /** - * @return string + * @return ?string */ public function getSignedDatetime() { @@ -285,7 +285,7 @@ public function getSignedDatetime() /** - * @param string $signed_datetime + * @param ?string $signed_datetime * * @return $this */