feat: prevent request work that already issued credit note
This commit is contained in:
parent
f4ded1692d
commit
26c9705b18
1 changed files with 2 additions and 0 deletions
|
|
@ -204,6 +204,7 @@ export class CreditNoteController extends Controller {
|
|||
async createCreditNote(@Request() req: RequestWithUser, @Body() body: CreditNoteCreate) {
|
||||
const requestWork = await prisma.requestWork.findMany({
|
||||
where: {
|
||||
creditNote: null,
|
||||
request: {
|
||||
quotation: {
|
||||
id: body.quotationId,
|
||||
|
|
@ -310,6 +311,7 @@ export class CreditNoteController extends Controller {
|
|||
|
||||
const requestWork = await prisma.requestWork.findMany({
|
||||
where: {
|
||||
OR: [{ creditNote: null }, { creditNoteId }],
|
||||
request: {
|
||||
quotation: {
|
||||
id: body.quotationId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue