feat: add more field for data store
This commit is contained in:
parent
a6f5cde21f
commit
66212b3b2d
2 changed files with 26 additions and 2 deletions
|
|
@ -1585,6 +1585,11 @@ enum CreditNoteStatus {
|
||||||
Success
|
Success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum CreditNotePaybackType {
|
||||||
|
Cash
|
||||||
|
BankTransfer
|
||||||
|
}
|
||||||
|
|
||||||
model CreditNote {
|
model CreditNote {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
|
|
||||||
|
|
@ -1592,7 +1597,14 @@ model CreditNote {
|
||||||
|
|
||||||
creditNoteStatus CreditNoteStatus @default(Pending)
|
creditNoteStatus CreditNoteStatus @default(Pending)
|
||||||
|
|
||||||
value Float @default(0)
|
value Float @default(0)
|
||||||
|
reason String?
|
||||||
|
detail String?
|
||||||
|
|
||||||
|
paybackType CreditNotePaybackType?
|
||||||
|
paybackBank String?
|
||||||
|
paybackAccount String?
|
||||||
|
paybackAccountName String?
|
||||||
|
|
||||||
quotation Quotation @relation(fields: [quotationId], references: [id], onDelete: Cascade)
|
quotation Quotation @relation(fields: [quotationId], references: [id], onDelete: Cascade)
|
||||||
quotationId String
|
quotationId String
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import {
|
||||||
import HttpError from "../interfaces/http-error";
|
import HttpError from "../interfaces/http-error";
|
||||||
import HttpStatus from "../interfaces/http-status";
|
import HttpStatus from "../interfaces/http-status";
|
||||||
import { notFoundError } from "../utils/error";
|
import { notFoundError } from "../utils/error";
|
||||||
import { CreditNoteStatus, Prisma } from "@prisma/client";
|
import { CreditNotePaybackType, CreditNoteStatus, Prisma } from "@prisma/client";
|
||||||
import { queryOrNot } from "../utils/relation";
|
import { queryOrNot } from "../utils/relation";
|
||||||
import { RequestWorkStatus } from "../generated/kysely/types";
|
import { RequestWorkStatus } from "../generated/kysely/types";
|
||||||
|
|
||||||
|
|
@ -52,10 +52,22 @@ const permissionCheckCompany = createPermCheck((_) => true);
|
||||||
type CreditNoteCreate = {
|
type CreditNoteCreate = {
|
||||||
requestWorkId: string[];
|
requestWorkId: string[];
|
||||||
quotationId: string;
|
quotationId: string;
|
||||||
|
reason?: string;
|
||||||
|
detail?: string;
|
||||||
|
paybackType?: CreditNotePaybackType;
|
||||||
|
paybackBank?: string;
|
||||||
|
paybackAccount?: string;
|
||||||
|
paybackAccountName?: string;
|
||||||
};
|
};
|
||||||
type CreditNoteUpdate = {
|
type CreditNoteUpdate = {
|
||||||
requestWorkId: string[];
|
requestWorkId: string[];
|
||||||
quotationId: string;
|
quotationId: string;
|
||||||
|
reason?: string;
|
||||||
|
detail?: string;
|
||||||
|
paybackType?: CreditNotePaybackType;
|
||||||
|
paybackBank?: string;
|
||||||
|
paybackAccount?: string;
|
||||||
|
paybackAccountName?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
@Route("api/v1/credit-note")
|
@Route("api/v1/credit-note")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue