feat: add original service reference
This commit is contained in:
parent
bada98d12d
commit
fbf7f6c968
3 changed files with 18 additions and 1 deletions
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- Added the required column `refServiceId` to the `QuotationService` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "QuotationService" ADD COLUMN "refServiceId" TEXT NOT NULL;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "QuotationService" ADD CONSTRAINT "QuotationService_refServiceId_fkey" FOREIGN KEY ("refServiceId") REFERENCES "Service"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
|
@ -718,7 +718,8 @@ model Service {
|
|||
status Status @default(CREATED)
|
||||
statusOrder Int @default(0)
|
||||
|
||||
work Work[]
|
||||
work Work[]
|
||||
quotationService QuotationService[]
|
||||
|
||||
productType ProductType? @relation(fields: [productTypeId], references: [id], onDelete: SetNull)
|
||||
productTypeId String?
|
||||
|
|
@ -854,8 +855,12 @@ model QuotationService {
|
|||
|
||||
work QuotationServiceWork[]
|
||||
|
||||
refServiceId String
|
||||
refService Service @relation(fields: [refServiceId], references: [id])
|
||||
|
||||
quotation Quotation @relation(fields: [quotationId], references: [id])
|
||||
quotationId String
|
||||
serviceId String
|
||||
}
|
||||
|
||||
model QuotationServiceWork {
|
||||
|
|
|
|||
|
|
@ -420,6 +420,7 @@ export class QuotationController extends Controller {
|
|||
detail: a.detail,
|
||||
attributes: a.attributes,
|
||||
quotationId: quotation.id,
|
||||
refServiceId: a.id,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue