feat: add messenger by area setting to workflow

This commit is contained in:
Methapon2001 2024-12-26 10:27:12 +07:00
parent ff858aaf50
commit f433875a7d
2 changed files with 5 additions and 0 deletions

View file

@ -1031,6 +1031,7 @@ model WorkflowTemplateStep {
value WorkflowTemplateStepValue[] // NOTE: For enum or options type value WorkflowTemplateStepValue[] // NOTE: For enum or options type
responsiblePerson WorkflowTemplateStepUser[] responsiblePerson WorkflowTemplateStepUser[]
responsibleInstitution WorkflowTemplateStepInstitution[] responsibleInstitution WorkflowTemplateStepInstitution[]
messengerByArea Boolean @default(false)
attributes Json? attributes Json?

View file

@ -37,6 +37,7 @@ type WorkflowPayload = {
attributes?: { [key: string]: any }; attributes?: { [key: string]: any };
responsiblePersonId?: string[]; responsiblePersonId?: string[];
responsibleInstitution?: string[]; responsibleInstitution?: string[];
messengerByArea?: boolean;
}[]; }[];
registeredBranchId?: string; registeredBranchId?: string;
status?: Status; status?: Status;
@ -202,6 +203,7 @@ export class FlowTemplateController extends Controller {
detail: v.detail, detail: v.detail,
order: i + 1, order: i + 1,
attributes: v.attributes, attributes: v.attributes,
messengerByArea: v.messengerByArea,
responsiblePerson: { responsiblePerson: {
create: v.responsiblePersonId?.map((id) => ({ create: v.responsiblePersonId?.map((id) => ({
userId: id, userId: id,
@ -255,6 +257,7 @@ export class FlowTemplateController extends Controller {
value: { value: {
create: v.value?.map((val) => ({ value: val })), create: v.value?.map((val) => ({ value: val })),
}, },
messengerByArea: v.messengerByArea,
responsiblePerson: { responsiblePerson: {
createMany: { createMany: {
data: v.responsiblePersonId?.map((id) => ({ userId: id })) || [], data: v.responsiblePersonId?.map((id) => ({ userId: id })) || [],
@ -273,6 +276,7 @@ export class FlowTemplateController extends Controller {
deleteMany: {}, deleteMany: {},
create: v.value?.map((val) => ({ value: val })), create: v.value?.map((val) => ({ value: val })),
}, },
messengerByArea: v.messengerByArea,
responsiblePerson: v.responsiblePersonId responsiblePerson: v.responsiblePersonId
? { ? {
deleteMany: { deleteMany: {