feat(contracts): implement staff cancellation of contracts with reason and notification

This commit is contained in:
Marshal
2026-08-29 11:31:13 +00:00
parent 978f1889c6
commit 6ac41cf078
13 changed files with 352 additions and 5 deletions

View File

@@ -72,6 +72,7 @@ import {
RequestChangesDto,
ResumeContractDto,
SuspendContractDto,
CancelContractByStaffDto,
} from './dto/approve-step.dto';
import { SignContractDto } from './dto/sign-contract.dto';
import { ReviewClearanceDocumentDto } from './dto/review-clearance-document.dto';
@@ -552,6 +553,25 @@ export class ContractsController {
);
}
@Post(':id/staff/cancel')
@BookingStaff(FREIGHT_PERMS.contracts.cancel)
@ApiOperation({
summary:
'Staff cancel a contract (terminal — a new contract with the same details may be submitted after)',
})
cancelByStaff(
@Param('id', ParseUUIDPipe) id: string,
@Body() dto: CancelContractByStaffDto,
@CurrentUser() user: TCurrentUser,
) {
return this.transitionService.cancelByStaff(
id,
dto.reason,
resolveAuthUserId(user),
user,
);
}
@Post(':id/approval-steps/:stepId/approve')
@BookingStaff(FREIGHT_PERMS.contracts.view)
@ApiOperation({ summary: 'Approve one approval step in sequence' })