Skip to content

Conversation

@flutistar
Copy link
Contributor

@flutistar flutistar commented Dec 19, 2024

Issue #: /bcgov/entity#24632
Description of changes:

  • Added document_record Service
  • Created upload/delete/download document APIs
  • Added 3 ENV variables
  • Moved pdf validation(max size, encryption) from filing process to document upload
  • Updates business identifier upon pay and approval

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).

Copy link
Collaborator

@doug-lovett doug-lovett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@vysakh-menon-aot
Copy link
Collaborator

vysakh-menon-aot commented Dec 20, 2024

Are we moving away from the minio file upload in legal-api? then we need to update COOP file upload (rules and memorandum) in various filings and dissolution and court order file upload.

@flutistar
Copy link
Contributor Author

Are we moving away from the minio file upload in legal-api? then we need to update COOP file upload (rules and memorandum) in various filings and dissolution and court order file upload.

Yes, we are replacing Minio with Document Record Service, but for now Continuation In only as a Proof of Concept.

@flutistar flutistar changed the title 24632 create upload document 24632 Document Record Service Cont. In Integration Jan 10, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots

See analysis details on SonarQube Cloud

Copy link
Collaborator

@doug-lovett doug-lovett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Copy link
Collaborator

@cameron-eyds cameron-eyds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me sir
Just like the UI side, we will want to think about ways to get this into dev without hindering current workflows, leaving in a feature branch will only get more cumbersome as time goes on!

@flutistar flutistar removed the request for review from vysakh-menon-aot February 5, 2025 14:22
@pwei1018 pwei1018 requested a review from Copilot May 2, 2025 16:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request integrates the Document Record Service across the codebase by adding a new service, updating document-related endpoints, and modifying validations to use the new file validation function.

  • Introduces DocumentRecordService with new methods for document upload, deletion, download, and business identifier update.
  • Updates filing processors and validations to transition from pdf‐based validation to DRS file validation.
  • Adds environment variable configuration and new API endpoints to support DRS operations.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
queue_services/entity-filer/src/entity_filer/filing_processors/continuation_in.py Updates filing processor to update business identifier via DRS.
legal-api/src/legal_api/services/filings/validations/continuation_in.py Replaces calls to validate_pdf with validate_file_on_drs for file validation.
legal-api/src/legal_api/services/filings/validations/common_validations.py Adds the new validate_file_on_drs helper using DocumentRecordService.
legal-api/src/legal_api/services/document_record.py Implements the DocumentRecordService with DRS operations.
legal-api/src/legal_api/resources/v2/document.py and business_documents.py Introduces new endpoints and logic for handling DRS documents.
legal-api/src/legal_api/constants.py Adds enums for document class and type for use with DRS integration.
legal-api/src/legal_api/config.py Adds new environment variables for DRS settings.
Comments suppressed due to low confidence (1)

legal-api/src/legal_api/constants.py:24

  • The trailing comma in the 'CNTO' enum value may result in a tuple instead of the intended string. Remove the comma to ensure the value is a string.
DocumentTypeEnum(Enum):\n    CNTO = 'CNTO',


try:
response = requests.patch(
url, json={ 'consumerIdentifer': business_identifier },
Copy link

Copilot AI May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key 'consumerIdentifer' is misspelled; it should be 'consumerIdentifier'. Additionally, the exception logging message below incorrectly references deletion instead of an update.

Suggested change
url, json={ 'consumerIdentifer': business_identifier },
url, json={ 'consumerIdentifier': business_identifier },

Copilot uses AI. Check for mistakes.

return msg

def validate_file_on_drs(document_class: str, document_service_id: str, path) -> bool:
Copy link

Copilot AI May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type annotation '-> bool' does not match the implementation which returns a list of errors. Consider updating the annotation to Optional[list] or a similar appropriate type.

Suggested change
def validate_file_on_drs(document_class: str, document_service_id: str, path) -> bool:
def validate_file_on_drs(document_class: str, document_service_id: str, path) -> list:

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@thorwolpert thorwolpert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants