feat: add waiting status
This commit is contained in:
parent
c4d45a137d
commit
230eae5c89
2 changed files with 11 additions and 0 deletions
|
|
@ -1603,6 +1603,7 @@ model UserTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
enum CreditNoteStatus {
|
enum CreditNoteStatus {
|
||||||
|
Waiting
|
||||||
Pending
|
Pending
|
||||||
Success
|
Success
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -560,6 +560,16 @@ export class CreditNoteActionController extends Controller {
|
||||||
return creditNoteData;
|
return creditNoteData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post("accept")
|
||||||
|
@Security("keycloak", MANAGE_ROLES)
|
||||||
|
async acceptCreditNote(@Request() req: RequestWithUser, @Path() creditNoteId: string) {
|
||||||
|
await this.#checkPermission(req.user, creditNoteId);
|
||||||
|
return await prisma.creditNote.update({
|
||||||
|
where: { id: creditNoteId },
|
||||||
|
data: { creditNoteStatus: CreditNoteStatus.Waiting },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Post("payback-status")
|
@Post("payback-status")
|
||||||
@Security("keycloak", MANAGE_ROLES)
|
@Security("keycloak", MANAGE_ROLES)
|
||||||
async updateStatus(
|
async updateStatus(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue