Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/Models/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ class Price extends SwaggerModel
*/
protected $rolling_price_initial_period_per_person_per_day = 0.0;

/**
* The weekly rent per person expressed to 4 decimal places of precision.
* This mirrors price_per_person_per_week but with greater precision
* to avoid rounding errors in downstream payment calculations.
*
* @var ?float
*/
protected $price_per_person_per_week_4dp = 0.0;


/**
* @return ?float
Expand Down Expand Up @@ -177,4 +186,26 @@ public function setRollingPriceInitialPeriodPerPersonPerDay($rolling_price_initi

return $this;
}


/**
* @return ?float
*/
public function getPricePerPersonPerWeek4dp()
{
return $this->price_per_person_per_week_4dp;
}


/**
* @param ?float $price_per_person_per_week_4dp
*
* @return $this
*/
public function setPricePerPersonPerWeek4dp($price_per_person_per_week_4dp)
{
$this->price_per_person_per_week_4dp = $price_per_person_per_week_4dp;

return $this;
}
}
7 changes: 7 additions & 0 deletions swagger/api-channel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,13 @@ definitions:
The first payment period covers the rent from the start date to
the day before the first rolling monthly payment day. The first payment rent
is calculated based on the number of days in the period multiplied by the per day rate.
price_per_person_per_week_4dp:
type: number
nullable: true
description: |
The weekly rent per person expressed to 4 decimal places of precision.
This mirrors price_per_person_per_week but with greater precision
to avoid rounding errors in downstream payment calculations.
PriceOutbound:
description: |
When fetching property details this describes a Price attached
Expand Down
11 changes: 9 additions & 2 deletions swagger/api-display.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd guess the channel api will also have this new field, so we should add it the the channel.yml schema too. It's only the api.yml file that is actually used to gen the model classes, but the other yml files are used to generate the docs.

Also, did we use the /generate.php script to gen the models, or did we manually update the models? Will want to use the script if latter.

Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,16 @@ definitions:
daily rent each tenant will pay for the first payment period for a rolling tenancy.
This is required if is_fixed_term is false.

The first payment period covers the rent from the start date to
the day before the first rolling monthly payment day. The first payment rent
The first payment period covers the rent from the start date to
the day before the first rolling monthly payment day. The first payment rent
is calculated based on the number of days in the period multiplied by the per day rate.
price_per_person_per_week_4dp:
type: number
nullable: true
description: |
The weekly rent per person expressed to 4 decimal places of precision.
This mirrors price_per_person_per_week but with greater precision
to avoid rounding errors in downstream payment calculations.
PriceOutbound:
description: |
When fetching property details this describes a Price attached
Expand Down
11 changes: 9 additions & 2 deletions swagger/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1393,9 +1393,16 @@ definitions:
daily rent each tenant will pay for the first payment period for a rolling tenancy.
This is required if is_fixed_term is false.

The first payment period covers the rent from the start date to
the day before the first rolling monthly payment day. The first payment rent
The first payment period covers the rent from the start date to
the day before the first rolling monthly payment day. The first payment rent
is calculated based on the number of days in the period multiplied by the per day rate.
price_per_person_per_week_4dp:
type: number
nullable: true
description: |
The weekly rent per person expressed to 4 decimal places of precision.
This mirrors price_per_person_per_week but with greater precision
to avoid rounding errors in downstream payment calculations.
PriceOutbound:
description: |
When fetching property details this describes a Price attached
Expand Down