mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 12:28:21 +00:00
feat(contracts): implement staff cancellation of contracts with reason and notification
This commit is contained in:
@@ -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' })
|
||||
|
||||
Reference in New Issue
Block a user