feat: update product fields

This commit is contained in:
Methapon2001 2024-06-14 16:53:48 +07:00
parent 51fd6b0589
commit d86a209639
3 changed files with 22 additions and 8 deletions

View file

@ -0,0 +1,10 @@
/*
Warnings:
- Changed the type of `process` on the `Product` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
*/
-- AlterTable
ALTER TABLE "Product" ADD COLUMN "remark" TEXT,
DROP COLUMN "process",
ADD COLUMN "process" INTEGER NOT NULL;

View file

@ -631,13 +631,15 @@ model Product {
code String
name String
detail String
process String
process Int
price Int
agentPrice Int
serviceCharge Int
status Status @default(CREATED)
remark String?
productType ProductType? @relation(fields: [productTypeId], references: [id], onDelete: SetNull)
productTypeId String?

View file

@ -30,19 +30,21 @@ type ProductCreate = {
code: "AC" | "DO" | "ac" | "do";
name: string;
detail: string;
process: string;
process: number;
price: number;
agentPrice: number;
serviceCharge: number;
remark?: string;
};
type ProductUpdate = {
name: string;
detail: string;
process?: string;
price: number;
agentPrice: number;
serviceCharge: number;
name?: string;
detail?: string;
process?: number;
price?: number;
agentPrice?: number;
serviceCharge?: number;
remark?: string;
};
function imageLocation(id: string) {