As an OPS user, I want to upload a document for an Agreement (Contract).
Acceptance Criteria
[x] User can upload a file using the UI or API.
[x] E2E tests stores the document in temporary/in-memory storage.
[x] Production app stores the document in Azure Storage.
[x] A user with the ADMIN role can upload a document for any Agreement.
[x] A user without the ADMIN role can upload a document for any Agreement they are associated with, i.e. a team member or project officer of that Agreement.
[x] A new privilege UPLOAD_DOCUMENT (or similar) should be assigned to the standard OPS roles.
[x] The proper history and event records are created.
Tasks
Dev
[x] Create JS component (based on FileUpload.jsx)
[x] Create initial temporary JS page for this story (add a page with the new JS component for testing purposes)
[x] Create API Document Management module (Flask blueprint) and /documents endpoint
[x] Create marshmallow request/response schemas for /documents (and update openapi.json)
[x] Create service create_document
[x] Create FakeDocumentRepository for storing documents in memory (for testing)
[x] Create an endpoint (or reuse /documents) that can handle file transfer for FakeDocumentRepository
[x] Update history record for the Agreement for uploading a document
[x] Create AzureDocumentRepository for storing documents in Azure.
User Story
As an OPS user, I want to upload a document for an Agreement (Contract).
Acceptance Criteria
ADMIN
role can upload a document for any Agreement.ADMIN
role can upload a document for any Agreement they are associated with, i.e. a team member or project officer of that Agreement.UPLOAD_DOCUMENT
(or similar) should be assigned to the standard OPS roles.Tasks
Dev
FileUpload.jsx
)Document Management
module (Flask blueprint) and/documents
endpoint/documents
(and update openapi.json)create_document
FakeDocumentRepository
for storing documents in memory (for testing)/documents
) that can handle file transfer forFakeDocumentRepository
AzureDocumentRepository
for storing documents in Azure.Links
https://flask.palletsprojects.com/en/2.3.x/patterns/fileuploads/
Previous PR