Add missing isPrivate to service and provider records

This commit is contained in:
Alex Tselegidis 2024-05-13 11:25:17 +02:00
parent 05e4829aaa
commit a993b83025
3 changed files with 22 additions and 0 deletions

View File

@ -748,6 +748,7 @@ class Providers_model extends EA_Model
'state' => $provider['state'],
'zip' => $provider['zip_code'],
'notes' => $provider['notes'],
'is_private' => $provider['is_private'],
'timezone' => $provider['timezone'],
];
@ -864,6 +865,10 @@ class Providers_model extends EA_Model
$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'] = [];

View File

@ -417,6 +417,7 @@ class Services_model extends EA_Model
'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,
];
@ -474,6 +475,10 @@ class Services_model extends EA_Model
$decoded_resource['id_service_categories'] = $service['serviceCategoryId'];
}
if (array_key_exists('isPrivate', $service)) {
$decoded_resource['is_private'] = (bool) $service['isPrivate'];
}
$service = $decoded_resource;
}
}

View File

@ -2024,6 +2024,8 @@ components:
type: string
attendantsNumber:
type: integer
isPrivate:
type: boolean
categoryId:
type: integer
example:
@ -2036,6 +2038,7 @@ components:
description: This is a test service.
availabilitiesType: flexible
attendantsNumber: 1
isPrivate: false
serviceCategoryId: null
ServicePayload:
type: object
@ -2056,6 +2059,8 @@ components:
type: string
attendantsNumber:
type: integer
isPrivate:
type: boolean
serviceCategoryId:
type: integer
example:
@ -2067,6 +2072,7 @@ components:
description: This is a test service.
availabilitiesType: flexible
attendantsNumber: 1
isPrivate: false
serviceCategoryId: null
ServiceCategoryRecord:
type: object
@ -2226,6 +2232,8 @@ components:
type: string
language:
type: string
isPrivate:
type: boolean
services:
type: array
items:
@ -2277,6 +2285,7 @@ components:
timezone: UTC
language: english
services: [ ]
isPrivate: false
settings:
username: chrisdoe
password: Password@123
@ -2340,6 +2349,8 @@ components:
type: string
language:
type: string
isPrivate:
type: boolean
services:
type: array
items:
@ -2390,6 +2401,7 @@ components:
notes: This is a test provider.
timezone: UTC
language: english
isPrivate: false
services: [ ]
settings:
username: chrisdoe