From c03c616bc2d473f2897fcaa551fa6d8c43155a80 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 16 May 2022 18:30:56 +0200 Subject: [PATCH] Bug 32030: ERM - Agreement documents - REST API Signed-off-by: Jonathan Field Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- api/v1/swagger/definitions/erm_agreement.yaml | 5 ++ .../definitions/erm_agreement_document.yaml | 56 +++++++++++++++++++ api/v1/swagger/paths/erm_agreements.yaml | 2 + 3 files changed, 63 insertions(+) create mode 100644 api/v1/swagger/definitions/erm_agreement_document.yaml diff --git a/api/v1/swagger/definitions/erm_agreement.yaml b/api/v1/swagger/definitions/erm_agreement.yaml index c1f41f8cd9..8e4bf4bd62 100644 --- a/api/v1/swagger/definitions/erm_agreement.yaml +++ b/api/v1/swagger/definitions/erm_agreement.yaml @@ -59,6 +59,11 @@ properties: description: agreement licenses items: $ref: erm_agreement_license.yaml + documents: + type: array + description: documents + items: + $ref: erm_agreement_document.yaml additionalProperties: false required: diff --git a/api/v1/swagger/definitions/erm_agreement_document.yaml b/api/v1/swagger/definitions/erm_agreement_document.yaml new file mode 100644 index 0000000000..d4f9e294b2 --- /dev/null +++ b/api/v1/swagger/definitions/erm_agreement_document.yaml @@ -0,0 +1,56 @@ +--- +type: object +properties: + document_id: + type: integer + description: internally assigned identifier + readOnly: true + agreement_id: + type: integer + description: Internal agreement identifier + file_name: + type: + - string + - "null" + description: Name of the file + file_type: + type: + - string + - "null" + description: Name of the file + file_description: + type: + - string + - "null" + description: Description of the file + file_content: + type: + - string + - "null" + description: Content of the file + uploaded_on: + type: + - string + - "null" + format: date-time + description: Datetime of the upload + file_type: + type: + - string + - "null" + description: Name of the file + physical_location: + type: + - string + - "null" + description: Physical location of the document + uri: + description: URI of the document + type: + - string + - "null" + notes: + type: + - string + - "null" +additionalProperties: false diff --git a/api/v1/swagger/paths/erm_agreements.yaml b/api/v1/swagger/paths/erm_agreements.yaml index e8b7358ab3..9a5efa0b7f 100644 --- a/api/v1/swagger/paths/erm_agreements.yaml +++ b/api/v1/swagger/paths/erm_agreements.yaml @@ -192,6 +192,7 @@ - agreement_relationships - agreement_relationships.agreement - agreement_relationships.related_agreement + - documents put: x-mojo-to: ERM::Agreements#update operationId: updateErmAgreements @@ -251,6 +252,7 @@ - user_roles - agreement_licenses - agreement_relationships + - documents delete: x-mojo-to: ERM::Agreements#delete operationId: deleteErmAgreements -- 2.39.5