Skip to content

Commit de9a696

Browse files
authored
Merge branch 'develop' into feature/358-more-filter-options
2 parents 435400e + 7cfc9cc commit de9a696

4 files changed

Lines changed: 39 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
<<<<<<< feature/358-more-filter-options
78
- [#363](https://github.com/os2display/display-api-service/pull/363)
89
- Added optional 'area' and 'facility' configuration fields
10+
=======
11+
### Added
12+
13+
- [#362](https://github.com/os2display/display-api-service/pull/362)
14+
- Added new API version field and variable to handle new feature from issue #352.
15+
>>>>>>> develop
916
1017
- [#385](https://github.com/os2display/display-api-service/pull/385)
1118
- Replaced PSR-6 caching with Symfony `CacheInterface::get()` in
@@ -32,9 +39,12 @@ All notable changes to this project will be documented in this file.
3239

3340
## [2.6.1] - 2026-03-06
3441

35-
- [#347](https://github.com/os2display/display-api-service/pull/347)
36-
- Added onFlush listener to handle ManyToMany collection changes for relations checksum propagation.
37-
- Added command to refresh relation checksums.
42+
### Added
43+
44+
- [#347](https://github.com/os2display/display-api-service/pull/347):
45+
Added onFlush listener to handle ManyToMany collection changes for
46+
relations checksum propagation.
47+
- [#347](https://github.com/os2display/display-api-service/pull/347): Added command to refresh relation checksums.
3848

3949
## [2.6.0] - 2025-12-05
4050

@@ -44,7 +54,7 @@ All notable changes to this project will be documented in this file.
4454
- Fix date parsing issue in BRND booking feed type
4555
- [#313](https://github.com/os2display/display-api-service/pull/313)
4656
- Add BRND booking feed type
47-
57+
4858
## [2.5.2] - 2025-09-25
4959

5060
- [#260](https://github.com/os2display/display-api-service/pull/260)

src/Feed/BrndFeedType.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ public function getRequiredSecrets(): array
224224
'type' => 'string',
225225
'exposeValue' => false,
226226
],
227+
'api_version' => [
228+
'type' => 'string',
229+
'exposeValue' => true,
230+
],
227231
];
228232
}
229233

@@ -253,6 +257,11 @@ public function getSchema(): array
253257
'api_auth_key' => [
254258
'type' => 'string',
255259
],
260+
'api_version' => [
261+
'type' => 'string',
262+
'pattern' => '^\d+(\.\d+)?$',
263+
'default' => '1.0',
264+
],
256265
],
257266
'required' => ['api_base_uri', 'company_id', 'api_auth_key'],
258267
];

src/Feed/SourceType/Brnd/ApiClient.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ private function getInfomonitorBookingsDetailsData(
9494
try {
9595
$client = $this->getApiClient($feedSource);
9696

97-
return $client->request('POST', '/v1.0/get-infomonitor-bookings-details', [
97+
$versionPath = '/v'.$secrets->apiVersion;
98+
99+
return $client->request('POST', $versionPath.'/get-infomonitor-bookings-details', [
98100
'json' => [
99101
'companyID' => $secrets->companyId,
100102
'associationID' => $sportCenterId,
@@ -164,7 +166,8 @@ private function fetchToken(FeedSource $feedSource): string
164166
} else {
165167
try {
166168
$secrets = new SecretsDTO($feedSource);
167-
$response = $this->client->request('POST', $secrets->apiBaseUri.'/v1.0/generate-token', [
169+
$versionPath = '/v'.$secrets->apiVersion;
170+
$response = $this->client->request('POST', $secrets->apiBaseUri.$versionPath.'/generate-token', [
168171
'headers' => [
169172
'Content-Type' => 'application/json',
170173
'Accept' => '*/*',

src/Feed/SourceType/Brnd/SecretsDTO.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
public string $apiBaseUri;
1212
public string $apiAuthKey;
1313
public string $companyId;
14+
public string $apiVersion;
1415

1516
public function __construct(FeedSource $feedSource)
1617
{
@@ -29,7 +30,15 @@ public function __construct(FeedSource $feedSource)
2930
}
3031

3132
$this->apiBaseUri = rtrim((string) $secrets['api_base_uri'], '/');
32-
$this->companyId = $secrets['company_id'];
33-
$this->apiAuthKey = $secrets['api_auth_key'];
33+
$this->companyId = (string) $secrets['company_id'];
34+
$this->apiAuthKey = (string) $secrets['api_auth_key'];
35+
36+
$version = $secrets['api_version'] ?? '1.0';
37+
38+
if (!is_string($version) || 1 !== preg_match('/^\d+(\.\d+)?$/', $version)) {
39+
throw new \RuntimeException('Invalid api_version. Expected format like "1.0" or "2.0".');
40+
}
41+
42+
$this->apiVersion = $version;
3443
}
3544
}

0 commit comments

Comments
 (0)