feat: exclude some work from service
This commit is contained in:
parent
e233869efe
commit
bada98d12d
1 changed files with 3 additions and 0 deletions
|
|
@ -67,6 +67,7 @@ type QuotationCreate = {
|
||||||
work: {
|
work: {
|
||||||
id: string;
|
id: string;
|
||||||
// Name field will come from original data
|
// Name field will come from original data
|
||||||
|
excluded?: boolean;
|
||||||
product: {
|
product: {
|
||||||
id: string;
|
id: string;
|
||||||
amount: number;
|
amount: number;
|
||||||
|
|
@ -335,6 +336,8 @@ export class QuotationController extends Controller {
|
||||||
detail: currentService.detail,
|
detail: currentService.detail,
|
||||||
attributes: currentService.attributes as Prisma.JsonObject,
|
attributes: currentService.attributes as Prisma.JsonObject,
|
||||||
work: a.work.flatMap((c) => {
|
work: a.work.flatMap((c) => {
|
||||||
|
if (c.excluded) return [];
|
||||||
|
|
||||||
const currentWork = currentService.work.find((d) => d.id === c.id);
|
const currentWork = currentService.work.find((d) => d.id === c.id);
|
||||||
|
|
||||||
if (!currentWork) return []; // should not possible
|
if (!currentWork) return []; // should not possible
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue