mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-02 02:23:25 +00:00
add dispute functionality for contract duty and implement collection dates
This commit is contained in:
@@ -303,8 +303,10 @@ export class ContractsController {
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@Body() dto: UpdateContractDto,
|
||||
@UploadedFiles() files: Express.Multer.File[],
|
||||
// Recorded on the edit's audit revision — who changed the contract.
|
||||
@CurrentUser() user?: TCurrentUser,
|
||||
) {
|
||||
return this.contractsService.update(id, dto, files ?? []);
|
||||
return this.contractsService.update(id, dto, files ?? [], user?.id);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@@ -738,6 +740,92 @@ export class ContractsController {
|
||||
return this.clearanceService.finalizePreClearance(id);
|
||||
}
|
||||
|
||||
@Post(':id/clearance/transit-assignee/request')
|
||||
@BookingStaff(FREIGHT_PERMS.contracts.clearanceEtActions)
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'GL ET asks GL Djibouti to name the transit officer — required before the customs declaration',
|
||||
})
|
||||
requestTransitAssignee(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@Body('note') note: string | undefined,
|
||||
@CurrentUser() user: AuthUserPayload,
|
||||
) {
|
||||
return this.clearanceService.requestTransitAssignee(
|
||||
id,
|
||||
note,
|
||||
resolveAuthUserId(user),
|
||||
);
|
||||
}
|
||||
|
||||
@Post(':id/clearance/transit-assignee/assign')
|
||||
@BookingStaff(FREIGHT_PERMS.contracts.clearanceDjActions)
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'GL Djibouti names the transit officer (free text) — unblocks the customs declaration; calling again reassigns',
|
||||
})
|
||||
assignTransitAssignee(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@Body('assignee') assignee: string,
|
||||
@CurrentUser() user: AuthUserPayload,
|
||||
) {
|
||||
return this.clearanceService.assignTransitAssignee(
|
||||
id,
|
||||
assignee,
|
||||
resolveAuthUserId(user),
|
||||
);
|
||||
}
|
||||
|
||||
@Get(':id/clearance/documents/:fileKey/versions')
|
||||
@BookingStaff(FREIGHT_PERMS.contracts.clearanceReview)
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Version history of one clearance document — the customer original plus every staff replacement',
|
||||
})
|
||||
documentVersions(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@Param('fileKey') fileKey: string,
|
||||
) {
|
||||
return this.clearanceService.documentVersions(id, fileKey);
|
||||
}
|
||||
|
||||
@Post(':id/clearance/documents/:fileKey/replace')
|
||||
@BookingStaff(FREIGHT_PERMS.contracts.clearanceReview)
|
||||
@UseInterceptors(FileInterceptor('file'))
|
||||
@ApiConsumes('multipart/form-data')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'GL replaces a clearance document in place (reason required) — the previous version is kept in the file history and the new one needs approving',
|
||||
})
|
||||
replaceClearanceDocument(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@Param('fileKey') fileKey: string,
|
||||
@UploadedFile() file: Express.Multer.File,
|
||||
@Body('reason') reason: string,
|
||||
@CurrentUser() user: AuthUserPayload,
|
||||
) {
|
||||
return this.clearanceService.replaceDocument(
|
||||
id,
|
||||
fileKey,
|
||||
file,
|
||||
resolveAuthUserId(user),
|
||||
reason,
|
||||
);
|
||||
}
|
||||
|
||||
@Post(':id/clearance/duty/dispute')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Customer disputes the advised duty/tax with a reason — reopens the step so GL Ethiopia can re-advise (repeatable)',
|
||||
})
|
||||
disputeContractDuty(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@Body('note') note: string,
|
||||
@CurrentUser() user: AuthUserPayload,
|
||||
) {
|
||||
return this.clearanceService.disputeDuty(id, note, resolveAuthUserId(user));
|
||||
}
|
||||
|
||||
@Post(':id/clearance/duty-slip')
|
||||
@UseInterceptors(FileInterceptor('file'))
|
||||
@ApiConsumes('multipart/form-data')
|
||||
@@ -766,19 +854,21 @@ export class ContractsController {
|
||||
@BookingStaff(FREIGHT_PERMS.contracts.clearanceDjActions)
|
||||
@UseInterceptors(FileInterceptor('file'))
|
||||
@ApiConsumes('multipart/form-data')
|
||||
@ApiOperation({ summary: 'GL DJ uploads Delivery Order (import)' })
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'GL DJ uploads Delivery Order (import) with vessel arrival + DO collected dates',
|
||||
})
|
||||
uploadDeliveryOrder(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@UploadedFile() file: Express.Multer.File,
|
||||
@Body('vesselDepartureDate') vesselDepartureDate: string | undefined,
|
||||
@Body('vesselArrivalDate') vesselArrivalDate: string | undefined,
|
||||
@Body('doCollectedDate') doCollectedDate: string | undefined,
|
||||
@CurrentUser() user: AuthUserPayload,
|
||||
) {
|
||||
return this.clearanceService.uploadDeliveryOrder(
|
||||
id,
|
||||
file,
|
||||
resolveAuthUserId(user),
|
||||
vesselDepartureDate,
|
||||
);
|
||||
return this.clearanceService.uploadDeliveryOrder(id, file, resolveAuthUserId(user), {
|
||||
vesselArrivalDate,
|
||||
doCollectedDate,
|
||||
});
|
||||
}
|
||||
|
||||
@Post(':id/clearance/release-order')
|
||||
|
||||
Reference in New Issue
Block a user