mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 10:45:44 +00:00
Enhance clearance milestone management and introduce new contract actions
- Added new milestones for 'Transit Permit Uploaded' and 'Export Transport Document Issued' in the clearance milestone catalog. - Implemented methods in ClearanceMilestoneService to skip milestones and complete them with metadata. - Updated ContractBookingService to check boundary conditions before booking creation. - Introduced new endpoints in ContractsController for uploading customs declarations, advising duty, and handling various document uploads. - Enhanced the UI to support new clearance actions and display relevant components based on milestone statuses.
This commit is contained in:
@@ -518,7 +518,17 @@ export class ContractsRepository extends BaseRepository<Contract> {
|
||||
cycleId: string,
|
||||
status: string,
|
||||
fields: Partial<
|
||||
Pick<ContractClearanceCycle, 'bookingId' | 'clearanceReadyAt' | 'completedAt'>
|
||||
Pick<
|
||||
ContractClearanceCycle,
|
||||
| 'bookingId'
|
||||
| 'clearanceReadyAt'
|
||||
| 'completedAt'
|
||||
| 'dutyRequired'
|
||||
| 'vesselDepartureDate'
|
||||
| 'roAmendmentRequestedAt'
|
||||
| 'roHoldReason'
|
||||
| 'currentPhase'
|
||||
>
|
||||
> = {},
|
||||
): Promise<void> {
|
||||
await this.dataSource
|
||||
@@ -526,6 +536,23 @@ export class ContractsRepository extends BaseRepository<Contract> {
|
||||
.update(cycleId, { status, ...fields } as never);
|
||||
}
|
||||
|
||||
async updateCycle(
|
||||
cycleId: string,
|
||||
fields: Partial<
|
||||
Pick<
|
||||
ContractClearanceCycle,
|
||||
| 'dutyRequired'
|
||||
| 'vesselDepartureDate'
|
||||
| 'roAmendmentRequestedAt'
|
||||
| 'roHoldReason'
|
||||
| 'currentPhase'
|
||||
| 'status'
|
||||
>
|
||||
>,
|
||||
): Promise<void> {
|
||||
await this.dataSource.getRepository(ContractClearanceCycle).update(cycleId, fields as never);
|
||||
}
|
||||
|
||||
/** Link the GL-created booking to a clearance cycle. */
|
||||
async linkBooking(cycleId: string, bookingId: string): Promise<void> {
|
||||
await this.dataSource
|
||||
|
||||
Reference in New Issue
Block a user