Skip to content

Commit e70ef8f

Browse files
Merge pull request #30 from johnjoey/master
add new rolling price field for initial period daily rate, make payme…
2 parents f0accb5 + 6fea168 commit e70ef8f

6 files changed

Lines changed: 124 additions & 77 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# StuRents API Helper
22

3-
_Master branch is for v2.0 which is not available yet; please check releases for previous versions. For outbound data check 1.3.*, for inbound use 1.2.*_
3+
_Master branch is for v3 of the StuRents API. Please check releases for previous versions.
44

55
Install using composer:
66

src/Models/Price.php

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,18 @@
1212
class Price extends SwaggerModel
1313
{
1414
/**
15-
* For fixed-term contracts, this is the monetary value indicating
15+
* A monetary value indicating
1616
* the weekly rent each tenant will be expected to pay during their
17-
* tenancy in the property.
17+
* fixed-term tenancy. This is required if is_fixed_term is true.
1818
*
19-
* For rolling contracts, this is the monetary value indicating the
20-
* daily rent each tenant will pay for the first payment period.
21-
* The first payment period covers the rent from the start date to
22-
* the day before the first rolling monthly payment day. The first payment rent
23-
* is calculated based on the number of days in the period multiplied by the per day rate.
24-
*
25-
* Whether fixed or rolling, this does not mean the rent is paid weekly or daily - the StuRents
19+
* This does not mean the rent is paid weekly - the StuRents
2620
* search and profiles display all rents as a weekly amount and this
2721
* will be used to calculate total and scheduled payments when
2822
* creating a tenancy and/or rent collection for the property
2923
*
30-
* @var float
31-
* @required
24+
* @var ?float
3225
*/
33-
protected $price_per_person_per_week;
26+
protected $price_per_person_per_week = 0.0;
3427

3528
/**
3629
* A monetary value indicating the deposit each tenant will be
@@ -51,20 +44,33 @@ class Price extends SwaggerModel
5144

5245
/**
5346
* A monetary value indicating the monthly rent each tenant will
54-
* be expected to pay during their rolling tenancy in the property.
55-
* This is required if is_fixed_term is false
47+
* be expected to pay during their rolling tenancy.
48+
* This is required if is_fixed_term is false.
5649
*
57-
* The StuRents search and profiles display all rents as a weekly amount and this
50+
* The StuRents search and profiles display all rents as a weekly amount and this field's value
5851
* will be used to calculate total and scheduled payments when
5952
* creating a tenancy and/or rent collection for the property.
6053
*
6154
* @var ?float
6255
*/
6356
protected $rolling_price_per_person_per_month = 0.0;
6457

58+
/**
59+
* A monetary value indicating the
60+
* daily rent each tenant will pay for the first payment period for a rolling tenancy.
61+
* This is required if is_fixed_term is false.
62+
*
63+
* The first payment period covers the rent from the start date to
64+
* the day before the first rolling monthly payment day. The first payment rent
65+
* is calculated based on the number of days in the period multiplied by the per day rate.
66+
*
67+
* @var ?float
68+
*/
69+
protected $rolling_price_initial_period_per_person_per_day = 0.0;
70+
6571

6672
/**
67-
* @return float
73+
* @return ?float
6874
*/
6975
public function getPricePerPersonPerWeek()
7076
{
@@ -73,7 +79,7 @@ public function getPricePerPersonPerWeek()
7379

7480

7581
/**
76-
* @param float $price_per_person_per_week
82+
* @param ?float $price_per_person_per_week
7783
*
7884
* @return $this
7985
*/
@@ -149,4 +155,26 @@ public function setRollingPricePerPersonPerMonth($rolling_price_per_person_per_m
149155

150156
return $this;
151157
}
158+
159+
160+
/**
161+
* @return ?float
162+
*/
163+
public function getRollingPriceInitialPeriodPerPersonPerDay()
164+
{
165+
return $this->rolling_price_initial_period_per_person_per_day;
166+
}
167+
168+
169+
/**
170+
* @param ?float $rolling_price_initial_period_per_person_per_day
171+
*
172+
* @return $this
173+
*/
174+
public function setRollingPriceInitialPeriodPerPersonPerDay($rolling_price_initial_period_per_person_per_day)
175+
{
176+
$this->rolling_price_initial_period_per_person_per_day = $rolling_price_initial_period_per_person_per_day;
177+
178+
return $this;
179+
}
152180
}

swagger/api-channel.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -660,26 +660,19 @@ definitions:
660660
this will apply to all rooms. That field may be left null
661661
if the "room_prices" array is used instead.
662662
type: object
663-
required:
664-
- price_per_person_per_week
665663
properties:
666664
price_per_person_per_week:
667665
type: number
666+
nullable: true
668667
description: |
669-
For fixed-term contracts, this is the monetary value indicating
668+
A monetary value indicating
670669
the weekly rent each tenant will be expected to pay during their
671-
tenancy in the property.
672-
673-
For rolling contracts, this is the monetary value indicating the
674-
daily rent each tenant will pay for the first payment period.
675-
The first payment period covers the rent from the start date to
676-
the day before the first rolling monthly payment day. The first payment rent
677-
is calculated based on the number of days in the period multiplied by the per day rate.
670+
fixed-term tenancy. This is required if is_fixed_term is true.
678671
679-
Whether fixed or rolling, this does not mean the rent is paid weekly or daily - the StuRents
672+
This does not mean the rent is paid weekly - the StuRents
680673
search and profiles display all rents as a weekly amount and this
681674
will be used to calculate total and scheduled payments when
682-
creating a tenancy and/or rent collection for the property.
675+
creating a tenancy and/or rent collection for the property
683676
deposit_per_person:
684677
type: number
685678
description: |
@@ -693,14 +686,26 @@ definitions:
693686
rent the property
694687
rolling_price_per_person_per_month:
695688
type: number
689+
nullable: true
696690
description: |
697691
A monetary value indicating the monthly rent each tenant will
698-
be expected to pay during their rolling tenancy in the property.
699-
This is required if is_fixed_term is false
692+
be expected to pay during their rolling tenancy.
693+
This is required if is_fixed_term is false.
700694
701-
The StuRents search and profiles display all rents as a weekly amount and this
695+
The StuRents search and profiles display all rents as a weekly amount and this field's value
702696
will be used to calculate total and scheduled payments when
703697
creating a tenancy and/or rent collection for the property.
698+
rolling_price_initial_period_per_person_per_day:
699+
type: number
700+
nullable: true
701+
description: |
702+
A monetary value indicating the
703+
daily rent each tenant will pay for the first payment period for a rolling tenancy.
704+
This is required if is_fixed_term is false.
705+
706+
The first payment period covers the rent from the start date to
707+
the day before the first rolling monthly payment day. The first payment rent
708+
is calculated based on the number of days in the period multiplied by the per day rate.
704709
PriceOutbound:
705710
description: |
706711
When fetching property details this describes a Price attached

swagger/api-display.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -556,26 +556,19 @@ definitions:
556556
this will apply to all rooms. That field may be left null
557557
if the "room_prices" array is used instead.
558558
type: object
559-
required:
560-
- price_per_person_per_week
561559
properties:
562560
price_per_person_per_week:
563561
type: number
562+
nullable: true
564563
description: |
565-
For fixed-term contracts, this is the monetary value indicating
564+
A monetary value indicating
566565
the weekly rent each tenant will be expected to pay during their
567-
tenancy in the property.
568-
569-
For rolling contracts, this is the monetary value indicating the
570-
daily rent each tenant will pay for the first payment period.
571-
The first payment period covers the rent from the start date to
572-
the day before the first rolling monthly payment day. The first payment rent
573-
is calculated based on the number of days in the period multiplied by the per day rate.
566+
fixed-term tenancy. This is required if is_fixed_term is true.
574567
575-
Whether fixed or rolling, this does not mean the rent is paid weekly or daily - the StuRents
568+
This does not mean the rent is paid weekly - the StuRents
576569
search and profiles display all rents as a weekly amount and this
577570
will be used to calculate total and scheduled payments when
578-
creating a tenancy and/or rent collection for the property.
571+
creating a tenancy and/or rent collection for the property
579572
deposit_per_person:
580573
type: number
581574
description: |
@@ -589,14 +582,26 @@ definitions:
589582
rent the property
590583
rolling_price_per_person_per_month:
591584
type: number
585+
nullable: true
592586
description: |
593587
A monetary value indicating the monthly rent each tenant will
594-
be expected to pay during their rolling tenancy in the property.
595-
This is required if is_fixed_term is false
588+
be expected to pay during their rolling tenancy.
589+
This is required if is_fixed_term is false.
596590
597-
The StuRents search and profiles display all rents as a weekly amount and this
591+
The StuRents search and profiles display all rents as a weekly amount and this field's value
598592
will be used to calculate total and scheduled payments when
599593
creating a tenancy and/or rent collection for the property.
594+
rolling_price_initial_period_per_person_per_day:
595+
type: number
596+
nullable: true
597+
description: |
598+
A monetary value indicating the
599+
daily rent each tenant will pay for the first payment period for a rolling tenancy.
600+
This is required if is_fixed_term is false.
601+
602+
The first payment period covers the rent from the start date to
603+
the day before the first rolling monthly payment day. The first payment rent
604+
is calculated based on the number of days in the period multiplied by the per day rate.
600605
PriceOutbound:
601606
description: |
602607
When fetching property details this describes a Price attached

swagger/api-upload.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,26 +1249,19 @@ definitions:
12491249
this will apply to all rooms. That field may be left null
12501250
if the "room_prices" array is used instead.
12511251
type: object
1252-
required:
1253-
- price_per_person_per_week
12541252
properties:
12551253
price_per_person_per_week:
12561254
type: number
1255+
nullable: true
12571256
description: |
1258-
For fixed-term contracts, this is the monetary value indicating
1257+
A monetary value indicating
12591258
the weekly rent each tenant will be expected to pay during their
1260-
tenancy in the property.
1261-
1262-
For rolling contracts, this is the monetary value indicating the
1263-
daily rent each tenant will pay for the first payment period.
1264-
The first payment period covers the rent from the start date to
1265-
the day before the first rolling monthly payment day. The first payment rent
1266-
is calculated based on the number of days in the period multiplied by the per day rate.
1259+
fixed-term tenancy. This is required if is_fixed_term is true.
12671260
1268-
Whether fixed or rolling, this does not mean the rent is paid weekly or daily - the StuRents
1261+
This does not mean the rent is paid weekly - the StuRents
12691262
search and profiles display all rents as a weekly amount and this
12701263
will be used to calculate total and scheduled payments when
1271-
creating a tenancy and/or rent collection for the property.
1264+
creating a tenancy and/or rent collection for the property
12721265
deposit_per_person:
12731266
type: number
12741267
description: |
@@ -1282,14 +1275,26 @@ definitions:
12821275
rent the property
12831276
rolling_price_per_person_per_month:
12841277
type: number
1278+
nullable: true
12851279
description: |
12861280
A monetary value indicating the monthly rent each tenant will
1287-
be expected to pay during their rolling tenancy in the property.
1288-
This is required if is_fixed_term is false
1281+
be expected to pay during their rolling tenancy.
1282+
This is required if is_fixed_term is false.
12891283
1290-
The StuRents search and profiles display all rents as a weekly amount and this
1284+
The StuRents search and profiles display all rents as a weekly amount and this field's value
12911285
will be used to calculate total and scheduled payments when
12921286
creating a tenancy and/or rent collection for the property.
1287+
rolling_price_initial_period_per_person_per_day:
1288+
type: number
1289+
nullable: true
1290+
description: |
1291+
A monetary value indicating the
1292+
daily rent each tenant will pay for the first payment period for a rolling tenancy.
1293+
This is required if is_fixed_term is false.
1294+
1295+
The first payment period covers the rent from the start date to
1296+
the day before the first rolling monthly payment day. The first payment rent
1297+
is calculated based on the number of days in the period multiplied by the per day rate.
12931298
PriceOutbound:
12941299
description: |
12951300
When fetching property details this describes a Price attached

swagger/api.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,23 +1330,16 @@ definitions:
13301330
this will apply to all rooms. That field may be left null
13311331
if the "room_prices" array is used instead.
13321332
type: object
1333-
required:
1334-
- price_per_person_per_week
13351333
properties:
13361334
price_per_person_per_week:
13371335
type: number
1336+
nullable: true
13381337
description: |
1339-
For fixed-term contracts, this is the monetary value indicating
1338+
A monetary value indicating
13401339
the weekly rent each tenant will be expected to pay during their
1341-
tenancy in the property.
1342-
1343-
For rolling contracts, this is the monetary value indicating the
1344-
daily rent each tenant will pay for the first payment period.
1345-
The first payment period covers the rent from the start date to
1346-
the day before the first rolling monthly payment day. The first payment rent
1347-
is calculated based on the number of days in the period multiplied by the per day rate.
1340+
fixed-term tenancy. This is required if is_fixed_term is true.
13481341
1349-
Whether fixed or rolling, this does not mean the rent is paid weekly or daily - the StuRents
1342+
This does not mean the rent is paid weekly - the StuRents
13501343
search and profiles display all rents as a weekly amount and this
13511344
will be used to calculate total and scheduled payments when
13521345
creating a tenancy and/or rent collection for the property
@@ -1366,12 +1359,23 @@ definitions:
13661359
nullable: true
13671360
description: |
13681361
A monetary value indicating the monthly rent each tenant will
1369-
be expected to pay during their rolling tenancy in the property.
1370-
This is required if is_fixed_term is false
1362+
be expected to pay during their rolling tenancy.
1363+
This is required if is_fixed_term is false.
13711364
1372-
The StuRents search and profiles display all rents as a weekly amount and this
1365+
The StuRents search and profiles display all rents as a weekly amount and this field's value
13731366
will be used to calculate total and scheduled payments when
13741367
creating a tenancy and/or rent collection for the property.
1368+
rolling_price_initial_period_per_person_per_day:
1369+
type: number
1370+
nullable: true
1371+
description: |
1372+
A monetary value indicating the
1373+
daily rent each tenant will pay for the first payment period for a rolling tenancy.
1374+
This is required if is_fixed_term is false.
1375+
1376+
The first payment period covers the rent from the start date to
1377+
the day before the first rolling monthly payment day. The first payment rent
1378+
is calculated based on the number of days in the period multiplied by the per day rate.
13751379
PriceOutbound:
13761380
description: |
13771381
When fetching property details this describes a Price attached

0 commit comments

Comments
 (0)