From 9c73fc50f2a932bb000133d60d5dd368a00d3282 Mon Sep 17 00:00:00 2001 From: sourav014 Date: Fri, 26 May 2023 16:23:03 +0530 Subject: [PATCH 1/8] openapi specs for send_back_reports_api --- src/admin/openapi.yaml | 2 + .../paths/admin@reports@send_back@bulk.yaml | 61 +++++++++++++++++++ src/components/schemas/report.yaml | 18 ++++++ 3 files changed, 81 insertions(+) create mode 100644 src/admin/paths/admin@reports@send_back@bulk.yaml diff --git a/src/admin/openapi.yaml b/src/admin/openapi.yaml index 03a987f71..387894b6f 100644 --- a/src/admin/openapi.yaml +++ b/src/admin/openapi.yaml @@ -188,6 +188,8 @@ paths: $ref: paths/admin@reports.yaml /admin/reports/eject_expenses: $ref: 'paths/admin@reports@eject_expenses.yaml' + /admin/reports/send_back/bulk: + $ref: 'paths/admin@reports@send_back@bulk.yaml' /admin/reports/process_ach/bulk: $ref: paths/admin@reports@process_ach@bulk.yaml /admin/reports/mark_paid/bulk: diff --git a/src/admin/paths/admin@reports@send_back@bulk.yaml b/src/admin/paths/admin@reports@send_back@bulk.yaml new file mode 100644 index 000000000..2a6cc1752 --- /dev/null +++ b/src/admin/paths/admin@reports@send_back@bulk.yaml @@ -0,0 +1,61 @@ +post: + tags: + - Reports + summary: Reports Send_back + description: | + Reports Send_back + operationId: reports_send_back + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: array + items: + $allOf: + $ref: ../../components/schemas/report.yaml#/reports_send_back_in + responses: + '200': + description: OK + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: ../../components/schemas/bulk_error.yaml + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: ../../components/schemas/401.yaml + '403': + description: Forbidden + content: + application/json: + schema: + $ref: ../../components/schemas/403.yaml + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' diff --git a/src/components/schemas/report.yaml b/src/components/schemas/report.yaml index e4f27ca67..443858987 100644 --- a/src/components/schemas/report.yaml +++ b/src/components/schemas/report.yaml @@ -488,6 +488,24 @@ report_action_with_expenses_ids_to_eject: - $ref: './fields.yaml#/id_string' example: [ 'txelntgwgwll' ] +reports_send_back_in: + type: object + additionalProperties: False + required: + - id + - reason + properties: + id: + type: string + description: | + id of report, which need to be send_back + example: 'rpa21A2rdj2' + reason: + type: string + description: | + reason for send_back of the report + example: "We don't accept laundry bills" + report_action_submit: type: object additionalProperties: False From 4de802ba916cd0e6ea62e08d9233570e5924d811 Mon Sep 17 00:00:00 2001 From: Siva Date: Fri, 26 May 2023 10:55:09 +0000 Subject: [PATCH 2/8] Auto generate API docs --- reference/admin.yaml | 62 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/reference/admin.yaml b/reference/admin.yaml index ba52187c3..64e50a245 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -12523,6 +12523,68 @@ paths: application/json: schema: $ref: '#/components/schemas/404' + /admin/reports/send_back/bulk: + post: + tags: + - Reports + summary: Reports Send_back + description: | + Reports Send_back + operationId: reports_send_back + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + items: + $allOf: + $ref: ../../components/schemas/report.yaml#/reports_send_back_in + responses: + '200': + description: OK + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/bulk_error' + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' /admin/reports/process_ach/bulk: post: tags: From 5df0bb2f4d505b07b16516cf44861bd86805ae1d Mon Sep 17 00:00:00 2001 From: sourav014 Date: Sat, 27 May 2023 17:49:13 +0530 Subject: [PATCH 3/8] small changes --- src/admin/paths/admin@reports@send_back@bulk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/admin/paths/admin@reports@send_back@bulk.yaml b/src/admin/paths/admin@reports@send_back@bulk.yaml index 2a6cc1752..a5be8dcb3 100644 --- a/src/admin/paths/admin@reports@send_back@bulk.yaml +++ b/src/admin/paths/admin@reports@send_back@bulk.yaml @@ -18,7 +18,7 @@ post: data: type: array items: - $allOf: + allOf: $ref: ../../components/schemas/report.yaml#/reports_send_back_in responses: '200': From 4e03645cfbfa29f6d07e889ae14e03a53d42c4ff Mon Sep 17 00:00:00 2001 From: Siva Date: Sat, 27 May 2023 12:20:19 +0000 Subject: [PATCH 4/8] Auto generate API docs --- reference/admin.yaml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/reference/admin.yaml b/reference/admin.yaml index 64e50a245..aa27c41f2 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -12544,8 +12544,23 @@ paths: data: type: array items: - $allOf: - $ref: ../../components/schemas/report.yaml#/reports_send_back_in + allOf: + type: object + additionalProperties: false + required: + - id + - reason + properties: + id: + type: string + description: | + id of report, which need to be send_back + example: rpa21A2rdj2 + reason: + type: string + description: | + reason for send_back of the report + example: We don't accept laundry bills responses: '200': description: OK From 5f29bd09b80b0ff9faf23b045c69750d33d7b864 Mon Sep 17 00:00:00 2001 From: sourav014 Date: Sat, 27 May 2023 20:05:08 +0530 Subject: [PATCH 5/8] changes in properties --- src/admin/paths/admin@reports@send_back@bulk.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/admin/paths/admin@reports@send_back@bulk.yaml b/src/admin/paths/admin@reports@send_back@bulk.yaml index a5be8dcb3..84ac514d6 100644 --- a/src/admin/paths/admin@reports@send_back@bulk.yaml +++ b/src/admin/paths/admin@reports@send_back@bulk.yaml @@ -18,8 +18,7 @@ post: data: type: array items: - allOf: - $ref: ../../components/schemas/report.yaml#/reports_send_back_in + $ref: ../../components/schemas/report.yaml#/reports_send_back_in responses: '200': description: OK From 1a78782f5b94599e4f66b412e727270f672fc5b5 Mon Sep 17 00:00:00 2001 From: Siva Date: Sat, 27 May 2023 14:36:02 +0000 Subject: [PATCH 6/8] Auto generate API docs --- reference/admin.yaml | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/reference/admin.yaml b/reference/admin.yaml index aa27c41f2..4d8d34673 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -4027,6 +4027,23 @@ components: description: | Explanation to the action if provided by the user example: All bills are in order + reports_send_back_in: + type: object + additionalProperties: false + required: + - id + - reason + properties: + id: + type: string + description: | + id of report, which need to be send_back + example: rpa21A2rdj2 + reason: + type: string + description: | + reason for send_back of the report + example: We don't accept laundry bills process_ach_in: type: object properties: @@ -12544,23 +12561,7 @@ paths: data: type: array items: - allOf: - type: object - additionalProperties: false - required: - - id - - reason - properties: - id: - type: string - description: | - id of report, which need to be send_back - example: rpa21A2rdj2 - reason: - type: string - description: | - reason for send_back of the report - example: We don't accept laundry bills + $ref: '#/components/schemas/reports_send_back_in' responses: '200': description: OK From 847eacf7b979ef74ee92a122d51e37db3514fcda Mon Sep 17 00:00:00 2001 From: Fyle Date: Mon, 29 May 2023 19:14:20 +0530 Subject: [PATCH 7/8] comment changes --- src/components/schemas/report.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/schemas/report.yaml b/src/components/schemas/report.yaml index 443858987..8b23c06e9 100644 --- a/src/components/schemas/report.yaml +++ b/src/components/schemas/report.yaml @@ -503,7 +503,7 @@ reports_send_back_in: reason: type: string description: | - reason for send_back of the report + reason for sending back the report example: "We don't accept laundry bills" report_action_submit: From 52680190c205f333a7197a7775041f9c5de153d4 Mon Sep 17 00:00:00 2001 From: Siva Date: Mon, 29 May 2023 13:45:03 +0000 Subject: [PATCH 8/8] Auto generate API docs --- reference/admin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/admin.yaml b/reference/admin.yaml index 4d8d34673..59e317233 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -4042,7 +4042,7 @@ components: reason: type: string description: | - reason for send_back of the report + reason for sending back the report example: We don't accept laundry bills process_ach_in: type: object