@wisemen/wise-crm-web 0.2.5 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BusinessDetailSidebarProvider-Dm6Dd7Nq.js +2899 -0
- package/dist/{BusinessDetailView-BZpocob4.js → BusinessDetailView-BHVUfCpV.js} +5 -5
- package/dist/{CrmDetailHeaderCard-Jo2OteBb.js → CrmDetailHeaderCard-CiVLyIuw.js} +39 -39
- package/dist/{CrmDetailView-DKHX-JEl.js → CrmDetailView-DaAuWeiB.js} +14 -14
- package/dist/{DealCommunicationTabView-ClflVxHJ.js → DealCommunicationTabView-xq_zOAsr.js} +2 -2
- package/dist/{DealDetailView-ChAFvBBK.js → DealDetailView-C54XpYN1.js} +124 -124
- package/dist/{DealExternalAttachment-ClwtFzpQ.js → DealExternalAttachment-Dp44vkgt.js} +1 -1
- package/dist/{DealSendMailDialog-SWWyaxq8.js → DealSendMailDialog-D11Tgd_A.js} +50 -50
- package/dist/{Error-CX6APxDX.js → Error-X0deDY-N.js} +510 -8
- package/dist/{IndividualDetailSidebarProvider-BJgxw1Jd.js → IndividualDetailSidebarProvider-BvjhFng9.js} +218 -218
- package/dist/{IndividualDetailView-CvGUCWPY.js → IndividualDetailView-Cq8iAwQv.js} +5 -5
- package/dist/{client-CpsHjr8V.js → client-S6BLV3Ct.js} +7 -12
- package/dist/composables/crmConfig.composable.d.ts +1 -0
- package/dist/index.js +375 -375
- package/dist/kbo-client/client/client.gen.d.ts +2 -0
- package/dist/kbo-client/client/index.d.ts +8 -0
- package/dist/kbo-client/client/types.gen.d.ts +117 -0
- package/dist/kbo-client/client/utils.gen.d.ts +33 -0
- package/dist/kbo-client/client.gen.d.ts +12 -0
- package/dist/kbo-client/core/auth.gen.d.ts +18 -0
- package/dist/kbo-client/core/bodySerializer.gen.d.ts +25 -0
- package/dist/kbo-client/core/params.gen.d.ts +43 -0
- package/dist/kbo-client/core/pathSerializer.gen.d.ts +33 -0
- package/dist/kbo-client/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/kbo-client/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/kbo-client/core/types.gen.d.ts +78 -0
- package/dist/kbo-client/core/utils.gen.d.ts +19 -0
- package/dist/kbo-client/index.d.ts +2 -0
- package/dist/kbo-client/sdk.gen.d.ts +72 -0
- package/dist/kbo-client/types.gen.d.ts +2089 -0
- package/dist/kbo-client/zod.gen.d.ts +5943 -0
- package/dist/libs/http.lib.d.ts +3 -1
- package/dist/libs/kboBaseUrl.lib.d.ts +1 -0
- package/dist/models/cbe/search/cbeEnterpriseSearchDto.model.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +2 -1
- package/dist/BusinessDetailSidebarProvider-CXG99iHk.js +0 -2077
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { a as contactPersonUpdateFormSchema, i as CrmDetailSidebarMapCard_default, l as ActivityList_default, n as CrmDetailSidebarAccordionContactPersonInfo_default, o as ContactPersonCreateForm_default, r as CrmDetailSidebarAccordionBillingInformation_default, s as ContactPersonCreateNewForm_default, t as CrmDetailHeaderCard_default, u as assert } from "./CrmDetailHeaderCard-
|
|
1
|
+
import { $ as useNoteDeleteMutation, A as AppColorProvider_default, B as CrmDetailSidebarNotesView_default, F as AppSidebarFormFooter_default, P as AppSidebarFormSubmitButton_default, Q as useKeysetInfiniteQuery, R as NoteUpdateDialog_default, T as useCrm, W as AppConfirmDialog_default, Y as useApiErrorToast, c as CrmDetailAccordionRoot_default, et as NoteService, h as useContactPersonCreateMutation, i as CrmDetailSidebarAccordionHeaderIconButton_default, l as AppIconLabelPair_default, m as AppDialog_default, n as CrmDetailContainer_default, o as CrmDetailSidebarCard_default, r as CrmDetailSidebarTabs_default, s as CrmDetailSidebarAccordionItem_default, t as Error_default, y as IndividualService } from "./Error-X0deDY-N.js";
|
|
2
|
+
import { a as contactPersonUpdateFormSchema, i as CrmDetailSidebarMapCard_default, l as ActivityList_default, n as CrmDetailSidebarAccordionContactPersonInfo_default, o as ContactPersonCreateForm_default, r as CrmDetailSidebarAccordionBillingInformation_default, s as ContactPersonCreateNewForm_default, t as CrmDetailHeaderCard_default, u as assert } from "./CrmDetailHeaderCard-CiVLyIuw.js";
|
|
3
3
|
import { c as Be, l as He, n as useDateTimeFormat, t as AppSkeletonLoader_default, u as ze } from "./AppSkeletonLoader-BAhoOmFD.js";
|
|
4
|
-
import {
|
|
4
|
+
import { mt as EntityType } from "./client-S6BLV3Ct.js";
|
|
5
5
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, renderList, toDisplayString, unref, withCtx } from "vue";
|
|
6
6
|
import { useI18n } from "vue-i18n";
|
|
7
7
|
import { VcButton, VcIconButton, VcRouterLinkButton, useDialog, usePagination, useToast } from "@wisemen/vue-core-components";
|
|
8
8
|
import { useMutation, useQueryClient } from "@tanstack/vue-query";
|
|
9
9
|
import { useForm } from "formango";
|
|
10
10
|
import { Motion } from "motion-v";
|
|
11
|
-
function useIndividualDetailQuery(
|
|
11
|
+
function useIndividualDetailQuery(i) {
|
|
12
12
|
return He({
|
|
13
|
-
isEnabled: computed(() =>
|
|
14
|
-
queryFn: () => (assert(
|
|
15
|
-
queryKey: { wiseCrmIndividualDetail: { individualUuid:
|
|
13
|
+
isEnabled: computed(() => i.value !== null),
|
|
14
|
+
queryFn: () => (assert(i.value !== null, "individualUuid is null"), IndividualService.getByUuid(i.value)),
|
|
15
|
+
queryKey: { wiseCrmIndividualDetail: { individualUuid: i } }
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
function useIndividualGrantMutation() {
|
|
19
19
|
return ze({
|
|
20
|
-
queryFn: async ({ body:
|
|
21
|
-
queryKeysToInvalidate: { wiseCrmIndividualDetail: { individualUuid: (
|
|
20
|
+
queryFn: async ({ body: i, params: N }) => await IndividualService.grantUser(N.individualUuid, i),
|
|
21
|
+
queryKeysToInvalidate: { wiseCrmIndividualDetail: { individualUuid: (i) => i.individualUuid } }
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
function useActivityIndividualIndexQuery(
|
|
24
|
+
function useActivityIndividualIndexQuery(i, N) {
|
|
25
25
|
return Be({
|
|
26
|
-
paginationOptions:
|
|
27
|
-
queryFn: async (
|
|
28
|
-
queryKey: { individualActivityIndex: { paginationOptions:
|
|
26
|
+
paginationOptions: N,
|
|
27
|
+
queryFn: async (N) => await IndividualService.getActivity(i.value, N),
|
|
28
|
+
queryKey: { individualActivityIndex: { paginationOptions: N } }
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
var IndividualDetailSidebarActivityContent_default = /* @__PURE__ */ defineComponent({
|
|
32
32
|
__name: "IndividualDetailSidebarActivityContent",
|
|
33
33
|
props: { individual: {} },
|
|
34
|
-
setup(
|
|
35
|
-
let
|
|
34
|
+
setup(i) {
|
|
35
|
+
let N = i, P = usePagination({
|
|
36
36
|
isRouteQueryEnabled: !1,
|
|
37
37
|
type: "keyset"
|
|
38
|
-
}),
|
|
39
|
-
async function
|
|
40
|
-
await
|
|
38
|
+
}), F = useActivityIndividualIndexQuery(computed(() => N.individual.uuid), P.paginationOptions), I = computed(() => F.data.value.data ?? []);
|
|
39
|
+
async function L() {
|
|
40
|
+
await F.getNextPage();
|
|
41
41
|
}
|
|
42
|
-
return (
|
|
43
|
-
"on-next":
|
|
44
|
-
"is-loading": unref(
|
|
45
|
-
activities:
|
|
42
|
+
return (i, N) => (openBlock(), createBlock(ActivityList_default, {
|
|
43
|
+
"on-next": L,
|
|
44
|
+
"is-loading": unref(F).isLoading.value,
|
|
45
|
+
activities: I.value
|
|
46
46
|
}, null, 8, ["is-loading", "activities"]));
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
function useNoteIndividualCreateMutation() {
|
|
50
50
|
return ze({
|
|
51
|
-
queryFn: async ({ body:
|
|
51
|
+
queryFn: async ({ body: i, params: N }) => await NoteService.create(i, { individualUuid: N.individualUuid }),
|
|
52
52
|
queryKeysToInvalidate: { noteIndividualIndex: {} }
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
function useNoteIndividualIndexQuery(
|
|
55
|
+
function useNoteIndividualIndexQuery(i, N) {
|
|
56
56
|
return useKeysetInfiniteQuery({
|
|
57
|
-
queryFn: (N) => NoteService.getIndividualNotes({ pagination: N },
|
|
57
|
+
queryFn: (N) => NoteService.getIndividualNotes({ pagination: N }, i.value),
|
|
58
58
|
queryKey: { noteIndividualIndex: { params: N?.params } }
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
var IndividualDetailSidebarNotesContent_default = /* @__PURE__ */ defineComponent({
|
|
62
62
|
__name: "IndividualDetailSidebarNotesContent",
|
|
63
63
|
props: { individual: {} },
|
|
64
|
-
setup(
|
|
65
|
-
let
|
|
66
|
-
async function
|
|
64
|
+
setup(N) {
|
|
65
|
+
let F = N, I = useApiErrorToast(), L = useNoteIndividualCreateMutation(), z = useNoteDeleteMutation(), B = useDialog(NoteUpdateDialog_default), V = useNoteIndividualIndexQuery(computed(() => F.individual.uuid)), H = computed(() => V.data?.value?.data ?? []);
|
|
66
|
+
async function U(i) {
|
|
67
67
|
try {
|
|
68
68
|
await L.execute({
|
|
69
|
-
body:
|
|
70
|
-
params: { individualUuid:
|
|
69
|
+
body: i,
|
|
70
|
+
params: { individualUuid: F.individual.uuid }
|
|
71
71
|
});
|
|
72
|
-
} catch (
|
|
73
|
-
|
|
72
|
+
} catch (i) {
|
|
73
|
+
I.show(i);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
async function
|
|
76
|
+
async function W(i) {
|
|
77
77
|
try {
|
|
78
|
-
await
|
|
79
|
-
} catch (
|
|
80
|
-
|
|
78
|
+
await z.execute({ params: { noteUuid: i } });
|
|
79
|
+
} catch (i) {
|
|
80
|
+
I.show(i);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
|
|
83
|
+
function G(i) {
|
|
84
|
+
B.open({ note: i });
|
|
85
85
|
}
|
|
86
|
-
return (
|
|
87
|
-
"is-loading": unref(
|
|
88
|
-
notes:
|
|
89
|
-
"on-submit":
|
|
90
|
-
"has-next-page": unref(
|
|
91
|
-
onNext:
|
|
92
|
-
onDelete:
|
|
93
|
-
onUpdate:
|
|
86
|
+
return (i, N) => (openBlock(), createBlock(CrmDetailSidebarNotesView_default, {
|
|
87
|
+
"is-loading": unref(V).isLoading.value,
|
|
88
|
+
notes: H.value,
|
|
89
|
+
"on-submit": U,
|
|
90
|
+
"has-next-page": unref(V).hasNextPage.value,
|
|
91
|
+
onNext: N[0] ||= (i) => unref(V).fetchNextPage(),
|
|
92
|
+
onDelete: W,
|
|
93
|
+
onUpdate: G
|
|
94
94
|
}, null, 8, [
|
|
95
95
|
"is-loading",
|
|
96
96
|
"notes",
|
|
@@ -99,68 +99,68 @@ var IndividualDetailSidebarNotesContent_default = /* @__PURE__ */ defineComponen
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
function useIndividualSetPrimaryContactPersonMutation() {
|
|
102
|
-
let
|
|
103
|
-
mutationFn: async (
|
|
104
|
-
await IndividualService.setPrimaryContactPerson(
|
|
102
|
+
let i = useQueryClient(), N = "wiseCrmIndividualDetail", P = useMutation({
|
|
103
|
+
mutationFn: async (i) => {
|
|
104
|
+
await IndividualService.setPrimaryContactPerson(i.individualUuid, i.contactPersonUuid);
|
|
105
105
|
},
|
|
106
|
-
onError: (
|
|
107
|
-
|
|
106
|
+
onError: (P, F, I) => {
|
|
107
|
+
i.setQueryData([N, { individualUuid: F.individualUuid }], I?.previousData);
|
|
108
108
|
},
|
|
109
|
-
onMutate: async (
|
|
110
|
-
await
|
|
111
|
-
let
|
|
112
|
-
return
|
|
113
|
-
...
|
|
114
|
-
contactPersons:
|
|
115
|
-
...
|
|
116
|
-
isPrimary: !
|
|
109
|
+
onMutate: async (P) => {
|
|
110
|
+
await i.cancelQueries({ queryKey: [N] });
|
|
111
|
+
let F = i.getQueryData([N, { individualUuid: P.individualUuid }]);
|
|
112
|
+
return F === void 0 ? {} : (i.setQueryData([N, { individualUuid: P.individualUuid }], {
|
|
113
|
+
...F,
|
|
114
|
+
contactPersons: F.contactPersons.map((i) => i.uuid === P.contactPersonUuid ? {
|
|
115
|
+
...i,
|
|
116
|
+
isPrimary: !i.isPrimary
|
|
117
117
|
} : {
|
|
118
|
-
...
|
|
118
|
+
...i,
|
|
119
119
|
isPrimary: !1
|
|
120
120
|
})
|
|
121
|
-
}), { previousData:
|
|
121
|
+
}), { previousData: F });
|
|
122
122
|
},
|
|
123
|
-
onSettled: (
|
|
124
|
-
|
|
123
|
+
onSettled: (P, F, I, L) => {
|
|
124
|
+
I !== void 0 && i.invalidateQueries({ queryKey: [N, { individualUuid: I.individualUuid }] });
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
return {
|
|
128
|
-
isLoading: computed(() =>
|
|
129
|
-
data: computed(() =>
|
|
130
|
-
execute: async (
|
|
131
|
-
await
|
|
128
|
+
isLoading: computed(() => P.isPending.value),
|
|
129
|
+
data: computed(() => P.data.value),
|
|
130
|
+
execute: async (i) => {
|
|
131
|
+
await P.mutateAsync(i.params);
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
function useIndividualUnlinkContactPersonMutation() {
|
|
136
136
|
return ze({
|
|
137
|
-
queryFn: async ({ body:
|
|
137
|
+
queryFn: async ({ body: i, params: N }) => await IndividualService.unlinkContactPerson(N.individualUuid, i.contactPersonUuid),
|
|
138
138
|
queryKeysToInvalidate: {
|
|
139
139
|
individualIndex: {},
|
|
140
|
-
wiseCrmIndividualDetail: { individualUuid: (
|
|
140
|
+
wiseCrmIndividualDetail: { individualUuid: (i) => i.individualUuid }
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
var _hoisted_1$1 = { class: "gap-md flex flex-col" }, CrmDetailSidebarAccordionCustomerInfo_default = /* @__PURE__ */ defineComponent({
|
|
145
145
|
__name: "CrmDetailSidebarAccordionCustomerInfo",
|
|
146
146
|
props: { individual: {} },
|
|
147
|
-
setup(
|
|
148
|
-
let
|
|
149
|
-
return (
|
|
147
|
+
setup(i) {
|
|
148
|
+
let N = i, P = useI18n();
|
|
149
|
+
return (i, F) => (openBlock(), createElementBlock("div", _hoisted_1$1, [createVNode(CrmDetailSidebarCard_default, null, {
|
|
150
150
|
default: withCtx(() => [createVNode(AppIconLabelPair_default, {
|
|
151
|
-
label: unref(
|
|
151
|
+
label: unref(P).t("wise_crm.info_dialog.sidebar.overview.created_at_label", { value: N.individual.createdAt ? unref(useDateTimeFormat)().toDateTime(N.individual.createdAt) : "-" }),
|
|
152
152
|
icon: "clockPlus"
|
|
153
153
|
}, null, 8, ["label"])]),
|
|
154
154
|
_: 1
|
|
155
|
-
}), createVNode(CrmDetailSidebarMapCard_default, { address:
|
|
155
|
+
}), createVNode(CrmDetailSidebarMapCard_default, { address: N.individual.address }, null, 8, ["address"])]));
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
158
|
function useIndividualLinkContactPersonMutation() {
|
|
159
159
|
return ze({
|
|
160
|
-
queryFn: async ({ body:
|
|
160
|
+
queryFn: async ({ body: i, params: N }) => await IndividualService.linkContactPerson(N.individualUuid, i.contactPersonUuid, i.position, i.contactInfo),
|
|
161
161
|
queryKeysToInvalidate: {
|
|
162
162
|
individualIndex: {},
|
|
163
|
-
wiseCrmIndividualDetail: { individualUuid: (
|
|
163
|
+
wiseCrmIndividualDetail: { individualUuid: (i) => i.individualUuid }
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
166
|
}
|
|
@@ -174,67 +174,67 @@ var IndividualContactPersonCreateDialog_default = /* @__PURE__ */ defineComponen
|
|
|
174
174
|
}
|
|
175
175
|
},
|
|
176
176
|
emits: ["close", "createNewContactPerson"],
|
|
177
|
-
setup(
|
|
178
|
-
let P =
|
|
179
|
-
async function B(
|
|
177
|
+
setup(i, { emit: N }) {
|
|
178
|
+
let P = i, F = N, I = useI18n(), L = useApiErrorToast(), R = useIndividualLinkContactPersonMutation(), z = useContactPersonCreateMutation();
|
|
179
|
+
async function B(i) {
|
|
180
180
|
try {
|
|
181
|
-
let
|
|
182
|
-
email:
|
|
183
|
-
firstName:
|
|
184
|
-
lastName:
|
|
185
|
-
mobilePhone:
|
|
186
|
-
phone:
|
|
181
|
+
let N = await z.execute({ body: {
|
|
182
|
+
email: i.email,
|
|
183
|
+
firstName: i.firstName,
|
|
184
|
+
lastName: i.lastName,
|
|
185
|
+
mobilePhone: i.mobilePhone,
|
|
186
|
+
phone: i.phone
|
|
187
187
|
} });
|
|
188
188
|
P.isCreatingNewContactPerson || await R.execute({
|
|
189
189
|
body: {
|
|
190
|
-
contactPersonUuid:
|
|
190
|
+
contactPersonUuid: N,
|
|
191
191
|
contactInfo: {
|
|
192
|
-
email:
|
|
193
|
-
mobilePhone:
|
|
194
|
-
phone:
|
|
192
|
+
email: i.email,
|
|
193
|
+
mobilePhone: i.mobilePhone,
|
|
194
|
+
phone: i.phone
|
|
195
195
|
},
|
|
196
|
-
position:
|
|
196
|
+
position: i.position
|
|
197
197
|
},
|
|
198
198
|
params: { individualUuid: P.individualUuid }
|
|
199
|
-
}),
|
|
200
|
-
label: `${
|
|
201
|
-
value:
|
|
199
|
+
}), H({
|
|
200
|
+
label: `${i.firstName} ${i.lastName}`,
|
|
201
|
+
value: N
|
|
202
202
|
});
|
|
203
|
-
} catch (
|
|
204
|
-
L.show(
|
|
203
|
+
} catch (i) {
|
|
204
|
+
L.show(i);
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
async function
|
|
208
|
-
if (
|
|
207
|
+
async function V(i, N, F) {
|
|
208
|
+
if (i !== null) try {
|
|
209
209
|
await R.execute({
|
|
210
210
|
body: {
|
|
211
|
-
contactPersonUuid:
|
|
212
|
-
contactInfo:
|
|
213
|
-
position:
|
|
211
|
+
contactPersonUuid: i,
|
|
212
|
+
contactInfo: N,
|
|
213
|
+
position: F
|
|
214
214
|
},
|
|
215
215
|
params: { individualUuid: P.individualUuid }
|
|
216
|
-
}),
|
|
217
|
-
} catch (
|
|
218
|
-
L.show(
|
|
216
|
+
}), H();
|
|
217
|
+
} catch (i) {
|
|
218
|
+
L.show(i);
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
if (
|
|
221
|
+
function H(i) {
|
|
222
|
+
if (i === void 0) {
|
|
223
223
|
F("close");
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
F("createNewContactPerson",
|
|
226
|
+
F("createNewContactPerson", i), F("close");
|
|
227
227
|
}
|
|
228
|
-
return (
|
|
228
|
+
return (i, N) => (openBlock(), createBlock(AppDialog_default, {
|
|
229
229
|
title: unref(I).t("wise_crm.info_dialog.contact_person_create.title"),
|
|
230
230
|
description: unref(I).t("wise_crm.info_dialog.contact_person_create.description"),
|
|
231
|
-
onClose:
|
|
231
|
+
onClose: H
|
|
232
232
|
}, {
|
|
233
233
|
default: withCtx(() => [createVNode(ContactPersonCreateForm_default, {
|
|
234
234
|
"on-submit": B,
|
|
235
|
-
"on-link-contact-person":
|
|
235
|
+
"on-link-contact-person": V,
|
|
236
236
|
"is-creating-new-contact-person": P.isCreatingNewContactPerson,
|
|
237
|
-
onClose:
|
|
237
|
+
onClose: H
|
|
238
238
|
}, null, 8, ["is-creating-new-contact-person"])]),
|
|
239
239
|
_: 1
|
|
240
240
|
}, 8, ["title", "description"]));
|
|
@@ -242,23 +242,23 @@ var IndividualContactPersonCreateDialog_default = /* @__PURE__ */ defineComponen
|
|
|
242
242
|
});
|
|
243
243
|
function useIndividualContactPersonUpdateMutation() {
|
|
244
244
|
return ze({
|
|
245
|
-
queryFn: async ({ body:
|
|
245
|
+
queryFn: async ({ body: i, params: N }) => await IndividualService.updateContactPerson(N.individualUuid, N.contactPersonUuid, i),
|
|
246
246
|
queryKeysToInvalidate: {
|
|
247
|
-
contactPersonDetail: { contactPersonUuid: (
|
|
247
|
+
contactPersonDetail: { contactPersonUuid: (i) => i.contactPersonUuid },
|
|
248
248
|
individualIndex: {},
|
|
249
|
-
wiseCrmIndividualDetail: { individualUuid: (
|
|
249
|
+
wiseCrmIndividualDetail: { individualUuid: (i) => i.individualUuid }
|
|
250
250
|
}
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
|
-
function useIndividualContactPersonDetailQuery(
|
|
253
|
+
function useIndividualContactPersonDetailQuery(i, N) {
|
|
254
254
|
return He({
|
|
255
|
-
isEnabled: computed(() =>
|
|
255
|
+
isEnabled: computed(() => i.value !== null && N.value !== null),
|
|
256
256
|
queryFn: () => {
|
|
257
|
-
if (
|
|
258
|
-
if (
|
|
259
|
-
return IndividualService.getContactPerson(
|
|
257
|
+
if (i.value === null) throw Error("Individual UUID is null");
|
|
258
|
+
if (N.value === null) throw Error("Contact Person UUID is null");
|
|
259
|
+
return IndividualService.getContactPerson(i.value, N.value);
|
|
260
260
|
},
|
|
261
|
-
queryKey: { contactPersonDetail: { contactPersonUuid:
|
|
261
|
+
queryKey: { contactPersonDetail: { contactPersonUuid: N } }
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
264
|
var IndividualContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
|
|
@@ -268,26 +268,26 @@ var IndividualContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent(
|
|
|
268
268
|
contactPerson: {},
|
|
269
269
|
onSubmit: { type: Function }
|
|
270
270
|
},
|
|
271
|
-
setup(
|
|
272
|
-
let
|
|
271
|
+
setup(i) {
|
|
272
|
+
let N = i, P = useI18n(), L = useForm({
|
|
273
273
|
initialState: {
|
|
274
|
-
email:
|
|
275
|
-
firstName:
|
|
276
|
-
lastName:
|
|
277
|
-
mobilePhone:
|
|
278
|
-
phone:
|
|
279
|
-
position:
|
|
274
|
+
email: N.contactPerson.email,
|
|
275
|
+
firstName: N.contactPerson.firstName,
|
|
276
|
+
lastName: N.contactPerson.lastName,
|
|
277
|
+
mobilePhone: N.contactPerson.mobilePhone,
|
|
278
|
+
phone: N.contactPerson.phone,
|
|
279
|
+
position: N.contactPerson.position
|
|
280
280
|
},
|
|
281
281
|
schema: contactPersonUpdateFormSchema,
|
|
282
|
-
onSubmit: async (
|
|
283
|
-
await
|
|
282
|
+
onSubmit: async (i) => {
|
|
283
|
+
await N.onSubmit(i);
|
|
284
284
|
}
|
|
285
285
|
});
|
|
286
|
-
return (
|
|
286
|
+
return (i, N) => (openBlock(), createBlock(ContactPersonCreateNewForm_default, { form: unref(L) }, {
|
|
287
287
|
actions: withCtx(() => [createVNode(AppSidebarFormFooter_default, null, {
|
|
288
288
|
default: withCtx(() => [createVNode(AppSidebarFormSubmitButton_default, {
|
|
289
|
-
"is-loading": unref(
|
|
290
|
-
label: unref(
|
|
289
|
+
"is-loading": unref(L).isSubmitting.value,
|
|
290
|
+
label: unref(P).t("wise_crm.shared.save_changes")
|
|
291
291
|
}, null, 8, ["is-loading", "label"])]),
|
|
292
292
|
_: 1
|
|
293
293
|
})]),
|
|
@@ -301,25 +301,25 @@ var IndividualContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent(
|
|
|
301
301
|
individualUuid: {}
|
|
302
302
|
},
|
|
303
303
|
emits: ["close"],
|
|
304
|
-
setup(
|
|
305
|
-
let P =
|
|
306
|
-
async function B(
|
|
304
|
+
setup(i, { emit: N }) {
|
|
305
|
+
let P = i, F = N, I = useI18n(), L = useApiErrorToast(), R = useIndividualContactPersonDetailQuery(computed(() => P.individualUuid), computed(() => P.contactPersonUuid)), z = useIndividualContactPersonUpdateMutation();
|
|
306
|
+
async function B(i) {
|
|
307
307
|
try {
|
|
308
308
|
await z.execute({
|
|
309
|
-
body:
|
|
309
|
+
body: i,
|
|
310
310
|
params: {
|
|
311
311
|
contactPersonUuid: P.contactPersonUuid,
|
|
312
312
|
individualUuid: P.individualUuid
|
|
313
313
|
}
|
|
314
314
|
}), F("close");
|
|
315
|
-
} catch (
|
|
316
|
-
L.show(
|
|
315
|
+
} catch (i) {
|
|
316
|
+
L.show(i);
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
function V() {
|
|
320
320
|
F("close");
|
|
321
321
|
}
|
|
322
|
-
return (
|
|
322
|
+
return (i, N) => (openBlock(), createBlock(AppDialog_default, {
|
|
323
323
|
title: unref(I).t("wise_crm.info_dialog.contact_person_update.title"),
|
|
324
324
|
description: unref(I).t("wise_crm.info_dialog.contact_person_create.description"),
|
|
325
325
|
onClose: V
|
|
@@ -337,19 +337,19 @@ var IndividualContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent(
|
|
|
337
337
|
}), _hoisted_1 = { class: "gap-sm flex" }, _hoisted_2 = { class: "font-regular flex flex-col items-start" }, _hoisted_3 = { class: "font-semibold" }, _hoisted_4 = { class: "font-regular text-brand-500 text-xs" }, IndividualDetailSidebarOverviewContent_default = /* @__PURE__ */ defineComponent({
|
|
338
338
|
__name: "IndividualDetailSidebarOverviewContent",
|
|
339
339
|
props: { individual: {} },
|
|
340
|
-
setup(
|
|
341
|
-
let N =
|
|
340
|
+
setup(i) {
|
|
341
|
+
let N = i, P = useI18n(), F = useApiErrorToast(), I = useCrm(), L = useDialog(IndividualContactPersonCreateDialog_default), R = useDialog(IndividualContactPersonUpdateDialog_default), H = useDialog(AppConfirmDialog_default), U = useIndividualSetPrimaryContactPersonMutation(), K = useIndividualUnlinkContactPersonMutation(), q = computed(() => N.individual.contactPersons.length > 0), J = computed(() => N.individual.billingInformationDetail !== null), Y = computed(() => I.getEntityConfig(EntityType.BUSINESS)?.name.toLowerCase() ?? "");
|
|
342
342
|
function X() {
|
|
343
|
-
|
|
343
|
+
L.open({ individualUuid: N.individual.uuid });
|
|
344
344
|
}
|
|
345
|
-
function Z(
|
|
346
|
-
|
|
347
|
-
contactPersonUuid:
|
|
345
|
+
function Z(i) {
|
|
346
|
+
R.open({
|
|
347
|
+
contactPersonUuid: i,
|
|
348
348
|
individualUuid: N.individual.uuid
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
|
-
function Q(
|
|
352
|
-
|
|
351
|
+
function Q(i) {
|
|
352
|
+
H.open({
|
|
353
353
|
title: P.t("wise_crm.info_dialog.sidebar.overview.delete_contact_person_title"),
|
|
354
354
|
isDestructive: !0,
|
|
355
355
|
isLoading: K.isLoading.value,
|
|
@@ -358,24 +358,24 @@ var IndividualContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent(
|
|
|
358
358
|
onConfirm: async () => {
|
|
359
359
|
try {
|
|
360
360
|
await K.execute({
|
|
361
|
-
body: { contactPersonUuid:
|
|
361
|
+
body: { contactPersonUuid: i },
|
|
362
362
|
params: { individualUuid: N.individual.uuid }
|
|
363
363
|
});
|
|
364
|
-
} catch (
|
|
365
|
-
F.show(
|
|
364
|
+
} catch (i) {
|
|
365
|
+
F.show(i);
|
|
366
366
|
} finally {
|
|
367
|
-
|
|
367
|
+
H.close();
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
});
|
|
371
371
|
}
|
|
372
|
-
function $(
|
|
373
|
-
|
|
374
|
-
contactPersonUuid:
|
|
372
|
+
function $(i) {
|
|
373
|
+
U.execute({ params: {
|
|
374
|
+
contactPersonUuid: i,
|
|
375
375
|
individualUuid: N.individual.uuid
|
|
376
376
|
} });
|
|
377
377
|
}
|
|
378
|
-
return (
|
|
378
|
+
return (F, I) => (openBlock(), createBlock(CrmDetailAccordionRoot_default, { "default-values": [
|
|
379
379
|
"customer",
|
|
380
380
|
"invoice",
|
|
381
381
|
"contact-persons",
|
|
@@ -387,7 +387,7 @@ var IndividualContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent(
|
|
|
387
387
|
value: "customer",
|
|
388
388
|
icon: "infoCircle"
|
|
389
389
|
}, {
|
|
390
|
-
default: withCtx(() => [createVNode(CrmDetailSidebarAccordionCustomerInfo_default, { individual:
|
|
390
|
+
default: withCtx(() => [createVNode(CrmDetailSidebarAccordionCustomerInfo_default, { individual: i.individual }, null, 8, ["individual"])]),
|
|
391
391
|
_: 1
|
|
392
392
|
}, 8, ["label"]),
|
|
393
393
|
createVNode(CrmDetailSidebarAccordionItem_default, {
|
|
@@ -417,15 +417,15 @@ var IndividualContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent(
|
|
|
417
417
|
icon: "plus",
|
|
418
418
|
onClick: X
|
|
419
419
|
}, null, 8, ["label"]))]),
|
|
420
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(N.individual.contactPersons, (
|
|
421
|
-
key:
|
|
422
|
-
"layout-id":
|
|
420
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(N.individual.contactPersons, (i) => (openBlock(), createBlock(unref(Motion), {
|
|
421
|
+
key: i.uuid,
|
|
422
|
+
"layout-id": i.uuid
|
|
423
423
|
}, {
|
|
424
424
|
default: withCtx(() => [createVNode(CrmDetailSidebarAccordionContactPersonInfo_default, {
|
|
425
|
-
"contact-person":
|
|
426
|
-
"on-toggle-is-primary": () => $(
|
|
427
|
-
onUpdate: (
|
|
428
|
-
onDelete: (
|
|
425
|
+
"contact-person": i,
|
|
426
|
+
"on-toggle-is-primary": () => $(i.uuid),
|
|
427
|
+
onUpdate: (N) => Z(i.uuid),
|
|
428
|
+
onDelete: (N) => Q(i.uuid)
|
|
429
429
|
}, null, 8, [
|
|
430
430
|
"contact-person",
|
|
431
431
|
"on-toggle-is-primary",
|
|
@@ -452,28 +452,28 @@ var IndividualContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent(
|
|
|
452
452
|
value: "linked-businesses",
|
|
453
453
|
icon: "building"
|
|
454
454
|
}, {
|
|
455
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(N.individual.linkedBusinesses, (
|
|
456
|
-
key:
|
|
455
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(N.individual.linkedBusinesses, (i) => (openBlock(), createBlock(CrmDetailSidebarCard_default, {
|
|
456
|
+
key: i.uuid,
|
|
457
457
|
class: "gap-lg flex flex-col"
|
|
458
458
|
}, {
|
|
459
459
|
default: withCtx(() => [
|
|
460
460
|
createElementVNode("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createVNode(unref(VcRouterLinkButton), {
|
|
461
461
|
to: {
|
|
462
462
|
name: "business-detail",
|
|
463
|
-
params: { businessUuid:
|
|
463
|
+
params: { businessUuid: i.uuid }
|
|
464
464
|
},
|
|
465
465
|
"class-config": { root: "p-0 bg-transparent! h-min hover:underline" },
|
|
466
466
|
variant: "tertiary"
|
|
467
467
|
}, {
|
|
468
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_3, toDisplayString(
|
|
468
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_3, toDisplayString(i.name), 1)]),
|
|
469
469
|
_: 2
|
|
470
|
-
}, 1032, ["to"]), createElementVNode("p", _hoisted_4, toDisplayString(
|
|
470
|
+
}, 1032, ["to"]), createElementVNode("p", _hoisted_4, toDisplayString(i.position), 1)])]),
|
|
471
471
|
createVNode(AppIconLabelPair_default, {
|
|
472
|
-
label:
|
|
472
|
+
label: i.email ?? "-",
|
|
473
473
|
icon: "mail"
|
|
474
474
|
}, null, 8, ["label"]),
|
|
475
475
|
createVNode(AppIconLabelPair_default, {
|
|
476
|
-
label:
|
|
476
|
+
label: i.mobilePhone ?? i.phone ?? "-",
|
|
477
477
|
icon: "phone"
|
|
478
478
|
}, null, 8, ["label"])
|
|
479
479
|
]),
|
|
@@ -485,63 +485,63 @@ var IndividualContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent(
|
|
|
485
485
|
_: 1
|
|
486
486
|
}));
|
|
487
487
|
}
|
|
488
|
-
}), InfoTab = /* @__PURE__ */ function(
|
|
489
|
-
return
|
|
488
|
+
}), InfoTab = /* @__PURE__ */ function(i) {
|
|
489
|
+
return i.ACTIVITY = "activity", i.NOTES = "notes", i.OVERVIEW = "overview", i;
|
|
490
490
|
}(InfoTab || {}), IndividualDetailSidebar_default = /* @__PURE__ */ defineComponent({
|
|
491
491
|
__name: "IndividualDetailSidebar",
|
|
492
492
|
props: { individual: {} },
|
|
493
|
-
setup(
|
|
494
|
-
let
|
|
493
|
+
setup(i) {
|
|
494
|
+
let P = i, F = useI18n(), I = useToast(), L = useCrm(), R = useApiErrorToast(), B = useIndividualGrantMutation(), V = ref(InfoTab.OVERVIEW), H = computed(() => [
|
|
495
495
|
{
|
|
496
496
|
icon: "infoCircle",
|
|
497
|
-
label:
|
|
497
|
+
label: F.t("wise_crm.shared.overview"),
|
|
498
498
|
value: InfoTab.OVERVIEW
|
|
499
499
|
},
|
|
500
500
|
{
|
|
501
501
|
icon: "activity",
|
|
502
|
-
label:
|
|
502
|
+
label: F.t("wise_crm.shared.activity"),
|
|
503
503
|
value: InfoTab.ACTIVITY
|
|
504
504
|
},
|
|
505
505
|
{
|
|
506
506
|
icon: "book",
|
|
507
|
-
label:
|
|
507
|
+
label: F.t("wise_crm.shared.notes"),
|
|
508
508
|
value: InfoTab.NOTES
|
|
509
509
|
}
|
|
510
|
-
]),
|
|
510
|
+
]), U = computed(() => L.getEntityConfig(EntityType.INDIVIDUAL));
|
|
511
511
|
async function W() {
|
|
512
|
-
if (
|
|
513
|
-
await
|
|
512
|
+
if (P.individual.email !== null) try {
|
|
513
|
+
await B.execute({
|
|
514
514
|
body: {
|
|
515
|
-
email:
|
|
516
|
-
firstName:
|
|
517
|
-
lastName:
|
|
515
|
+
email: P.individual.email,
|
|
516
|
+
firstName: P.individual.firstName,
|
|
517
|
+
lastName: P.individual.lastName
|
|
518
518
|
},
|
|
519
|
-
params: { individualUuid:
|
|
520
|
-
}),
|
|
521
|
-
title:
|
|
522
|
-
description:
|
|
519
|
+
params: { individualUuid: P.individual.uuid }
|
|
520
|
+
}), I.success({
|
|
521
|
+
title: F.t("toast.success.general_title"),
|
|
522
|
+
description: F.t("wise_crm.info_dialog.sidebar.grant_customer_zone_access_success")
|
|
523
523
|
});
|
|
524
|
-
} catch (
|
|
525
|
-
R.show(
|
|
524
|
+
} catch (i) {
|
|
525
|
+
R.show(i);
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
return (
|
|
529
|
-
color: unref(
|
|
528
|
+
return (I, R) => (openBlock(), createBlock(AppColorProvider_default, {
|
|
529
|
+
color: unref(L).getEntityConfig(unref(EntityType).INDIVIDUAL)?.color ?? null,
|
|
530
530
|
class: "flex h-full flex-col"
|
|
531
531
|
}, {
|
|
532
532
|
default: withCtx(() => [createVNode(CrmDetailHeaderCard_default, {
|
|
533
533
|
"entity-type": unref(EntityType).INDIVIDUAL,
|
|
534
|
-
name: `${
|
|
535
|
-
address:
|
|
536
|
-
email:
|
|
537
|
-
"mobile-phone":
|
|
538
|
-
"entity-name":
|
|
539
|
-
phone:
|
|
534
|
+
name: `${P.individual.firstName} ${P.individual.lastName}`,
|
|
535
|
+
address: P.individual.address,
|
|
536
|
+
email: P.individual.email,
|
|
537
|
+
"mobile-phone": P.individual.mobilePhone,
|
|
538
|
+
"entity-name": U.value?.name ?? null,
|
|
539
|
+
phone: P.individual.phone
|
|
540
540
|
}, {
|
|
541
541
|
actions: withCtx(() => [createVNode(unref(VcIconButton), {
|
|
542
|
-
disabled:
|
|
543
|
-
"is-loading": unref(
|
|
544
|
-
label: unref(
|
|
542
|
+
disabled: P.individual.email === null || unref(B).isLoading.value,
|
|
543
|
+
"is-loading": unref(B).isLoading.value,
|
|
544
|
+
label: unref(F).t("wise_crm.info_dialog.sidebar.grant_customer_zone_access"),
|
|
545
545
|
"class-config": {
|
|
546
546
|
root: "bg-gray-50/50 dark:bg-brand-950 border-none shadow-none w-auto h-auto p-xs data-[loading=false]:not-disabled:hover:bg-gray-50/30 rounded-full size-8 duration-300",
|
|
547
547
|
icon: "text-brand-700 size-4 dark:text-brand-200"
|
|
@@ -565,19 +565,19 @@ var IndividualContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent(
|
|
|
565
565
|
"entity-name",
|
|
566
566
|
"phone"
|
|
567
567
|
]), createVNode(CrmDetailSidebarTabs_default, {
|
|
568
|
-
modelValue:
|
|
569
|
-
"onUpdate:modelValue":
|
|
570
|
-
tabs:
|
|
568
|
+
modelValue: V.value,
|
|
569
|
+
"onUpdate:modelValue": R[0] ||= (i) => V.value = i,
|
|
570
|
+
tabs: H.value
|
|
571
571
|
}, {
|
|
572
|
-
default: withCtx(() => [
|
|
572
|
+
default: withCtx(() => [V.value === InfoTab.OVERVIEW ? (openBlock(), createBlock(IndividualDetailSidebarOverviewContent_default, {
|
|
573
573
|
key: 0,
|
|
574
|
-
individual:
|
|
575
|
-
}, null, 8, ["individual"])) :
|
|
574
|
+
individual: i.individual
|
|
575
|
+
}, null, 8, ["individual"])) : V.value === InfoTab.ACTIVITY ? (openBlock(), createBlock(IndividualDetailSidebarActivityContent_default, {
|
|
576
576
|
key: 1,
|
|
577
|
-
individual:
|
|
578
|
-
}, null, 8, ["individual"])) : createCommentVNode("", !0),
|
|
577
|
+
individual: i.individual
|
|
578
|
+
}, null, 8, ["individual"])) : createCommentVNode("", !0), V.value === InfoTab.NOTES ? (openBlock(), createBlock(IndividualDetailSidebarNotesContent_default, {
|
|
579
579
|
key: 2,
|
|
580
|
-
individual:
|
|
580
|
+
individual: P.individual
|
|
581
581
|
}, null, 8, ["individual"])) : createCommentVNode("", !0)]),
|
|
582
582
|
_: 1
|
|
583
583
|
}, 8, ["modelValue", "tabs"])]),
|
|
@@ -587,19 +587,19 @@ var IndividualContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent(
|
|
|
587
587
|
}), IndividualDetailSidebarProvider_default = /* @__PURE__ */ defineComponent({
|
|
588
588
|
__name: "IndividualDetailSidebarProvider",
|
|
589
589
|
props: { individualUuid: {} },
|
|
590
|
-
setup(
|
|
591
|
-
let
|
|
592
|
-
return (
|
|
593
|
-
default: withCtx(() => [unref(
|
|
590
|
+
setup(i) {
|
|
591
|
+
let N = i, P = useI18n(), F = useIndividualDetailQuery(computed(() => N.individualUuid)), I = computed(() => F.data.value ?? null);
|
|
592
|
+
return (i, N) => (openBlock(), createBlock(CrmDetailContainer_default, null, {
|
|
593
|
+
default: withCtx(() => [unref(F).isError.value ? (openBlock(), createBlock(Error_default, {
|
|
594
594
|
key: 0,
|
|
595
|
-
message: unref(
|
|
596
|
-
title: unref(
|
|
597
|
-
}, null, 8, ["message", "title"])) : unref(
|
|
595
|
+
message: unref(P).t("error.business_details.description"),
|
|
596
|
+
title: unref(P).t("error.business_details.title")
|
|
597
|
+
}, null, 8, ["message", "title"])) : unref(F).isLoading.value ? (openBlock(), createBlock(AppSkeletonLoader_default, {
|
|
598
598
|
key: 1,
|
|
599
599
|
class: "h-full"
|
|
600
|
-
})) :
|
|
600
|
+
})) : I.value ? (openBlock(), createBlock(IndividualDetailSidebar_default, {
|
|
601
601
|
key: 2,
|
|
602
|
-
individual:
|
|
602
|
+
individual: I.value
|
|
603
603
|
}, null, 8, ["individual"])) : createCommentVNode("", !0)]),
|
|
604
604
|
_: 1
|
|
605
605
|
}));
|