From 24f22292c16ee802a38f1e35788d8818473d5695 Mon Sep 17 00:00:00 2001 From: John DeAngelis Date: Thu, 12 Dec 2024 14:47:55 -0500 Subject: [PATCH 1/3] docs: update spec for /can-history Signed-off-by: John DeAngelis --- backend/openapi.yml | 82 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/backend/openapi.yml b/backend/openapi.yml index 389b713fa9..e685909224 100644 --- a/backend/openapi.yml +++ b/backend/openapi.yml @@ -877,6 +877,42 @@ paths: description: Unauthorized "404": description: Unable to find specified CANFundingBudget + /api/v1/can-history: + get: + tags: + - CAN History + operationId: getAllCANHistory + summary: Get a list all CAN history objects + parameters: + - $ref: "#/components/parameters/simulatedError" + - name: can_id + in: query + schema: + type: integer + example: 1 + - name: offset + in: query + schema: + type: integer + example: 0 + - name: limit + in: query + schema: + type: integer + default: 10 + example: 10 + description: Get CANHistory + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/CANHistoryList" + "401": + description: Insufficient Privileges to use this endpoint. + "403": + description: Forbidden /api/v1/portfolios: get: tags: @@ -2811,6 +2847,52 @@ components: - id - portfolio_id - number + CANHistoryList: + description: A list of CAN objects with their history + type: array + items: + anyOf: + - $ref: "#/components/schemas/CANHistoryItem" + CANHistoryItem: + description: A single CAN object with its history + type: object + properties: + id: + type: integer + example: 2 + can_id: + type: integer + example: 3 + history_title: + type: string + example: "Nickname Edited" + history_message: + type: string + example: "Omkar Kuber edited the nickname from 'CAN 1' to 'CAN 2'" + timestamp: + type: string + format: date-time + example: "2021-01-01T00:00:00Z" + history_type: + type: string + enum: + - CAN_DATA_IMPORT + - CAN_NICKNAME_EDITED + - CAN_DESCRIPTION_EDITED + - CAN_FUNDING_CREATED + - CAN_RECEIVED_CREATED + - CAN_FUNDING_EDITED + - CAN_RECEIVED_EDITED + - CAN_FUNDING_DELETED + - CAN_RECEIVED_DELETED + - CAN_PORTFOLIO_CREATED + - CAN_PORTFOLIO_DELETED + - CAN_PORTFOLIO_EDITED + - CAN_DIVISION_CREATED + - CAN_DIVISION_DELETED + - CAN_DIVISION_EDITED + - CAN_CARRY_FORWARD_CALCULATED + example: "CAN_NICKNAME_EDITED" FundingReceived: description: Funding Received Object type: object From 61a0b0cab6ff524c93c665fd931f355284619d74 Mon Sep 17 00:00:00 2001 From: John DeAngelis Date: Thu, 12 Dec 2024 14:50:35 -0500 Subject: [PATCH 2/3] docs: update date-time example Signed-off-by: John DeAngelis --- backend/openapi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/openapi.yml b/backend/openapi.yml index e685909224..b2731afa90 100644 --- a/backend/openapi.yml +++ b/backend/openapi.yml @@ -2872,7 +2872,7 @@ components: timestamp: type: string format: date-time - example: "2021-01-01T00:00:00Z" + example: "2023-09-01T00:00:00.000000Z" history_type: type: string enum: From e0c587b6818ea435dffc217864858cfa69fafba9 Mon Sep 17 00:00:00 2001 From: John DeAngelis Date: Thu, 12 Dec 2024 15:19:26 -0500 Subject: [PATCH 3/3] docs: added ops_event_id and some descriptions Signed-off-by: John DeAngelis --- backend/openapi.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/openapi.yml b/backend/openapi.yml index b2731afa90..6a865ac939 100644 --- a/backend/openapi.yml +++ b/backend/openapi.yml @@ -2859,18 +2859,27 @@ components: properties: id: type: integer + description: The unique identifier for the history record. example: 2 can_id: type: integer + description: FK to the CAN object that the history record is associated with. example: 3 + ops_event_id: + type: integer + description: FK to the OPS event that triggered the history record. + example: 4 history_title: type: string + description: The title of the history event in Markdown format. example: "Nickname Edited" history_message: type: string + description: The message that describes the history event in Markdown format. example: "Omkar Kuber edited the nickname from 'CAN 1' to 'CAN 2'" timestamp: type: string + description: The timestamp of when the history event was created (different than created_on). format: date-time example: "2023-09-01T00:00:00.000000Z" history_type: