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
|
||||
}
|
||||
|
||||
enum CreditNotePaybackType {
|
||||
Cash
|
||||
BankTransfer
|
||||
}
|
||||
|
||||
model CreditNote {
|
||||
id String @id @default(cuid())
|
||||
|
||||
|
|
@ -1592,7 +1597,14 @@ model CreditNote {
|
|||
|
||||
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)
|
||||
quotationId String
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import {
|
|||
import HttpError from "../interfaces/http-error";
|
||||
import HttpStatus from "../interfaces/http-status";
|
||||
import { notFoundError } from "../utils/error";
|
||||
import { CreditNoteStatus, Prisma } from "@prisma/client";
|
||||
import { CreditNotePaybackType, CreditNoteStatus, Prisma } from "@prisma/client";
|
||||
import { queryOrNot } from "../utils/relation";
|
||||
import { RequestWorkStatus } from "../generated/kysely/types";
|
||||
|
||||
|
|
@ -52,10 +52,22 @@ const permissionCheckCompany = createPermCheck((_) => true);
|
|||
type CreditNoteCreate = {
|
||||
requestWorkId: string[];
|
||||
quotationId: string;
|
||||
reason?: string;
|
||||
detail?: string;
|
||||
paybackType?: CreditNotePaybackType;
|
||||
paybackBank?: string;
|
||||
paybackAccount?: string;
|
||||
paybackAccountName?: string;
|
||||
};
|
||||
type CreditNoteUpdate = {
|
||||
requestWorkId: string[];
|
||||
quotationId: string;
|
||||
reason?: string;
|
||||
detail?: string;
|
||||
paybackType?: CreditNotePaybackType;
|
||||
paybackBank?: string;
|
||||
paybackAccount?: string;
|
||||
paybackAccountName?: string;
|
||||
};
|
||||
|
||||
@Route("api/v1/credit-note")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue