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

#3920 - Update Expected Name for Disbursement File #3963

Merged

Conversation

lewischen-aot
Copy link
Collaborator

@lewischen-aot lewischen-aot commented Nov 19, 2024

  • Updated expected file name for disbursement receipt file to ${this.esdcConfig.environmentCode}EDU\\.PBC\\.DIS.[0-9]{8}\\.[0-9]{3}$

Screenshot of the Bull Dashboard completed task with the disbursement schedule records not found
image

Screenshot of the Bull Dashboard completed task with the disbursement schedule records found
image

@lewischen-aot lewischen-aot marked this pull request as ready for review November 19, 2024 17:36
@bidyashish
Copy link
Collaborator

bidyashish commented Nov 19, 2024

Any sample file name is added in PR?
Regex looks fine for filename

Example matches:
DEVEDU.PBC.DIS.ANYTHING.123
DEVEDU.PBC.DIS.TEST.456

@@ -50,7 +50,7 @@ export class DisbursementReceiptProcessingService {
async process(auditUserId: number): Promise<ProcessSFTPResponseResult[]> {
// Get the list of all files from SFTP ordered by file name.
const fileSearch = new RegExp(
`^${this.esdcConfig.environmentCode}EDU.PBC.DIS.D[\w]*\.[0-9]*`,
`^${this.esdcConfig.environmentCode}EDU.PBC.DIS.[\\w]*\\.[0-9]*`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

The intermediate points should also be escaped:

^${this.esdcConfig.environmentCode}EDU\\.PBC\\.DIS\\.[\\w]*\\.[0-9]*

Now that the format is well known, a more precise regex could be used, as below.

^${this.esdcConfig.environmentCode}EDU\\.PBC\\.DIS.[0-9]{8}\\.[0-9]{3}$

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @andrewsignori-aot for the precise regex format. The PR is updated with this regex.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks good, minor observation that the $ at the end was part of it, but it would not be a blocker 😉

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The anchor tag is now added. This $ works 🙂

@lewischen-aot
Copy link
Collaborator Author

lewischen-aot commented Nov 19, 2024

Any sample file name is added in PR? Regex looks fine for filename

Example matches:
DEVEDU.PBC.DIS.ANYTHING.123
DEVEDU.PBC.DIS.TEST.456

Thanks @bidyashish for pointing it out. There is no sample file added to the PR. The file I used to process the disbursement receipts is similar to the file for the federal provincial part time disbursement file, and the content of the file was modified to match existing disbursement schedules in my local database for running sample processes. The file name was changed to "DEDU.PBC.DIS.20241119.001" to match the regex format for this PR, and the screenshots of the Bull Dashboard show the results of process summary. The regex is now using ${this.esdcConfig.environmentCode}EDU\\.PBC\\.DIS.[0-9]{8}\\.[0-9]{3}$ as a precise match as of @andrewsignori-aot 's comment.

Copy link
Collaborator

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

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Nice job, looks good 👍

Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 22.1% ( 3718 / 16821 )
Methods: 10.19% ( 214 / 2100 )
Lines: 25.44% ( 3226 / 12680 )
Branches: 13.62% ( 278 / 2041 )

Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 65.43% ( 583 / 891 )
Methods: 59.26% ( 64 / 108 )
Lines: 68.54% ( 464 / 677 )
Branches: 51.89% ( 55 / 106 )

Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 86.93% ( 1244 / 1431 )
Methods: 88.57% ( 124 / 140 )
Lines: 87.78% ( 1056 / 1203 )
Branches: 72.73% ( 64 / 88 )

Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 66.96% ( 5773 / 8621 )
Methods: 64.8% ( 718 / 1108 )
Lines: 70.89% ( 4530 / 6390 )
Branches: 46.75% ( 525 / 1123 )

@lewischen-aot lewischen-aot added this pull request to the merge queue Nov 20, 2024
Merged via the queue into main with commit 991b597 Nov 20, 2024
20 checks passed
@lewischen-aot lewischen-aot deleted the feature/#3920-update-expected-name-for-disbursement-file branch November 20, 2024 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants