@snabcentr/common-lib 4.3.0-dev → 4.5.0-dev
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/manifest.json +1 -1
- package/dist/sc-common-lib.js +606 -500
- package/dist/sc-common-lib.js.map +1 -1
- package/dist/sc-common-lib.umd.cjs +1 -1
- package/dist/sc-common-lib.umd.cjs.map +1 -1
- package/dist/src/admins/classes/admin-full-info.d.ts +18 -0
- package/dist/src/admins/classes/admin-full-info.d.ts.map +1 -0
- package/dist/src/admins/classes/admin-short-info.d.ts +18 -0
- package/dist/src/admins/classes/admin-short-info.d.ts.map +1 -0
- package/dist/src/admins/classes/admins-list-filters.d.ts +38 -0
- package/dist/src/admins/classes/admins-list-filters.d.ts.map +1 -0
- package/dist/src/admins/classes/index.d.ts +4 -0
- package/dist/src/admins/classes/index.d.ts.map +1 -0
- package/dist/src/admins/index.d.ts +4 -0
- package/dist/src/admins/index.d.ts.map +1 -0
- package/dist/src/admins/interfaces/i-admin-full-info.d.ts +11 -0
- package/dist/src/admins/interfaces/i-admin-full-info.d.ts.map +1 -0
- package/dist/src/admins/interfaces/i-admin-short-info.d.ts +11 -0
- package/dist/src/admins/interfaces/i-admin-short-info.d.ts.map +1 -0
- package/dist/src/admins/interfaces/i-admins-list-filters.d.ts +27 -0
- package/dist/src/admins/interfaces/i-admins-list-filters.d.ts.map +1 -0
- package/dist/src/admins/interfaces/index.d.ts +4 -0
- package/dist/src/admins/interfaces/index.d.ts.map +1 -0
- package/dist/src/admins/providers/admin-provider.d.ts +69 -0
- package/dist/src/admins/providers/admin-provider.d.ts.map +1 -0
- package/dist/src/admins/providers/index.d.ts +2 -0
- package/dist/src/admins/providers/index.d.ts.map +1 -0
- package/dist/src/external-seo/classes/external-seo-full-info.d.ts +18 -0
- package/dist/src/external-seo/classes/external-seo-full-info.d.ts.map +1 -0
- package/dist/src/external-seo/classes/external-seo-list-filters.d.ts +34 -0
- package/dist/src/external-seo/classes/external-seo-list-filters.d.ts.map +1 -0
- package/dist/src/external-seo/classes/index.d.ts +3 -0
- package/dist/src/external-seo/classes/index.d.ts.map +1 -0
- package/dist/src/external-seo/index.d.ts +4 -0
- package/dist/src/external-seo/index.d.ts.map +1 -0
- package/dist/src/external-seo/interfaces/i-external-seo-full-info.d.ts +11 -0
- package/dist/src/external-seo/interfaces/i-external-seo-full-info.d.ts.map +1 -0
- package/dist/src/external-seo/interfaces/i-external-seo-list-filters.d.ts +23 -0
- package/dist/src/external-seo/interfaces/i-external-seo-list-filters.d.ts.map +1 -0
- package/dist/src/external-seo/interfaces/index.d.ts +3 -0
- package/dist/src/external-seo/interfaces/index.d.ts.map +1 -0
- package/dist/src/external-seo/providers/external-seo-provider.d.ts +68 -0
- package/dist/src/external-seo/providers/external-seo-provider.d.ts.map +1 -0
- package/dist/src/external-seo/providers/index.d.ts +2 -0
- package/dist/src/external-seo/providers/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/managers/interfaces/index.d.ts +0 -1
- package/dist/src/managers/interfaces/index.d.ts.map +1 -1
- package/dist/src/managers/providers/manager-provider.d.ts +4 -4
- package/dist/src/managers/providers/manager-provider.d.ts.map +1 -1
- package/dist/src/operators/interfaces/index.d.ts +0 -1
- package/dist/src/operators/interfaces/index.d.ts.map +1 -1
- package/dist/src/operators/providers/operator-provider.d.ts +4 -4
- package/dist/src/operators/providers/operator-provider.d.ts.map +1 -1
- package/dist/src/user/interfaces/i-user-save-data.d.ts +18 -0
- package/dist/src/user/interfaces/i-user-save-data.d.ts.map +1 -0
- package/dist/src/user/interfaces/index.d.ts +1 -0
- package/dist/src/user/interfaces/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/src/managers/interfaces/i-manager-save-data.d.ts +0 -18
- package/dist/src/managers/interfaces/i-manager-save-data.d.ts.map +0 -1
- package/dist/src/operators/interfaces/i-operator-save-data.d.ts +0 -18
- package/dist/src/operators/interfaces/i-operator-save-data.d.ts.map +0 -1
package/dist/sc-common-lib.js
CHANGED
|
@@ -1,41 +1,106 @@
|
|
|
1
|
-
import { BasePaginationProvider as e, ChannelPrimaryInterest as t, CityWithRegionAndCountry as n, ContactLinks as r, Country as i, CuratedDirection as a, Currency as o, DateHelper as s, DeliveryType as c, FieldValidationResultData as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { BasePaginationProvider as e, ChannelPrimaryInterest as t, CityWithRegionAndCountry as n, ContactLinks as r, Country as i, CuratedDirection as a, Currency as o, DateHelper as s, DeliveryType as c, FieldValidationResultData as ee, FilterGroup as te, FilterOpEnum as ne, GeoCoordinates as re, HttpRequester as l, Identity as u, Manager as d, ManagerCommon as ie, ManagerDataProvider as ae, NamedIdentity as f, Operator as oe, Opf as se, OpfEnum as p, OrderStatus as ce, PartnerGroup as m, PaymentType as le, PriceCoefficient as ue, PropertyType as de, Reference as fe, Region as pe, ResourceType as me, SalesDirection as h, Shop as he, SourcePrimaryInterest as ge, TypedInstanceFactory as g, UpdatableNamedIdentity as _e, User as ve, UserCommonInfo as ye, UserRegionShortInfo as be, Warehouse as xe, useBaseConfigStore as _ } from "@snabcentr/common-core";
|
|
2
|
+
import { cloneDeep as Se, endsWith as Ce, forEach as we, includes as Te, isArray as Ee, isDate as De, isEmpty as Oe, isFunction as ke, isNil as v, isObject as Ae, isString as y, isUndefined as je, map as b, merge as Me, omitBy as Ne, round as Pe, some as Fe, startsWith as Ie, toUpper as Le } from "lodash-es";
|
|
3
|
+
import { addBusinessDays as Re, addDays as x, addMonths as S, addQuarters as ze, addWeeks as Be, addYears as Ve, differenceInCalendarDays as He, differenceInCalendarMonths as Ue, endOfDay as C, endOfMonth as w, endOfQuarter as We, endOfToday as Ge, endOfTomorrow as Ke, endOfWeek as qe, endOfYear as Je, endOfYesterday as Ye, format as T, getDate as Xe, getDaysInMonth as Ze, parseISO as E, setDate as Qe, startOfDay as D, startOfMonth as O, startOfQuarter as $e, startOfToday as et, startOfTomorrow as tt, startOfWeek as k, startOfYear as A, startOfYesterday as nt, subDays as rt, subMonths as it, subQuarters as at, subWeeks as ot, subYears as st } from "date-fns";
|
|
4
4
|
export * from "@snabcentr/common-core";
|
|
5
|
-
//#region src/
|
|
6
|
-
var
|
|
5
|
+
//#region src/admins/classes/admin-short-info.ts
|
|
6
|
+
var ct = class extends ve {
|
|
7
|
+
isSuperadmin;
|
|
8
|
+
constructor(e) {
|
|
9
|
+
super(e), this.isSuperadmin = e?.isSuperadmin ?? !1;
|
|
10
|
+
}
|
|
11
|
+
}, lt = class extends ct {
|
|
12
|
+
showAllCosts;
|
|
13
|
+
constructor(e) {
|
|
14
|
+
super(e), this.showAllCosts = e?.showAllCosts;
|
|
15
|
+
}
|
|
16
|
+
}, j = class {
|
|
17
|
+
asClearRaw() {
|
|
18
|
+
let e = {};
|
|
19
|
+
return Object.keys(this).forEach((t) => {
|
|
20
|
+
let n = this[t];
|
|
21
|
+
v(n) || y(n) && n.trim().length === 0 || ke(n.isNewRec) && n.isNewRec() || (e[t] = n);
|
|
22
|
+
}), e;
|
|
23
|
+
}
|
|
24
|
+
}, ut = class extends j {
|
|
25
|
+
name;
|
|
26
|
+
phone;
|
|
27
|
+
email;
|
|
28
|
+
isActive;
|
|
29
|
+
isSuperadmin;
|
|
30
|
+
constructor(e) {
|
|
31
|
+
super(), this.name = e?.name, this.phone = e?.phone, this.email = e?.email, this.isActive = e?.isActive, this.isSuperadmin = e?.isSuperadmin;
|
|
32
|
+
}
|
|
33
|
+
resetFilterValue(e) {
|
|
34
|
+
switch (e) {
|
|
35
|
+
case "name":
|
|
36
|
+
case "phone":
|
|
37
|
+
case "email":
|
|
38
|
+
case "isActive":
|
|
39
|
+
case "isSuperadmin": this[e] = void 0;
|
|
40
|
+
}
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
}, dt = class t extends e {
|
|
44
|
+
static transformAdminDataToRequest(e) {
|
|
45
|
+
return {
|
|
46
|
+
name: e.name,
|
|
47
|
+
phone: e.phone,
|
|
48
|
+
email: e.email,
|
|
49
|
+
password: e.password,
|
|
50
|
+
isActive: e.isActive,
|
|
51
|
+
isSuperadmin: e.isSuperadmin,
|
|
52
|
+
pricingRoleId: e.pricingRole?.id,
|
|
53
|
+
showAllCosts: e.showAllCosts ?? !1
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
getAdminsList(e, t, n, r) {
|
|
57
|
+
return this.getTypedPaginated(ct, "/internal/admins", e, t, n, {}, void 0, r);
|
|
58
|
+
}
|
|
59
|
+
getAdmin(e, t = !1) {
|
|
60
|
+
return this.get(`/internal/admins/${e}`, {}, (e) => new lt(e.data), t);
|
|
61
|
+
}
|
|
62
|
+
createAdmin(e, n = {}) {
|
|
63
|
+
return this.post("/internal/admins", t.transformAdminDataToRequest(e), (e) => new lt(e.data), n);
|
|
64
|
+
}
|
|
65
|
+
updateAdmin(e, n = {}) {
|
|
66
|
+
return this.patch(`/internal/admins/${e.id}`, t.transformAdminDataToRequest(e), (e) => new lt(e.data), n);
|
|
67
|
+
}
|
|
68
|
+
deleteAdmin(e) {
|
|
69
|
+
return this.delete(`/internal/admins/${e}`);
|
|
70
|
+
}
|
|
71
|
+
}, ft = /* @__PURE__ */ function(e) {
|
|
7
72
|
return e.Image = "image", e.Video = "video", e;
|
|
8
|
-
}({}),
|
|
73
|
+
}({}), pt = class extends u {
|
|
9
74
|
mediaType;
|
|
10
75
|
isCover;
|
|
11
76
|
isUnused;
|
|
12
77
|
url;
|
|
13
78
|
urlWebp;
|
|
14
79
|
constructor(e) {
|
|
15
|
-
super(e, ""), this.mediaType = e?.mediaType ??
|
|
80
|
+
super(e, ""), this.mediaType = e?.mediaType ?? ft.Image, this.isCover = e?.isCover ?? !1, this.isUnused = e?.isUnused ?? !1, this.url = e?.url ?? "", this.urlWebp = e?.urlWebp;
|
|
16
81
|
}
|
|
17
82
|
isImage() {
|
|
18
|
-
return this.mediaType ===
|
|
83
|
+
return this.mediaType === ft.Image;
|
|
19
84
|
}
|
|
20
85
|
isVideo() {
|
|
21
|
-
return this.mediaType ===
|
|
86
|
+
return this.mediaType === ft.Video;
|
|
22
87
|
}
|
|
23
|
-
},
|
|
88
|
+
}, mt = /* @__PURE__ */ function(e) {
|
|
24
89
|
return e.Draft = "draft", e.Published = "published", e.Scheduled = "scheduled", e;
|
|
25
|
-
}({}), M = class extends
|
|
90
|
+
}({}), M = class extends u {
|
|
26
91
|
createdAt;
|
|
27
92
|
constructor(e, t) {
|
|
28
93
|
super(e, t), this.createdAt = s.parse(e?.createdAt) ?? /* @__PURE__ */ new Date();
|
|
29
94
|
}
|
|
30
|
-
},
|
|
95
|
+
}, ht = class e extends M {
|
|
31
96
|
static resolvePublicationStatus(e) {
|
|
32
|
-
return
|
|
97
|
+
return v(e) ? mt.Draft : e.getTime() > Date.now() ? mt.Scheduled : mt.Published;
|
|
33
98
|
}
|
|
34
99
|
static getSlugError(e) {
|
|
35
|
-
return e ? /[^a-z0-9-]/.test(e) ? "Допустимы только строчные латинские буквы, цифры и дефис: пример «kak-vybrat-podokonnik»." :
|
|
100
|
+
return e ? /[^a-z0-9-]/.test(e) ? "Допустимы только строчные латинские буквы, цифры и дефис: пример «kak-vybrat-podokonnik»." : Ie(e, "-") || Ce(e, "-") ? "Обозначение не может начинаться или заканчиваться дефисом." : Te(e, "--") ? "Дефисы не могут идти подряд: разделяйте слова одним дефисом." : "" : "";
|
|
36
101
|
}
|
|
37
102
|
static parseDate(e) {
|
|
38
|
-
return
|
|
103
|
+
return v(e) ? null : y(e) ? E(e) : e;
|
|
39
104
|
}
|
|
40
105
|
slug;
|
|
41
106
|
title;
|
|
@@ -46,11 +111,11 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
46
111
|
getPublicationStatus() {
|
|
47
112
|
return e.resolvePublicationStatus(this.publishedAt);
|
|
48
113
|
}
|
|
49
|
-
},
|
|
114
|
+
}, gt = class extends ht {
|
|
50
115
|
content;
|
|
51
116
|
media;
|
|
52
117
|
constructor(e) {
|
|
53
|
-
super(e), this.content = e?.content ?? "", this.media = (e?.media ?? []).map((e) => new
|
|
118
|
+
super(e), this.content = e?.content ?? "", this.media = (e?.media ?? []).map((e) => new pt(e));
|
|
54
119
|
}
|
|
55
120
|
toSaveData(e = !1) {
|
|
56
121
|
return {
|
|
@@ -67,20 +132,12 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
67
132
|
return this.media.filter((e) => e.isUnused);
|
|
68
133
|
}
|
|
69
134
|
}, N = class {
|
|
70
|
-
asClearRaw() {
|
|
71
|
-
let e = {};
|
|
72
|
-
return Object.keys(this).forEach((t) => {
|
|
73
|
-
let n = this[t];
|
|
74
|
-
k(n) || A(n) && n.trim().length === 0 || Qe(n.isNewRec) && n.isNewRec() || (e[t] = n);
|
|
75
|
-
}), e;
|
|
76
|
-
}
|
|
77
|
-
}, P = class {
|
|
78
135
|
from;
|
|
79
136
|
to;
|
|
80
137
|
constructor(e) {
|
|
81
|
-
this.from =
|
|
138
|
+
this.from = y(e?.from) ? E(e.from) : e?.from ?? null, this.to = y(e?.to) ? E(e.to) : e?.to ?? null;
|
|
82
139
|
}
|
|
83
|
-
},
|
|
140
|
+
}, _t = class extends j {
|
|
84
141
|
id;
|
|
85
142
|
title;
|
|
86
143
|
slug;
|
|
@@ -89,7 +146,7 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
89
146
|
publishedAt;
|
|
90
147
|
createdAt;
|
|
91
148
|
constructor(e) {
|
|
92
|
-
super(), this.id = e?.id, this.title = e?.title, this.slug = e?.slug, this.content = e?.content, this.publicationStatus = e?.publicationStatus, this.publishedAt = new
|
|
149
|
+
super(), this.id = e?.id, this.title = e?.title, this.slug = e?.slug, this.content = e?.content, this.publicationStatus = e?.publicationStatus, this.publishedAt = new N(e?.publishedAt), this.createdAt = new N(e?.createdAt);
|
|
93
150
|
}
|
|
94
151
|
resetFilterValue(e) {
|
|
95
152
|
switch (e) {
|
|
@@ -111,29 +168,29 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
111
168
|
let e = super.asClearRaw();
|
|
112
169
|
return !e?.publishedAt?.from && !e?.publishedAt?.to && delete e.publishedAt, !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, e;
|
|
113
170
|
}
|
|
114
|
-
},
|
|
171
|
+
}, vt = class t extends e {
|
|
115
172
|
static preparePostSaveData(e) {
|
|
116
173
|
let t = {};
|
|
117
|
-
if (
|
|
118
|
-
let n =
|
|
119
|
-
t.publishedAt =
|
|
174
|
+
if (je(e.title) || (t.title = e.title), je(e.slug) || (t.slug = e.slug), je(e.content) || (t.content = e.content), !je(e.publishedAt)) {
|
|
175
|
+
let n = _().config.dateFormats.api;
|
|
176
|
+
t.publishedAt = v(e.publishedAt) ? null : T(e.publishedAt, n);
|
|
120
177
|
}
|
|
121
178
|
return t;
|
|
122
179
|
}
|
|
123
180
|
getPostList(e, t, n) {
|
|
124
181
|
return this.getPaginated("/internal/blog", e, t, n, {}, (e) => ({
|
|
125
182
|
...e.data,
|
|
126
|
-
data: e.data.data.map((e) => new
|
|
183
|
+
data: e.data.data.map((e) => new ht(e))
|
|
127
184
|
}));
|
|
128
185
|
}
|
|
129
186
|
getPost(e) {
|
|
130
|
-
return this.get(`/internal/blog/${e}`, {}, (e) => new
|
|
187
|
+
return this.get(`/internal/blog/${e}`, {}, (e) => new gt(e.data));
|
|
131
188
|
}
|
|
132
189
|
createPost(e, n = {}) {
|
|
133
|
-
return this.post("/internal/blog", t.preparePostSaveData(e), (e) => new
|
|
190
|
+
return this.post("/internal/blog", t.preparePostSaveData(e), (e) => new gt(e.data), n);
|
|
134
191
|
}
|
|
135
192
|
updatePost(e, n, r = {}) {
|
|
136
|
-
return this.patch(`/internal/blog/${e}`, t.preparePostSaveData(n), (e) => new
|
|
193
|
+
return this.patch(`/internal/blog/${e}`, t.preparePostSaveData(n), (e) => new gt(e.data), r);
|
|
137
194
|
}
|
|
138
195
|
removePost(e) {
|
|
139
196
|
return this.delete(`/internal/blog/${e}`);
|
|
@@ -149,26 +206,26 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
149
206
|
onUploadProgress: (e) => {
|
|
150
207
|
r && r(e.total ? Math.round(e.loaded / e.total * 100) : 0);
|
|
151
208
|
}
|
|
152
|
-
}, (e) => new
|
|
209
|
+
}, (e) => new pt(e.data), i);
|
|
153
210
|
}
|
|
154
211
|
updateMedia(e, t, n, r = {}) {
|
|
155
|
-
return this.patch(`/internal/blog/${e}/media/${t}`, { isCover: n }, (e) => new
|
|
212
|
+
return this.patch(`/internal/blog/${e}/media/${t}`, { isCover: n }, (e) => new pt(e.data), r);
|
|
156
213
|
}
|
|
157
214
|
removeMedia(e, t) {
|
|
158
215
|
return this.delete(`/internal/blog/${e}/media/${t}`);
|
|
159
216
|
}
|
|
160
|
-
},
|
|
217
|
+
}, P = class extends _e {
|
|
161
218
|
deletedAt;
|
|
162
219
|
constructor(e) {
|
|
163
220
|
super(e), this.deletedAt = s.parse(e?.deletedAt);
|
|
164
221
|
}
|
|
165
|
-
}, F = class extends
|
|
222
|
+
}, F = class extends f {
|
|
166
223
|
type;
|
|
167
224
|
isActive;
|
|
168
225
|
constructor(e) {
|
|
169
226
|
super(e), this.type = e?.type, this.isActive = e?.isActive ?? !0;
|
|
170
227
|
}
|
|
171
|
-
},
|
|
228
|
+
}, yt = class extends P {
|
|
172
229
|
costCoefficient;
|
|
173
230
|
isLowPriceAllowed;
|
|
174
231
|
publishedAt;
|
|
@@ -178,28 +235,28 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
178
235
|
constructor(e) {
|
|
179
236
|
super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.isLowPriceAllowed = e?.isLowPriceAllowed ?? !1, this.publishedAt = s.parse(e?.publishedAt), this.description = e?.description ?? void 0, this.percent = e?.percent ?? 0, this.owner = new F(e?.owner);
|
|
180
237
|
}
|
|
181
|
-
}, I = class extends
|
|
238
|
+
}, I = class extends _e {
|
|
182
239
|
description;
|
|
183
240
|
owner;
|
|
184
241
|
constructor(e) {
|
|
185
242
|
super(e), this.description = e?.description ?? "", this.owner = e?.owner ? new F(e.owner) : void 0;
|
|
186
243
|
}
|
|
187
|
-
},
|
|
244
|
+
}, bt = class {
|
|
188
245
|
coefficient;
|
|
189
246
|
value;
|
|
190
247
|
cost;
|
|
191
248
|
percent;
|
|
192
249
|
readOnly;
|
|
193
250
|
constructor(e) {
|
|
194
|
-
this.coefficient = new
|
|
251
|
+
this.coefficient = new ue(e?.coefficient), this.value = e?.value ?? 0, this.cost = e?.cost ?? 0, this.percent = e?.percent ?? 0, this.readOnly = e?.readOnly ?? !0;
|
|
195
252
|
}
|
|
196
|
-
},
|
|
253
|
+
}, xt = class {
|
|
197
254
|
warehouse;
|
|
198
255
|
count;
|
|
199
256
|
constructor(e) {
|
|
200
|
-
this.warehouse = new
|
|
257
|
+
this.warehouse = new xe(e?.warehouse), this.count = e?.count ?? 0;
|
|
201
258
|
}
|
|
202
|
-
},
|
|
259
|
+
}, St = class extends f {
|
|
203
260
|
slug = "";
|
|
204
261
|
description;
|
|
205
262
|
isSquare = !1;
|
|
@@ -207,35 +264,35 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
207
264
|
constructor(e) {
|
|
208
265
|
super(e), e && (this.slug = e.slug ?? "", this.description = e.description, this.isSquare = e.isSquare ?? !1, this.isLinear = e.isLinear ?? !1);
|
|
209
266
|
}
|
|
210
|
-
}, L = class extends
|
|
267
|
+
}, L = class extends f {
|
|
211
268
|
code = "";
|
|
212
269
|
constructor(e) {
|
|
213
270
|
super(e), this.code = e?.code ?? "";
|
|
214
271
|
}
|
|
215
|
-
},
|
|
272
|
+
}, Ct = class extends L {
|
|
216
273
|
slug;
|
|
217
274
|
type;
|
|
218
275
|
constructor(e) {
|
|
219
276
|
super(e), this.slug = e?.slug ?? "";
|
|
220
277
|
}
|
|
221
|
-
},
|
|
278
|
+
}, wt = class extends Ct {
|
|
222
279
|
isHidden;
|
|
223
280
|
constructor(e) {
|
|
224
281
|
super(e), this.isHidden = e?.isHidden ?? !1;
|
|
225
282
|
}
|
|
226
|
-
},
|
|
283
|
+
}, Tt = class {
|
|
227
284
|
image;
|
|
228
285
|
preview;
|
|
229
286
|
isDefault;
|
|
230
287
|
constructor(e, t) {
|
|
231
288
|
this.image = `${t ?? ""}${e.image}`, this.preview = `${t ?? ""}${e.preview}`, this.isDefault = e.isDefault;
|
|
232
289
|
}
|
|
233
|
-
},
|
|
290
|
+
}, Et = class extends Ct {
|
|
234
291
|
isPrimary;
|
|
235
292
|
constructor(e) {
|
|
236
293
|
super(e), this.isPrimary = e?.isPrimary ?? !1;
|
|
237
294
|
}
|
|
238
|
-
}, R = class extends
|
|
295
|
+
}, R = class extends wt {
|
|
239
296
|
supplierSku;
|
|
240
297
|
unit;
|
|
241
298
|
pack;
|
|
@@ -254,12 +311,12 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
254
311
|
retailCostRub;
|
|
255
312
|
priceCoefficients;
|
|
256
313
|
constructor(e) {
|
|
257
|
-
super(e), this.supplierSku = e?.supplierSku, this.unit = e?.unit ? new
|
|
314
|
+
super(e), this.supplierSku = e?.supplierSku, this.unit = e?.unit ? new St(e.unit) : new St(), this.pack = e?.pack, this.minCount = e?.minCount, this.currency = e?.currency ? new o(e.currency) : new o(), this.cost = e?.cost ?? 0, this.costRub = e?.costRub ?? 0, this.costDate = y(e?.costDate) ? E(e.costDate) : e?.costDate, this.onOrder = e?.onOrder ?? !1, this.stockCount = e?.stockCount?.map((e) => new xt(e)) ?? [], this.type = "product";
|
|
258
315
|
let t = e?.category ?? e?.categories?.find((e) => e.isPrimary);
|
|
259
|
-
t && (this.category = new
|
|
316
|
+
t && (this.category = new Et({
|
|
260
317
|
...t,
|
|
261
318
|
isPrimary: !0
|
|
262
|
-
}), this.categories = [this.category]), e?.categories && (this.categories = e.categories.map((e) => new
|
|
319
|
+
}), this.categories = [this.category]), e?.categories && (this.categories = e.categories.map((e) => new Et(e))), this.images = e?.images?.map((e) => new Tt(e, _().config.http.mediaUrl)) ?? [], this.properties = e?.properties ?? {}, this.retailCost = e?.retailCost, this.retailCostRub = e?.retailCostRub, this.priceCoefficients = e?.priceCoefficients?.map((e) => new bt(e)) ?? [], e && "codeNumber" in e && !e.code && (this.code = e?.codeNumber);
|
|
263
320
|
}
|
|
264
321
|
getIsMeasurable() {
|
|
265
322
|
return this.unit.isLinear || this.unit.isSquare;
|
|
@@ -270,7 +327,7 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
270
327
|
getRetailCostRub() {
|
|
271
328
|
return this.retailCostRub ?? this.costRub;
|
|
272
329
|
}
|
|
273
|
-
},
|
|
330
|
+
}, Dt = /* @__PURE__ */ function(e) {
|
|
274
331
|
return e.Discount = "discount", e.PriceTemplate = "price_template", e.ClientPrice = "client_price", e.Product = "product", e;
|
|
275
332
|
}({}), z = class extends R {
|
|
276
333
|
costCoefficient;
|
|
@@ -283,17 +340,17 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
283
340
|
isRequired;
|
|
284
341
|
isFavorite;
|
|
285
342
|
constructor(e) {
|
|
286
|
-
super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.costSource = e?.costSource ??
|
|
343
|
+
super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.costSource = e?.costSource ?? Dt.Product, this.discount = e?.discount ? new yt(e.discount) : void 0, this.priceTemplate = e?.priceTemplate ? new I(e.priceTemplate) : void 0, this.priceCoefficient = e?.priceCoefficient ? new ue(e.priceCoefficient) : void 0, this.increasePercent = e?.increasePercent, this.isPreviouslyOrdered = e?.isPreviouslyOrdered, this.isRequired = e?.isRequired, this.isFavorite = e?.isFavorite;
|
|
287
344
|
}
|
|
288
|
-
}, B = class extends
|
|
345
|
+
}, B = class extends Et {
|
|
289
346
|
isHidden;
|
|
290
347
|
parentCategoryId;
|
|
291
348
|
properties;
|
|
292
349
|
currencyRates;
|
|
293
350
|
constructor(e) {
|
|
294
|
-
super(e), this.isHidden = e?.isHidden ?? !1, this.parentCategoryId = e?.parentCategoryId, this.properties = e?.properties, this.type = "category", this.currencyRates = e?.currencyRates ? Object.fromEntries(Object.entries(e.currencyRates).map(([e, t]) => [
|
|
351
|
+
super(e), this.isHidden = e?.isHidden ?? !1, this.parentCategoryId = e?.parentCategoryId, this.properties = e?.properties, this.type = "category", this.currencyRates = e?.currencyRates ? Object.fromEntries(Object.entries(e.currencyRates).map(([e, t]) => [Le(e), t])) : void 0;
|
|
295
352
|
}
|
|
296
|
-
},
|
|
353
|
+
}, Ot = class extends u {
|
|
297
354
|
category;
|
|
298
355
|
product;
|
|
299
356
|
quantity;
|
|
@@ -312,9 +369,9 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
312
369
|
originalId;
|
|
313
370
|
replacementId;
|
|
314
371
|
constructor(e) {
|
|
315
|
-
super(e), this.product = new z(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new B(), this.currency = e.currency ? new o(e.currency) : void 0, this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams &&
|
|
372
|
+
super(e), this.product = new z(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new B(), this.currency = e.currency ? new o(e.currency) : void 0, this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams && Se(e.configuratorParams), this.isAdditionalSale = e.isAdditionalSale, this.creator = e.creator && new F(e.creator), this.isRemoved = e.isRemoved, this.ord = e.ord, this.onOrder = e.onOrder, this.originalId = e.originalId, this.replacementId = e.replacementId;
|
|
316
373
|
}
|
|
317
|
-
},
|
|
374
|
+
}, kt = class extends Ot {
|
|
318
375
|
cost;
|
|
319
376
|
costOne;
|
|
320
377
|
costOneRub;
|
|
@@ -325,16 +382,16 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
325
382
|
sawing;
|
|
326
383
|
currency;
|
|
327
384
|
constructor(e) {
|
|
328
|
-
super(e), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing =
|
|
385
|
+
super(e), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing = Ee(e.sawing) ? e.sawing : e.sawing ? [e.sawing] : void 0, this.currency = new o(e.currency);
|
|
329
386
|
}
|
|
330
387
|
}, V = class {
|
|
331
388
|
items;
|
|
332
389
|
resultSum;
|
|
333
390
|
directionsSum;
|
|
334
391
|
constructor(e) {
|
|
335
|
-
this.items = e.items.map((e) => new
|
|
392
|
+
this.items = e.items.map((e) => new kt(e)), this.resultSum = e.resultSum, this.directionsSum = e.directionsSum;
|
|
336
393
|
}
|
|
337
|
-
},
|
|
394
|
+
}, At = class extends l {
|
|
338
395
|
getCart(e) {
|
|
339
396
|
return this.get(`internal/clients/${e.id}/cart`, {}, (e) => new V(e.data));
|
|
340
397
|
}
|
|
@@ -378,9 +435,9 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
378
435
|
getCartItemFromCSVExample(e) {
|
|
379
436
|
return this.get(`internal/clients/${e.id}/cart/add-products-from-csv/example`, {}, (e) => new Blob([e.data], { type: "text/csv" }));
|
|
380
437
|
}
|
|
381
|
-
},
|
|
438
|
+
}, jt = /* @__PURE__ */ function(e) {
|
|
382
439
|
return e.m2Cost = "m2Cost", e.percent = "percent", e.value = "value", e;
|
|
383
|
-
}({}),
|
|
440
|
+
}({}), Mt = /* @__PURE__ */ function(e) {
|
|
384
441
|
return e.Checkbox = "checkbox", e.Range = "range", e.Toggle = "toggle", e;
|
|
385
442
|
}({}), H = class e extends B {
|
|
386
443
|
categories;
|
|
@@ -388,44 +445,44 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
388
445
|
constructor(t) {
|
|
389
446
|
super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new R(e));
|
|
390
447
|
}
|
|
391
|
-
},
|
|
448
|
+
}, Nt = class extends B {
|
|
392
449
|
isDisabled;
|
|
393
450
|
isRequired;
|
|
394
451
|
isFavorite;
|
|
395
452
|
hidingComment;
|
|
396
453
|
manager;
|
|
397
454
|
constructor(e) {
|
|
398
|
-
super(e), this.isDisabled = e?.isDisabled ?? !1, this.isRequired = e?.isRequired ?? !1, this.isFavorite = e?.isFavorite ?? !1, this.hidingComment = e?.hidingComment, this.manager = e?.manager ? new
|
|
455
|
+
super(e), this.isDisabled = e?.isDisabled ?? !1, this.isRequired = e?.isRequired ?? !1, this.isFavorite = e?.isFavorite ?? !1, this.hidingComment = e?.hidingComment, this.manager = e?.manager ? new d(e.manager) : void 0;
|
|
399
456
|
}
|
|
400
|
-
},
|
|
457
|
+
}, Pt = class e extends Nt {
|
|
401
458
|
categories;
|
|
402
459
|
products;
|
|
403
460
|
constructor(t) {
|
|
404
461
|
super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new z(e));
|
|
405
462
|
}
|
|
406
|
-
},
|
|
463
|
+
}, Ft = class {
|
|
407
464
|
priceCoefficient;
|
|
408
465
|
increasePercent;
|
|
409
466
|
constructor(e) {
|
|
410
|
-
this.priceCoefficient = e?.priceCoefficient && new
|
|
467
|
+
this.priceCoefficient = e?.priceCoefficient && new ue(e.priceCoefficient), this.increasePercent = e?.increasePercent;
|
|
411
468
|
}
|
|
412
|
-
},
|
|
469
|
+
}, It = class extends Ft {
|
|
413
470
|
constructor(e) {
|
|
414
471
|
super(e);
|
|
415
472
|
}
|
|
416
|
-
},
|
|
473
|
+
}, Lt = class extends It {
|
|
417
474
|
productCategory;
|
|
418
475
|
constructor(e) {
|
|
419
476
|
super(e), this.productCategory = new B(e?.productCategory);
|
|
420
477
|
}
|
|
421
|
-
},
|
|
478
|
+
}, Rt = class extends f {
|
|
422
479
|
photo;
|
|
423
480
|
contacts;
|
|
424
481
|
curatedDirection;
|
|
425
482
|
constructor(e) {
|
|
426
483
|
super(e), this.photo = e.photo, this.contacts = new r(e.contacts), this.curatedDirection = new a(e.curatedDirection);
|
|
427
484
|
}
|
|
428
|
-
}, U = class extends
|
|
485
|
+
}, U = class extends ye {
|
|
429
486
|
salesDirection;
|
|
430
487
|
debt;
|
|
431
488
|
alternativeName;
|
|
@@ -436,31 +493,31 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
436
493
|
managers;
|
|
437
494
|
curators;
|
|
438
495
|
constructor(e) {
|
|
439
|
-
super(e), this.salesDirection = new
|
|
496
|
+
super(e), this.salesDirection = new h(e?.salesDirection), this.debt = e?.debt ?? 0, this.alternativeName = e?.alternativeName ?? "", this.city = new n(e?.city), this.comment = e?.comment, this.isPhoneApproved = e?.isPhoneApproved ?? !1, this.isEmailApproved = e?.isEmailApproved ?? !1, this.managers = e?.managers?.map((e) => new ie(e)) ?? [], this.curators = e?.curators?.map((e) => new Rt(e)) ?? void 0;
|
|
440
497
|
}
|
|
441
|
-
},
|
|
498
|
+
}, zt = class extends M {
|
|
442
499
|
deletedAt;
|
|
443
500
|
constructor(e, t) {
|
|
444
501
|
super(e, t), this.deletedAt = s.parse(e?.deletedAt);
|
|
445
502
|
}
|
|
446
|
-
}, W = class extends
|
|
503
|
+
}, W = class extends zt {
|
|
447
504
|
client;
|
|
448
505
|
priceTemplate;
|
|
449
506
|
constructor(e) {
|
|
450
507
|
super(e), this.client = new U(e?.client), this.priceTemplate = new I(e?.priceTemplate);
|
|
451
508
|
}
|
|
452
|
-
},
|
|
509
|
+
}, Bt = class extends It {
|
|
453
510
|
product;
|
|
454
511
|
constructor(e) {
|
|
455
512
|
super(e), this.product = new R(e?.product);
|
|
456
513
|
}
|
|
457
|
-
}, G = class extends
|
|
514
|
+
}, G = class extends f {
|
|
458
515
|
type;
|
|
459
516
|
description;
|
|
460
517
|
metadata;
|
|
461
518
|
isFilterable;
|
|
462
519
|
constructor(e) {
|
|
463
|
-
super(e), this.type = new
|
|
520
|
+
super(e), this.type = new de(e?.type), this.description = e?.description ?? "", this.metadata = e?.metadata, this.isFilterable = e?.isFilterable;
|
|
464
521
|
}
|
|
465
522
|
}, K = class {
|
|
466
523
|
property;
|
|
@@ -468,15 +525,15 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
468
525
|
constructor(e) {
|
|
469
526
|
this.property = new G(e?.property), this.value = e?.value ?? "";
|
|
470
527
|
}
|
|
471
|
-
},
|
|
528
|
+
}, Vt = class {
|
|
472
529
|
id;
|
|
473
530
|
name;
|
|
474
531
|
description;
|
|
475
532
|
ownerName;
|
|
476
|
-
createdAt = new
|
|
477
|
-
updatedAt = new
|
|
533
|
+
createdAt = new N();
|
|
534
|
+
updatedAt = new N();
|
|
478
535
|
constructor(e) {
|
|
479
|
-
this.id = e?.id, this.name = e?.name, this.description = e?.description, this.ownerName = e?.ownerName, this.createdAt = new
|
|
536
|
+
this.id = e?.id, this.name = e?.name, this.description = e?.description, this.ownerName = e?.ownerName, this.createdAt = new N(e?.createdAt), this.updatedAt = new N(e?.updatedAt);
|
|
480
537
|
}
|
|
481
538
|
resetFilterValue(e) {
|
|
482
539
|
switch (e) {
|
|
@@ -497,26 +554,26 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
497
554
|
let e = {};
|
|
498
555
|
return Object.keys(this).forEach((t) => {
|
|
499
556
|
let n = this[t];
|
|
500
|
-
|
|
557
|
+
v(n) || y(n) && n.trim().length === 0 || ke(n.isNewRec) && n.isNewRec() || (e[t] = n);
|
|
501
558
|
}), !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, !e?.updatedAt?.from && !e?.updatedAt?.to && delete e.updatedAt, e;
|
|
502
559
|
}
|
|
503
|
-
},
|
|
560
|
+
}, Ht = class extends Ft {
|
|
504
561
|
executor;
|
|
505
562
|
createdAt;
|
|
506
563
|
constructor(e) {
|
|
507
564
|
super(e), this.executor = e?.executor ? new F(e.executor) : void 0, this.createdAt = s.parse(e?.createdAt);
|
|
508
565
|
}
|
|
509
|
-
},
|
|
566
|
+
}, Ut = class extends Ht {
|
|
510
567
|
product;
|
|
511
568
|
constructor(e) {
|
|
512
569
|
super(e), this.product = new R(e?.product);
|
|
513
570
|
}
|
|
514
|
-
},
|
|
571
|
+
}, Wt = class extends Ht {
|
|
515
572
|
productCategory;
|
|
516
573
|
constructor(e) {
|
|
517
574
|
super(e), this.productCategory = new B(e?.productCategory);
|
|
518
575
|
}
|
|
519
|
-
}, q = class extends
|
|
576
|
+
}, q = class extends f {
|
|
520
577
|
description;
|
|
521
578
|
canChangeLowCost;
|
|
522
579
|
parentRoleId;
|
|
@@ -526,14 +583,14 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
526
583
|
constructor(e) {
|
|
527
584
|
super(e), this.description = e?.description, this.canChangeLowCost = e?.canChangeLowCost ?? !1, this.parentRoleId = e?.parentRoleId;
|
|
528
585
|
}
|
|
529
|
-
},
|
|
586
|
+
}, Gt = class {
|
|
530
587
|
role;
|
|
531
588
|
category;
|
|
532
589
|
minCoefficient;
|
|
533
590
|
constructor(e) {
|
|
534
|
-
this.role = new q(e?.role), this.category = new B(e?.category), this.minCoefficient = new
|
|
591
|
+
this.role = new q(e?.role), this.category = new B(e?.category), this.minCoefficient = new ue(e?.minCoefficient);
|
|
535
592
|
}
|
|
536
|
-
},
|
|
593
|
+
}, Kt = class {
|
|
537
594
|
isFake;
|
|
538
595
|
isHidden;
|
|
539
596
|
isMultiple;
|
|
@@ -542,20 +599,20 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
542
599
|
constructor(e) {
|
|
543
600
|
this.isFake = e?.isFake ?? !1, this.isHidden = e?.isHidden ?? !1, this.isMultiple = e?.isMultiple ?? null, this.type = e?.type ?? null, this.ord = e?.ord ?? 0;
|
|
544
601
|
}
|
|
545
|
-
},
|
|
602
|
+
}, qt = class {
|
|
546
603
|
category;
|
|
547
604
|
property;
|
|
548
605
|
settings;
|
|
549
606
|
constructor(e) {
|
|
550
|
-
this.category = new B(e?.category), this.property = new G(e?.property), this.settings = new
|
|
607
|
+
this.category = new B(e?.category), this.property = new G(e?.property), this.settings = new Kt(e?.settings);
|
|
551
608
|
}
|
|
552
|
-
},
|
|
609
|
+
}, Jt = class {
|
|
553
610
|
id;
|
|
554
611
|
label;
|
|
555
612
|
constructor(e) {
|
|
556
613
|
this.id = e?.id ?? "", this.label = e?.label ?? "";
|
|
557
614
|
}
|
|
558
|
-
},
|
|
615
|
+
}, Yt = class {
|
|
559
616
|
id;
|
|
560
617
|
label;
|
|
561
618
|
type;
|
|
@@ -565,9 +622,9 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
565
622
|
min;
|
|
566
623
|
max;
|
|
567
624
|
constructor(e) {
|
|
568
|
-
this.id = e?.id ?? "", this.label = e?.label ?? "", this.type = e?.type ??
|
|
625
|
+
this.id = e?.id ?? "", this.label = e?.label ?? "", this.type = e?.type ?? Mt.Checkbox, this.ord = e?.ord ?? 0, this.isMultiple = e?.isMultiple ?? null, this.values = e?.values?.map((e) => new Jt(e)) ?? [], this.min = e?.min ?? null, this.max = e?.max ?? null;
|
|
569
626
|
}
|
|
570
|
-
},
|
|
627
|
+
}, Xt = class extends l {
|
|
571
628
|
search(e, t = !1) {
|
|
572
629
|
return this.get("/internal/catalog/search", {
|
|
573
630
|
term: e,
|
|
@@ -575,18 +632,18 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
575
632
|
});
|
|
576
633
|
}
|
|
577
634
|
getPriceExportLink(e = "csv", t = !1, n = void 0, r = void 0) {
|
|
578
|
-
let i = `${
|
|
635
|
+
let i = `${_().config.http.portalApiUrl}/api/internal/price/export?format=${e}&show_hidden=${t}`;
|
|
579
636
|
return n && (i += `&category_id=${n}`), r && (i += `&client_id=${r}`), i;
|
|
580
637
|
}
|
|
581
|
-
},
|
|
638
|
+
}, Zt = class extends l {
|
|
582
639
|
importPrices(e, t, n = !1) {
|
|
583
640
|
return this.post(`/internal/clients/${e}/price/import`, t, void 0, {}, n);
|
|
584
641
|
}
|
|
585
642
|
getCategoryPrices(e) {
|
|
586
|
-
return this.getTypedList(
|
|
643
|
+
return this.getTypedList(Wt, `/internal/clients/${e}/price/categories`);
|
|
587
644
|
}
|
|
588
645
|
getCategoryPrice(e, t) {
|
|
589
|
-
return this.get(`/internal/clients/${e}/price/categories/${t}`, {}, (e) => new
|
|
646
|
+
return this.get(`/internal/clients/${e}/price/categories/${t}`, {}, (e) => new Wt(e.data));
|
|
590
647
|
}
|
|
591
648
|
updateCategoryPrices(e, t, n, r = !1) {
|
|
592
649
|
return this.request({
|
|
@@ -632,16 +689,16 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
632
689
|
return this.delete(`/internal/clients/${e}/price/categories/${t}/manager`);
|
|
633
690
|
}
|
|
634
691
|
getProductPrices(e) {
|
|
635
|
-
return this.getTypedList(
|
|
692
|
+
return this.getTypedList(Ut, `/internal/clients/${e}/price/products`);
|
|
636
693
|
}
|
|
637
694
|
getProductPrice(e, t) {
|
|
638
|
-
return this.get(`/internal/clients/${e}/price/products/${t}`, {}, (e) => new
|
|
695
|
+
return this.get(`/internal/clients/${e}/price/products/${t}`, {}, (e) => new Ut(e.data));
|
|
639
696
|
}
|
|
640
697
|
updateProductPrice(e, t, n) {
|
|
641
698
|
return this.patch(`/internal/clients/${e}/price/products/${t}`, {
|
|
642
699
|
price_coefficient_id: n.coefficient?.id,
|
|
643
700
|
increase_percent: n.value
|
|
644
|
-
}, (e) => new
|
|
701
|
+
}, (e) => new Ut(e.data));
|
|
645
702
|
}
|
|
646
703
|
removeProductPrice(e, t) {
|
|
647
704
|
return this.delete(`/internal/clients/${e}/price/products/${t}`);
|
|
@@ -661,7 +718,7 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
661
718
|
sendCommercialOffer(e, t) {
|
|
662
719
|
return this.post(`/internal/clients/${e}/price/commercial-offer/send`, t);
|
|
663
720
|
}
|
|
664
|
-
},
|
|
721
|
+
}, Qt = class extends l {
|
|
665
722
|
getTemplateList(e) {
|
|
666
723
|
return this.getTypedList(W, `/internal/clients/${e}/price/templates`);
|
|
667
724
|
}
|
|
@@ -669,26 +726,26 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
669
726
|
return this.get(`/internal/clients/${e}/price/templates/active`, {}, (e) => new W(e.data), !0);
|
|
670
727
|
}
|
|
671
728
|
attachTemplate(e, t, n) {
|
|
672
|
-
let r =
|
|
729
|
+
let r = _().config.dateFormats.api;
|
|
673
730
|
return this.post(`/internal/clients/${e}/price/templates/${t}`, n && {
|
|
674
|
-
startAt: n.startAt &&
|
|
675
|
-
endAt: n.endAt &&
|
|
731
|
+
startAt: n.startAt && T(n.startAt, r),
|
|
732
|
+
endAt: n.endAt && T(n.endAt, r)
|
|
676
733
|
}, (e) => new W(e.data), {}, !0);
|
|
677
734
|
}
|
|
678
735
|
applyTemplate(e, t) {
|
|
679
736
|
return this.post(`/internal/clients/${e}/price/templates/${t}/apply`, {}, void 0, {}, !0);
|
|
680
737
|
}
|
|
681
738
|
changeTemplate(e, t, n, r) {
|
|
682
|
-
let i =
|
|
739
|
+
let i = _().config.dateFormats.api;
|
|
683
740
|
return this.patch(`/internal/clients/${e}/price/templates/${t}/${n}`, r && {
|
|
684
|
-
startAt: r.startAt &&
|
|
685
|
-
endAt: r.endAt &&
|
|
741
|
+
startAt: r.startAt && T(r.startAt, i),
|
|
742
|
+
endAt: r.endAt && T(r.endAt, i)
|
|
686
743
|
}, (e) => new W(e.data));
|
|
687
744
|
}
|
|
688
745
|
detachTemplate(e, t, n) {
|
|
689
746
|
return this.delete(`/internal/clients/${e}/price/templates/${t}/${n}`);
|
|
690
747
|
}
|
|
691
|
-
},
|
|
748
|
+
}, $t = class extends l {
|
|
692
749
|
getRootCategoriesList(e = !1) {
|
|
693
750
|
return this.getTypedList(H, "/internal/catalog/categories", { showHidden: e });
|
|
694
751
|
}
|
|
@@ -705,12 +762,12 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
705
762
|
return this.get(`/internal/catalog/categories/${e}/products`, {
|
|
706
763
|
showHidden: n,
|
|
707
764
|
withPriceCoefficients: t
|
|
708
|
-
}, (e) =>
|
|
765
|
+
}, (e) => b(e.data, (e) => new R(e)));
|
|
709
766
|
}
|
|
710
767
|
getCategoryProductsCoefficients(e) {
|
|
711
768
|
return this.get(`/internal/catalog/categories/${e}/products/coefficients`, {}, (e) => {
|
|
712
769
|
let { data: t } = e;
|
|
713
|
-
return
|
|
770
|
+
return we(t, (e) => e.map((e) => new bt(e))), t;
|
|
714
771
|
});
|
|
715
772
|
}
|
|
716
773
|
publicSimpleSearch(e, t = 10) {
|
|
@@ -722,7 +779,7 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
722
779
|
});
|
|
723
780
|
});
|
|
724
781
|
}
|
|
725
|
-
},
|
|
782
|
+
}, en = class extends e {
|
|
726
783
|
getProductData(e, t = !1) {
|
|
727
784
|
return this.get(`/internal/catalog/products/${e}`, { withPriceCoefficients: t }, (e) => new R(e.data));
|
|
728
785
|
}
|
|
@@ -730,12 +787,12 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
730
787
|
return this.get(`/public/catalog/products/${e}`, {}, (e) => new R(e.data));
|
|
731
788
|
}
|
|
732
789
|
getProductPriceCoefficients(e) {
|
|
733
|
-
return this.get(`/internal/catalog/products/${e}/coefficients`, {}, (e) =>
|
|
790
|
+
return this.get(`/internal/catalog/products/${e}/coefficients`, {}, (e) => b(e.data, (e) => new bt(e)));
|
|
734
791
|
}
|
|
735
792
|
getNewProducts(e, t, n = !0) {
|
|
736
|
-
let r =
|
|
793
|
+
let r = _().config.dateFormats.api;
|
|
737
794
|
return this.getTypedPaginated(R, "/internal/catalog/products/new", void 0, void 0, t, {
|
|
738
|
-
period: { from:
|
|
795
|
+
period: { from: T(e, r) },
|
|
739
796
|
withPriceCoefficients: n
|
|
740
797
|
});
|
|
741
798
|
}
|
|
@@ -748,9 +805,9 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
748
805
|
});
|
|
749
806
|
});
|
|
750
807
|
}
|
|
751
|
-
},
|
|
808
|
+
}, tn = class extends l {
|
|
752
809
|
getRootCategoriesList(e, t = !1) {
|
|
753
|
-
return this.getTypedList(
|
|
810
|
+
return this.getTypedList(Pt, "/internal/catalog/categories", {
|
|
754
811
|
clientId: e,
|
|
755
812
|
showHidden: t
|
|
756
813
|
});
|
|
@@ -760,16 +817,16 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
760
817
|
clientId: e,
|
|
761
818
|
showHidden: n,
|
|
762
819
|
withNestedCategories: r
|
|
763
|
-
}, (e) => new
|
|
820
|
+
}, (e) => new Pt(e.data));
|
|
764
821
|
}
|
|
765
822
|
getCategoryProductsList(e, t, n = !0, r = !1) {
|
|
766
823
|
return this.get(`/internal/catalog/categories/${t}/products`, {
|
|
767
824
|
client_id: e,
|
|
768
825
|
showHidden: r,
|
|
769
826
|
withPriceCoefficients: n
|
|
770
|
-
}, (e) =>
|
|
827
|
+
}, (e) => b(e.data, (e) => new z(e)));
|
|
771
828
|
}
|
|
772
|
-
},
|
|
829
|
+
}, nn = class extends e {
|
|
773
830
|
getProductData(e, t, n = !1) {
|
|
774
831
|
return this.get(`/internal/catalog/products/${e}`, {
|
|
775
832
|
clientId: t,
|
|
@@ -777,14 +834,14 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
777
834
|
}, (e) => new z(e.data));
|
|
778
835
|
}
|
|
779
836
|
getNewProducts(e, t, n, r = !0) {
|
|
780
|
-
let i =
|
|
837
|
+
let i = _().config.dateFormats.api;
|
|
781
838
|
return this.getTypedPaginated(z, "/internal/catalog/products/new", void 0, void 0, n, {
|
|
782
839
|
clientId: e,
|
|
783
|
-
period: { from:
|
|
840
|
+
period: { from: T(t, i) },
|
|
784
841
|
withPriceCoefficients: r
|
|
785
842
|
});
|
|
786
843
|
}
|
|
787
|
-
},
|
|
844
|
+
}, rn = class extends e {
|
|
788
845
|
getTemplateList(e, t, n) {
|
|
789
846
|
return this.getTypedPaginated(I, "/internal/price/templates", e, t, n);
|
|
790
847
|
}
|
|
@@ -801,25 +858,25 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
801
858
|
return this.delete(`/internal/price/templates/${e}`);
|
|
802
859
|
}
|
|
803
860
|
getProductTemplatePrices(e) {
|
|
804
|
-
return this.getTypedList(
|
|
861
|
+
return this.getTypedList(Bt, `/internal/price/templates/${e}/products`);
|
|
805
862
|
}
|
|
806
863
|
getProductTemplatePrice(e, t) {
|
|
807
|
-
return this.get(`/internal/price/templates/${e}/products/${t}`, {}, (e) => new
|
|
864
|
+
return this.get(`/internal/price/templates/${e}/products/${t}`, {}, (e) => new Bt(e.data));
|
|
808
865
|
}
|
|
809
866
|
saveProductTemplatePrice(e, t, n) {
|
|
810
867
|
return this.post(`/internal/price/templates/${e}/products/${t}`, {
|
|
811
868
|
price_coefficient_id: n.coefficient?.id,
|
|
812
869
|
increase_percent: n.value
|
|
813
|
-
}, (e) => new
|
|
870
|
+
}, (e) => new Bt(e.data));
|
|
814
871
|
}
|
|
815
872
|
deleteProductTemplatePrice(e, t) {
|
|
816
873
|
return this.delete(`/internal/price/templates/${e}/products/${t}`);
|
|
817
874
|
}
|
|
818
875
|
getCategoryTemplatePrices(e) {
|
|
819
|
-
return this.getTypedList(
|
|
876
|
+
return this.getTypedList(Lt, `/internal/price/templates/${e}/categories`);
|
|
820
877
|
}
|
|
821
878
|
getCategoryTemplatePrice(e, t) {
|
|
822
|
-
return this.get(`/internal/price/templates/${e}/categories/${t}`, {}, (e) => new
|
|
879
|
+
return this.get(`/internal/price/templates/${e}/categories/${t}`, {}, (e) => new Lt(e.data));
|
|
823
880
|
}
|
|
824
881
|
saveCategoryTemplatePrice(e, t, n, r = !1) {
|
|
825
882
|
return this.request({
|
|
@@ -830,7 +887,7 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
830
887
|
increase_percent: n.value
|
|
831
888
|
},
|
|
832
889
|
params: r ? { recursively: !0 } : {}
|
|
833
|
-
}, (e) => new
|
|
890
|
+
}, (e) => new Lt(e.data));
|
|
834
891
|
}
|
|
835
892
|
deleteCategoryTemplatePrice(e, t, n = !1) {
|
|
836
893
|
return this.request({
|
|
@@ -842,7 +899,7 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
842
899
|
getTemplateClients(e) {
|
|
843
900
|
return this.getTypedList(W, `/internal/price/templates/${e}/clients`);
|
|
844
901
|
}
|
|
845
|
-
},
|
|
902
|
+
}, an = class extends l {
|
|
846
903
|
getRoles() {
|
|
847
904
|
return this.getTypedList(q, "/internal/price/roles");
|
|
848
905
|
}
|
|
@@ -859,12 +916,12 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
859
916
|
return this.delete(`/internal/price/roles/${e}`);
|
|
860
917
|
}
|
|
861
918
|
getCategoryRules(e) {
|
|
862
|
-
return this.getTypedList(
|
|
919
|
+
return this.getTypedList(Gt, `/internal/price/roles/rules/categories/${e}`);
|
|
863
920
|
}
|
|
864
921
|
updateCategoryRules(e, t) {
|
|
865
|
-
return this.patch(`/internal/price/roles/rules/categories/${e}`, t, (e) =>
|
|
922
|
+
return this.patch(`/internal/price/roles/rules/categories/${e}`, t, (e) => g.instanceListInitializer(Gt, e.data));
|
|
866
923
|
}
|
|
867
|
-
},
|
|
924
|
+
}, on = class extends e {
|
|
868
925
|
getProperties(e, t, n) {
|
|
869
926
|
return this.getTypedPaginated(G, "/internal/catalog/properties", e, t, n);
|
|
870
927
|
}
|
|
@@ -982,18 +1039,18 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
982
1039
|
return this.post(`/internal/catalog/categories/${e}/image`, { image: t });
|
|
983
1040
|
}
|
|
984
1041
|
getCategoryFilters(e, t = !1) {
|
|
985
|
-
return this.get(`/internal/catalog/categories/${e}/filters`, { recursively: t }, (e) => e.data.map((e) => new
|
|
1042
|
+
return this.get(`/internal/catalog/categories/${e}/filters`, { recursively: t }, (e) => e.data.map((e) => new Yt(e)));
|
|
986
1043
|
}
|
|
987
1044
|
getCategoryFilterSettings(e) {
|
|
988
|
-
return this.getTypedList(
|
|
1045
|
+
return this.getTypedList(qt, `/internal/catalog/categories/${e}/filter-settings`);
|
|
989
1046
|
}
|
|
990
1047
|
saveCategoryFilterSetting(e, t, n) {
|
|
991
|
-
return this.patch(`/internal/catalog/categories/${e}/filter-settings/${t}`, n, (e) => new
|
|
1048
|
+
return this.patch(`/internal/catalog/categories/${e}/filter-settings/${t}`, n, (e) => new qt(e.data));
|
|
992
1049
|
}
|
|
993
1050
|
deleteCategoryFilterSetting(e, t) {
|
|
994
1051
|
return this.delete(`/internal/catalog/categories/${e}/filter-settings/${t}`);
|
|
995
1052
|
}
|
|
996
|
-
},
|
|
1053
|
+
}, sn = class extends l {
|
|
997
1054
|
getRootCategoriesList(e, t = !1) {
|
|
998
1055
|
return this.getTypedList(H, "/internal/catalog/categories", {
|
|
999
1056
|
priceTemplateId: e,
|
|
@@ -1012,23 +1069,23 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
1012
1069
|
priceTemplateId: e,
|
|
1013
1070
|
showHidden: r,
|
|
1014
1071
|
withPriceCoefficients: n
|
|
1015
|
-
}, (e) =>
|
|
1072
|
+
}, (e) => b(e.data, (e) => new R(e)));
|
|
1016
1073
|
}
|
|
1017
1074
|
};
|
|
1018
1075
|
//#endregion
|
|
1019
1076
|
//#region src/catalog/methods/find-catalog-item.ts
|
|
1020
|
-
function
|
|
1077
|
+
function cn(e, t, n) {
|
|
1021
1078
|
let r;
|
|
1022
1079
|
return e.some((e) => {
|
|
1023
1080
|
if (e.type === n && e.id === t) return r = e, !0;
|
|
1024
1081
|
if (e.type === "product") return !1;
|
|
1025
1082
|
let i = e;
|
|
1026
1083
|
if (i.products && i.products.length > 0) {
|
|
1027
|
-
let e =
|
|
1084
|
+
let e = cn(i.products, t, n);
|
|
1028
1085
|
if (e) return r = e, !0;
|
|
1029
1086
|
}
|
|
1030
1087
|
if (i.categories && i.categories.length > 0) {
|
|
1031
|
-
let e =
|
|
1088
|
+
let e = cn(i.categories, t, n);
|
|
1032
1089
|
if (e) return r = e, !0;
|
|
1033
1090
|
}
|
|
1034
1091
|
return !1;
|
|
@@ -1036,20 +1093,20 @@ function rn(e, t, n) {
|
|
|
1036
1093
|
}
|
|
1037
1094
|
//#endregion
|
|
1038
1095
|
//#region src/catalog/methods/flatten-catalog-items.ts
|
|
1039
|
-
function
|
|
1096
|
+
function ln(e) {
|
|
1040
1097
|
let t = [];
|
|
1041
1098
|
return e.forEach((e) => {
|
|
1042
1099
|
if (t.push(e), e.type === "category") {
|
|
1043
1100
|
let n = e;
|
|
1044
|
-
n.products && n.products.length > 0 && t.push(...
|
|
1101
|
+
n.products && n.products.length > 0 && t.push(...ln(n.products)), n.categories && n.categories.length > 0 && t.push(...ln(n.categories));
|
|
1045
1102
|
}
|
|
1046
1103
|
}), t;
|
|
1047
1104
|
}
|
|
1048
1105
|
//#endregion
|
|
1049
1106
|
//#region src/clients/enums/clients-additional-data-request-type-enum.ts
|
|
1050
|
-
var
|
|
1107
|
+
var un = /* @__PURE__ */ function(e) {
|
|
1051
1108
|
return e.LastOrder = "last_order", e.Contacts = "contacts", e.PartnerGroups = "partner_groups", e.PreferredDeliveryType = "preferred_delivery_type", e.SalesDirection = "sales_direction", e.Managers = "managers", e.Curators = "curators", e;
|
|
1052
|
-
}({}),
|
|
1109
|
+
}({}), dn = class extends u {
|
|
1053
1110
|
bankName = "";
|
|
1054
1111
|
bic = "";
|
|
1055
1112
|
accountNumber = "";
|
|
@@ -1058,13 +1115,13 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1058
1115
|
constructor(e) {
|
|
1059
1116
|
super(e), e && (this.bankName = e.bankName ?? "", this.bic = e.bic ?? "", this.accountNumber = e.accountNumber ?? "", this.correspondentAccount = e.correspondentAccount ?? "", this.currency = new o(e.currency));
|
|
1060
1117
|
}
|
|
1061
|
-
},
|
|
1118
|
+
}, fn = class extends P {
|
|
1062
1119
|
phone;
|
|
1063
1120
|
email;
|
|
1064
1121
|
constructor(e) {
|
|
1065
1122
|
super(e), this.email = e?.email, this.phone = /^\d+$/.test(e?.phone ?? "") ? `+${e?.phone}` : e?.phone;
|
|
1066
1123
|
}
|
|
1067
|
-
}, J = class extends
|
|
1124
|
+
}, J = class extends fn {
|
|
1068
1125
|
isPrimary;
|
|
1069
1126
|
position;
|
|
1070
1127
|
notDisturb;
|
|
@@ -1072,9 +1129,9 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1072
1129
|
constructor(e) {
|
|
1073
1130
|
super(e), this.isPrimary = e?.isPrimary ?? !1, this.position = e?.position, this.notDisturb = e?.notDisturb ?? !1, this.comment = e?.comment;
|
|
1074
1131
|
}
|
|
1075
|
-
},
|
|
1076
|
-
opf =
|
|
1077
|
-
partnerGroup = new
|
|
1132
|
+
}, pn = class extends P {
|
|
1133
|
+
opf = se.generatePersonItem();
|
|
1134
|
+
partnerGroup = new m();
|
|
1078
1135
|
contacts = [];
|
|
1079
1136
|
bankAccounts = [];
|
|
1080
1137
|
comment;
|
|
@@ -1083,7 +1140,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1083
1140
|
updater;
|
|
1084
1141
|
constructor(e) {
|
|
1085
1142
|
if (super(e), e) {
|
|
1086
|
-
if (this.opf = new
|
|
1143
|
+
if (this.opf = new se(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.creator = e.creator ? new F(e.creator) : void 0, this.updater = e.updater ? new F(e.updater) : void 0, e.partnerGroup && (this.partnerGroup = new m(e.partnerGroup)), e.contacts) {
|
|
1087
1144
|
let t = [];
|
|
1088
1145
|
e.contacts.forEach((e) => {
|
|
1089
1146
|
t.push(new J(e));
|
|
@@ -1092,16 +1149,16 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1092
1149
|
if (e.bankAccounts) {
|
|
1093
1150
|
let t = [];
|
|
1094
1151
|
e.bankAccounts.forEach((e) => {
|
|
1095
|
-
t.push(new
|
|
1152
|
+
t.push(new dn(e));
|
|
1096
1153
|
}), this.bankAccounts = t;
|
|
1097
1154
|
}
|
|
1098
1155
|
}
|
|
1099
1156
|
}
|
|
1100
|
-
},
|
|
1157
|
+
}, mn = class extends pn {
|
|
1101
1158
|
constructor(e) {
|
|
1102
1159
|
super(e);
|
|
1103
1160
|
}
|
|
1104
|
-
},
|
|
1161
|
+
}, hn = class extends pn {
|
|
1105
1162
|
inn = "";
|
|
1106
1163
|
okpo = "";
|
|
1107
1164
|
ogrn = "";
|
|
@@ -1114,34 +1171,34 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1114
1171
|
constructor(e) {
|
|
1115
1172
|
super(e), e && (this.inn = e.inn ?? "", this.okpo = e.okpo ?? "", this.ogrn = e.ogrn ?? "", this.directorName = e.directorName ?? "", this.directorPosition = e.directorPosition ?? "", this.directorActsOn = e.directorActsOn ?? "", this.legalAddress = e.legalAddress ?? "", this.postalAddress = e.postalAddress ?? "", this.actualAddress = e.actualAddress ?? "");
|
|
1116
1173
|
}
|
|
1117
|
-
},
|
|
1174
|
+
}, gn = class extends hn {
|
|
1118
1175
|
kpp = "";
|
|
1119
1176
|
constructor(e) {
|
|
1120
1177
|
super(e), e && (this.kpp = e.kpp ?? "");
|
|
1121
1178
|
}
|
|
1122
|
-
},
|
|
1179
|
+
}, _n = class extends gn {
|
|
1123
1180
|
registrationCountry = new i();
|
|
1124
1181
|
registrationNumber = "";
|
|
1125
1182
|
taxNumber = "";
|
|
1126
1183
|
constructor(e) {
|
|
1127
1184
|
super(e), e && (this.registrationCountry = new i(e.registrationCountry), this.registrationNumber = e.registrationNumber ?? "", this.taxNumber = e.taxNumber ?? "");
|
|
1128
1185
|
}
|
|
1129
|
-
},
|
|
1186
|
+
}, vn = class {
|
|
1130
1187
|
static createInstance(e) {
|
|
1131
1188
|
switch (e.opf.slug) {
|
|
1132
|
-
case
|
|
1133
|
-
case
|
|
1134
|
-
case
|
|
1135
|
-
default: return new
|
|
1189
|
+
case p.Ic: return new hn(e);
|
|
1190
|
+
case p.UlR: return new gn(e);
|
|
1191
|
+
case p.UlNr: return new _n(e);
|
|
1192
|
+
default: return new mn(e);
|
|
1136
1193
|
}
|
|
1137
1194
|
}
|
|
1138
|
-
},
|
|
1195
|
+
}, yn = class extends f {
|
|
1139
1196
|
city;
|
|
1140
1197
|
isActive;
|
|
1141
1198
|
constructor(e) {
|
|
1142
1199
|
super(e), this.city = e?.city ? new n(e.city) : void 0, this.isActive = e?.isActive ?? !1;
|
|
1143
1200
|
}
|
|
1144
|
-
}, Y = class extends
|
|
1201
|
+
}, Y = class extends P {
|
|
1145
1202
|
address = "";
|
|
1146
1203
|
coordinates;
|
|
1147
1204
|
contacts;
|
|
@@ -1150,9 +1207,9 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1150
1207
|
isOneTime;
|
|
1151
1208
|
isTransportCompanyAddress;
|
|
1152
1209
|
constructor(e) {
|
|
1153
|
-
super(e), this.address = e?.address ?? "", this.coordinates = new
|
|
1210
|
+
super(e), this.address = e?.address ?? "", this.coordinates = new re(e?.coordinates), this.contacts = e?.contacts?.map((e) => new J(e)) ?? [], this.comment = e?.comment, this.operatingHours = e?.operatingHours, this.isOneTime = e?.isOneTime, this.isTransportCompanyAddress = e?.isTransportCompanyAddress;
|
|
1154
1211
|
}
|
|
1155
|
-
},
|
|
1212
|
+
}, bn = class extends U {
|
|
1156
1213
|
contragents;
|
|
1157
1214
|
partnerGroups;
|
|
1158
1215
|
contacts;
|
|
@@ -1164,9 +1221,9 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1164
1221
|
preferredWarehouse;
|
|
1165
1222
|
extraData;
|
|
1166
1223
|
constructor(e) {
|
|
1167
|
-
super(e), this.contragents = e?.contragents?.map((e) =>
|
|
1224
|
+
super(e), this.contragents = e?.contragents?.map((e) => vn.createInstance(e)) ?? [], this.partnerGroups = e?.partnerGroups?.map((e) => new m(e)) ?? [], this.contacts = e?.contacts?.map((e) => new J(e)) ?? [], this.deliveryAddresses = e?.deliveryAddresses?.map((e) => new Y(e)) ?? [], this.channelPrimaryInterest = new t(e?.channelPrimaryInterest), this.sourcePrimaryInterest = new ge(e?.sourcePrimaryInterest), this.preferredDeliveryType = new c(e?.preferredDeliveryType), this.primaryDemand = e?.primaryDemand, this.preferredWarehouse = e?.preferredWarehouse ? new xe(e.preferredWarehouse) : void 0, this.extraData = e?.extraData ?? {};
|
|
1168
1225
|
}
|
|
1169
|
-
},
|
|
1226
|
+
}, xn = class extends j {
|
|
1170
1227
|
id;
|
|
1171
1228
|
guid;
|
|
1172
1229
|
name;
|
|
@@ -1178,8 +1235,8 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1178
1235
|
phone;
|
|
1179
1236
|
email;
|
|
1180
1237
|
isActive;
|
|
1181
|
-
createdAt = new
|
|
1182
|
-
lastLoginDate = new
|
|
1238
|
+
createdAt = new N();
|
|
1239
|
+
lastLoginDate = new N();
|
|
1183
1240
|
lastLoginDateHasOrder;
|
|
1184
1241
|
managers;
|
|
1185
1242
|
includeSubordinateManagers;
|
|
@@ -1192,13 +1249,13 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1192
1249
|
partnerGroups;
|
|
1193
1250
|
contact;
|
|
1194
1251
|
lastOrder;
|
|
1195
|
-
noOrdersPeriod = new
|
|
1252
|
+
noOrdersPeriod = new N();
|
|
1196
1253
|
constructor(e) {
|
|
1197
|
-
super(), this.id = e?.id, this.guid = e?.guid, this.name = e?.name, this.alternativeName = e?.alternativeName, this.searchTerm = e?.searchTerm, this.cities = e?.cities?.map((e) => new n(e)), this.region = new
|
|
1198
|
-
createdAt: new
|
|
1254
|
+
super(), this.id = e?.id, this.guid = e?.guid, this.name = e?.name, this.alternativeName = e?.alternativeName, this.searchTerm = e?.searchTerm, this.cities = e?.cities?.map((e) => new n(e)), this.region = new pe(e?.region), this.country = new i(e?.country), this.phone = e?.phone, this.email = e?.email, this.isActive = e && Object.prototype.hasOwnProperty.call(e, "isActive") ? e?.isActive : !0, this.createdAt = new N(e?.createdAt), this.lastLoginDate = new N(e?.lastLoginDate), this.lastLoginDateHasOrder = e?.lastLoginDateHasOrder ?? void 0, this.managers = e?.managers?.map((e) => new d(e)) ?? [], this.includeSubordinateManagers = e?.includeSubordinateManagers ?? !0, this.curators = e?.curators?.map((e) => new Rt(e)) ?? [], this.salesDirections = e?.salesDirections?.map((e) => new h(e)), this.contragentInn = e?.contragentInn, this.contragentType = new se(e?.contragentType), this.preferredDeliveryType = e?.preferredDeliveryType ? new c(e?.preferredDeliveryType) : void 0, this.partnerGroups = e?.partnerGroups?.map((e) => new m(e)), this.contact = new fn(e?.contact), this.lastOrder = {
|
|
1255
|
+
createdAt: new N(e?.lastOrder?.createdAt),
|
|
1199
1256
|
creator: e?.lastOrder?.creator,
|
|
1200
1257
|
isApproved: e?.lastOrder?.isApproved
|
|
1201
|
-
}, this.noOrdersPeriod = new
|
|
1258
|
+
}, this.noOrdersPeriod = new N(e?.noOrdersPeriod);
|
|
1202
1259
|
}
|
|
1203
1260
|
resetFilterValue(e) {
|
|
1204
1261
|
switch (e) {
|
|
@@ -1206,7 +1263,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1206
1263
|
this.cities = [];
|
|
1207
1264
|
break;
|
|
1208
1265
|
case "region":
|
|
1209
|
-
this.region = new
|
|
1266
|
+
this.region = new pe();
|
|
1210
1267
|
break;
|
|
1211
1268
|
case "isActive":
|
|
1212
1269
|
this.isActive = !0;
|
|
@@ -1233,7 +1290,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1233
1290
|
this.salesDirections = [];
|
|
1234
1291
|
break;
|
|
1235
1292
|
case "contragentType":
|
|
1236
|
-
this.contragentType = new
|
|
1293
|
+
this.contragentType = new se();
|
|
1237
1294
|
break;
|
|
1238
1295
|
case "preferredDeliveryType":
|
|
1239
1296
|
this.preferredDeliveryType = new c();
|
|
@@ -1242,7 +1299,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1242
1299
|
this.partnerGroups = [];
|
|
1243
1300
|
break;
|
|
1244
1301
|
case "contact":
|
|
1245
|
-
this.contact = new
|
|
1302
|
+
this.contact = new fn();
|
|
1246
1303
|
break;
|
|
1247
1304
|
default: this[e] = void 0;
|
|
1248
1305
|
}
|
|
@@ -1252,12 +1309,12 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1252
1309
|
let e = super.asClearRaw();
|
|
1253
1310
|
return !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, !e?.lastLoginDate?.from && !e?.lastLoginDate?.to && delete e.lastLoginDate, !e?.noOrdersPeriod?.from && !e?.noOrdersPeriod?.to && delete e.noOrdersPeriod, e;
|
|
1254
1311
|
}
|
|
1255
|
-
},
|
|
1312
|
+
}, Sn = class extends M {
|
|
1256
1313
|
creator;
|
|
1257
1314
|
constructor(e) {
|
|
1258
1315
|
super(e), this.creator = new F(e?.creator);
|
|
1259
1316
|
}
|
|
1260
|
-
},
|
|
1317
|
+
}, Cn = class extends f {
|
|
1261
1318
|
contacts = [];
|
|
1262
1319
|
preferredDeliveryType;
|
|
1263
1320
|
partnerGroups = [];
|
|
@@ -1266,23 +1323,23 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1266
1323
|
managers;
|
|
1267
1324
|
curators;
|
|
1268
1325
|
constructor(e) {
|
|
1269
|
-
super(e), this.contacts = e.contacts?.map((e) => new J(e)) ?? void 0, this.lastOrder = e.lastOrder ? new
|
|
1326
|
+
super(e), this.contacts = e.contacts?.map((e) => new J(e)) ?? void 0, this.lastOrder = e.lastOrder ? new Sn(e.lastOrder) : void 0, this.partnerGroups = e.partnerGroups?.map((e) => new m(e)) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new c(e.preferredDeliveryType) : void 0, this.salesDirection = e.salesDirection ? new h(e.salesDirection) : void 0, this.managers = e.managers?.map((e) => new ie(e)) ?? void 0, this.curators = e.curators?.map((e) => new Rt(e)) ?? void 0;
|
|
1270
1327
|
}
|
|
1271
|
-
},
|
|
1328
|
+
}, wn = class extends u {
|
|
1272
1329
|
isPrimary;
|
|
1273
1330
|
constructor(e) {
|
|
1274
1331
|
super(e), this.isPrimary = e.isPrimary;
|
|
1275
1332
|
}
|
|
1276
|
-
},
|
|
1333
|
+
}, Tn = class extends J {
|
|
1277
1334
|
relations = {
|
|
1278
1335
|
clients: [],
|
|
1279
1336
|
contragents: [],
|
|
1280
1337
|
addresses: []
|
|
1281
1338
|
};
|
|
1282
1339
|
constructor(e) {
|
|
1283
|
-
super(e), e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((e) => new
|
|
1340
|
+
super(e), e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((e) => new wn(e))), e.relations.clients && (this.relations.clients = e.relations.clients.map((e) => new wn(e))), e.relations.contragents && (this.relations.contragents = e.relations.contragents.map((e) => new wn(e))));
|
|
1284
1341
|
}
|
|
1285
|
-
},
|
|
1342
|
+
}, En = class t extends e {
|
|
1286
1343
|
static transformClientDataToRequest(e) {
|
|
1287
1344
|
return {
|
|
1288
1345
|
name: e.name,
|
|
@@ -1301,7 +1358,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1301
1358
|
static transformContragentClientDataToRequest(e) {
|
|
1302
1359
|
let t, n = e, r = e, i = e;
|
|
1303
1360
|
switch (e.opf.slug) {
|
|
1304
|
-
case
|
|
1361
|
+
case p.Ic:
|
|
1305
1362
|
t = {
|
|
1306
1363
|
opf: n.opf.slug,
|
|
1307
1364
|
name: n.name,
|
|
@@ -1319,7 +1376,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1319
1376
|
actual_address: n.actualAddress
|
|
1320
1377
|
};
|
|
1321
1378
|
break;
|
|
1322
|
-
case
|
|
1379
|
+
case p.UlR:
|
|
1323
1380
|
t = {
|
|
1324
1381
|
opf: r.opf.slug,
|
|
1325
1382
|
name: r.name,
|
|
@@ -1338,7 +1395,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1338
1395
|
actual_address: r.actualAddress
|
|
1339
1396
|
};
|
|
1340
1397
|
break;
|
|
1341
|
-
case
|
|
1398
|
+
case p.UlNr:
|
|
1342
1399
|
t = {
|
|
1343
1400
|
opf: i.opf.slug,
|
|
1344
1401
|
name: i.name,
|
|
@@ -1391,7 +1448,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1391
1448
|
};
|
|
1392
1449
|
}
|
|
1393
1450
|
getClient(e) {
|
|
1394
|
-
return this.get(`/internal/clients/${e}`, {}, (e) => new
|
|
1451
|
+
return this.get(`/internal/clients/${e}`, {}, (e) => new bn(e.data));
|
|
1395
1452
|
}
|
|
1396
1453
|
getClientsList(e, t, n, r, i) {
|
|
1397
1454
|
return this.getTypedPaginated(U, "/internal/clients", e, t, n, r, void 0, i);
|
|
@@ -1405,7 +1462,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1405
1462
|
groups: [],
|
|
1406
1463
|
filters: [{
|
|
1407
1464
|
field: "phone",
|
|
1408
|
-
op:
|
|
1465
|
+
op: ne.Contains,
|
|
1409
1466
|
value: e
|
|
1410
1467
|
}]
|
|
1411
1468
|
});
|
|
@@ -1415,13 +1472,13 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1415
1472
|
return this.post("/internal/clients/additional-data", {
|
|
1416
1473
|
clients: n,
|
|
1417
1474
|
requested_data_types: t
|
|
1418
|
-
}, (e) =>
|
|
1475
|
+
}, (e) => g.instanceListInitializer(Cn, e.data));
|
|
1419
1476
|
}
|
|
1420
1477
|
getAllClientContacts(e) {
|
|
1421
|
-
return this.getTypedList(
|
|
1478
|
+
return this.getTypedList(Tn, `/internal/clients/${e}/contacts/all`);
|
|
1422
1479
|
}
|
|
1423
1480
|
createClientCommonData(e, n = {}) {
|
|
1424
|
-
return this.post("/internal/clients", t.transformClientDataToRequest(e), (e) => new
|
|
1481
|
+
return this.post("/internal/clients", t.transformClientDataToRequest(e), (e) => new bn(e.data), n);
|
|
1425
1482
|
}
|
|
1426
1483
|
updateClientCommonData(e, n = {}) {
|
|
1427
1484
|
return this.patch(`/internal/clients/${e.id}`, t.transformClientDataToRequest(e), void 0, n);
|
|
@@ -1463,10 +1520,10 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1463
1520
|
})) });
|
|
1464
1521
|
}
|
|
1465
1522
|
createContragentClientData(e, n, r = {}) {
|
|
1466
|
-
return this.post(`/internal/clients/${e}/contragents`, t.transformContragentClientDataToRequest(n), (e) =>
|
|
1523
|
+
return this.post(`/internal/clients/${e}/contragents`, t.transformContragentClientDataToRequest(n), (e) => vn.createInstance(e.data), r);
|
|
1467
1524
|
}
|
|
1468
1525
|
updateContragentClientData(e, n, r = {}) {
|
|
1469
|
-
return this.patch(`/internal/clients/${e}/contragents/${n.id}`, t.transformContragentClientDataToRequest(n), (e) =>
|
|
1526
|
+
return this.patch(`/internal/clients/${e}/contragents/${n.id}`, t.transformContragentClientDataToRequest(n), (e) => vn.createInstance(e.data), r);
|
|
1470
1527
|
}
|
|
1471
1528
|
deleteClientContragent(e, t) {
|
|
1472
1529
|
return this.delete(`/internal/clients/${e}/contragents/${t.id}`);
|
|
@@ -1484,10 +1541,10 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1484
1541
|
return this.delete(`/internal/clients/${e}/delivery-addresses/${t.id}`);
|
|
1485
1542
|
}
|
|
1486
1543
|
createContragentBankAccount(e, n, r, i = {}) {
|
|
1487
|
-
return this.post(`/internal/clients/${e}/contragents/${n}/bank-accounts`, t.transformClientContragentBankAccountToRequest(r), (e) => new
|
|
1544
|
+
return this.post(`/internal/clients/${e}/contragents/${n}/bank-accounts`, t.transformClientContragentBankAccountToRequest(r), (e) => new dn(e.data), i);
|
|
1488
1545
|
}
|
|
1489
1546
|
updateContragentBankAccount(e, n, r, i = {}) {
|
|
1490
|
-
return this.patch(`/internal/clients/${e}/contragents/${n}/bank-accounts/${r.id}`, t.transformClientContragentBankAccountToRequest(r), (e) => new
|
|
1547
|
+
return this.patch(`/internal/clients/${e}/contragents/${n}/bank-accounts/${r.id}`, t.transformClientContragentBankAccountToRequest(r), (e) => new dn(e.data), i);
|
|
1491
1548
|
}
|
|
1492
1549
|
deleteContragentBankAccount(e, t, n) {
|
|
1493
1550
|
return this.delete(`/internal/clients/${e}/contragents/${t}/bank-accounts/${n.id}`);
|
|
@@ -1559,7 +1616,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1559
1616
|
sendClientEmailConfirmation(e) {
|
|
1560
1617
|
return this.get(`/internal/clients/${e.id}/verification/email?email=${e.email}`);
|
|
1561
1618
|
}
|
|
1562
|
-
},
|
|
1619
|
+
}, Dn = class extends l {
|
|
1563
1620
|
checkPhoneIsBusy(e) {
|
|
1564
1621
|
return new Promise((t, n) => {
|
|
1565
1622
|
this.request({
|
|
@@ -1571,16 +1628,16 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1571
1628
|
}).catch(n);
|
|
1572
1629
|
});
|
|
1573
1630
|
}
|
|
1574
|
-
},
|
|
1631
|
+
}, On = class {
|
|
1575
1632
|
date;
|
|
1576
1633
|
name;
|
|
1577
1634
|
version;
|
|
1578
1635
|
constructor(e) {
|
|
1579
|
-
this.date =
|
|
1636
|
+
this.date = y(e?.date) ? E(e.date) : e?.date ?? /* @__PURE__ */ new Date(), this.name = e?.name ?? "", this.version = e?.version ?? "0.0.0";
|
|
1580
1637
|
}
|
|
1581
|
-
},
|
|
1638
|
+
}, kn = /* @__PURE__ */ function(e) {
|
|
1582
1639
|
return e.Kozyrek = "kozyrek", e.Mosquitto = "mosquitto", e.Strip = "strip", e.MetalForDoors = "metal_for_doors", e.Sandwich = "sandwich", e.SandwichM2 = "sandwich_m2", e;
|
|
1583
|
-
}({}),
|
|
1640
|
+
}({}), An = class extends l {
|
|
1584
1641
|
getConfiguratorSettings(e, t) {
|
|
1585
1642
|
return this.get(`internal/catalog/categories/${e.id}/configurators/${e.properties?.configurator}/settings?client_id=${t}`);
|
|
1586
1643
|
}
|
|
@@ -1606,13 +1663,13 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1606
1663
|
...n
|
|
1607
1664
|
});
|
|
1608
1665
|
}
|
|
1609
|
-
},
|
|
1666
|
+
}, jn = class {
|
|
1610
1667
|
page = 1;
|
|
1611
1668
|
pageSize = 50;
|
|
1612
1669
|
constructor(e) {
|
|
1613
1670
|
this.page = e?.page ?? 1, this.pageSize = e?.pageSize ?? 50;
|
|
1614
1671
|
}
|
|
1615
|
-
},
|
|
1672
|
+
}, Mn = class extends jn {
|
|
1616
1673
|
itemCount = 0;
|
|
1617
1674
|
pageCount = 1;
|
|
1618
1675
|
pageSlot = 5;
|
|
@@ -1629,7 +1686,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1629
1686
|
100
|
|
1630
1687
|
], this.showSizePicker = e?.showSizePicker ?? !0;
|
|
1631
1688
|
}
|
|
1632
|
-
},
|
|
1689
|
+
}, Nn = class {
|
|
1633
1690
|
field;
|
|
1634
1691
|
direction;
|
|
1635
1692
|
constructor(e) {
|
|
@@ -1654,47 +1711,47 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1654
1711
|
return new Date(e.getFullYear(), e.getMonth() < 6 ? 0 : 6, 1);
|
|
1655
1712
|
}
|
|
1656
1713
|
static endOfHalfYear(e) {
|
|
1657
|
-
return
|
|
1714
|
+
return w(new Date(e.getFullYear(), e.getMonth() < 6 ? 5 : 11, 1));
|
|
1658
1715
|
}
|
|
1659
1716
|
static addHalfYears(e, t) {
|
|
1660
|
-
return
|
|
1717
|
+
return S(e, t * 6);
|
|
1661
1718
|
}
|
|
1662
1719
|
static intervalTillSameDate(e, t, n) {
|
|
1663
|
-
let r =
|
|
1720
|
+
let r = Ue(O(n), O(e)), i = O(S(t, r)), a = Math.min(Xe(n), Ze(i));
|
|
1664
1721
|
return {
|
|
1665
|
-
from:
|
|
1666
|
-
to:
|
|
1722
|
+
from: D(t),
|
|
1723
|
+
to: C(Qe(i, a))
|
|
1667
1724
|
};
|
|
1668
1725
|
}
|
|
1669
1726
|
static weekTillSameWeekday(e, t) {
|
|
1670
|
-
let n =
|
|
1727
|
+
let n = k(Be(e, t), { weekStartsOn: 1 }), r = He(e, k(e, { weekStartsOn: 1 }));
|
|
1671
1728
|
return {
|
|
1672
1729
|
from: n,
|
|
1673
|
-
to: x(
|
|
1730
|
+
to: C(x(n, r))
|
|
1674
1731
|
};
|
|
1675
1732
|
}
|
|
1676
1733
|
static decadeTillSameDayNumber(t, n) {
|
|
1677
|
-
let [r] = e.shiftedDecadeBounds(t, 0), i =
|
|
1734
|
+
let [r] = e.shiftedDecadeBounds(t, 0), i = He(t, r) + 1, [a, o] = e.shiftedDecadeBounds(t, n), s = He(o, a) + 1;
|
|
1678
1735
|
return {
|
|
1679
1736
|
from: a,
|
|
1680
|
-
to: x(
|
|
1737
|
+
to: C(x(a, Math.min(i, s) - 1))
|
|
1681
1738
|
};
|
|
1682
1739
|
}
|
|
1683
1740
|
static shiftedDecadeBounds(e, t) {
|
|
1684
|
-
let n =
|
|
1741
|
+
let n = Xe(e), r = 2;
|
|
1685
1742
|
n <= 10 ? r = 0 : n <= 20 && (r = 1);
|
|
1686
|
-
let i = r + t, a = Math.floor(i / 3), o = (i % 3 + 3) % 3, s =
|
|
1687
|
-
return [c, o === 2 ?
|
|
1743
|
+
let i = r + t, a = Math.floor(i / 3), o = (i % 3 + 3) % 3, s = O(S(e, a)), c = x(s, o * 10);
|
|
1744
|
+
return [c, o === 2 ? w(s) : C(x(c, 9))];
|
|
1688
1745
|
}
|
|
1689
1746
|
};
|
|
1690
1747
|
//#endregion
|
|
1691
1748
|
//#region src/date-time/helpers/days-ago-iso.ts
|
|
1692
|
-
function
|
|
1693
|
-
return
|
|
1749
|
+
function Pn(e) {
|
|
1750
|
+
return T(rt(et(), e), "yyyy-MM-dd");
|
|
1694
1751
|
}
|
|
1695
1752
|
//#endregion
|
|
1696
1753
|
//#region src/i18n/helpers/pluralize.ts
|
|
1697
|
-
function
|
|
1754
|
+
function Fn(e, t) {
|
|
1698
1755
|
let n = [
|
|
1699
1756
|
2,
|
|
1700
1757
|
0,
|
|
@@ -1707,13 +1764,13 @@ function jn(e, t) {
|
|
|
1707
1764
|
}
|
|
1708
1765
|
//#endregion
|
|
1709
1766
|
//#region src/date-time/helpers/format-relative-date.ts
|
|
1710
|
-
function
|
|
1711
|
-
let t =
|
|
1767
|
+
function In(e) {
|
|
1768
|
+
let t = E(e), n = He(et(), t);
|
|
1712
1769
|
switch (!0) {
|
|
1713
1770
|
case n === 0: return "Сегодня";
|
|
1714
1771
|
case n === 1: return "Вчера";
|
|
1715
1772
|
case n < 0: return e;
|
|
1716
|
-
default: return `${n} ${
|
|
1773
|
+
default: return `${n} ${Fn(n, [
|
|
1717
1774
|
"день",
|
|
1718
1775
|
"дня",
|
|
1719
1776
|
"дней"
|
|
@@ -1722,83 +1779,83 @@ function Mn(e) {
|
|
|
1722
1779
|
}
|
|
1723
1780
|
//#endregion
|
|
1724
1781
|
//#region src/date-time/providers/date-time-provider.ts
|
|
1725
|
-
var
|
|
1782
|
+
var Ln = class {
|
|
1726
1783
|
static defaultDateRanges(e) {
|
|
1727
|
-
let t =
|
|
1784
|
+
let t = Re(/* @__PURE__ */ new Date(), 1), n = /* @__PURE__ */ new Date(), r = A(e === void 0 ? n : new Date(e, 0, 1)), i = Je(r);
|
|
1728
1785
|
return {
|
|
1729
1786
|
nextWorkingDay: {
|
|
1730
1787
|
label: "Следующий рабочий день",
|
|
1731
|
-
from:
|
|
1732
|
-
to:
|
|
1788
|
+
from: D(t),
|
|
1789
|
+
to: C(t)
|
|
1733
1790
|
},
|
|
1734
1791
|
today: {
|
|
1735
1792
|
label: "Сегодня",
|
|
1736
|
-
from:
|
|
1737
|
-
to:
|
|
1793
|
+
from: et(),
|
|
1794
|
+
to: Ge()
|
|
1738
1795
|
},
|
|
1739
1796
|
yesterday: {
|
|
1740
1797
|
label: "Вчера",
|
|
1741
|
-
from:
|
|
1742
|
-
to:
|
|
1798
|
+
from: nt(),
|
|
1799
|
+
to: Ye()
|
|
1743
1800
|
},
|
|
1744
1801
|
tomorrow: {
|
|
1745
1802
|
label: "Завтра",
|
|
1746
|
-
from:
|
|
1747
|
-
to:
|
|
1803
|
+
from: tt(),
|
|
1804
|
+
to: Ke()
|
|
1748
1805
|
},
|
|
1749
1806
|
currentWeek: {
|
|
1750
1807
|
label: "Неделя",
|
|
1751
|
-
from:
|
|
1752
|
-
to:
|
|
1808
|
+
from: k(n, { weekStartsOn: 1 }),
|
|
1809
|
+
to: qe(n, { weekStartsOn: 1 })
|
|
1753
1810
|
},
|
|
1754
1811
|
currentMonth: {
|
|
1755
1812
|
label: "Месяц",
|
|
1756
|
-
from:
|
|
1757
|
-
to:
|
|
1813
|
+
from: O(n),
|
|
1814
|
+
to: w(n)
|
|
1758
1815
|
},
|
|
1759
1816
|
oneMonth: {
|
|
1760
1817
|
label: "1 месяц",
|
|
1761
1818
|
from: r,
|
|
1762
|
-
to:
|
|
1819
|
+
to: w(r)
|
|
1763
1820
|
},
|
|
1764
1821
|
threeMonths: {
|
|
1765
1822
|
label: "3 месяца",
|
|
1766
1823
|
from: r,
|
|
1767
|
-
to: S(
|
|
1824
|
+
to: w(S(r, 2))
|
|
1768
1825
|
},
|
|
1769
1826
|
nineMonths: {
|
|
1770
1827
|
label: "9 месяцев",
|
|
1771
1828
|
from: r,
|
|
1772
|
-
to: S(
|
|
1829
|
+
to: w(S(r, 8))
|
|
1773
1830
|
},
|
|
1774
1831
|
firstQuarter: {
|
|
1775
1832
|
label: "I квартал",
|
|
1776
1833
|
from: r,
|
|
1777
|
-
to: S(
|
|
1834
|
+
to: w(S(r, 2))
|
|
1778
1835
|
},
|
|
1779
1836
|
secondQuarter: {
|
|
1780
1837
|
label: "II квартал",
|
|
1781
|
-
from:
|
|
1782
|
-
to: S(
|
|
1838
|
+
from: S(r, 3),
|
|
1839
|
+
to: w(S(r, 5))
|
|
1783
1840
|
},
|
|
1784
1841
|
thirdQuarter: {
|
|
1785
1842
|
label: "III квартал",
|
|
1786
|
-
from:
|
|
1787
|
-
to: S(
|
|
1843
|
+
from: S(r, 6),
|
|
1844
|
+
to: w(S(r, 8))
|
|
1788
1845
|
},
|
|
1789
1846
|
fourthQuarter: {
|
|
1790
1847
|
label: "IV квартал",
|
|
1791
|
-
from:
|
|
1792
|
-
to: S(
|
|
1848
|
+
from: S(r, 9),
|
|
1849
|
+
to: w(S(r, 11))
|
|
1793
1850
|
},
|
|
1794
1851
|
firstHalfYear: {
|
|
1795
1852
|
label: "I полугодие",
|
|
1796
1853
|
from: r,
|
|
1797
|
-
to: S(
|
|
1854
|
+
to: w(S(r, 5))
|
|
1798
1855
|
},
|
|
1799
1856
|
secondHalfYear: {
|
|
1800
1857
|
label: "II полугодие",
|
|
1801
|
-
from:
|
|
1858
|
+
from: S(r, 6),
|
|
1802
1859
|
to: i
|
|
1803
1860
|
},
|
|
1804
1861
|
currentYear: {
|
|
@@ -1809,13 +1866,13 @@ var Nn = class {
|
|
|
1809
1866
|
};
|
|
1810
1867
|
}
|
|
1811
1868
|
static standardPeriods(e = /* @__PURE__ */ new Date()) {
|
|
1812
|
-
let t = { weekStartsOn: 1 }, n =
|
|
1869
|
+
let t = { weekStartsOn: 1 }, n = D(e), r = C(e), i = X.decadeInterval(e), a = O(e), o = $e(e), s = X.startOfHalfYear(e), c = A(e), ee = X.addHalfYears(e, -1), te = X.addHalfYears(e, 1);
|
|
1813
1870
|
return {
|
|
1814
1871
|
yesterday: {
|
|
1815
1872
|
label: "Вчера",
|
|
1816
1873
|
group: "day",
|
|
1817
|
-
from:
|
|
1818
|
-
to:
|
|
1874
|
+
from: D(rt(e, 1)),
|
|
1875
|
+
to: C(rt(e, 1))
|
|
1819
1876
|
},
|
|
1820
1877
|
today: {
|
|
1821
1878
|
label: "Сегодня",
|
|
@@ -1826,26 +1883,26 @@ var Nn = class {
|
|
|
1826
1883
|
tomorrow: {
|
|
1827
1884
|
label: "Завтра",
|
|
1828
1885
|
group: "day",
|
|
1829
|
-
from:
|
|
1830
|
-
to: x(
|
|
1886
|
+
from: D(x(e, 1)),
|
|
1887
|
+
to: C(x(e, 1))
|
|
1831
1888
|
},
|
|
1832
1889
|
lastWeek: {
|
|
1833
1890
|
label: "Прошлая неделя",
|
|
1834
1891
|
group: "week",
|
|
1835
|
-
from:
|
|
1836
|
-
to:
|
|
1892
|
+
from: k(ot(e, 1), t),
|
|
1893
|
+
to: qe(ot(e, 1), t)
|
|
1837
1894
|
},
|
|
1838
1895
|
thisWeek: {
|
|
1839
1896
|
label: "Эта неделя",
|
|
1840
1897
|
group: "week",
|
|
1841
|
-
from:
|
|
1842
|
-
to:
|
|
1898
|
+
from: k(e, t),
|
|
1899
|
+
to: qe(e, t)
|
|
1843
1900
|
},
|
|
1844
1901
|
nextWeek: {
|
|
1845
1902
|
label: "Следующая неделя",
|
|
1846
1903
|
group: "week",
|
|
1847
|
-
from:
|
|
1848
|
-
to:
|
|
1904
|
+
from: k(Be(e, 1), t),
|
|
1905
|
+
to: qe(Be(e, 1), t)
|
|
1849
1906
|
},
|
|
1850
1907
|
lastTenDays: {
|
|
1851
1908
|
label: "Прошлая декада",
|
|
@@ -1865,44 +1922,44 @@ var Nn = class {
|
|
|
1865
1922
|
lastMonth: {
|
|
1866
1923
|
label: "Прошлый месяц",
|
|
1867
1924
|
group: "month",
|
|
1868
|
-
from:
|
|
1869
|
-
to:
|
|
1925
|
+
from: O(it(e, 1)),
|
|
1926
|
+
to: w(it(e, 1))
|
|
1870
1927
|
},
|
|
1871
1928
|
thisMonth: {
|
|
1872
1929
|
label: "Этот месяц",
|
|
1873
1930
|
group: "month",
|
|
1874
1931
|
from: a,
|
|
1875
|
-
to:
|
|
1932
|
+
to: w(e)
|
|
1876
1933
|
},
|
|
1877
1934
|
nextMonth: {
|
|
1878
1935
|
label: "Следующий месяц",
|
|
1879
1936
|
group: "month",
|
|
1880
|
-
from:
|
|
1881
|
-
to: S(
|
|
1937
|
+
from: O(S(e, 1)),
|
|
1938
|
+
to: w(S(e, 1))
|
|
1882
1939
|
},
|
|
1883
1940
|
lastQuarter: {
|
|
1884
1941
|
label: "Прошлый квартал",
|
|
1885
1942
|
group: "quarter",
|
|
1886
|
-
from:
|
|
1887
|
-
to:
|
|
1943
|
+
from: $e(at(e, 1)),
|
|
1944
|
+
to: We(at(e, 1))
|
|
1888
1945
|
},
|
|
1889
1946
|
thisQuarter: {
|
|
1890
1947
|
label: "Этот квартал",
|
|
1891
1948
|
group: "quarter",
|
|
1892
1949
|
from: o,
|
|
1893
|
-
to:
|
|
1950
|
+
to: We(e)
|
|
1894
1951
|
},
|
|
1895
1952
|
nextQuarter: {
|
|
1896
1953
|
label: "Следующий квартал",
|
|
1897
1954
|
group: "quarter",
|
|
1898
|
-
from:
|
|
1899
|
-
to:
|
|
1955
|
+
from: $e(ze(e, 1)),
|
|
1956
|
+
to: We(ze(e, 1))
|
|
1900
1957
|
},
|
|
1901
1958
|
lastHalfYear: {
|
|
1902
1959
|
label: "Прошлое полугодие",
|
|
1903
1960
|
group: "halfYear",
|
|
1904
|
-
from: X.startOfHalfYear(
|
|
1905
|
-
to: X.endOfHalfYear(
|
|
1961
|
+
from: X.startOfHalfYear(ee),
|
|
1962
|
+
to: X.endOfHalfYear(ee)
|
|
1906
1963
|
},
|
|
1907
1964
|
thisHalfYear: {
|
|
1908
1965
|
label: "Это полугодие",
|
|
@@ -1913,32 +1970,32 @@ var Nn = class {
|
|
|
1913
1970
|
nextHalfYear: {
|
|
1914
1971
|
label: "Следующее полугодие",
|
|
1915
1972
|
group: "halfYear",
|
|
1916
|
-
from: X.startOfHalfYear(
|
|
1917
|
-
to: X.endOfHalfYear(
|
|
1973
|
+
from: X.startOfHalfYear(te),
|
|
1974
|
+
to: X.endOfHalfYear(te)
|
|
1918
1975
|
},
|
|
1919
1976
|
lastYear: {
|
|
1920
1977
|
label: "Прошлый год",
|
|
1921
1978
|
group: "year",
|
|
1922
|
-
from:
|
|
1923
|
-
to:
|
|
1979
|
+
from: A(st(e, 1)),
|
|
1980
|
+
to: Je(st(e, 1))
|
|
1924
1981
|
},
|
|
1925
1982
|
thisYear: {
|
|
1926
1983
|
label: "Этот год",
|
|
1927
1984
|
group: "year",
|
|
1928
1985
|
from: c,
|
|
1929
|
-
to:
|
|
1986
|
+
to: Je(e)
|
|
1930
1987
|
},
|
|
1931
1988
|
nextYear: {
|
|
1932
1989
|
label: "Следующий год",
|
|
1933
1990
|
group: "year",
|
|
1934
|
-
from:
|
|
1935
|
-
to:
|
|
1991
|
+
from: A(Ve(e, 1)),
|
|
1992
|
+
to: Je(Ve(e, 1))
|
|
1936
1993
|
},
|
|
1937
1994
|
fromBeginningOfThisWeek: {
|
|
1938
1995
|
label: "С начала этой недели",
|
|
1939
1996
|
group: "other",
|
|
1940
1997
|
section: "fromBeginning",
|
|
1941
|
-
from:
|
|
1998
|
+
from: k(e, t),
|
|
1942
1999
|
to: r
|
|
1943
2000
|
},
|
|
1944
2001
|
fromBeginningOfThisTenDays: {
|
|
@@ -1981,7 +2038,7 @@ var Nn = class {
|
|
|
1981
2038
|
group: "other",
|
|
1982
2039
|
section: "tillEnd",
|
|
1983
2040
|
from: n,
|
|
1984
|
-
to:
|
|
2041
|
+
to: qe(e, t)
|
|
1985
2042
|
},
|
|
1986
2043
|
tillEndOfThisTenDays: {
|
|
1987
2044
|
label: "До конца этой декады",
|
|
@@ -1995,14 +2052,14 @@ var Nn = class {
|
|
|
1995
2052
|
group: "other",
|
|
1996
2053
|
section: "tillEnd",
|
|
1997
2054
|
from: n,
|
|
1998
|
-
to:
|
|
2055
|
+
to: w(e)
|
|
1999
2056
|
},
|
|
2000
2057
|
tillEndOfThisQuarter: {
|
|
2001
2058
|
label: "До конца этого квартала",
|
|
2002
2059
|
group: "other",
|
|
2003
2060
|
section: "tillEnd",
|
|
2004
2061
|
from: n,
|
|
2005
|
-
to:
|
|
2062
|
+
to: We(e)
|
|
2006
2063
|
},
|
|
2007
2064
|
tillEndOfThisHalfYear: {
|
|
2008
2065
|
label: "До конца этого полугодия",
|
|
@@ -2016,7 +2073,7 @@ var Nn = class {
|
|
|
2016
2073
|
group: "other",
|
|
2017
2074
|
section: "tillEnd",
|
|
2018
2075
|
from: n,
|
|
2019
|
-
to:
|
|
2076
|
+
to: Je(e)
|
|
2020
2077
|
},
|
|
2021
2078
|
lastWeekTillSameWeekDay: {
|
|
2022
2079
|
label: "Прошлая неделя, до такого же дня недели",
|
|
@@ -2034,25 +2091,25 @@ var Nn = class {
|
|
|
2034
2091
|
label: "Прошлый месяц, до такой же даты",
|
|
2035
2092
|
group: "other",
|
|
2036
2093
|
section: "lastTillSame",
|
|
2037
|
-
...X.intervalTillSameDate(a,
|
|
2094
|
+
...X.intervalTillSameDate(a, O(it(e, 1)), e)
|
|
2038
2095
|
},
|
|
2039
2096
|
lastQuarterTillSameDate: {
|
|
2040
2097
|
label: "Прошлый квартал, до такой же даты",
|
|
2041
2098
|
group: "other",
|
|
2042
2099
|
section: "lastTillSame",
|
|
2043
|
-
...X.intervalTillSameDate(o,
|
|
2100
|
+
...X.intervalTillSameDate(o, $e(at(e, 1)), e)
|
|
2044
2101
|
},
|
|
2045
2102
|
lastHalfYearTillSameDate: {
|
|
2046
2103
|
label: "Прошлое полугодие, до такой же даты",
|
|
2047
2104
|
group: "other",
|
|
2048
2105
|
section: "lastTillSame",
|
|
2049
|
-
...X.intervalTillSameDate(s, X.startOfHalfYear(
|
|
2106
|
+
...X.intervalTillSameDate(s, X.startOfHalfYear(ee), e)
|
|
2050
2107
|
},
|
|
2051
2108
|
lastYearTillSameDate: {
|
|
2052
2109
|
label: "Прошлый год, до такой же даты",
|
|
2053
2110
|
group: "other",
|
|
2054
2111
|
section: "lastTillSame",
|
|
2055
|
-
...X.intervalTillSameDate(c,
|
|
2112
|
+
...X.intervalTillSameDate(c, A(st(e, 1)), e)
|
|
2056
2113
|
},
|
|
2057
2114
|
nextWeekTillSameWeekDay: {
|
|
2058
2115
|
label: "Следующая неделя, до такого же дня недели",
|
|
@@ -2070,31 +2127,31 @@ var Nn = class {
|
|
|
2070
2127
|
label: "Следующий месяц, до такой же даты",
|
|
2071
2128
|
group: "other",
|
|
2072
2129
|
section: "nextTillSame",
|
|
2073
|
-
...X.intervalTillSameDate(a,
|
|
2130
|
+
...X.intervalTillSameDate(a, O(S(e, 1)), e)
|
|
2074
2131
|
},
|
|
2075
2132
|
nextQuarterTillSameDate: {
|
|
2076
2133
|
label: "Следующий квартал, до такой же даты",
|
|
2077
2134
|
group: "other",
|
|
2078
2135
|
section: "nextTillSame",
|
|
2079
|
-
...X.intervalTillSameDate(o,
|
|
2136
|
+
...X.intervalTillSameDate(o, $e(ze(e, 1)), e)
|
|
2080
2137
|
},
|
|
2081
2138
|
nextHalfYearTillSameDate: {
|
|
2082
2139
|
label: "Следующее полугодие, до такой же даты",
|
|
2083
2140
|
group: "other",
|
|
2084
2141
|
section: "nextTillSame",
|
|
2085
|
-
...X.intervalTillSameDate(s, X.startOfHalfYear(
|
|
2142
|
+
...X.intervalTillSameDate(s, X.startOfHalfYear(te), e)
|
|
2086
2143
|
},
|
|
2087
2144
|
nextYearTillSameDate: {
|
|
2088
2145
|
label: "Следующий год, до такой же даты",
|
|
2089
2146
|
group: "other",
|
|
2090
2147
|
section: "nextTillSame",
|
|
2091
|
-
...X.intervalTillSameDate(c,
|
|
2148
|
+
...X.intervalTillSameDate(c, A(Ve(e, 1)), e)
|
|
2092
2149
|
},
|
|
2093
2150
|
last7Days: {
|
|
2094
2151
|
label: "Последние 7 дней",
|
|
2095
2152
|
group: "other",
|
|
2096
2153
|
section: "rollingDays",
|
|
2097
|
-
from:
|
|
2154
|
+
from: D(rt(e, 6)),
|
|
2098
2155
|
to: r
|
|
2099
2156
|
},
|
|
2100
2157
|
next7Days: {
|
|
@@ -2102,11 +2159,11 @@ var Nn = class {
|
|
|
2102
2159
|
group: "other",
|
|
2103
2160
|
section: "rollingDays",
|
|
2104
2161
|
from: n,
|
|
2105
|
-
to: x(
|
|
2162
|
+
to: C(x(e, 6))
|
|
2106
2163
|
}
|
|
2107
2164
|
};
|
|
2108
2165
|
}
|
|
2109
|
-
},
|
|
2166
|
+
}, Rn = [
|
|
2110
2167
|
{
|
|
2111
2168
|
key: "day",
|
|
2112
2169
|
label: "День"
|
|
@@ -2139,7 +2196,7 @@ var Nn = class {
|
|
|
2139
2196
|
key: "other",
|
|
2140
2197
|
label: "Прочее"
|
|
2141
2198
|
}
|
|
2142
|
-
],
|
|
2199
|
+
], zn = [
|
|
2143
2200
|
{
|
|
2144
2201
|
key: "fromBeginning",
|
|
2145
2202
|
label: "С начала периода"
|
|
@@ -2160,7 +2217,7 @@ var Nn = class {
|
|
|
2160
2217
|
key: "rollingDays",
|
|
2161
2218
|
label: "7 дней"
|
|
2162
2219
|
}
|
|
2163
|
-
],
|
|
2220
|
+
], Bn = class extends yn {}, Vn = class {
|
|
2164
2221
|
salesDirections;
|
|
2165
2222
|
partnerGroups;
|
|
2166
2223
|
managers;
|
|
@@ -2171,10 +2228,10 @@ var Nn = class {
|
|
|
2171
2228
|
lastLoginDate;
|
|
2172
2229
|
lastOrderDate;
|
|
2173
2230
|
constructor(e) {
|
|
2174
|
-
this.salesDirections =
|
|
2231
|
+
this.salesDirections = b(e?.salesDirections ?? [], (e) => new h(e)), this.partnerGroups = b(e?.partnerGroups ?? [], (e) => new m(e)), this.managers = b(e?.managers ?? [], (e) => new F(e)), this.additionalClients = b(e?.additionalClients ?? [], (e) => new Bn(e)), this.fixedClients = b(e?.fixedClients ?? [], (e) => new Bn(e)), this.regions = b(e?.regions ?? [], (e) => new pe(e)), this.cities = b(e?.cities ?? [], (e) => new n(e)), this.lastLoginDate = new N(e?.lastLoginDate), this.lastOrderDate = new N(e?.lastOrderDate);
|
|
2175
2232
|
}
|
|
2176
2233
|
hasClientConditions() {
|
|
2177
|
-
return
|
|
2234
|
+
return Fe([
|
|
2178
2235
|
this.salesDirections,
|
|
2179
2236
|
this.partnerGroups,
|
|
2180
2237
|
this.managers,
|
|
@@ -2182,33 +2239,33 @@ var Nn = class {
|
|
|
2182
2239
|
this.fixedClients,
|
|
2183
2240
|
this.regions,
|
|
2184
2241
|
this.cities
|
|
2185
|
-
], (e) => !
|
|
2242
|
+
], (e) => !Oe(e)) || Fe([this.lastLoginDate, this.lastOrderDate], (e) => !!e.from || !!e.to);
|
|
2186
2243
|
}
|
|
2187
2244
|
setPeriod(e, t) {
|
|
2188
|
-
return this[e] = new
|
|
2189
|
-
from: t?.from ?
|
|
2190
|
-
to: t?.to ?
|
|
2245
|
+
return this[e] = new N({
|
|
2246
|
+
from: t?.from ? D(t.from) : null,
|
|
2247
|
+
to: t?.to ? C(t.to) : null
|
|
2191
2248
|
}), this;
|
|
2192
2249
|
}
|
|
2193
2250
|
toSaveData() {
|
|
2194
2251
|
return {
|
|
2195
|
-
salesDirections:
|
|
2196
|
-
partnerGroups:
|
|
2197
|
-
managers:
|
|
2198
|
-
additionalClients:
|
|
2199
|
-
regions:
|
|
2200
|
-
cities:
|
|
2201
|
-
lastLoginDate: new
|
|
2202
|
-
lastOrderDate: new
|
|
2252
|
+
salesDirections: b(this.salesDirections, "id"),
|
|
2253
|
+
partnerGroups: b(this.partnerGroups, "id"),
|
|
2254
|
+
managers: b(this.managers, "id"),
|
|
2255
|
+
additionalClients: b(this.additionalClients, "id"),
|
|
2256
|
+
regions: b(this.regions, "id"),
|
|
2257
|
+
cities: b(this.cities, "id"),
|
|
2258
|
+
lastLoginDate: new N(this.lastLoginDate),
|
|
2259
|
+
lastOrderDate: new N(this.lastOrderDate)
|
|
2203
2260
|
};
|
|
2204
2261
|
}
|
|
2205
|
-
},
|
|
2262
|
+
}, Hn = /* @__PURE__ */ function(e) {
|
|
2206
2263
|
return e.Active = "active", e.Scheduled = "scheduled", e.Completed = "completed", e;
|
|
2207
|
-
}({}),
|
|
2264
|
+
}({}), Un = class {
|
|
2208
2265
|
static resolve(e, t = /* @__PURE__ */ new Date()) {
|
|
2209
|
-
return e.deletedAt && e.deletedAt.getTime() <= t.getTime() ?
|
|
2266
|
+
return e.deletedAt && e.deletedAt.getTime() <= t.getTime() ? Hn.Completed : e.publishedAt && e.publishedAt.getTime() > t.getTime() ? Hn.Scheduled : Hn.Active;
|
|
2210
2267
|
}
|
|
2211
|
-
},
|
|
2268
|
+
}, Wn = class extends yt {
|
|
2212
2269
|
conditions;
|
|
2213
2270
|
products;
|
|
2214
2271
|
productCategories;
|
|
@@ -2217,10 +2274,10 @@ var Nn = class {
|
|
|
2217
2274
|
countDiscountedProducts;
|
|
2218
2275
|
countDiscountedClients;
|
|
2219
2276
|
constructor(e) {
|
|
2220
|
-
super(e), this.conditions = new
|
|
2277
|
+
super(e), this.conditions = new Vn(e?.conditions), this.products = b(e?.products ?? [], (e) => new R(e)), this.productCategories = b(e?.productCategories ?? [], (e) => new H(e)), this.countDiscountedPrices = e?.countDiscountedPrices ?? 0, this.expectedCountDiscountedPrices = e?.expectedCountDiscountedPrices ?? 0, this.countDiscountedProducts = e?.countDiscountedProducts ?? 0, this.countDiscountedClients = e?.countDiscountedClients ?? 0;
|
|
2221
2278
|
}
|
|
2222
2279
|
getState(e = /* @__PURE__ */ new Date()) {
|
|
2223
|
-
return
|
|
2280
|
+
return Un.resolve(this, e);
|
|
2224
2281
|
}
|
|
2225
2282
|
assignCounters(e) {
|
|
2226
2283
|
this.countDiscountedPrices = e.countDiscountedPrices, this.expectedCountDiscountedPrices = e.expectedCountDiscountedPrices, this.countDiscountedProducts = e.countDiscountedProducts, this.countDiscountedClients = e.countDiscountedClients;
|
|
@@ -2236,12 +2293,12 @@ var Nn = class {
|
|
|
2236
2293
|
publishedAt: this.publishedAt ?? null,
|
|
2237
2294
|
deletedAt: this.deletedAt ?? null,
|
|
2238
2295
|
description: this.description ?? "",
|
|
2239
|
-
products:
|
|
2240
|
-
productCategories:
|
|
2296
|
+
products: b(this.products, "id"),
|
|
2297
|
+
productCategories: b(this.productCategories, "id"),
|
|
2241
2298
|
conditions: this.conditions.toSaveData()
|
|
2242
2299
|
};
|
|
2243
2300
|
}
|
|
2244
|
-
},
|
|
2301
|
+
}, Gn = class {
|
|
2245
2302
|
client;
|
|
2246
2303
|
additionalClientsCondition;
|
|
2247
2304
|
fixedClientsCondition;
|
|
@@ -2251,12 +2308,12 @@ var Nn = class {
|
|
|
2251
2308
|
regionsCondition;
|
|
2252
2309
|
salesDirectionsCondition;
|
|
2253
2310
|
constructor(e) {
|
|
2254
|
-
this.client = new
|
|
2311
|
+
this.client = new Bn(e?.client), this.additionalClientsCondition = e?.additionalClientsCondition ?? !1, this.fixedClientsCondition = e?.fixedClientsCondition ?? !1, this.partnerGroupsCondition = e?.partnerGroupsCondition ?? !1, this.managersCondition = e?.managersCondition ?? !1, this.citiesCondition = e?.citiesCondition ?? !1, this.regionsCondition = e?.regionsCondition ?? !1, this.salesDirectionsCondition = e?.salesDirectionsCondition ?? !1;
|
|
2255
2312
|
}
|
|
2256
2313
|
isEligible() {
|
|
2257
2314
|
return this.additionalClientsCondition || this.fixedClientsCondition || this.partnerGroupsCondition || this.managersCondition || this.citiesCondition || this.regionsCondition || this.salesDirectionsCondition;
|
|
2258
2315
|
}
|
|
2259
|
-
},
|
|
2316
|
+
}, Kn = class extends j {
|
|
2260
2317
|
id;
|
|
2261
2318
|
name;
|
|
2262
2319
|
states;
|
|
@@ -2271,7 +2328,7 @@ var Nn = class {
|
|
|
2271
2328
|
}
|
|
2272
2329
|
return this;
|
|
2273
2330
|
}
|
|
2274
|
-
},
|
|
2331
|
+
}, qn = class t extends e {
|
|
2275
2332
|
static prepareSaveData(e, t) {
|
|
2276
2333
|
return {
|
|
2277
2334
|
...e,
|
|
@@ -2286,68 +2343,117 @@ var Nn = class {
|
|
|
2286
2343
|
};
|
|
2287
2344
|
}
|
|
2288
2345
|
getDiscountsList(e, t, n, r) {
|
|
2289
|
-
return this.getTypedPaginated(
|
|
2346
|
+
return this.getTypedPaginated(yt, "/internal/price/discounts", e, t, n, {}, void 0, r);
|
|
2290
2347
|
}
|
|
2291
2348
|
getDiscount(e) {
|
|
2292
|
-
return this.get(`/internal/price/discounts/${e}`, {}, (e) => new
|
|
2349
|
+
return this.get(`/internal/price/discounts/${e}`, {}, (e) => new Wn(e.data));
|
|
2293
2350
|
}
|
|
2294
2351
|
createDiscount(e, n, r = {}) {
|
|
2295
|
-
return this.post("/internal/price/discounts", t.prepareSaveData(e, n), (e) => new
|
|
2352
|
+
return this.post("/internal/price/discounts", t.prepareSaveData(e, n), (e) => new Wn(e.data), r);
|
|
2296
2353
|
}
|
|
2297
2354
|
updateDiscount(e, n, r, i = {}) {
|
|
2298
|
-
return this.patch(`/internal/price/discounts/${e}`, t.prepareSaveData(n, r), (e) => new
|
|
2355
|
+
return this.patch(`/internal/price/discounts/${e}`, t.prepareSaveData(n, r), (e) => new Wn(e.data), i);
|
|
2299
2356
|
}
|
|
2300
2357
|
removeDiscount(e) {
|
|
2301
2358
|
return this.delete(`/internal/price/discounts/${e}`);
|
|
2302
2359
|
}
|
|
2303
2360
|
getEligibleClients(e) {
|
|
2304
|
-
return this.getTypedList(
|
|
2361
|
+
return this.getTypedList(Gn, `/internal/price/discounts/${e}/clients`);
|
|
2305
2362
|
}
|
|
2306
2363
|
checkClient(e, t) {
|
|
2307
|
-
return this.get(`/internal/price/discounts/${e}/clients/${t}/check`, {}, (e) => new
|
|
2364
|
+
return this.get(`/internal/price/discounts/${e}/clients/${t}/check`, {}, (e) => new Gn(e.data));
|
|
2365
|
+
}
|
|
2366
|
+
}, Jn = class extends ve {
|
|
2367
|
+
showAllCosts;
|
|
2368
|
+
constructor(e) {
|
|
2369
|
+
super(e), this.showAllCosts = e?.showAllCosts;
|
|
2370
|
+
}
|
|
2371
|
+
}, Yn = class extends j {
|
|
2372
|
+
name;
|
|
2373
|
+
phone;
|
|
2374
|
+
email;
|
|
2375
|
+
isActive;
|
|
2376
|
+
constructor(e) {
|
|
2377
|
+
super(), this.name = e?.name, this.phone = e?.phone, this.email = e?.email, this.isActive = e?.isActive;
|
|
2378
|
+
}
|
|
2379
|
+
resetFilterValue(e) {
|
|
2380
|
+
switch (e) {
|
|
2381
|
+
case "name":
|
|
2382
|
+
case "phone":
|
|
2383
|
+
case "email":
|
|
2384
|
+
case "isActive": this[e] = void 0;
|
|
2385
|
+
}
|
|
2386
|
+
return this;
|
|
2308
2387
|
}
|
|
2309
|
-
},
|
|
2388
|
+
}, Xn = class t extends e {
|
|
2389
|
+
static transformExternalSeoDataToRequest(e) {
|
|
2390
|
+
return {
|
|
2391
|
+
name: e.name,
|
|
2392
|
+
phone: e.phone,
|
|
2393
|
+
email: e.email,
|
|
2394
|
+
password: e.password,
|
|
2395
|
+
isActive: e.isActive,
|
|
2396
|
+
pricingRoleId: e.pricingRole?.id,
|
|
2397
|
+
showAllCosts: e.showAllCosts ?? !1
|
|
2398
|
+
};
|
|
2399
|
+
}
|
|
2400
|
+
getExternalSeoList(e, t, n, r) {
|
|
2401
|
+
return this.getTypedPaginated(ve, "/internal/external-seo", e, t, n, {}, void 0, r);
|
|
2402
|
+
}
|
|
2403
|
+
getExternalSeo(e, t = !1) {
|
|
2404
|
+
return this.get(`/internal/external-seo/${e}`, {}, (e) => new Jn(e.data), t);
|
|
2405
|
+
}
|
|
2406
|
+
createExternalSeo(e, n = {}) {
|
|
2407
|
+
return this.post("/internal/external-seo", t.transformExternalSeoDataToRequest(e), (e) => new Jn(e.data), n);
|
|
2408
|
+
}
|
|
2409
|
+
updateExternalSeo(e, n = {}) {
|
|
2410
|
+
return this.patch(`/internal/external-seo/${e.id}`, t.transformExternalSeoDataToRequest(e), (e) => new Jn(e.data), n);
|
|
2411
|
+
}
|
|
2412
|
+
deleteExternalSeo(e) {
|
|
2413
|
+
return this.delete(`/internal/external-seo/${e}`);
|
|
2414
|
+
}
|
|
2415
|
+
}, Zn = class extends f {
|
|
2310
2416
|
constructor(e) {
|
|
2311
2417
|
super(e);
|
|
2312
2418
|
}
|
|
2313
|
-
},
|
|
2419
|
+
}, Qn = class extends u {
|
|
2314
2420
|
question;
|
|
2315
2421
|
answer;
|
|
2316
2422
|
groups;
|
|
2317
2423
|
constructor(e) {
|
|
2318
|
-
super(e, -1), this.question = e?.question ?? "", this.answer = e?.answer ?? "", this.groups =
|
|
2424
|
+
super(e, -1), this.question = e?.question ?? "", this.answer = e?.answer ?? "", this.groups = b(e?.groups ?? [], (e) => new Zn(e));
|
|
2319
2425
|
}
|
|
2320
2426
|
toSaveData() {
|
|
2321
2427
|
return {
|
|
2322
2428
|
question: this.question,
|
|
2323
2429
|
answer: this.answer,
|
|
2324
|
-
groups:
|
|
2430
|
+
groups: b(this.groups, "id")
|
|
2325
2431
|
};
|
|
2326
2432
|
}
|
|
2327
|
-
},
|
|
2433
|
+
}, $n = class extends e {
|
|
2328
2434
|
getFaqList(e, t) {
|
|
2329
|
-
return this.getTypedPaginated(
|
|
2435
|
+
return this.getTypedPaginated(Qn, "/internal/faq", void 0, void 0, t, v(e) ? {} : { group: e });
|
|
2330
2436
|
}
|
|
2331
2437
|
getFaq(e) {
|
|
2332
|
-
return this.get(`/internal/faq/${e}`, {}, (e) => new
|
|
2438
|
+
return this.get(`/internal/faq/${e}`, {}, (e) => new Qn(e.data));
|
|
2333
2439
|
}
|
|
2334
2440
|
createFaq(e, t = {}) {
|
|
2335
|
-
return this.post("/internal/faq", e, (e) => new
|
|
2441
|
+
return this.post("/internal/faq", e, (e) => new Qn(e.data), t);
|
|
2336
2442
|
}
|
|
2337
2443
|
updateFaq(e, t, n = {}) {
|
|
2338
|
-
return this.patch(`/internal/faq/${e}`, t, (e) => new
|
|
2444
|
+
return this.patch(`/internal/faq/${e}`, t, (e) => new Qn(e.data), n);
|
|
2339
2445
|
}
|
|
2340
2446
|
removeFaq(e) {
|
|
2341
2447
|
return this.delete(`/internal/faq/${e}`);
|
|
2342
2448
|
}
|
|
2343
2449
|
getGroupsList() {
|
|
2344
|
-
return this.getTypedList(
|
|
2450
|
+
return this.getTypedList(Zn, "/internal/faq/groups");
|
|
2345
2451
|
}
|
|
2346
2452
|
createGroup(e, t = {}) {
|
|
2347
|
-
return this.post("/internal/faq/groups", e, (e) => new
|
|
2453
|
+
return this.post("/internal/faq/groups", e, (e) => new Zn(e.data), t);
|
|
2348
2454
|
}
|
|
2349
2455
|
updateGroup(e, t, n = {}) {
|
|
2350
|
-
return this.patch(`/internal/faq/groups/${e}`, t, (e) => new
|
|
2456
|
+
return this.patch(`/internal/faq/groups/${e}`, t, (e) => new Zn(e.data), n);
|
|
2351
2457
|
}
|
|
2352
2458
|
removeGroup(e) {
|
|
2353
2459
|
return this.delete(`/internal/faq/groups/${e}`);
|
|
@@ -2355,13 +2461,13 @@ var Nn = class {
|
|
|
2355
2461
|
};
|
|
2356
2462
|
//#endregion
|
|
2357
2463
|
//#region src/helpers/format-percent-change.ts
|
|
2358
|
-
function
|
|
2359
|
-
let t =
|
|
2464
|
+
function er(e) {
|
|
2465
|
+
let t = Pe(e * 100);
|
|
2360
2466
|
return `${t >= 0 ? "+" : ""}${t}%`;
|
|
2361
2467
|
}
|
|
2362
2468
|
//#endregion
|
|
2363
2469
|
//#region src/helpers/units-helper.ts
|
|
2364
|
-
var
|
|
2470
|
+
var tr = class e {
|
|
2365
2471
|
static productIsMeasurable(e) {
|
|
2366
2472
|
return e.unit.isLinear || e.unit.isSquare;
|
|
2367
2473
|
}
|
|
@@ -2371,9 +2477,9 @@ var Jn = class e {
|
|
|
2371
2477
|
static getProductLengthMultiplicity(e) {
|
|
2372
2478
|
return e.properties?.lengthStep == null ? !e.properties?.ignoreMinCountCheck && e.properties?.minCount != null ? e.properties.minCount : .01 : e.properties.lengthStep;
|
|
2373
2479
|
}
|
|
2374
|
-
},
|
|
2480
|
+
}, nr = class {
|
|
2375
2481
|
static generateUndefinedManagerInstance() {
|
|
2376
|
-
return new
|
|
2482
|
+
return new d({
|
|
2377
2483
|
id: 0,
|
|
2378
2484
|
name: "- Не назначен -",
|
|
2379
2485
|
isActive: !0,
|
|
@@ -2383,7 +2489,7 @@ var Jn = class e {
|
|
|
2383
2489
|
static isUndefinedManagerInstance(e) {
|
|
2384
2490
|
return e.id === 0 && e.guid === "-undefined-";
|
|
2385
2491
|
}
|
|
2386
|
-
},
|
|
2492
|
+
}, rr = class extends j {
|
|
2387
2493
|
name;
|
|
2388
2494
|
phone;
|
|
2389
2495
|
email;
|
|
@@ -2392,7 +2498,7 @@ var Jn = class e {
|
|
|
2392
2498
|
isSupervisor;
|
|
2393
2499
|
canDoReclamations;
|
|
2394
2500
|
constructor(e) {
|
|
2395
|
-
super(), this.name = e?.name, this.phone = e?.phone, this.email = e?.email, this.salesDirections = e?.salesDirections?.map((e) => new
|
|
2501
|
+
super(), this.name = e?.name, this.phone = e?.phone, this.email = e?.email, this.salesDirections = e?.salesDirections?.map((e) => new h(e)), this.isActive = e?.isActive, this.isSupervisor = e?.isSupervisor, this.canDoReclamations = e?.canDoReclamations;
|
|
2396
2502
|
}
|
|
2397
2503
|
resetFilterValue(e) {
|
|
2398
2504
|
switch (e) {
|
|
@@ -2406,7 +2512,7 @@ var Jn = class e {
|
|
|
2406
2512
|
}
|
|
2407
2513
|
return this;
|
|
2408
2514
|
}
|
|
2409
|
-
},
|
|
2515
|
+
}, ir = class e extends ae {
|
|
2410
2516
|
static transformManagerDataToRequest(e) {
|
|
2411
2517
|
return {
|
|
2412
2518
|
name: e.name,
|
|
@@ -2420,37 +2526,37 @@ var Jn = class e {
|
|
|
2420
2526
|
salesDirectionId: e.salesDirection.id,
|
|
2421
2527
|
pricingRoleId: e.pricingRole?.id,
|
|
2422
2528
|
showAllCosts: e.showAllCosts ?? !1,
|
|
2423
|
-
storeIds:
|
|
2424
|
-
curatedDirectionIds:
|
|
2425
|
-
managerRegionIds:
|
|
2426
|
-
managerIds:
|
|
2529
|
+
storeIds: b(e.stores, "id"),
|
|
2530
|
+
curatedDirectionIds: b(e.curatedDirections, "id"),
|
|
2531
|
+
managerRegionIds: b(e.managerRegions, "id"),
|
|
2532
|
+
managerIds: b(e.managers, "id"),
|
|
2427
2533
|
photo: e.photoFile
|
|
2428
2534
|
};
|
|
2429
2535
|
}
|
|
2430
2536
|
getManagersList(e, t, n, r) {
|
|
2431
|
-
return this.getTypedPaginated(
|
|
2537
|
+
return this.getTypedPaginated(d, "/internal/managers", e, t, n, {}, void 0, r);
|
|
2432
2538
|
}
|
|
2433
2539
|
createManager(t, n = {}) {
|
|
2434
|
-
return this.post("/internal/managers", e.transformManagerDataToRequest(t), (e) => new
|
|
2540
|
+
return this.post("/internal/managers", e.transformManagerDataToRequest(t), (e) => new d(e.data), n);
|
|
2435
2541
|
}
|
|
2436
2542
|
updateManager(t, n = {}) {
|
|
2437
|
-
return this.patch(`/internal/managers/${t.id}`, e.transformManagerDataToRequest(t), (e) => new
|
|
2543
|
+
return this.patch(`/internal/managers/${t.id}`, e.transformManagerDataToRequest(t), (e) => new d(e.data), n);
|
|
2438
2544
|
}
|
|
2439
2545
|
getManagerRegionsList(e, t, n) {
|
|
2440
|
-
return this.getTypedPaginated(
|
|
2546
|
+
return this.getTypedPaginated(be, "/internal/managers/regions", e, t, n);
|
|
2441
2547
|
}
|
|
2442
|
-
},
|
|
2548
|
+
}, ar = /* @__PURE__ */ function(e) {
|
|
2443
2549
|
return e.Processing = "processing", e.Completed = "completed", e.Error = "error", e.NeedsActualization = "needs_actualization", e;
|
|
2444
|
-
}({}),
|
|
2550
|
+
}({}), or = class {
|
|
2445
2551
|
status;
|
|
2446
2552
|
actualizedAt;
|
|
2447
2553
|
expiresAt;
|
|
2448
2554
|
error;
|
|
2449
2555
|
constructor(e) {
|
|
2450
|
-
this.status = e?.status ??
|
|
2556
|
+
this.status = e?.status ?? ar.Processing, this.actualizedAt = s.parse(e?.actualizedAt), this.expiresAt = s.parse(e?.expiresAt), this.error = e?.error;
|
|
2451
2557
|
}
|
|
2452
2558
|
get isProcessing() {
|
|
2453
|
-
return this.status ===
|
|
2559
|
+
return this.status === ar.Processing;
|
|
2454
2560
|
}
|
|
2455
2561
|
get isOutdated() {
|
|
2456
2562
|
return this.isOutdatedAt(/* @__PURE__ */ new Date());
|
|
@@ -2459,12 +2565,12 @@ var Jn = class e {
|
|
|
2459
2565
|
return this.isOrderAllowedAt(/* @__PURE__ */ new Date());
|
|
2460
2566
|
}
|
|
2461
2567
|
isOutdatedAt(e) {
|
|
2462
|
-
return this.status !==
|
|
2568
|
+
return this.status !== ar.Completed || v(this.actualizedAt) ? !0 : !v(this.expiresAt) && this.expiresAt.getTime() < e.getTime();
|
|
2463
2569
|
}
|
|
2464
2570
|
isOrderAllowedAt(e) {
|
|
2465
|
-
return this.status ===
|
|
2571
|
+
return this.status === ar.Completed && !this.isOutdatedAt(e);
|
|
2466
2572
|
}
|
|
2467
|
-
},
|
|
2573
|
+
}, sr = class extends M {
|
|
2468
2574
|
name;
|
|
2469
2575
|
client;
|
|
2470
2576
|
sum;
|
|
@@ -2472,9 +2578,9 @@ var Jn = class e {
|
|
|
2472
2578
|
actualization;
|
|
2473
2579
|
file;
|
|
2474
2580
|
constructor(e) {
|
|
2475
|
-
super(e), this.name = e?.name, this.client = new U(e?.client), this.sum = e?.sum, this.isProfstroy = e?.isProfstroy, this.actualization = e?.actualization && new
|
|
2581
|
+
super(e), this.name = e?.name, this.client = new U(e?.client), this.sum = e?.sum, this.isProfstroy = e?.isProfstroy, this.actualization = e?.actualization && new or(e.actualization), this.file = e?.file;
|
|
2476
2582
|
}
|
|
2477
|
-
},
|
|
2583
|
+
}, cr = class extends kt {
|
|
2478
2584
|
groupName;
|
|
2479
2585
|
supplierSku;
|
|
2480
2586
|
isIgnored;
|
|
@@ -2483,24 +2589,24 @@ var Jn = class e {
|
|
|
2483
2589
|
super(e), this.groupName = e.groupName, this.supplierSku = e.supplierSku ?? e.product.supplierSku, this.isIgnored = e.isIgnored, this.lineError = e.lineError;
|
|
2484
2590
|
}
|
|
2485
2591
|
get isProductStub() {
|
|
2486
|
-
return
|
|
2592
|
+
return v(this.product.id);
|
|
2487
2593
|
}
|
|
2488
2594
|
get isOrderable() {
|
|
2489
|
-
return !this.isProductStub && !this.isIgnored &&
|
|
2595
|
+
return !this.isProductStub && !this.isIgnored && Oe(this.lineError);
|
|
2490
2596
|
}
|
|
2491
|
-
}, Z = class extends
|
|
2597
|
+
}, Z = class extends sr {
|
|
2492
2598
|
sum;
|
|
2493
2599
|
products;
|
|
2494
2600
|
constructor(e) {
|
|
2495
|
-
super(e), this.sum = e.sum ?? 0, this.products = (e.products ?? []).map((t) => e.isProfstroy ? new
|
|
2601
|
+
super(e), this.sum = e.sum ?? 0, this.products = (e.products ?? []).map((t) => e.isProfstroy ? new cr(t) : new kt(t));
|
|
2496
2602
|
}
|
|
2497
|
-
},
|
|
2603
|
+
}, lr = class extends j {
|
|
2498
2604
|
id;
|
|
2499
2605
|
clientSearchTerm;
|
|
2500
2606
|
name;
|
|
2501
|
-
createdAt = new
|
|
2607
|
+
createdAt = new N();
|
|
2502
2608
|
constructor(e) {
|
|
2503
|
-
super(), this.id = e?.id, this.clientSearchTerm = e?.clientSearchTerm, this.name = e?.name, this.createdAt = new
|
|
2609
|
+
super(), this.id = e?.id, this.clientSearchTerm = e?.clientSearchTerm, this.name = e?.name, this.createdAt = new N(e?.createdAt);
|
|
2504
2610
|
}
|
|
2505
2611
|
resetFilterValue(e) {
|
|
2506
2612
|
return e === "createdAt" ? (this.createdAt.from = null, this.createdAt.to = null) : this[e] = void 0, this;
|
|
@@ -2509,7 +2615,7 @@ var Jn = class e {
|
|
|
2509
2615
|
let e = super.asClearRaw();
|
|
2510
2616
|
return !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, e;
|
|
2511
2617
|
}
|
|
2512
|
-
},
|
|
2618
|
+
}, ur = class extends Sn {
|
|
2513
2619
|
client;
|
|
2514
2620
|
payment;
|
|
2515
2621
|
delivery;
|
|
@@ -2530,14 +2636,14 @@ var Jn = class e {
|
|
|
2530
2636
|
onlinePaymentLink: e?.payment?.onlinePaymentLink
|
|
2531
2637
|
}, this.delivery = {
|
|
2532
2638
|
type: e?.delivery?.type ?? -1,
|
|
2533
|
-
date:
|
|
2639
|
+
date: y(e?.delivery?.date) ? E(e.delivery.date) : e?.delivery?.date ?? /* @__PURE__ */ new Date(),
|
|
2534
2640
|
address: e?.delivery?.address ? new Y(e.delivery.address) : void 0,
|
|
2535
|
-
warehouse: e?.delivery?.warehouse ? new
|
|
2536
|
-
}, this.attachedUser = e?.attachedUser ? new F(e?.attachedUser) : void 0, this.status = new
|
|
2641
|
+
warehouse: e?.delivery?.warehouse ? new xe(e.delivery.warehouse) : void 0
|
|
2642
|
+
}, this.attachedUser = e?.attachedUser ? new F(e?.attachedUser) : void 0, this.status = new ce(e?.status), this.statusDetail = e?.statusDetail ? new fe(e.statusDetail) : void 0, this.salesDirection = new h(e?.salesDirection);
|
|
2537
2643
|
let t = e?.attachedAt;
|
|
2538
|
-
this.attachedAt =
|
|
2644
|
+
this.attachedAt = y(t) ? E(t) : e?.attachedAt, this.isOnOrder = e?.isOnOrder ?? !1, this.isProfstroy = e?.isProfstroy ?? !1, this.isNotInStock = e?.isNotInStock ?? !1, this.sum = e?.sum ?? 0, this.isLargeOrder = e?.isLargeOrder ?? !1;
|
|
2539
2645
|
}
|
|
2540
|
-
},
|
|
2646
|
+
}, dr = class extends Ot {
|
|
2541
2647
|
product;
|
|
2542
2648
|
cost;
|
|
2543
2649
|
costOne;
|
|
@@ -2551,9 +2657,9 @@ var Jn = class e {
|
|
|
2551
2657
|
changedFields = [];
|
|
2552
2658
|
replacement;
|
|
2553
2659
|
constructor(e, t) {
|
|
2554
|
-
super(e), this.product = new z(e.product), this.currency = new o(e.currency), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing =
|
|
2660
|
+
super(e), this.product = new z(e.product), this.currency = new o(e.currency), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing = Ee(e.sawing) ? e.sawing : e.sawing ? [e.sawing] : void 0, t && (this.replacement = t, this.quantity !== t.quantity && this.changedFields.push("quantity"), this.length !== t.length && this.changedFields.push("length"));
|
|
2555
2661
|
}
|
|
2556
|
-
}, Q = class extends
|
|
2662
|
+
}, Q = class extends ur {
|
|
2557
2663
|
products;
|
|
2558
2664
|
invoices;
|
|
2559
2665
|
comment;
|
|
@@ -2569,11 +2675,11 @@ var Jn = class e {
|
|
|
2569
2675
|
erpOrderUrl;
|
|
2570
2676
|
numberDoc;
|
|
2571
2677
|
constructor(e) {
|
|
2572
|
-
super(e), this.products = (e.products ?? []).map((t) => new
|
|
2678
|
+
super(e), this.products = (e.products ?? []).map((t) => new dr(t, t.replacementId ? e.products?.find((e) => e.id === t.replacementId) : void 0)), this.invoices = e.invoices ?? [], this.comment = e.comment, this.image = e.image, this.contragent = e.contragent ? vn.createInstance(e.contragent) : void 0, this.barcode = e.barcode, this.orderSource = e.orderSource ? new fe(e.orderSource) : void 0, this.isAllowProcessingWithoutPayment = e.isAllowProcessingWithoutPayment, this.nextStatuses = e.nextStatuses?.map((e) => new ce(e)), this.actions = e.actions, this.operatorsComment = e.operatorsComment, this.operatorsForWarehouseComment = e.operatorsForWarehouseComment, this.erpOrderUrl = e.erpOrderUrl, this.numberDoc = e.numberDoc;
|
|
2573
2679
|
}
|
|
2574
|
-
},
|
|
2680
|
+
}, fr = class extends e {
|
|
2575
2681
|
getOffers(e, t, n, r) {
|
|
2576
|
-
return this.getTypedPaginated(
|
|
2682
|
+
return this.getTypedPaginated(sr, "/internal/orders/offers", e, t, n, {}, void 0, r);
|
|
2577
2683
|
}
|
|
2578
2684
|
createOfferFromCart(e, t, n) {
|
|
2579
2685
|
return this.post(`/internal/orders/offers/${e}`, {
|
|
@@ -2603,12 +2709,12 @@ var Jn = class e {
|
|
|
2603
2709
|
return this.delete(`/internal/orders/offers/${e}`);
|
|
2604
2710
|
}
|
|
2605
2711
|
createOrderFromDraft(e, t, n, r = {}) {
|
|
2606
|
-
let i =
|
|
2712
|
+
let i = _().config.dateFormats.api;
|
|
2607
2713
|
return this.post(`/internal/orders/offers/${e}/create-order`, {
|
|
2608
2714
|
...t,
|
|
2609
|
-
deliveryDate: t.deliveryDate ?
|
|
2715
|
+
deliveryDate: t.deliveryDate ? T(t.deliveryDate, i) : void 0,
|
|
2610
2716
|
items: n?.length ? n : void 0
|
|
2611
|
-
}, (e) =>
|
|
2717
|
+
}, (e) => g.instanceListInitializer(Q, e.data), r);
|
|
2612
2718
|
}
|
|
2613
2719
|
addOfferProduct(e, t, n = {}) {
|
|
2614
2720
|
return this.post(`/internal/orders/offers/${e}/products`, {
|
|
@@ -2657,25 +2763,25 @@ var Jn = class e {
|
|
|
2657
2763
|
sendOffer(e, t) {
|
|
2658
2764
|
return this.post(`/internal/orders/offers/${e}/send`, t);
|
|
2659
2765
|
}
|
|
2660
|
-
},
|
|
2766
|
+
}, pr = class {
|
|
2661
2767
|
static isProfstroy(e) {
|
|
2662
2768
|
return !!e?.isProfstroy;
|
|
2663
2769
|
}
|
|
2664
2770
|
static isProfstroyOffer(e) {
|
|
2665
|
-
return !
|
|
2771
|
+
return !v(e) && e.isProfstroy === !0 && !v(e.actualization);
|
|
2666
2772
|
}
|
|
2667
|
-
},
|
|
2773
|
+
}, mr = class extends ve {
|
|
2668
2774
|
isBillingSupervisor;
|
|
2669
2775
|
constructor(e) {
|
|
2670
2776
|
super(e), this.isBillingSupervisor = e?.isBillingSupervisor ?? !1;
|
|
2671
2777
|
}
|
|
2672
|
-
},
|
|
2778
|
+
}, hr = class extends mr {
|
|
2673
2779
|
showAllCosts;
|
|
2674
2780
|
stores;
|
|
2675
2781
|
constructor(e) {
|
|
2676
|
-
super(e), this.showAllCosts = e?.showAllCosts, this.stores = e?.stores?.map((e) => new
|
|
2782
|
+
super(e), this.showAllCosts = e?.showAllCosts, this.stores = e?.stores?.map((e) => new he(e));
|
|
2677
2783
|
}
|
|
2678
|
-
},
|
|
2784
|
+
}, gr = class extends j {
|
|
2679
2785
|
name;
|
|
2680
2786
|
phone;
|
|
2681
2787
|
email;
|
|
@@ -2684,7 +2790,7 @@ var Jn = class e {
|
|
|
2684
2790
|
isBillingSupervisor;
|
|
2685
2791
|
canDoReclamations;
|
|
2686
2792
|
constructor(e) {
|
|
2687
|
-
super(), this.name = e?.name, this.phone = e?.phone, this.email = e?.email, this.salesDirections = e?.salesDirections?.map((e) => new
|
|
2793
|
+
super(), this.name = e?.name, this.phone = e?.phone, this.email = e?.email, this.salesDirections = e?.salesDirections?.map((e) => new h(e)), this.isActive = e?.isActive, this.isBillingSupervisor = e?.isBillingSupervisor, this.canDoReclamations = e?.canDoReclamations;
|
|
2688
2794
|
}
|
|
2689
2795
|
resetFilterValue(e) {
|
|
2690
2796
|
switch (e) {
|
|
@@ -2698,7 +2804,7 @@ var Jn = class e {
|
|
|
2698
2804
|
}
|
|
2699
2805
|
return this;
|
|
2700
2806
|
}
|
|
2701
|
-
},
|
|
2807
|
+
}, _r = class t extends e {
|
|
2702
2808
|
static transformOperatorDataToRequest(e) {
|
|
2703
2809
|
return {
|
|
2704
2810
|
name: e.name,
|
|
@@ -2711,25 +2817,25 @@ var Jn = class e {
|
|
|
2711
2817
|
salesDirectionId: e.salesDirection?.id,
|
|
2712
2818
|
pricingRoleId: e.pricingRole?.id,
|
|
2713
2819
|
showAllCosts: e.showAllCosts ?? !1,
|
|
2714
|
-
storeIds:
|
|
2820
|
+
storeIds: b(e.stores, "id"),
|
|
2715
2821
|
photo: e.photoFile
|
|
2716
2822
|
};
|
|
2717
2823
|
}
|
|
2718
2824
|
getOperatorsList(e, t, n, r) {
|
|
2719
|
-
return this.getTypedPaginated(
|
|
2825
|
+
return this.getTypedPaginated(mr, "/internal/operators", e, t, n, {}, void 0, r);
|
|
2720
2826
|
}
|
|
2721
2827
|
getOperator(e, t = !1) {
|
|
2722
|
-
return this.get(`/internal/operators/${e}`, {}, (e) => new
|
|
2828
|
+
return this.get(`/internal/operators/${e}`, {}, (e) => new hr(e.data), t);
|
|
2723
2829
|
}
|
|
2724
2830
|
createOperator(e, n = {}) {
|
|
2725
|
-
return this.post("/internal/operators", t.transformOperatorDataToRequest(e), (e) => new
|
|
2831
|
+
return this.post("/internal/operators", t.transformOperatorDataToRequest(e), (e) => new hr(e.data), n);
|
|
2726
2832
|
}
|
|
2727
2833
|
updateOperator(e, n = {}) {
|
|
2728
|
-
return this.patch(`/internal/operators/${e.id}`, t.transformOperatorDataToRequest(e), (e) => new
|
|
2834
|
+
return this.patch(`/internal/operators/${e.id}`, t.transformOperatorDataToRequest(e), (e) => new hr(e.data), n);
|
|
2729
2835
|
}
|
|
2730
|
-
},
|
|
2836
|
+
}, vr = /* @__PURE__ */ function(e) {
|
|
2731
2837
|
return e.View = "view", e.Share = "share", e.EditTags = "edit_tags", e.SaveOrderIgnoredProducts = "save_order_ignored_products", e.ChangeStatus = "change_status", e.ChangeProducts = "change_products", e.ChangeOrderParameters = "change_order_parameters", e.Recalculate = "recalculate", e.AttachOrder = "attach_order", e.DetachOrder = "detach_order", e.ChangeAttachedOperator = "change_attached_operator", e.SendOnlinePaymentLink = "send_online_payment_link", e.ConfirmOnlineFullPayment = "confirm_online_full_payment", e.MergeOrders = "merge_orders", e.GetHistory = "get_history", e.CloneOrder = "clone_order", e.DeleteAttachedFile = "delete_attached_file", e;
|
|
2732
|
-
}({}),
|
|
2838
|
+
}({}), yr = class {
|
|
2733
2839
|
paymentType;
|
|
2734
2840
|
deliveryType;
|
|
2735
2841
|
contragentId;
|
|
@@ -2747,21 +2853,21 @@ var Jn = class e {
|
|
|
2747
2853
|
constructor(e) {
|
|
2748
2854
|
this.paymentType = e?.payment.type, this.deliveryType = e?.delivery.type, this.contragentId = e?.contragent?.id, this.deliveryDate = e?.delivery.date ? new Date(e.delivery.date) : void 0, this.addressId = e?.delivery.address?.id, this.warehouseId = e?.delivery.warehouse?.id, this.comment = e?.comment, this.barcode = e?.barcode, this.operatorsComment = e?.operatorsComment, this.operatorsForWarehouseComment = e?.operatorsForWarehouseComment, this.isAllowProcessingWithoutPayment = e?.isAllowProcessingWithoutPayment;
|
|
2749
2855
|
}
|
|
2750
|
-
},
|
|
2856
|
+
}, br = class extends j {
|
|
2751
2857
|
attachedUsers;
|
|
2752
2858
|
clientSearchTerm;
|
|
2753
2859
|
client;
|
|
2754
2860
|
contragent;
|
|
2755
|
-
createdAt = new
|
|
2861
|
+
createdAt = new N();
|
|
2756
2862
|
creator;
|
|
2757
|
-
deliveryDate = new
|
|
2863
|
+
deliveryDate = new N();
|
|
2758
2864
|
deliveryAddressSearch;
|
|
2759
2865
|
clientCities;
|
|
2760
2866
|
id;
|
|
2761
2867
|
isApproved;
|
|
2762
2868
|
isNotInStock;
|
|
2763
2869
|
isOnOrder;
|
|
2764
|
-
attachedAt = new
|
|
2870
|
+
attachedAt = new N();
|
|
2765
2871
|
salesDirections;
|
|
2766
2872
|
status;
|
|
2767
2873
|
statusDetail;
|
|
@@ -2772,7 +2878,7 @@ var Jn = class e {
|
|
|
2772
2878
|
isToProcess;
|
|
2773
2879
|
onlyMyRegions;
|
|
2774
2880
|
constructor(e) {
|
|
2775
|
-
super(), this.attachedUsers = e?.attachedUsers?.map((e) => "isActive" in e ? new
|
|
2881
|
+
super(), this.attachedUsers = e?.attachedUsers?.map((e) => "isActive" in e ? new d(e) : new oe(e)), this.clientSearchTerm = e?.clientSearchTerm, this.client = e?.client ? new U(e.client) : void 0, this.contragent = e?.contragent, this.createdAt = new N(e?.createdAt), this.creator = e?.creator ? new F(e.creator) : void 0, this.deliveryDate = new N(e?.deliveryDate), this.deliveryAddressSearch = e?.deliveryAddressSearch, this.clientCities = e?.clientCities?.map((e) => new n(e)), this.id = e?.id, this.isApproved = e?.isApproved, this.isNotInStock = e?.isNotInStock, this.isOnOrder = e?.isOnOrder, this.isLargeOrder = e?.isLargeOrder, this.attachedAt = new N(e?.attachedAt), this.salesDirections = e?.salesDirections?.map((e) => new h(e)), this.status = e?.status, this.statusDetail = e?.statusDetail, this.deliveryType = e?.deliveryType ? new c(e.deliveryType) : void 0, this.paymentType = e?.paymentType ? new le(e.paymentType) : void 0, this.warehouses = e?.warehouses?.map((e) => new xe(e)), this.isToProcess = e?.isToProcess;
|
|
2776
2882
|
}
|
|
2777
2883
|
resetFilterValue(e) {
|
|
2778
2884
|
switch (e) {
|
|
@@ -2813,22 +2919,22 @@ var Jn = class e {
|
|
|
2813
2919
|
let e = super.asClearRaw();
|
|
2814
2920
|
return !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, !e?.deliveryDate?.from && !e?.deliveryDate?.to && delete e.deliveryDate, !e?.attachedAt?.from && !e?.attachedAt?.to && delete e.attachedAt, e;
|
|
2815
2921
|
}
|
|
2816
|
-
},
|
|
2922
|
+
}, xr = class {
|
|
2817
2923
|
user;
|
|
2818
2924
|
status;
|
|
2819
2925
|
statusDetail;
|
|
2820
2926
|
createdAt;
|
|
2821
2927
|
constructor(e) {
|
|
2822
|
-
this.user = new F(e?.user), this.status = new
|
|
2928
|
+
this.user = new F(e?.user), this.status = new ce(e?.status), this.statusDetail = e?.statusDetail ? new fe(e.statusDetail) : void 0;
|
|
2823
2929
|
let t = e?.createdAt;
|
|
2824
|
-
this.createdAt =
|
|
2930
|
+
this.createdAt = y(t) ? E(t) : e?.createdAt ?? /* @__PURE__ */ new Date();
|
|
2825
2931
|
}
|
|
2826
|
-
},
|
|
2932
|
+
}, Sr = class extends e {
|
|
2827
2933
|
getOrders(e, t, n, r) {
|
|
2828
|
-
return this.getTypedPaginated(
|
|
2934
|
+
return this.getTypedPaginated(ur, "/internal/orders", e, t, n, {}, void 0, r);
|
|
2829
2935
|
}
|
|
2830
2936
|
getOrdersCount(e, t) {
|
|
2831
|
-
return this.get("/internal/orders/count", e ? { filters: JSON.stringify((e instanceof
|
|
2937
|
+
return this.get("/internal/orders/count", e ? { filters: JSON.stringify((e instanceof te ? e : new te(e)).toPrimitive()) } : {}, void 0, void 0, t).then((e) => e.count);
|
|
2832
2938
|
}
|
|
2833
2939
|
getClientOrderStatistics(e, t) {
|
|
2834
2940
|
return this.get(`/internal/clients/${e}/orders/statistics`, t ? { period: t } : {});
|
|
@@ -2837,12 +2943,12 @@ var Jn = class e {
|
|
|
2837
2943
|
return this.get(`/internal/orders/${e}`, {}, (e) => new Q(e.data));
|
|
2838
2944
|
}
|
|
2839
2945
|
createClientOrder(e, t, n, r = {}) {
|
|
2840
|
-
let i =
|
|
2946
|
+
let i = _().config.dateFormats.api;
|
|
2841
2947
|
return this.post(`/internal/clients/${e}/orders`, {
|
|
2842
2948
|
...t,
|
|
2843
|
-
deliveryDate:
|
|
2949
|
+
deliveryDate: T(t.deliveryDate, i),
|
|
2844
2950
|
items: n?.length ? n : void 0
|
|
2845
|
-
}, (e) =>
|
|
2951
|
+
}, (e) => g.instanceListInitializer(Q, e.data), r);
|
|
2846
2952
|
}
|
|
2847
2953
|
attachOrder(e) {
|
|
2848
2954
|
return this.patch(`/internal/orders/${e}/attach`, {}, (e) => new Q(e.data));
|
|
@@ -2860,10 +2966,10 @@ var Jn = class e {
|
|
|
2860
2966
|
return this.get(`/internal/orders/${e}/clone`, {});
|
|
2861
2967
|
}
|
|
2862
2968
|
updateOrder(e, t, n = {}) {
|
|
2863
|
-
let r =
|
|
2969
|
+
let r = _().config.dateFormats.api;
|
|
2864
2970
|
return this.patch(`/internal/orders/${e}`, {
|
|
2865
2971
|
...t,
|
|
2866
|
-
deliveryDate: t.deliveryDate ?
|
|
2972
|
+
deliveryDate: t.deliveryDate ? T(t.deliveryDate, r) : void 0
|
|
2867
2973
|
}, (e) => new Q(e.data), n);
|
|
2868
2974
|
}
|
|
2869
2975
|
addOrderProduct(e, t, n = {}) {
|
|
@@ -2890,7 +2996,7 @@ var Jn = class e {
|
|
|
2890
2996
|
return this.patch(`/internal/orders/${e}/status`, { statusDetail: t }, (e) => new Q(e.data));
|
|
2891
2997
|
}
|
|
2892
2998
|
getOrderStatusHistory(e) {
|
|
2893
|
-
return this.getTypedList(
|
|
2999
|
+
return this.getTypedList(xr, `/internal/orders/${e}/history`);
|
|
2894
3000
|
}
|
|
2895
3001
|
getOrderPrintHtml(e, t) {
|
|
2896
3002
|
return this.get(`/internal/orders/${e}/print/view`, { ...t }, (e) => new Blob([e.data], { type: "text/html" }));
|
|
@@ -2931,51 +3037,51 @@ var Jn = class e {
|
|
|
2931
3037
|
return this.get(`/internal/orders/self-delivery/${e}/nearest-dates`, {}, (e) => e.data, void 0, t);
|
|
2932
3038
|
}
|
|
2933
3039
|
getDeliveryCost(e, t, n, r) {
|
|
2934
|
-
let i =
|
|
3040
|
+
let i = _().config.dateFormats.api;
|
|
2935
3041
|
return this.get(`/internal/orders/delivery/${e}/cost`, {
|
|
2936
|
-
date:
|
|
3042
|
+
date: T(t, i),
|
|
2937
3043
|
warehouse_id: n
|
|
2938
3044
|
}, (e) => e.data, void 0, r);
|
|
2939
3045
|
}
|
|
2940
|
-
},
|
|
3046
|
+
}, Cr = Symbol("currentOrder"), wr = class {
|
|
2941
3047
|
client;
|
|
2942
3048
|
product;
|
|
2943
3049
|
cost;
|
|
2944
3050
|
costCoefficient;
|
|
2945
3051
|
source;
|
|
2946
3052
|
constructor(e) {
|
|
2947
|
-
this.client = new U(e?.client), this.product = new R(e?.product), this.cost = e?.cost ?? 0, this.costCoefficient = e?.costCoefficient ?? 0, this.source = e?.source ??
|
|
3053
|
+
this.client = new U(e?.client), this.product = new R(e?.product), this.cost = e?.cost ?? 0, this.costCoefficient = e?.costCoefficient ?? 0, this.source = e?.source ?? Dt.Product;
|
|
2948
3054
|
}
|
|
2949
|
-
},
|
|
3055
|
+
}, Tr = (e) => e ? Ne({
|
|
2950
3056
|
cities: e.cities?.map((e) => e.id),
|
|
2951
3057
|
clients: e.clients?.map((e) => e.id),
|
|
2952
3058
|
managers: e.managers?.map((e) => e.id),
|
|
2953
3059
|
partnerGroups: e.partnerGroups?.map((e) => e.id),
|
|
2954
3060
|
salesDirections: e.salesDirections?.map((e) => e.id),
|
|
2955
3061
|
hideNotActive: e.hideNotActive
|
|
2956
|
-
}, (e) =>
|
|
3062
|
+
}, (e) => v(e) || (Ee(e) || Ae(e)) && Oe(e)) : {}, Er = (e) => {
|
|
2957
3063
|
let t = {};
|
|
2958
3064
|
return e.from && (e.from.coefficient || e.from.value) && (t.from = {}, e.from.coefficient && (t.from.priceCoefficientId = e.from.coefficient.id), e.from.value && (t.from.increasePercent = e.from.value)), e.to && (e.to.coefficient || e.to.value) && (t.to = {}, e.to.coefficient && (t.to.priceCoefficientId = e.to.coefficient.id), e.to.value && (t.to.increasePercent = e.to.value)), t;
|
|
2959
|
-
},
|
|
3065
|
+
}, Dr = class extends l {
|
|
2960
3066
|
analyzeProductPrices(e, t, n) {
|
|
2961
3067
|
return this.get(`/internal/price/products/${e}/analyze`, {
|
|
2962
|
-
...
|
|
2963
|
-
filters:
|
|
2964
|
-
}, (e) =>
|
|
3068
|
+
...Er(t),
|
|
3069
|
+
filters: Tr(n)
|
|
3070
|
+
}, (e) => g.instanceListInitializer(wr, e.data));
|
|
2965
3071
|
}
|
|
2966
3072
|
analyzeCategoryPrices(e, t, n) {
|
|
2967
3073
|
return this.get(`/internal/price/categories/${e}/analyze`, {
|
|
2968
|
-
...
|
|
2969
|
-
filters:
|
|
2970
|
-
}, (e) =>
|
|
3074
|
+
...Er(t),
|
|
3075
|
+
filters: Tr(n)
|
|
3076
|
+
}, (e) => g.instanceListInitializer(wr, e.data));
|
|
2971
3077
|
}
|
|
2972
3078
|
analyzeCategoryPricesBySquare(e, t, n) {
|
|
2973
3079
|
return this.get(`/internal/price/categories/${e}/analyze/square`, {
|
|
2974
3080
|
...t,
|
|
2975
|
-
filters:
|
|
2976
|
-
}, (e) =>
|
|
3081
|
+
filters: Tr(n)
|
|
3082
|
+
}, (e) => g.instanceListInitializer(wr, e.data));
|
|
2977
3083
|
}
|
|
2978
|
-
},
|
|
3084
|
+
}, Or = class {
|
|
2979
3085
|
cost;
|
|
2980
3086
|
isLowCost;
|
|
2981
3087
|
isRetail;
|
|
@@ -2987,43 +3093,43 @@ var Jn = class e {
|
|
|
2987
3093
|
executor;
|
|
2988
3094
|
currency;
|
|
2989
3095
|
constructor(e) {
|
|
2990
|
-
this.cost = e.cost ?? 0, this.isLowCost = e.isLowCost ?? !1, this.isRetail = e.isRetail ?? !1, this.costDate =
|
|
3096
|
+
this.cost = e.cost ?? 0, this.isLowCost = e.isLowCost ?? !1, this.isRetail = e.isRetail ?? !1, this.costDate = y(e.costDate) ? E(e.costDate) : e.costDate ?? /* @__PURE__ */ new Date(), this.discountName = e.discountName, this.priceTemplateName = e.priceTemplateName, this.product = e.product ? new L(e.product) : void 0, this.client = e.client ? new F(e.client) : void 0, this.executor = e.executor ? new F(e.executor) : void 0, this.currency = e.currency ? new o(e.currency) : void 0;
|
|
2991
3097
|
}
|
|
2992
|
-
},
|
|
3098
|
+
}, kr = class extends L {
|
|
2993
3099
|
history;
|
|
2994
3100
|
constructor(e) {
|
|
2995
|
-
super(e), this.history =
|
|
3101
|
+
super(e), this.history = b(e.history, (e) => new Or(e));
|
|
2996
3102
|
}
|
|
2997
|
-
},
|
|
3103
|
+
}, Ar = class extends l {
|
|
2998
3104
|
getProductPriceHistory(e) {
|
|
2999
|
-
let t =
|
|
3000
|
-
from:
|
|
3001
|
-
to:
|
|
3002
|
-
} }), (e) =>
|
|
3003
|
-
return delete n.product, this.get(`/internal/price/products/${r}/history`, n).then((e) => [new
|
|
3105
|
+
let t = _().config.dateFormats.api, n = Ne(Me(e, { costDate: {
|
|
3106
|
+
from: De(e.costDate?.from) ? T(e.costDate.from, t) : e.costDate?.from,
|
|
3107
|
+
to: De(e.costDate?.to) ? T(e.costDate.to, t) : e.costDate?.to
|
|
3108
|
+
} }), (e) => v(e) || (Ee(e) || Ae(e)) && Oe(e)), r = e.product?.[0] ?? 0;
|
|
3109
|
+
return delete n.product, this.get(`/internal/price/products/${r}/history`, n).then((e) => [new kr(Me(e[0], { history: e }))]);
|
|
3004
3110
|
}
|
|
3005
|
-
},
|
|
3111
|
+
}, jr = class {
|
|
3006
3112
|
createdAt;
|
|
3007
3113
|
creator;
|
|
3008
3114
|
files;
|
|
3009
3115
|
text;
|
|
3010
3116
|
status;
|
|
3011
3117
|
constructor(e) {
|
|
3012
|
-
this.createdAt = s.parse(e?.createdAt) ?? /* @__PURE__ */ new Date(), this.creator =
|
|
3118
|
+
this.createdAt = s.parse(e?.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = v(e?.creator) ? void 0 : new F(e.creator), this.files = e?.files ?? [], this.text = e?.text ?? void 0, this.status = e?.status ?? void 0;
|
|
3013
3119
|
}
|
|
3014
3120
|
isStatusChanged() {
|
|
3015
|
-
return !
|
|
3121
|
+
return !v(this.status);
|
|
3016
3122
|
}
|
|
3017
3123
|
}, $ = /* @__PURE__ */ function(e) {
|
|
3018
3124
|
return e[e.Initiated = 1] = "Initiated", e[e.InfoRequired = 2] = "InfoRequired", e[e.Pending = 3] = "Pending", e[e.Completed = 4] = "Completed", e;
|
|
3019
|
-
}({}),
|
|
3125
|
+
}({}), Mr = class extends M {
|
|
3020
3126
|
status;
|
|
3021
3127
|
closedAt;
|
|
3022
3128
|
isRead;
|
|
3023
3129
|
isDeleted;
|
|
3024
3130
|
client;
|
|
3025
3131
|
constructor(e) {
|
|
3026
|
-
super(e), this.status = e?.status ?? $.Initiated, this.closedAt = s.parse(e?.closedAt), this.isRead = e?.isRead ?? !1, this.isDeleted = e?.isDeleted ?? !1, this.client = new
|
|
3132
|
+
super(e), this.status = e?.status ?? $.Initiated, this.closedAt = s.parse(e?.closedAt), this.isRead = e?.isRead ?? !1, this.isDeleted = e?.isDeleted ?? !1, this.client = new yn(e?.client);
|
|
3027
3133
|
}
|
|
3028
3134
|
isClosed() {
|
|
3029
3135
|
return this.status === $.Completed;
|
|
@@ -3035,17 +3141,17 @@ var Jn = class e {
|
|
|
3035
3141
|
return !this.isClosed();
|
|
3036
3142
|
}
|
|
3037
3143
|
getConsiderationDays(e = /* @__PURE__ */ new Date()) {
|
|
3038
|
-
return Math.max(
|
|
3144
|
+
return Math.max(He(this.closedAt ?? e, this.createdAt), 0);
|
|
3039
3145
|
}
|
|
3040
|
-
},
|
|
3146
|
+
}, Nr = class extends Mr {
|
|
3041
3147
|
items;
|
|
3042
3148
|
constructor(e) {
|
|
3043
|
-
super(e), this.items =
|
|
3149
|
+
super(e), this.items = b(e?.items ?? [], (e) => new jr(e));
|
|
3044
3150
|
}
|
|
3045
3151
|
isClientMessage(e) {
|
|
3046
3152
|
return e.creator?.id === this.client.id;
|
|
3047
3153
|
}
|
|
3048
|
-
},
|
|
3154
|
+
}, Pr = class extends j {
|
|
3049
3155
|
id;
|
|
3050
3156
|
statuses;
|
|
3051
3157
|
createdAt;
|
|
@@ -3058,7 +3164,7 @@ var Jn = class e {
|
|
|
3058
3164
|
super(), this.id = {
|
|
3059
3165
|
from: e?.id?.from ?? null,
|
|
3060
3166
|
to: e?.id?.to ?? null
|
|
3061
|
-
}, this.statuses = e?.statuses, this.createdAt = new
|
|
3167
|
+
}, this.statuses = e?.statuses, this.createdAt = new N(e?.createdAt), this.closedAt = new N(e?.closedAt), this.isRead = e?.isRead, this.isDeleted = e?.isDeleted, this.clientName = e?.clientName, this.cityName = e?.cityName;
|
|
3062
3168
|
}
|
|
3063
3169
|
resetFilterValue(e) {
|
|
3064
3170
|
switch (e) {
|
|
@@ -3081,7 +3187,7 @@ var Jn = class e {
|
|
|
3081
3187
|
}
|
|
3082
3188
|
return this;
|
|
3083
3189
|
}
|
|
3084
|
-
},
|
|
3190
|
+
}, Fr = class e {
|
|
3085
3191
|
static apiCodes = {
|
|
3086
3192
|
[$.Initiated]: "initiated",
|
|
3087
3193
|
[$.InfoRequired]: "info_required",
|
|
@@ -3092,23 +3198,23 @@ var Jn = class e {
|
|
|
3092
3198
|
return e.apiCodes[t];
|
|
3093
3199
|
}
|
|
3094
3200
|
static toApiCodes(t) {
|
|
3095
|
-
return
|
|
3201
|
+
return b(t, (t) => e.toApiCode(t));
|
|
3096
3202
|
}
|
|
3097
|
-
},
|
|
3203
|
+
}, Ir = class extends e {
|
|
3098
3204
|
getReclamationsList(e, t, n, r, i = !1) {
|
|
3099
|
-
return this.getTypedPaginated(
|
|
3205
|
+
return this.getTypedPaginated(Mr, "/internal/reclamations", e, t, n, {}, i, r);
|
|
3100
3206
|
}
|
|
3101
3207
|
getReclamation(e, t, n = !1) {
|
|
3102
|
-
return this.get(`/internal/reclamations/${e}`, {}, (e) => new
|
|
3208
|
+
return this.get(`/internal/reclamations/${e}`, {}, (e) => new Nr(e.data), n, t);
|
|
3103
3209
|
}
|
|
3104
3210
|
createMessage(e, t, n = {}) {
|
|
3105
|
-
return this.post(`/internal/reclamations/${e}/messages`, t, (e) => new
|
|
3211
|
+
return this.post(`/internal/reclamations/${e}/messages`, t, (e) => new Nr(e.data), n);
|
|
3106
3212
|
}
|
|
3107
3213
|
deleteReclamation(e) {
|
|
3108
3214
|
return this.delete(`/internal/reclamations/${e}`);
|
|
3109
3215
|
}
|
|
3110
3216
|
restoreReclamation(e) {
|
|
3111
|
-
return this.post(`/internal/reclamations/${e}/restore`, {}, (e) => new
|
|
3217
|
+
return this.post(`/internal/reclamations/${e}/restore`, {}, (e) => new Nr(e.data));
|
|
3112
3218
|
}
|
|
3113
3219
|
downloadReclamation(e, t = !1) {
|
|
3114
3220
|
return this.getBlob(`/internal/reclamations/${e}/download`, {}, (e) => new Blob([e.request.response], { type: "application/pdf" }), t);
|
|
@@ -3116,18 +3222,18 @@ var Jn = class e {
|
|
|
3116
3222
|
getUpdates(e, t = !1) {
|
|
3117
3223
|
return this.get("/internal/reclamations/updates", {}, void 0, t, e);
|
|
3118
3224
|
}
|
|
3119
|
-
},
|
|
3225
|
+
}, Lr = class {
|
|
3120
3226
|
products = [];
|
|
3121
3227
|
productCategories = [];
|
|
3122
3228
|
constructor(e) {
|
|
3123
3229
|
e?.products && (this.products = e.products.map((e) => new L(e))), e?.productCategories && (this.productCategories = e.productCategories.map((e) => new L(e)));
|
|
3124
3230
|
}
|
|
3125
|
-
},
|
|
3231
|
+
}, Rr = class extends l {
|
|
3126
3232
|
getProductCategoryRecommendations(e) {
|
|
3127
|
-
return this.get(`/internal/catalog/recommendations/categories/${e.id}`, {}, (e) => new
|
|
3233
|
+
return this.get(`/internal/catalog/recommendations/categories/${e.id}`, {}, (e) => new Lr(e.data));
|
|
3128
3234
|
}
|
|
3129
3235
|
getProductRecommendations(e) {
|
|
3130
|
-
return this.get(`/internal/catalog/recommendations/products/${e.id}`, {}, (e) => new
|
|
3236
|
+
return this.get(`/internal/catalog/recommendations/products/${e.id}`, {}, (e) => new Lr(e.data));
|
|
3131
3237
|
}
|
|
3132
3238
|
saveProductCategoryRecommendations(e, t) {
|
|
3133
3239
|
return this.post(`/internal/catalog/recommendations/categories/${e.id}`, {
|
|
@@ -3141,7 +3247,7 @@ var Jn = class e {
|
|
|
3141
3247
|
products: t.products.map((e) => e.id)
|
|
3142
3248
|
});
|
|
3143
3249
|
}
|
|
3144
|
-
},
|
|
3250
|
+
}, zr = class {
|
|
3145
3251
|
static generateUndefinedInstance(e, t = "- Не определён -") {
|
|
3146
3252
|
return new e({
|
|
3147
3253
|
id: 0,
|
|
@@ -3152,13 +3258,13 @@ var Jn = class e {
|
|
|
3152
3258
|
static isUndefinedInstance(e) {
|
|
3153
3259
|
return e.id === 0 && e.slug === "-undefined-";
|
|
3154
3260
|
}
|
|
3155
|
-
},
|
|
3261
|
+
}, Br = class {
|
|
3156
3262
|
name;
|
|
3157
3263
|
content;
|
|
3158
3264
|
constructor(e) {
|
|
3159
3265
|
this.name = e.name, this.content = e.content;
|
|
3160
3266
|
}
|
|
3161
|
-
},
|
|
3267
|
+
}, Vr = class {
|
|
3162
3268
|
resourceType;
|
|
3163
3269
|
resourceId;
|
|
3164
3270
|
h1;
|
|
@@ -3168,42 +3274,42 @@ var Jn = class e {
|
|
|
3168
3274
|
meta;
|
|
3169
3275
|
tags;
|
|
3170
3276
|
constructor(e) {
|
|
3171
|
-
this.resourceType = new
|
|
3277
|
+
this.resourceType = new me(e?.resourceType), this.resourceId = e?.resourceId ?? "", this.h1 = e?.h1, this.title = e?.title, this.description = e?.description, this.keywords = e?.keywords, this.meta = e?.meta?.map((e) => new Br(e)) ?? [], this.tags = e?.tags;
|
|
3172
3278
|
}
|
|
3173
|
-
},
|
|
3279
|
+
}, Hr = class extends l {
|
|
3174
3280
|
getResourceSeoData(e, t) {
|
|
3175
|
-
return this.get(`/internal/seo/${e.slug}/${t}`, {}, (e) => new
|
|
3281
|
+
return this.get(`/internal/seo/${e.slug}/${t}`, {}, (e) => new Vr(e.data));
|
|
3176
3282
|
}
|
|
3177
3283
|
saveResourceSeoData(e, t = {}) {
|
|
3178
|
-
return this.post(`/internal/seo/${e.resourceType.slug}/${e.resourceId}`, e, (e) => new
|
|
3284
|
+
return this.post(`/internal/seo/${e.resourceType.slug}/${e.resourceId}`, e, (e) => new Vr(e.data), t);
|
|
3179
3285
|
}
|
|
3180
3286
|
deleteResourceSeoData(e, t) {
|
|
3181
3287
|
return this.delete(`/internal/seo/${e.slug}/${t}`);
|
|
3182
3288
|
}
|
|
3183
|
-
},
|
|
3289
|
+
}, Ur = class extends u {
|
|
3184
3290
|
text;
|
|
3185
3291
|
searchCount;
|
|
3186
3292
|
lastSearchedAt;
|
|
3187
3293
|
constructor(e) {
|
|
3188
3294
|
super(e), this.text = e?.text ?? "", this.searchCount = e?.searchCount ?? 0, this.lastSearchedAt = s.parse(e?.lastSearchedAt);
|
|
3189
3295
|
}
|
|
3190
|
-
},
|
|
3296
|
+
}, Wr = class extends l {
|
|
3191
3297
|
getSearchProductsStatistics(e, t) {
|
|
3192
|
-
return this.getTypedList(
|
|
3298
|
+
return this.getTypedList(Ur, "/internal/statistics/search/products", { date: s.periodToApiFormat(e) }, !1, t);
|
|
3193
3299
|
}
|
|
3194
3300
|
removeSearchProductStatistic(e) {
|
|
3195
3301
|
return this.delete(`/internal/statistics/search/products/${e}`);
|
|
3196
3302
|
}
|
|
3197
|
-
},
|
|
3303
|
+
}, Gr = /* @__PURE__ */ function(e) {
|
|
3198
3304
|
return e[e.Undetermined = 0] = "Undetermined", e[e.Complete = 1] = "Complete", e[e.Incomplete = 2] = "Incomplete", e;
|
|
3199
|
-
}({}),
|
|
3305
|
+
}({}), Kr = class e {
|
|
3200
3306
|
static isBlocked(e, t) {
|
|
3201
|
-
return t && e ===
|
|
3307
|
+
return t && e === Gr.Incomplete;
|
|
3202
3308
|
}
|
|
3203
3309
|
static getValidationResult(t, n) {
|
|
3204
|
-
return e.isBlocked(t, n) ? new
|
|
3310
|
+
return e.isBlocked(t, n) ? new ee("Проверьте адрес и выберите более точный вариант из подсказок", "error") : t === Gr.Incomplete || t === Gr.Undetermined ? new ee("Проверьте правильность адреса", "warning") : void 0;
|
|
3205
3311
|
}
|
|
3206
|
-
},
|
|
3312
|
+
}, qr = class extends l {
|
|
3207
3313
|
searchAddresses(e) {
|
|
3208
3314
|
return this.execSuggestionQuery("/public/suggestions/address", e);
|
|
3209
3315
|
}
|
|
@@ -3221,26 +3327,26 @@ var Jn = class e {
|
|
|
3221
3327
|
}), t;
|
|
3222
3328
|
});
|
|
3223
3329
|
}
|
|
3224
|
-
},
|
|
3330
|
+
}, Jr = class extends l {
|
|
3225
3331
|
constructor() {
|
|
3226
|
-
super(), this.baseUrl = `${
|
|
3332
|
+
super(), this.baseUrl = `${_().config.http.portalApiUrl}/api`, this.interceptorIds.request.authRequestInterceptor && this.httpClient.interceptors.request.eject(this.interceptorIds.request.authRequestInterceptor);
|
|
3227
3333
|
}
|
|
3228
3334
|
getAccessToken() {
|
|
3229
3335
|
return this.get("internal/users/current-tokens").then((e) => e.accessToken);
|
|
3230
3336
|
}
|
|
3231
|
-
},
|
|
3337
|
+
}, Yr = class {
|
|
3232
3338
|
user;
|
|
3233
3339
|
salesDirection;
|
|
3234
3340
|
constructor(e) {
|
|
3235
|
-
this.user = new F(e?.user), this.salesDirection = new
|
|
3341
|
+
this.user = new F(e?.user), this.salesDirection = new h(e?.salesDirection);
|
|
3236
3342
|
}
|
|
3237
|
-
},
|
|
3343
|
+
}, Xr = class extends be {
|
|
3238
3344
|
cities;
|
|
3239
3345
|
users;
|
|
3240
3346
|
constructor(e) {
|
|
3241
|
-
super(e), this.cities = e?.cities?.map((e) => new n(e)) ?? [], this.users = e?.users?.map((e) => new
|
|
3347
|
+
super(e), this.cities = e?.cities?.map((e) => new n(e)) ?? [], this.users = e?.users?.map((e) => new Yr(e)) ?? [];
|
|
3242
3348
|
}
|
|
3243
|
-
},
|
|
3349
|
+
}, Zr = class extends j {
|
|
3244
3350
|
id;
|
|
3245
3351
|
name;
|
|
3246
3352
|
abbr;
|
|
@@ -3255,27 +3361,27 @@ var Jn = class e {
|
|
|
3255
3361
|
}
|
|
3256
3362
|
return this;
|
|
3257
3363
|
}
|
|
3258
|
-
},
|
|
3364
|
+
}, Qr = class extends e {
|
|
3259
3365
|
getRegionsList(e, t, n) {
|
|
3260
|
-
return this.getTypedPaginated(
|
|
3366
|
+
return this.getTypedPaginated(be, "/internal/users/regions", e, t, n);
|
|
3261
3367
|
}
|
|
3262
3368
|
getRegion(e) {
|
|
3263
|
-
return this.get(`/internal/users/regions/${e}`, {}, (e) => new
|
|
3369
|
+
return this.get(`/internal/users/regions/${e}`, {}, (e) => new Xr(e.data));
|
|
3264
3370
|
}
|
|
3265
3371
|
createRegion(e, t = {}) {
|
|
3266
|
-
return this.post("/internal/users/regions", e, (e) => new
|
|
3372
|
+
return this.post("/internal/users/regions", e, (e) => new Xr(e.data), t);
|
|
3267
3373
|
}
|
|
3268
3374
|
updateRegion(e, t, n = {}) {
|
|
3269
|
-
return this.patch(`/internal/users/regions/${e}`, t, (e) => new
|
|
3375
|
+
return this.patch(`/internal/users/regions/${e}`, t, (e) => new Xr(e.data), n);
|
|
3270
3376
|
}
|
|
3271
3377
|
removeRegion(e) {
|
|
3272
3378
|
return this.delete(`/internal/users/regions/${e}`);
|
|
3273
3379
|
}
|
|
3274
3380
|
getRegionEmployees(e) {
|
|
3275
|
-
return this.getTypedList(
|
|
3381
|
+
return this.getTypedList(Yr, `/internal/users/regions/${e}/users`);
|
|
3276
3382
|
}
|
|
3277
3383
|
attachRegionEmployee(e, t, n) {
|
|
3278
|
-
return this.post(`/internal/users/regions/${e}/users/${t}`, { salesDirectionId: n }, (e) => new
|
|
3384
|
+
return this.post(`/internal/users/regions/${e}/users/${t}`, { salesDirectionId: n }, (e) => new Yr(e.data));
|
|
3279
3385
|
}
|
|
3280
3386
|
detachRegionEmployee(e, t, n) {
|
|
3281
3387
|
return this.request({
|
|
@@ -3286,4 +3392,4 @@ var Jn = class e {
|
|
|
3286
3392
|
}
|
|
3287
3393
|
};
|
|
3288
3394
|
//#endregion
|
|
3289
|
-
export {
|
|
3395
|
+
export { Gr as AddressQualityEnum, Kr as AddressQualityHelper, lt as AdminFullInfo, dt as AdminProvider, ct as AdminShortInfo, ut as AdminsListFilters, dn as BankAccount, gt as BlogPost, pt as BlogPostMediaFile, ft as BlogPostMediaTypeEnum, mt as BlogPostPublicationStatusEnum, ht as BlogPostShortInfo, _t as BlogPostsListFilters, vt as BlogProvider, jt as CalculationTypeEnum, X as CalendarHelper, V as Cart, At as CartProvider, Xt as CatalogProvider, Ct as CatalogableItem, H as Category, Yt as CategoryFilter, qt as CategoryFilterSetting, Jt as CategoryFilterValue, Gt as CategoryPricingRule, bn as Client, Cn as ClientAdditionalData, yn as ClientBaseInfo, Pt as ClientCategory, En as ClientDataProvider, Ht as ClientPriceCatalogableItem, Wt as ClientPriceCategory, Ut as ClientPriceProduct, Zt as ClientPriceProvider, Qt as ClientPriceTemplateProvider, z as ClientProduct, tn as ClientProductCategoryDataProvider, nn as ClientProductDataProvider, U as ClientShortInfo, un as ClientsAdditionalDataRequestTypeEnum, xn as ClientsListFilters, L as CodedIdentity, An as ConfiguratorProvider, kn as ConfiguratorsEnum, fn as Contact, J as ContactPerson, Tn as ContactPersonRelated, wn as ContactRelation, pn as ContragentBase, vn as ContragentFactory, hn as ContragentIc, mn as ContragentPerson, _n as ContragentUlNr, gn as ContragentUlR, Dt as CostSourceEnum, M as CreatableIdentity, Rt as Curator, qr as DataSuggestionProvider, Ln as DateTimeProvider, zt as DeletableIdentity, P as DeletableNamedIdentity, Y as DeliveryAddress, Wn as Discount, Bn as DiscountClient, Gn as DiscountClientEligibility, Vn as DiscountConditions, qn as DiscountProvider, yt as DiscountShortInfo, Hn as DiscountStateEnum, Un as DiscountStateHelper, Kn as DiscountsListFilters, Jn as ExternalSeoFullInfo, Yn as ExternalSeoListFilters, Xn as ExternalSeoProvider, Qn as Faq, Zn as FaqGroup, $n as FaqProvider, Kt as FilterSettings, wt as HiddenCatalogableItem, Tt as Image, nr as ManagerDataFactory, ir as ManagerProvider, rr as ManagersListFilters, Br as MetaTagItem, Z as Offer, or as OfferActualization, ar as OfferActualizationStatus, pr as OfferHelper, sr as OfferShortInfo, fr as OffersDataProvider, lr as OffersListFilters, hr as OperatorFullInfo, _r as OperatorProvider, mr as OperatorShortInfo, gr as OperatorsListFilters, Q as Order, vr as OrderAction, yr as OrderEditorData, ur as OrderInfo, dr as OrderItem, Ot as OrderItemBase, Sn as OrderShortInfo, xr as OrderStatusHistoryInfo, Sr as OrdersDataProvider, br as OrdersListFilters, j as PaginationFiltersBase, wr as PriceAnalyze, Dr as PriceAnalyzeProvider, Ft as PriceCatalogableItem, Ar as PriceHistoryDataProvider, Or as PriceHistoryItem, I as PriceTemplate, Lt as PriceTemplateCategory, W as PriceTemplateClient, It as PriceTemplateICatalogableItem, Bt as PriceTemplateProduct, rn as PriceTemplateProvider, q as PricingRole, an as PricingRoleProvider, Et as PrimaryCatalogableItem, R as Product, $t as ProductCategoryDataProvider, en as ProductDataProvider, Mt as ProductFilterTypeEnum, bt as ProductPriceCoefficient, kr as ProductPriceHistory, St as ProductUnit, cr as ProfstroyOfferItem, on as PropertiesProvider, G as Property, K as PropertyValue, Nr as Reclamation, jr as ReclamationItem, Ir as ReclamationProvider, Mr as ReclamationShortInfo, $ as ReclamationStatusEnum, Fr as ReclamationStatusHelper, Pr as ReclamationsListFilters, Rr as RecommendationsDataProvider, Lr as RecommendationsList, zr as ReferenceDataFactory, Rn as STANDARD_PERIOD_GROUPS, zn as STANDARD_PERIOD_SECTIONS, Ur as SearchProductStatistic, Vr as Seo, Hr as SeoDataProvider, Wr as StatisticsProvider, xt as StockCount, Mn as TableDataPagination, jn as TableDataPaginationRequestParams, Nn as TableDataSortRequestParams, sn as TemplateProductCategoryDataProvider, Vt as TemplatesListFilters, tr as UnitsHelper, Dn as UnknownClientDataProvider, Jr as UserAuthDataProvider, Xr as UserRegion, Yr as UserRegionEmployee, Qr as UserRegionProvider, Zr as UserRegionsListFilters, F as UserShortInfo, On as VersionConfig, Cr as currentOrderInjectionKey, Pn as daysAgoIso, cn as findCatalogItemByIdRecursive, ln as flattenCatalogItems, er as formatPercentChange, In as formatRelativeDate, Fn as pluralize };
|