From 039f3ec9932e096ad288c67aa0da1bfc6ee1cfac Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Fri, 11 Dec 2020 12:49:27 +0200 Subject: [PATCH] Added timezone support to the API when managing users (#952). --- engine/Api/V1/Parsers/Admins.php | 6 ++++++ engine/Api/V1/Parsers/Providers.php | 6 ++++++ engine/Api/V1/Parsers/Secretaries.php | 6 ++++++ swagger.yml | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/engine/Api/V1/Parsers/Admins.php b/engine/Api/V1/Parsers/Admins.php index e1c56b08..4f754f03 100644 --- a/engine/Api/V1/Parsers/Admins.php +++ b/engine/Api/V1/Parsers/Admins.php @@ -40,6 +40,7 @@ class Admins implements ParsersInterface { 'state' => $response['state'], 'zip' => $response['zip_code'], 'notes' => $response['notes'], + 'timezone' => $response['timezone'], 'settings' => [ 'username' => $response['settings']['username'], 'notifications' => filter_var($response['settings']['notifications'], FILTER_VALIDATE_BOOLEAN), @@ -115,6 +116,11 @@ class Admins implements ParsersInterface { $decoded_request['notes'] = $request['notes']; } + if ( ! empty($request['timezone'])) + { + $decoded_request['timezone'] = $request['timezone']; + } + if ( ! empty($request['settings'])) { if (empty($decoded_request['settings'])) diff --git a/engine/Api/V1/Parsers/Providers.php b/engine/Api/V1/Parsers/Providers.php index 2f8327a8..b2f41436 100644 --- a/engine/Api/V1/Parsers/Providers.php +++ b/engine/Api/V1/Parsers/Providers.php @@ -40,6 +40,7 @@ class Providers implements ParsersInterface { 'state' => $response['state'], 'zip' => $response['zip_code'], 'notes' => $response['notes'], + 'timezone' => $response['timezone'], ]; if (array_key_exists('services', $response)) @@ -131,6 +132,11 @@ class Providers implements ParsersInterface { $decoded_request['notes'] = $request['notes']; } + if ( ! empty($request['timezone'])) + { + $decoded_request['timezone'] = $request['timezone']; + } + if ( ! empty($request['services'])) { $decoded_request['services'] = $request['services']; diff --git a/engine/Api/V1/Parsers/Secretaries.php b/engine/Api/V1/Parsers/Secretaries.php index 86bda591..05c88aeb 100644 --- a/engine/Api/V1/Parsers/Secretaries.php +++ b/engine/Api/V1/Parsers/Secretaries.php @@ -41,6 +41,7 @@ class Secretaries implements ParsersInterface { 'zip' => $response['zip_code'], 'notes' => $response['notes'], 'providers' => $response['providers'], + 'timezone' => $response['timezone'], 'settings' => [ 'username' => $response['settings']['username'], 'notifications' => filter_var($response['settings']['notifications'], FILTER_VALIDATE_BOOLEAN), @@ -116,6 +117,11 @@ class Secretaries implements ParsersInterface { $decoded_request['notes'] = $request['notes']; } + if ( ! empty($request['timezone'])) + { + $decoded_request['timezone'] = $request['timezone']; + } + if ( ! empty($request['providers'])) { $decoded_request['providers'] = $request['providers']; diff --git a/swagger.yml b/swagger.yml index 0fb61b85..1b4f2790 100644 --- a/swagger.yml +++ b/swagger.yml @@ -977,6 +977,8 @@ definitions: type: string notes: type: string + timezone: + type: string settings: type: object properties: @@ -1012,6 +1014,8 @@ definitions: type: string notes: type: string + timezone: + type: string services: type: array items: @@ -1063,6 +1067,8 @@ definitions: type: string notes: type: string + timezone: + type: string providers: type: array items: