revert back the clerance payment

This commit is contained in:
Marshal
2026-07-23 13:54:09 +00:00
parent 13609f8d59
commit 15a6bab5d0
54 changed files with 1222 additions and 712 deletions

View File

@@ -361,8 +361,15 @@ export class ContractsController {
);
}
// Readable by anyone who may view the contract: the draft carries
// `editableByMe`, and the approval chain's approvers (identified by position
// type, not by staff_accept) must be able to fetch it to learn it is their
// turn. Gating this on staff_accept hid the edit dialog from every approver.
@Get(':id/document/draft')
@BookingStaff(bothFreightTypes(FREIGHT_PERMS.contracts.staffAccept))
@BookingStaff([
FREIGHT_PERMS.contracts.view,
...bothFreightTypes(FREIGHT_PERMS.contracts.staffAccept),
])
@ApiOperation({
summary:
'Editable contract-document draft (this contract\'s snapshot, or the live template) for the accept/edit dialog',
@@ -385,8 +392,15 @@ export class ContractsController {
return this.documentHistory.list(id);
}
// Coarse gate only. WHO may actually edit is turn-based, not a static
// permission, so `updateContractDocument` -> `assertDocumentEditable` is the
// real boundary: it admits only the approver whose step is currently pending
// (edit rights hand off down the chain on each approval).
@Put(':id/document/articles')
@BookingStaff(bothFreightTypes(FREIGHT_PERMS.contracts.staffAccept))
@BookingStaff([
FREIGHT_PERMS.contracts.view,
...bothFreightTypes(FREIGHT_PERMS.contracts.staffAccept),
])
@ApiOperation({
summary:
'Edit this contract\'s document articles only (per-contract; never touches the six shared templates)',