Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replaced Minio with Document Record Service #760

Open
wants to merge 4 commits into
base: feature-drs-integration
Choose a base branch
from

Conversation

flutistar
Copy link
Collaborator

@flutistar flutistar commented Dec 19, 2024

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

  • Updated AuthorizationProof component
  • Updated UnlimitedLiabilityCorporationInformation component
  • Upload document function to Document Record Service
  • Delete document from Document Record Service
  • Get/Set consumerDocumentId
  • Added 3 new env variables

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

Copy link

@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 Brandon!
I have a few questions around the state management of consumerDocumentId.
Are we storing this in state because we are using it in subsequent document requests?
ie the first POST generates the docId and we use that affiliate all the following documents to that singular docId?

If so, it makes sense in state, that being said we may want to consider that this property will need to be cleared before the Cont-In flow is launched or exited etc.

Either way, we will want to make sure this ID doesn't persist between Cont In Filings.
Edge case for sure and maybe the state IS already reset between, just wanted to call it out!

Copy link
Collaborator

@JazzarKarim JazzarKarim left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Collaborator

@severinbeauvais severinbeauvais left a comment

Choose a reason for hiding this comment

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

There's one outstanding comment that I'd like to see resolved but other than that, LGTM.

Copy link

@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.

DRS integration looks good. FYI CNTA is a legacy/existing document type possibly also used in the past by the scanning application.

@@ -285,14 +285,28 @@ export default class AuthorizationInformation extends Mixins(DateMixin, Document
if (!documentKey || !documentName) return // safety check

this.isDownloading = true
await this.downloadDocument(documentKey, documentName).catch(error => {
const documentClass = 'CORP'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please create an enum for document classes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks.

Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think about an enum for the document type as well? (I'd be OK with both enums in the same file, fwiw.)

@@ -4,4 +4,5 @@ export interface AuthorizationProofIF {
fileKey: string
fileName: string
}>
consumerDocumentId?: string
Copy link
Collaborator

@severinbeauvais severinbeauvais Jan 10, 2025

Choose a reason for hiding this comment

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

Can we make this name consistent with documentServiceId (in filing-interfaces.ts and elsewhere)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We have both documentServiceId and consumerDocumentId as well.
Thanks

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was thinking about this documentServiceId + documentConsumerId.

Is the first one "service id" and second one "document id"? If yes then what you have makes sense.


// use beforeCreate() instead of created() to avoid type conflict with components that use this mixin
async beforeCreate (): Promise<void> {
// NB: we load the lib and worker this way to avoid a memory leak (esp in unit tests)
// NB: must use legacy build for unit tests not running in Node 18+
this.pdfjsLib = pdfjs
this.pdfjsLib.GlobalWorkerOptions.workerSrc = await import('pdfjs-dist/legacy/build/pdf.worker.entry')
this.documentTypes = DOCUMENT_TYPES
Copy link
Collaborator

Choose a reason for hiding this comment

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

For cleaner code, I think you can actually do import { DOCUMENT_TYPES as documentTypes } from ....

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I used to use documentTypes in the components that extend documentMixin and that's why I redefined documentTypes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

My point is, instead of using a local variable to rename DOCUMENT_TYPES, you can import it with the name you want, as per my example.

Copy link
Collaborator

@JazzarKarim JazzarKarim left a comment

Choose a reason for hiding this comment

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

LGTM

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