From 93ecb8790b287738eabd2bfd5e0ca98ffe51f971 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Nov 2022 11:21:05 +1100 Subject: [PATCH] API Doc Blocks for Bank Transaction Rules --- .../BankTransactionRuleController.php | 12 ++++----- .../Controllers/OpenAPI/BTRulesSchema.php | 10 ++++++++ .../Controllers/OpenAPI/BankTransaction.php | 2 +- .../OpenAPI/BankTransactionRule.php | 25 +++++++++++++++++++ 4 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 app/Http/Controllers/OpenAPI/BTRulesSchema.php create mode 100644 app/Http/Controllers/OpenAPI/BankTransactionRule.php diff --git a/app/Http/Controllers/BankTransactionRuleController.php b/app/Http/Controllers/BankTransactionRuleController.php index 1f8ae13b2..5e16a645e 100644 --- a/app/Http/Controllers/BankTransactionRuleController.php +++ b/app/Http/Controllers/BankTransactionRuleController.php @@ -83,7 +83,7 @@ class BankTransactionRuleController extends BaseController * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * @OA\JsonContent(ref="#/components/schemas/BankTransactionRule"), * ), * @OA\Response( * response=422, @@ -143,7 +143,7 @@ class BankTransactionRuleController extends BaseController * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * @OA\JsonContent(ref="#/components/schemas/BankTransactionRule"), * ), * @OA\Response( * response=422, @@ -199,7 +199,7 @@ class BankTransactionRuleController extends BaseController * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * @OA\JsonContent(ref="#/components/schemas/BankTransactionRule"), * ), * @OA\Response( * response=422, @@ -255,7 +255,7 @@ class BankTransactionRuleController extends BaseController * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * @OA\JsonContent(ref="#/components/schemas/BankTransactionRule"), * ), * @OA\Response( * response=422, @@ -303,7 +303,7 @@ class BankTransactionRuleController extends BaseController * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * @OA\JsonContent(ref="#/components/schemas/BankTransactionRule"), * ), * @OA\Response( * response=422, @@ -349,7 +349,7 @@ class BankTransactionRuleController extends BaseController * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * @OA\JsonContent(ref="#/components/schemas/BankTransactionRule"), * ), * @OA\Response( * response=422, diff --git a/app/Http/Controllers/OpenAPI/BTRulesSchema.php b/app/Http/Controllers/OpenAPI/BTRulesSchema.php new file mode 100644 index 000000000..8c967291a --- /dev/null +++ b/app/Http/Controllers/OpenAPI/BTRulesSchema.php @@ -0,0 +1,10 @@ +", description="The operator flag of the search"), + * @OA\Property(property="value", type="string" ,example="bob", description="The value to search for"), + * ) + */ diff --git a/app/Http/Controllers/OpenAPI/BankTransaction.php b/app/Http/Controllers/OpenAPI/BankTransaction.php index c3e5f3d19..184c24f30 100644 --- a/app/Http/Controllers/OpenAPI/BankTransaction.php +++ b/app/Http/Controllers/OpenAPI/BankTransaction.php @@ -6,7 +6,7 @@ * @OA\Property(property="id", type="string", example="AS3df3A", description="The bank integration hashed id"), * @OA\Property(property="company_id", type="string", example="AS3df3A", description="The company hashed id"), * @OA\Property(property="user_id", type="string", example="AS3df3A", description="The user hashed id"), - * @OA\Property(property="transaction_id", type="integer", example=343434, description="The id of the transaction"), + * @OA\Property(property="transaction_id", type="integer", example=343434, description="The id of the transaction rule"), * @OA\Property(property="amount", type="number", example=10.00, description="The transaction amount"), * @OA\Property(property="currency_id", type="string", example="1", description="The currency ID of the currency"), * @OA\Property(property="account_type", type="string", example="creditCard", description="The account type"), diff --git a/app/Http/Controllers/OpenAPI/BankTransactionRule.php b/app/Http/Controllers/OpenAPI/BankTransactionRule.php new file mode 100644 index 000000000..f62e0cf19 --- /dev/null +++ b/app/Http/Controllers/OpenAPI/BankTransactionRule.php @@ -0,0 +1,25 @@ +