From f44746978aa4a8e8c6da763ad10b626821295c9c Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Tue, 8 Oct 2024 14:10:13 +0700 Subject: [PATCH] feat: add more relation --- src/controllers/05-quotation-controller.ts | 47 +++++++++++++++++++--- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index 9eb8c73..65b36ec 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -230,6 +230,7 @@ export class QuotationController extends Controller { include: { service: { include: { + productGroup: true, work: { include: { productOnWork: { @@ -242,7 +243,9 @@ export class QuotationController extends Controller { }, }, work: true, - product: true, + product: { + include: { productGroup: true }, + }, worker: true, }, @@ -404,9 +407,26 @@ export class QuotationController extends Controller { include: { productServiceList: { include: { - product: true, + service: { + include: { + productGroup: true, + work: { + include: { + productOnWork: { + include: { + product: true, + }, + }, + }, + }, + }, + }, work: true, - service: true, + product: { + include: { productGroup: true }, + }, + + worker: true, }, }, paySplit: true, @@ -608,9 +628,26 @@ export class QuotationController extends Controller { include: { productServiceList: { include: { - product: true, + service: { + include: { + productGroup: true, + work: { + include: { + productOnWork: { + include: { + product: true, + }, + }, + }, + }, + }, + }, work: true, - service: true, + product: { + include: { productGroup: true }, + }, + + worker: true, }, }, paySplit: true,