Skip to content

Commit

Permalink
Add missing isPrivate to service and provider records
Browse files Browse the repository at this point in the history
  • Loading branch information
alextselegidis committed May 13, 2024
1 parent 05e4829 commit a993b83
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions application/models/Providers_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@ public function api_encode(array &$provider): void
'state' => $provider['state'],
'zip' => $provider['zip_code'],
'notes' => $provider['notes'],
'is_private' => $provider['is_private'],
'timezone' => $provider['timezone'],
];

Expand Down Expand Up @@ -864,6 +865,10 @@ public function api_decode(array &$provider, array $base = null): void
$decoded_resource['services'] = $provider['services'];
}

if (array_key_exists('isPrivate', $provider)) {
$decoded_resource['is_private'] = (bool) $provider['isPrivate'];
}

if (array_key_exists('settings', $provider)) {
if (empty($decoded_resource['settings'])) {
$decoded_resource['settings'] = [];
Expand Down
5 changes: 5 additions & 0 deletions application/models/Services_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ public function api_encode(array &$service): void
'location' => $service['location'],
'availabilitiesType' => $service['availabilities_type'],
'attendantsNumber' => (int) $service['attendants_number'],
'isPrivate' => (bool) $service['is_private'],
'serviceCategoryId' =>
$service['id_service_categories'] !== null ? (int) $service['id_service_categories'] : null,
];
Expand Down Expand Up @@ -474,6 +475,10 @@ public function api_decode(array &$service, array $base = null): void
$decoded_resource['id_service_categories'] = $service['serviceCategoryId'];
}

if (array_key_exists('isPrivate', $service)) {
$decoded_resource['is_private'] = (bool) $service['isPrivate'];
}

$service = $decoded_resource;
}
}
12 changes: 12 additions & 0 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2024,6 +2024,8 @@ components:
type: string
attendantsNumber:
type: integer
isPrivate:
type: boolean
categoryId:
type: integer
example:
Expand All @@ -2036,6 +2038,7 @@ components:
description: This is a test service.
availabilitiesType: flexible
attendantsNumber: 1
isPrivate: false
serviceCategoryId: null
ServicePayload:
type: object
Expand All @@ -2056,6 +2059,8 @@ components:
type: string
attendantsNumber:
type: integer
isPrivate:
type: boolean
serviceCategoryId:
type: integer
example:
Expand All @@ -2067,6 +2072,7 @@ components:
description: This is a test service.
availabilitiesType: flexible
attendantsNumber: 1
isPrivate: false
serviceCategoryId: null
ServiceCategoryRecord:
type: object
Expand Down Expand Up @@ -2226,6 +2232,8 @@ components:
type: string
language:
type: string
isPrivate:
type: boolean
services:
type: array
items:
Expand Down Expand Up @@ -2277,6 +2285,7 @@ components:
timezone: UTC
language: english
services: [ ]
isPrivate: false
settings:
username: chrisdoe
password: Password@123
Expand Down Expand Up @@ -2340,6 +2349,8 @@ components:
type: string
language:
type: string
isPrivate:
type: boolean
services:
type: array
items:
Expand Down Expand Up @@ -2390,6 +2401,7 @@ components:
notes: This is a test provider.
timezone: UTC
language: english
isPrivate: false
services: [ ]
settings:
username: chrisdoe
Expand Down

0 comments on commit a993b83

Please sign in to comment.