-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add LoA validation on pay now #1718
base: main
Are you sure you want to change the base?
Conversation
Quality Gate passed for 'onroutebc_scheduler'Issues Measures |
Quality Gate passed for 'onroutebc_policy'Issues Measures |
Quality Gate passed for 'onroutebc dops'Issues Measures |
Quality Gate failed for 'onroutebc vehicles'Failed conditions |
Quality Gate passed for 'onroutebc frontend'Issues Measures |
@@ -887,4 +904,137 @@ export class PaymentService { | |||
})), | |||
) as PermitHistoryDto[]; | |||
} | |||
|
|||
async isValidLoa(permit: Permit): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be part of the validate endpoint?
permitVehicleType, | ||
); | ||
} | ||
private validateLoaDetails( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor to Loa helper or util or the loa module
} | ||
} | ||
|
||
private validatePermitDataAgainstLoas( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor to Loa helper or util or the loa module
const permitData = JSON.parse(permit.permitData.permitData) as PermitData; | ||
const { vehicleId: permitVehicleId, vehicleType: permitVehicleType } = | ||
permitData.vehicleDetails; | ||
const loaNumbers = permitData.loas.map((loa) => loa.loaNumber); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add optional chaining
@@ -887,4 +904,137 @@ export class PaymentService { | |||
})), | |||
) as PermitHistoryDto[]; | |||
} | |||
|
|||
async isValidLoa(permit: Permit): Promise<void> { | |||
const { companyId } = permit.company; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add optional chaining
Description
This PR is to add LoA validation on pay now. Verifies the consistency of loa data in database and permit snapshot. Validates permit type, dates and vehicles with loa and loa snapshot data.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist
Further comments
Thanks for the PR!
Deployments, as required, will be available below:
Please create PRs in draft mode. Mark as ready to enable:
After merge, new images are promoted to: