Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(OpenAPI): Use correct tags for payment modes #293

Merged
merged 2 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"cs:fix": "php-cs-fixer fix",
"psalm": "psalm.phar --no-cache",
"test:unit": "phpunit --config tests/phpunit.xml",
"openapi": "generate-spec --verbose --continue-on-error"
"openapi": "generate-spec --verbose --allow-missing-docs"
},
"repositories": [
{
Expand Down
8 changes: 4 additions & 4 deletions lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ public function editSharedAccess(string $projectId, int $shId, ?string $label =
#[NoAdminRequired]
#[CORS]
#[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Payment modes'])]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Payment-modes'])]
public function createPaymentMode(string $projectId, string $name, ?string $icon, string $color, ?int $order = 0): DataResponse {
$result = $this->projectService->createPaymentMode($projectId, $name, $icon, $color, $order);
return new DataResponse($result);
Expand All @@ -970,7 +970,7 @@ public function createPaymentMode(string $projectId, string $name, ?string $icon
#[NoAdminRequired]
#[CORS]
#[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Payment modes'])]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Payment-modes'])]
public function editPaymentMode(
string $projectId, int $pmId, ?string $name = null, ?string $icon = null, ?string $color = null
): DataResponse {
Expand All @@ -994,7 +994,7 @@ public function editPaymentMode(
#[NoAdminRequired]
#[CORS]
#[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Payment modes'])]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Payment-modes'])]
public function savePaymentModeOrder(string $projectId, array $order): DataResponse {
if ($this->projectService->savePaymentModeOrder($projectId, $order)) {
return new DataResponse('');
Expand All @@ -1016,7 +1016,7 @@ public function savePaymentModeOrder(string $projectId, array $order): DataRespo
#[NoAdminRequired]
#[CORS]
#[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Payment modes'])]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Payment-modes'])]
public function deletePaymentMode(string $projectId, int $pmId): DataResponse {
$result = $this->projectService->deletePaymentMode($projectId, $pmId);
if (isset($result['success'])) {
Expand Down
8 changes: 4 additions & 4 deletions lib/Controller/PublicApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ public function publicCreateMember(
#[CORS]
#[CospendPublicAuth(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)]
#[BruteForceProtection(action: 'CospendPublicCreatePaymentMode')]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Public-API_Payment modes'])]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Public-API_Payment-modes'])]
public function publicCreatePaymentMode(string $token, string $name, ?string $icon, string $color, ?int $order = 0): DataResponse {
$publicShareInfo = $this->projectService->getShareInfoFromShareToken($token);
$result = $this->projectService->createPaymentMode(
Expand All @@ -810,7 +810,7 @@ public function publicCreatePaymentMode(string $token, string $name, ?string $ic
#[CORS]
#[CospendPublicAuth(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)]
#[BruteForceProtection(action: 'CospendPublicEditPaymentMode')]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Public-API_Payment modes'])]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Public-API_Payment-modes'])]
public function publicEditPaymentMode(
string $token, int $pmId, ?string $name = null, ?string $icon = null, ?string $color = null
): DataResponse {
Expand Down Expand Up @@ -839,7 +839,7 @@ public function publicEditPaymentMode(
#[CORS]
#[CospendPublicAuth(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)]
#[BruteForceProtection(action: 'CospendPublicSavePMOrder')]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Public-API_Payment modes'])]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Public-API_Payment-modes'])]
public function publicSavePaymentModeOrder(string $token, array $order): DataResponse {
$publicShareInfo = $this->projectService->getShareInfoFromShareToken($token);
if ($this->projectService->savePaymentModeOrder($publicShareInfo['projectid'], $order)) {
Expand All @@ -862,7 +862,7 @@ public function publicSavePaymentModeOrder(string $token, array $order): DataRes
#[CORS]
#[CospendPublicAuth(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)]
#[BruteForceProtection(action: 'CospendPublicDeletePM')]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Public-API_Payment modes'])]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Public-API_Payment-modes'])]
public function publicDeletePaymentMode(string $token, int $pmId): DataResponse {
$publicShareInfo = $this->projectService->getShareInfoFromShareToken($token);
$result = $this->projectService->deletePaymentMode($publicShareInfo['projectid'], $pmId);
Expand Down
Loading
Loading