From e04463733b42f842e3977e5f503f4c1d376045b9 Mon Sep 17 00:00:00 2001 From: Lucas Mathews Date: Fri, 17 May 2024 21:19:05 +0200 Subject: [PATCH] added update account and client functionality to api --- api.yml | 124 ++++++++++++++++++----------------- bank.db | Bin 28672 -> 28672 bytes manager.py | 186 +++++++++++++++++++++-------------------------------- 3 files changed, 138 insertions(+), 172 deletions(-) diff --git a/api.yml b/api.yml index 611b2fe..e033cf4 100644 --- a/api.yml +++ b/api.yml @@ -157,26 +157,54 @@ paths: summary: Update an existing client description: Update an existing client Id operationId: manager.update_client - requestBody: - description: Update an existing client's details - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - required: true + parameters: + - name: client_id + in: query + description: ID of client to update + required: true + schema: + type: string + - name: name + in: query + description: Client Name + required: false + schema: + type: string + - name: birthdate + in: query + description: Client Birthdate (dd-mm-yyyy) + required: false + schema: + type: string + - name: address + in: query + description: Client Address + required: false + schema: + type: string + - name: phone_number + in: query + description: Client Phone Number + required: false + schema: + type: string + - name: email + in: query + description: Client Email Address + required: false + schema: + type: string + - name: notes + in: query + description: Notes about client + required: false + schema: + type: string responses: '200': description: Successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Client' '400': description: Invalid Client ID supplied - '404': - description: Client not found - '422': - description: Validation exception get: tags: - client @@ -273,28 +301,31 @@ paths: description: ID of account to update required: true schema: - type: integer - format: int32 - requestBody: - description: Update an existing account - content: - application/json: - schema: - $ref: '#/components/schemas/Account' - required: true + type: string + - name: description + in: query + description: Account description + required: false + schema: + type: string + - name: account_type + in: query + description: Type of account + required: false + schema: + type: string + - name: notes + in: query + description: Notes about account + required: false + schema: + type: string + responses: '200': description: Successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Account' '400': description: Invalid Account ID supplied - '404': - description: Account not found - '422': - description: Validation exception get: tags: - account @@ -353,8 +384,7 @@ paths: description: ID of transaction to return required: true schema: - type: integer - format: int32 + type: string responses: '200': description: Successful operation @@ -535,32 +565,6 @@ paths: description: Invalid input '404': description: No transactions found - put: - tags: - - manager - summary: Update an existing transaction - description: Update an existing transaction - operationId: manager.update_transaction - requestBody: - description: Update an existing transaction - content: - application/json: - schema: - $ref: '#/components/schemas/Transaction' - required: true - responses: - '200': - description: Successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Transaction' - '400': - description: Invalid Transaction ID supplied - '404': - description: Transaction not found - '422': - description: Validation exception /Manager/Hash: get: tags: diff --git a/bank.db b/bank.db index 03becb765417072b506622e5999dfebd37d05fa9..58722bd172100ed080d998e08aed06c56660997e 100644 GIT binary patch delta 178 zcmZp8z}WDBae_3XZ;Z>E;KrL5$27Wz{F!%8R2Y*_Wn~2?8`z6V7pE8*7@6oAnCcpuD;ODA VnHX9b7#o=y8#8{~JjFi8003mWF`@tf delta 168 zcmZp8z}WDBae_3X@I)DBM&XSKOZmC^(ir&C_|18)@Lbs}sBna5@)emqlOyH$#h7_z z#TAW3#U-0~88|r-%~F#MObnAI*U8CF=9Fy*D!Hk|A*-%v+~|g?(!|WrJk8uB)u%K$ zv3T-F8R^aW@{PXXE_!#`Qe-h{`P@goBRgR!izu_(vnx%OI{ Jr`YEh0085