fix: relation
This commit is contained in:
parent
e3464c4891
commit
9358cac3f8
3 changed files with 18 additions and 9 deletions
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `customerId` on the `Quotation` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "Quotation" DROP CONSTRAINT "Quotation_customerId_fkey";
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Quotation" DROP COLUMN "customerId";
|
||||
|
|
@ -444,8 +444,7 @@ model Customer {
|
|||
updatedBy User? @relation(name: "CustomerUpdatedByUser", fields: [updatedByUserId], references: [id], onDelete: SetNull)
|
||||
updatedByUserId String?
|
||||
|
||||
branch CustomerBranch[]
|
||||
quotation Quotation[]
|
||||
branch CustomerBranch[]
|
||||
}
|
||||
|
||||
model CustomerBranch {
|
||||
|
|
@ -1056,14 +1055,12 @@ model Quotation {
|
|||
vatExcluded Float
|
||||
finalPrice Float
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
createdBy User? @relation(name: "QuotationCreatedByUser", fields: [createdByUserId], references: [id], onDelete: SetNull)
|
||||
createdAt DateTime @default(now())
|
||||
createdBy User? @relation(name: "QuotationCreatedByUser", fields: [createdByUserId], references: [id], onDelete: SetNull)
|
||||
createdByUserId String?
|
||||
updatedAt DateTime @updatedAt
|
||||
updatedBy User? @relation(name: "QuotationUpdatedByUser", fields: [updatedByUserId], references: [id], onDelete: SetNull)
|
||||
updatedAt DateTime @updatedAt
|
||||
updatedBy User? @relation(name: "QuotationUpdatedByUser", fields: [updatedByUserId], references: [id], onDelete: SetNull)
|
||||
updatedByUserId String?
|
||||
Customer Customer? @relation(fields: [customerId], references: [id])
|
||||
customerId String?
|
||||
}
|
||||
|
||||
model QuotationPaySplit {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import {
|
|||
createPermCondition,
|
||||
} from "../services/permission";
|
||||
import { filterStatus } from "../services/prisma";
|
||||
import { notFoundError } from "../utils/error";
|
||||
|
||||
type ProductGroupCreate = {
|
||||
name: string;
|
||||
|
|
@ -56,7 +57,7 @@ function globalAllow(user: RequestWithUser["user"]) {
|
|||
return allowList.some((v) => user.roles?.includes(v));
|
||||
}
|
||||
|
||||
const permissionCond = createPermCondition(globalAllow);
|
||||
const permissionCond = createPermCondition((_) => true);
|
||||
const permissionCheck = createPermCheck(globalAllow);
|
||||
|
||||
@Route("api/v1/product-group")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue