@snabcentr/common-lib 4.4.0-dev → 4.6.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 +584 -510
- 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/catalog/classes/category-filter.d.ts +4 -0
- package/dist/src/catalog/classes/category-filter.d.ts.map +1 -1
- package/dist/src/catalog/classes/filter-settings.d.ts +4 -0
- package/dist/src/catalog/classes/filter-settings.d.ts.map +1 -1
- package/dist/src/catalog/enums/product-filter-type-enum.d.ts +5 -1
- package/dist/src/catalog/enums/product-filter-type-enum.d.ts.map +1 -1
- package/dist/src/catalog/interfaces/i-category-filter-setting-update-data.d.ts +7 -2
- package/dist/src/catalog/interfaces/i-category-filter-setting-update-data.d.ts.map +1 -1
- package/dist/src/catalog/interfaces/i-category-filter.d.ts +4 -0
- package/dist/src/catalog/interfaces/i-category-filter.d.ts.map +1 -1
- package/dist/src/catalog/interfaces/i-filter-settings.d.ts +5 -0
- package/dist/src/catalog/interfaces/i-filter-settings.d.ts.map +1 -1
- package/dist/src/catalog/providers/properties-provider.d.ts +8 -0
- package/dist/src/catalog/providers/properties-provider.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/orders/classes/orders-list-filters.d.ts +5 -1
- package/dist/src/orders/classes/orders-list-filters.d.ts.map +1 -1
- package/dist/src/orders/interfaces/i-orders-list-filters.d.ts +5 -1
- package/dist/src/orders/interfaces/i-orders-list-filters.d.ts.map +1 -1
- package/package.json +2 -2
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,54 +435,54 @@ 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
|
-
}({}),
|
|
384
|
-
return e.Checkbox = "checkbox", e.Range = "range", e.Toggle = "toggle", e;
|
|
440
|
+
}({}), Mt = /* @__PURE__ */ function(e) {
|
|
441
|
+
return e.Checkbox = "checkbox", e.Range = "range", e.Toggle = "toggle", e.Group = "group", e;
|
|
385
442
|
}({}), H = class e extends B {
|
|
386
443
|
categories;
|
|
387
444
|
products;
|
|
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,36 +583,37 @@ 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;
|
|
540
597
|
type;
|
|
541
598
|
ord;
|
|
599
|
+
group;
|
|
542
600
|
constructor(e) {
|
|
543
|
-
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;
|
|
601
|
+
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, this.group = e?.group;
|
|
544
602
|
}
|
|
545
|
-
},
|
|
603
|
+
}, qt = class {
|
|
546
604
|
category;
|
|
547
605
|
property;
|
|
548
606
|
settings;
|
|
549
607
|
constructor(e) {
|
|
550
|
-
this.category = new B(e?.category), this.property = new G(e?.property), this.settings = new
|
|
608
|
+
this.category = new B(e?.category), this.property = new G(e?.property), this.settings = new Kt(e?.settings);
|
|
551
609
|
}
|
|
552
|
-
},
|
|
610
|
+
}, Jt = class {
|
|
553
611
|
id;
|
|
554
612
|
label;
|
|
555
613
|
constructor(e) {
|
|
556
614
|
this.id = e?.id ?? "", this.label = e?.label ?? "";
|
|
557
615
|
}
|
|
558
|
-
},
|
|
616
|
+
}, Yt = class e {
|
|
559
617
|
id;
|
|
560
618
|
label;
|
|
561
619
|
type;
|
|
@@ -564,10 +622,11 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
564
622
|
values;
|
|
565
623
|
min;
|
|
566
624
|
max;
|
|
567
|
-
|
|
568
|
-
|
|
625
|
+
filters;
|
|
626
|
+
constructor(t) {
|
|
627
|
+
this.id = t?.id ?? "", this.label = t?.label ?? "", this.type = t?.type ?? Mt.Checkbox, this.ord = t?.ord ?? 0, this.isMultiple = t?.isMultiple ?? null, this.values = t?.values?.map((e) => new Jt(e)) ?? [], this.min = t?.min ?? null, this.max = t?.max ?? null, this.filters = t?.filters?.map((t) => new e(t)) ?? [];
|
|
569
628
|
}
|
|
570
|
-
},
|
|
629
|
+
}, Xt = class extends l {
|
|
571
630
|
search(e, t = !1) {
|
|
572
631
|
return this.get("/internal/catalog/search", {
|
|
573
632
|
term: e,
|
|
@@ -575,18 +634,18 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
575
634
|
});
|
|
576
635
|
}
|
|
577
636
|
getPriceExportLink(e = "csv", t = !1, n = void 0, r = void 0) {
|
|
578
|
-
let i = `${
|
|
637
|
+
let i = `${_().config.http.portalApiUrl}/api/internal/price/export?format=${e}&show_hidden=${t}`;
|
|
579
638
|
return n && (i += `&category_id=${n}`), r && (i += `&client_id=${r}`), i;
|
|
580
639
|
}
|
|
581
|
-
},
|
|
640
|
+
}, Zt = class extends l {
|
|
582
641
|
importPrices(e, t, n = !1) {
|
|
583
642
|
return this.post(`/internal/clients/${e}/price/import`, t, void 0, {}, n);
|
|
584
643
|
}
|
|
585
644
|
getCategoryPrices(e) {
|
|
586
|
-
return this.getTypedList(
|
|
645
|
+
return this.getTypedList(Wt, `/internal/clients/${e}/price/categories`);
|
|
587
646
|
}
|
|
588
647
|
getCategoryPrice(e, t) {
|
|
589
|
-
return this.get(`/internal/clients/${e}/price/categories/${t}`, {}, (e) => new
|
|
648
|
+
return this.get(`/internal/clients/${e}/price/categories/${t}`, {}, (e) => new Wt(e.data));
|
|
590
649
|
}
|
|
591
650
|
updateCategoryPrices(e, t, n, r = !1) {
|
|
592
651
|
return this.request({
|
|
@@ -632,16 +691,16 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
632
691
|
return this.delete(`/internal/clients/${e}/price/categories/${t}/manager`);
|
|
633
692
|
}
|
|
634
693
|
getProductPrices(e) {
|
|
635
|
-
return this.getTypedList(
|
|
694
|
+
return this.getTypedList(Ut, `/internal/clients/${e}/price/products`);
|
|
636
695
|
}
|
|
637
696
|
getProductPrice(e, t) {
|
|
638
|
-
return this.get(`/internal/clients/${e}/price/products/${t}`, {}, (e) => new
|
|
697
|
+
return this.get(`/internal/clients/${e}/price/products/${t}`, {}, (e) => new Ut(e.data));
|
|
639
698
|
}
|
|
640
699
|
updateProductPrice(e, t, n) {
|
|
641
700
|
return this.patch(`/internal/clients/${e}/price/products/${t}`, {
|
|
642
701
|
price_coefficient_id: n.coefficient?.id,
|
|
643
702
|
increase_percent: n.value
|
|
644
|
-
}, (e) => new
|
|
703
|
+
}, (e) => new Ut(e.data));
|
|
645
704
|
}
|
|
646
705
|
removeProductPrice(e, t) {
|
|
647
706
|
return this.delete(`/internal/clients/${e}/price/products/${t}`);
|
|
@@ -661,7 +720,7 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
661
720
|
sendCommercialOffer(e, t) {
|
|
662
721
|
return this.post(`/internal/clients/${e}/price/commercial-offer/send`, t);
|
|
663
722
|
}
|
|
664
|
-
},
|
|
723
|
+
}, Qt = class extends l {
|
|
665
724
|
getTemplateList(e) {
|
|
666
725
|
return this.getTypedList(W, `/internal/clients/${e}/price/templates`);
|
|
667
726
|
}
|
|
@@ -669,26 +728,26 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
669
728
|
return this.get(`/internal/clients/${e}/price/templates/active`, {}, (e) => new W(e.data), !0);
|
|
670
729
|
}
|
|
671
730
|
attachTemplate(e, t, n) {
|
|
672
|
-
let r =
|
|
731
|
+
let r = _().config.dateFormats.api;
|
|
673
732
|
return this.post(`/internal/clients/${e}/price/templates/${t}`, n && {
|
|
674
|
-
startAt: n.startAt &&
|
|
675
|
-
endAt: n.endAt &&
|
|
733
|
+
startAt: n.startAt && T(n.startAt, r),
|
|
734
|
+
endAt: n.endAt && T(n.endAt, r)
|
|
676
735
|
}, (e) => new W(e.data), {}, !0);
|
|
677
736
|
}
|
|
678
737
|
applyTemplate(e, t) {
|
|
679
738
|
return this.post(`/internal/clients/${e}/price/templates/${t}/apply`, {}, void 0, {}, !0);
|
|
680
739
|
}
|
|
681
740
|
changeTemplate(e, t, n, r) {
|
|
682
|
-
let i =
|
|
741
|
+
let i = _().config.dateFormats.api;
|
|
683
742
|
return this.patch(`/internal/clients/${e}/price/templates/${t}/${n}`, r && {
|
|
684
|
-
startAt: r.startAt &&
|
|
685
|
-
endAt: r.endAt &&
|
|
743
|
+
startAt: r.startAt && T(r.startAt, i),
|
|
744
|
+
endAt: r.endAt && T(r.endAt, i)
|
|
686
745
|
}, (e) => new W(e.data));
|
|
687
746
|
}
|
|
688
747
|
detachTemplate(e, t, n) {
|
|
689
748
|
return this.delete(`/internal/clients/${e}/price/templates/${t}/${n}`);
|
|
690
749
|
}
|
|
691
|
-
},
|
|
750
|
+
}, $t = class extends l {
|
|
692
751
|
getRootCategoriesList(e = !1) {
|
|
693
752
|
return this.getTypedList(H, "/internal/catalog/categories", { showHidden: e });
|
|
694
753
|
}
|
|
@@ -705,12 +764,12 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
705
764
|
return this.get(`/internal/catalog/categories/${e}/products`, {
|
|
706
765
|
showHidden: n,
|
|
707
766
|
withPriceCoefficients: t
|
|
708
|
-
}, (e) =>
|
|
767
|
+
}, (e) => b(e.data, (e) => new R(e)));
|
|
709
768
|
}
|
|
710
769
|
getCategoryProductsCoefficients(e) {
|
|
711
770
|
return this.get(`/internal/catalog/categories/${e}/products/coefficients`, {}, (e) => {
|
|
712
771
|
let { data: t } = e;
|
|
713
|
-
return
|
|
772
|
+
return we(t, (e) => e.map((e) => new bt(e))), t;
|
|
714
773
|
});
|
|
715
774
|
}
|
|
716
775
|
publicSimpleSearch(e, t = 10) {
|
|
@@ -722,7 +781,7 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
722
781
|
});
|
|
723
782
|
});
|
|
724
783
|
}
|
|
725
|
-
},
|
|
784
|
+
}, en = class extends e {
|
|
726
785
|
getProductData(e, t = !1) {
|
|
727
786
|
return this.get(`/internal/catalog/products/${e}`, { withPriceCoefficients: t }, (e) => new R(e.data));
|
|
728
787
|
}
|
|
@@ -730,12 +789,12 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
730
789
|
return this.get(`/public/catalog/products/${e}`, {}, (e) => new R(e.data));
|
|
731
790
|
}
|
|
732
791
|
getProductPriceCoefficients(e) {
|
|
733
|
-
return this.get(`/internal/catalog/products/${e}/coefficients`, {}, (e) =>
|
|
792
|
+
return this.get(`/internal/catalog/products/${e}/coefficients`, {}, (e) => b(e.data, (e) => new bt(e)));
|
|
734
793
|
}
|
|
735
794
|
getNewProducts(e, t, n = !0) {
|
|
736
|
-
let r =
|
|
795
|
+
let r = _().config.dateFormats.api;
|
|
737
796
|
return this.getTypedPaginated(R, "/internal/catalog/products/new", void 0, void 0, t, {
|
|
738
|
-
period: { from:
|
|
797
|
+
period: { from: T(e, r) },
|
|
739
798
|
withPriceCoefficients: n
|
|
740
799
|
});
|
|
741
800
|
}
|
|
@@ -748,9 +807,9 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
748
807
|
});
|
|
749
808
|
});
|
|
750
809
|
}
|
|
751
|
-
},
|
|
810
|
+
}, tn = class extends l {
|
|
752
811
|
getRootCategoriesList(e, t = !1) {
|
|
753
|
-
return this.getTypedList(
|
|
812
|
+
return this.getTypedList(Pt, "/internal/catalog/categories", {
|
|
754
813
|
clientId: e,
|
|
755
814
|
showHidden: t
|
|
756
815
|
});
|
|
@@ -760,16 +819,16 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
760
819
|
clientId: e,
|
|
761
820
|
showHidden: n,
|
|
762
821
|
withNestedCategories: r
|
|
763
|
-
}, (e) => new
|
|
822
|
+
}, (e) => new Pt(e.data));
|
|
764
823
|
}
|
|
765
824
|
getCategoryProductsList(e, t, n = !0, r = !1) {
|
|
766
825
|
return this.get(`/internal/catalog/categories/${t}/products`, {
|
|
767
826
|
client_id: e,
|
|
768
827
|
showHidden: r,
|
|
769
828
|
withPriceCoefficients: n
|
|
770
|
-
}, (e) =>
|
|
829
|
+
}, (e) => b(e.data, (e) => new z(e)));
|
|
771
830
|
}
|
|
772
|
-
},
|
|
831
|
+
}, nn = class extends e {
|
|
773
832
|
getProductData(e, t, n = !1) {
|
|
774
833
|
return this.get(`/internal/catalog/products/${e}`, {
|
|
775
834
|
clientId: t,
|
|
@@ -777,14 +836,14 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
777
836
|
}, (e) => new z(e.data));
|
|
778
837
|
}
|
|
779
838
|
getNewProducts(e, t, n, r = !0) {
|
|
780
|
-
let i =
|
|
839
|
+
let i = _().config.dateFormats.api;
|
|
781
840
|
return this.getTypedPaginated(z, "/internal/catalog/products/new", void 0, void 0, n, {
|
|
782
841
|
clientId: e,
|
|
783
|
-
period: { from:
|
|
842
|
+
period: { from: T(t, i) },
|
|
784
843
|
withPriceCoefficients: r
|
|
785
844
|
});
|
|
786
845
|
}
|
|
787
|
-
},
|
|
846
|
+
}, rn = class extends e {
|
|
788
847
|
getTemplateList(e, t, n) {
|
|
789
848
|
return this.getTypedPaginated(I, "/internal/price/templates", e, t, n);
|
|
790
849
|
}
|
|
@@ -801,25 +860,25 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
801
860
|
return this.delete(`/internal/price/templates/${e}`);
|
|
802
861
|
}
|
|
803
862
|
getProductTemplatePrices(e) {
|
|
804
|
-
return this.getTypedList(
|
|
863
|
+
return this.getTypedList(Bt, `/internal/price/templates/${e}/products`);
|
|
805
864
|
}
|
|
806
865
|
getProductTemplatePrice(e, t) {
|
|
807
|
-
return this.get(`/internal/price/templates/${e}/products/${t}`, {}, (e) => new
|
|
866
|
+
return this.get(`/internal/price/templates/${e}/products/${t}`, {}, (e) => new Bt(e.data));
|
|
808
867
|
}
|
|
809
868
|
saveProductTemplatePrice(e, t, n) {
|
|
810
869
|
return this.post(`/internal/price/templates/${e}/products/${t}`, {
|
|
811
870
|
price_coefficient_id: n.coefficient?.id,
|
|
812
871
|
increase_percent: n.value
|
|
813
|
-
}, (e) => new
|
|
872
|
+
}, (e) => new Bt(e.data));
|
|
814
873
|
}
|
|
815
874
|
deleteProductTemplatePrice(e, t) {
|
|
816
875
|
return this.delete(`/internal/price/templates/${e}/products/${t}`);
|
|
817
876
|
}
|
|
818
877
|
getCategoryTemplatePrices(e) {
|
|
819
|
-
return this.getTypedList(
|
|
878
|
+
return this.getTypedList(Lt, `/internal/price/templates/${e}/categories`);
|
|
820
879
|
}
|
|
821
880
|
getCategoryTemplatePrice(e, t) {
|
|
822
|
-
return this.get(`/internal/price/templates/${e}/categories/${t}`, {}, (e) => new
|
|
881
|
+
return this.get(`/internal/price/templates/${e}/categories/${t}`, {}, (e) => new Lt(e.data));
|
|
823
882
|
}
|
|
824
883
|
saveCategoryTemplatePrice(e, t, n, r = !1) {
|
|
825
884
|
return this.request({
|
|
@@ -830,7 +889,7 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
830
889
|
increase_percent: n.value
|
|
831
890
|
},
|
|
832
891
|
params: r ? { recursively: !0 } : {}
|
|
833
|
-
}, (e) => new
|
|
892
|
+
}, (e) => new Lt(e.data));
|
|
834
893
|
}
|
|
835
894
|
deleteCategoryTemplatePrice(e, t, n = !1) {
|
|
836
895
|
return this.request({
|
|
@@ -842,7 +901,7 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
842
901
|
getTemplateClients(e) {
|
|
843
902
|
return this.getTypedList(W, `/internal/price/templates/${e}/clients`);
|
|
844
903
|
}
|
|
845
|
-
},
|
|
904
|
+
}, an = class extends l {
|
|
846
905
|
getRoles() {
|
|
847
906
|
return this.getTypedList(q, "/internal/price/roles");
|
|
848
907
|
}
|
|
@@ -859,15 +918,26 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
859
918
|
return this.delete(`/internal/price/roles/${e}`);
|
|
860
919
|
}
|
|
861
920
|
getCategoryRules(e) {
|
|
862
|
-
return this.getTypedList(
|
|
921
|
+
return this.getTypedList(Gt, `/internal/price/roles/rules/categories/${e}`);
|
|
863
922
|
}
|
|
864
923
|
updateCategoryRules(e, t) {
|
|
865
|
-
return this.patch(`/internal/price/roles/rules/categories/${e}`, t, (e) =>
|
|
924
|
+
return this.patch(`/internal/price/roles/rules/categories/${e}`, t, (e) => g.instanceListInitializer(Gt, e.data));
|
|
866
925
|
}
|
|
867
|
-
},
|
|
926
|
+
}, on = class extends e {
|
|
868
927
|
getProperties(e, t, n) {
|
|
869
928
|
return this.getTypedPaginated(G, "/internal/catalog/properties", e, t, n);
|
|
870
929
|
}
|
|
930
|
+
getFilterGroups(e) {
|
|
931
|
+
return this.getProperties({
|
|
932
|
+
groupOp: "and",
|
|
933
|
+
filters: [{
|
|
934
|
+
field: "is_filter_group",
|
|
935
|
+
op: ne.Equals,
|
|
936
|
+
value: !0
|
|
937
|
+
}],
|
|
938
|
+
groups: []
|
|
939
|
+
}, void 0, e);
|
|
940
|
+
}
|
|
871
941
|
createProperty(e) {
|
|
872
942
|
let { typeId: t, ...n } = e;
|
|
873
943
|
return this.post("/internal/catalog/properties", {
|
|
@@ -982,18 +1052,18 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
982
1052
|
return this.post(`/internal/catalog/categories/${e}/image`, { image: t });
|
|
983
1053
|
}
|
|
984
1054
|
getCategoryFilters(e, t = !1) {
|
|
985
|
-
return this.get(`/internal/catalog/categories/${e}/filters`, { recursively: t }, (e) => e.data.map((e) => new
|
|
1055
|
+
return this.get(`/internal/catalog/categories/${e}/filters`, { recursively: t }, (e) => e.data.map((e) => new Yt(e)));
|
|
986
1056
|
}
|
|
987
1057
|
getCategoryFilterSettings(e) {
|
|
988
|
-
return this.getTypedList(
|
|
1058
|
+
return this.getTypedList(qt, `/internal/catalog/categories/${e}/filter-settings`);
|
|
989
1059
|
}
|
|
990
1060
|
saveCategoryFilterSetting(e, t, n) {
|
|
991
|
-
return this.patch(`/internal/catalog/categories/${e}/filter-settings/${t}`, n, (e) => new
|
|
1061
|
+
return this.patch(`/internal/catalog/categories/${e}/filter-settings/${t}`, n, (e) => new qt(e.data));
|
|
992
1062
|
}
|
|
993
1063
|
deleteCategoryFilterSetting(e, t) {
|
|
994
1064
|
return this.delete(`/internal/catalog/categories/${e}/filter-settings/${t}`);
|
|
995
1065
|
}
|
|
996
|
-
},
|
|
1066
|
+
}, sn = class extends l {
|
|
997
1067
|
getRootCategoriesList(e, t = !1) {
|
|
998
1068
|
return this.getTypedList(H, "/internal/catalog/categories", {
|
|
999
1069
|
priceTemplateId: e,
|
|
@@ -1012,23 +1082,23 @@ var st = /* @__PURE__ */ function(e) {
|
|
|
1012
1082
|
priceTemplateId: e,
|
|
1013
1083
|
showHidden: r,
|
|
1014
1084
|
withPriceCoefficients: n
|
|
1015
|
-
}, (e) =>
|
|
1085
|
+
}, (e) => b(e.data, (e) => new R(e)));
|
|
1016
1086
|
}
|
|
1017
1087
|
};
|
|
1018
1088
|
//#endregion
|
|
1019
1089
|
//#region src/catalog/methods/find-catalog-item.ts
|
|
1020
|
-
function
|
|
1090
|
+
function cn(e, t, n) {
|
|
1021
1091
|
let r;
|
|
1022
1092
|
return e.some((e) => {
|
|
1023
1093
|
if (e.type === n && e.id === t) return r = e, !0;
|
|
1024
1094
|
if (e.type === "product") return !1;
|
|
1025
1095
|
let i = e;
|
|
1026
1096
|
if (i.products && i.products.length > 0) {
|
|
1027
|
-
let e =
|
|
1097
|
+
let e = cn(i.products, t, n);
|
|
1028
1098
|
if (e) return r = e, !0;
|
|
1029
1099
|
}
|
|
1030
1100
|
if (i.categories && i.categories.length > 0) {
|
|
1031
|
-
let e =
|
|
1101
|
+
let e = cn(i.categories, t, n);
|
|
1032
1102
|
if (e) return r = e, !0;
|
|
1033
1103
|
}
|
|
1034
1104
|
return !1;
|
|
@@ -1036,20 +1106,20 @@ function rn(e, t, n) {
|
|
|
1036
1106
|
}
|
|
1037
1107
|
//#endregion
|
|
1038
1108
|
//#region src/catalog/methods/flatten-catalog-items.ts
|
|
1039
|
-
function
|
|
1109
|
+
function ln(e) {
|
|
1040
1110
|
let t = [];
|
|
1041
1111
|
return e.forEach((e) => {
|
|
1042
1112
|
if (t.push(e), e.type === "category") {
|
|
1043
1113
|
let n = e;
|
|
1044
|
-
n.products && n.products.length > 0 && t.push(...
|
|
1114
|
+
n.products && n.products.length > 0 && t.push(...ln(n.products)), n.categories && n.categories.length > 0 && t.push(...ln(n.categories));
|
|
1045
1115
|
}
|
|
1046
1116
|
}), t;
|
|
1047
1117
|
}
|
|
1048
1118
|
//#endregion
|
|
1049
1119
|
//#region src/clients/enums/clients-additional-data-request-type-enum.ts
|
|
1050
|
-
var
|
|
1120
|
+
var un = /* @__PURE__ */ function(e) {
|
|
1051
1121
|
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
|
-
}({}),
|
|
1122
|
+
}({}), dn = class extends u {
|
|
1053
1123
|
bankName = "";
|
|
1054
1124
|
bic = "";
|
|
1055
1125
|
accountNumber = "";
|
|
@@ -1058,13 +1128,13 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1058
1128
|
constructor(e) {
|
|
1059
1129
|
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
1130
|
}
|
|
1061
|
-
},
|
|
1131
|
+
}, fn = class extends P {
|
|
1062
1132
|
phone;
|
|
1063
1133
|
email;
|
|
1064
1134
|
constructor(e) {
|
|
1065
1135
|
super(e), this.email = e?.email, this.phone = /^\d+$/.test(e?.phone ?? "") ? `+${e?.phone}` : e?.phone;
|
|
1066
1136
|
}
|
|
1067
|
-
}, J = class extends
|
|
1137
|
+
}, J = class extends fn {
|
|
1068
1138
|
isPrimary;
|
|
1069
1139
|
position;
|
|
1070
1140
|
notDisturb;
|
|
@@ -1072,9 +1142,9 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1072
1142
|
constructor(e) {
|
|
1073
1143
|
super(e), this.isPrimary = e?.isPrimary ?? !1, this.position = e?.position, this.notDisturb = e?.notDisturb ?? !1, this.comment = e?.comment;
|
|
1074
1144
|
}
|
|
1075
|
-
},
|
|
1076
|
-
opf =
|
|
1077
|
-
partnerGroup = new
|
|
1145
|
+
}, pn = class extends P {
|
|
1146
|
+
opf = se.generatePersonItem();
|
|
1147
|
+
partnerGroup = new m();
|
|
1078
1148
|
contacts = [];
|
|
1079
1149
|
bankAccounts = [];
|
|
1080
1150
|
comment;
|
|
@@ -1083,7 +1153,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1083
1153
|
updater;
|
|
1084
1154
|
constructor(e) {
|
|
1085
1155
|
if (super(e), e) {
|
|
1086
|
-
if (this.opf = new
|
|
1156
|
+
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
1157
|
let t = [];
|
|
1088
1158
|
e.contacts.forEach((e) => {
|
|
1089
1159
|
t.push(new J(e));
|
|
@@ -1092,16 +1162,16 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1092
1162
|
if (e.bankAccounts) {
|
|
1093
1163
|
let t = [];
|
|
1094
1164
|
e.bankAccounts.forEach((e) => {
|
|
1095
|
-
t.push(new
|
|
1165
|
+
t.push(new dn(e));
|
|
1096
1166
|
}), this.bankAccounts = t;
|
|
1097
1167
|
}
|
|
1098
1168
|
}
|
|
1099
1169
|
}
|
|
1100
|
-
},
|
|
1170
|
+
}, mn = class extends pn {
|
|
1101
1171
|
constructor(e) {
|
|
1102
1172
|
super(e);
|
|
1103
1173
|
}
|
|
1104
|
-
},
|
|
1174
|
+
}, hn = class extends pn {
|
|
1105
1175
|
inn = "";
|
|
1106
1176
|
okpo = "";
|
|
1107
1177
|
ogrn = "";
|
|
@@ -1114,34 +1184,34 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1114
1184
|
constructor(e) {
|
|
1115
1185
|
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
1186
|
}
|
|
1117
|
-
},
|
|
1187
|
+
}, gn = class extends hn {
|
|
1118
1188
|
kpp = "";
|
|
1119
1189
|
constructor(e) {
|
|
1120
1190
|
super(e), e && (this.kpp = e.kpp ?? "");
|
|
1121
1191
|
}
|
|
1122
|
-
},
|
|
1192
|
+
}, _n = class extends gn {
|
|
1123
1193
|
registrationCountry = new i();
|
|
1124
1194
|
registrationNumber = "";
|
|
1125
1195
|
taxNumber = "";
|
|
1126
1196
|
constructor(e) {
|
|
1127
1197
|
super(e), e && (this.registrationCountry = new i(e.registrationCountry), this.registrationNumber = e.registrationNumber ?? "", this.taxNumber = e.taxNumber ?? "");
|
|
1128
1198
|
}
|
|
1129
|
-
},
|
|
1199
|
+
}, vn = class {
|
|
1130
1200
|
static createInstance(e) {
|
|
1131
1201
|
switch (e.opf.slug) {
|
|
1132
|
-
case
|
|
1133
|
-
case
|
|
1134
|
-
case
|
|
1135
|
-
default: return new
|
|
1202
|
+
case p.Ic: return new hn(e);
|
|
1203
|
+
case p.UlR: return new gn(e);
|
|
1204
|
+
case p.UlNr: return new _n(e);
|
|
1205
|
+
default: return new mn(e);
|
|
1136
1206
|
}
|
|
1137
1207
|
}
|
|
1138
|
-
},
|
|
1208
|
+
}, yn = class extends f {
|
|
1139
1209
|
city;
|
|
1140
1210
|
isActive;
|
|
1141
1211
|
constructor(e) {
|
|
1142
1212
|
super(e), this.city = e?.city ? new n(e.city) : void 0, this.isActive = e?.isActive ?? !1;
|
|
1143
1213
|
}
|
|
1144
|
-
}, Y = class extends
|
|
1214
|
+
}, Y = class extends P {
|
|
1145
1215
|
address = "";
|
|
1146
1216
|
coordinates;
|
|
1147
1217
|
contacts;
|
|
@@ -1150,9 +1220,9 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1150
1220
|
isOneTime;
|
|
1151
1221
|
isTransportCompanyAddress;
|
|
1152
1222
|
constructor(e) {
|
|
1153
|
-
super(e), this.address = e?.address ?? "", this.coordinates = new
|
|
1223
|
+
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
1224
|
}
|
|
1155
|
-
},
|
|
1225
|
+
}, bn = class extends U {
|
|
1156
1226
|
contragents;
|
|
1157
1227
|
partnerGroups;
|
|
1158
1228
|
contacts;
|
|
@@ -1164,9 +1234,9 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1164
1234
|
preferredWarehouse;
|
|
1165
1235
|
extraData;
|
|
1166
1236
|
constructor(e) {
|
|
1167
|
-
super(e), this.contragents = e?.contragents?.map((e) =>
|
|
1237
|
+
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
1238
|
}
|
|
1169
|
-
},
|
|
1239
|
+
}, xn = class extends j {
|
|
1170
1240
|
id;
|
|
1171
1241
|
guid;
|
|
1172
1242
|
name;
|
|
@@ -1178,8 +1248,8 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1178
1248
|
phone;
|
|
1179
1249
|
email;
|
|
1180
1250
|
isActive;
|
|
1181
|
-
createdAt = new
|
|
1182
|
-
lastLoginDate = new
|
|
1251
|
+
createdAt = new N();
|
|
1252
|
+
lastLoginDate = new N();
|
|
1183
1253
|
lastLoginDateHasOrder;
|
|
1184
1254
|
managers;
|
|
1185
1255
|
includeSubordinateManagers;
|
|
@@ -1192,13 +1262,13 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1192
1262
|
partnerGroups;
|
|
1193
1263
|
contact;
|
|
1194
1264
|
lastOrder;
|
|
1195
|
-
noOrdersPeriod = new
|
|
1265
|
+
noOrdersPeriod = new N();
|
|
1196
1266
|
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
|
|
1267
|
+
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 = {
|
|
1268
|
+
createdAt: new N(e?.lastOrder?.createdAt),
|
|
1199
1269
|
creator: e?.lastOrder?.creator,
|
|
1200
1270
|
isApproved: e?.lastOrder?.isApproved
|
|
1201
|
-
}, this.noOrdersPeriod = new
|
|
1271
|
+
}, this.noOrdersPeriod = new N(e?.noOrdersPeriod);
|
|
1202
1272
|
}
|
|
1203
1273
|
resetFilterValue(e) {
|
|
1204
1274
|
switch (e) {
|
|
@@ -1206,7 +1276,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1206
1276
|
this.cities = [];
|
|
1207
1277
|
break;
|
|
1208
1278
|
case "region":
|
|
1209
|
-
this.region = new
|
|
1279
|
+
this.region = new pe();
|
|
1210
1280
|
break;
|
|
1211
1281
|
case "isActive":
|
|
1212
1282
|
this.isActive = !0;
|
|
@@ -1233,7 +1303,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1233
1303
|
this.salesDirections = [];
|
|
1234
1304
|
break;
|
|
1235
1305
|
case "contragentType":
|
|
1236
|
-
this.contragentType = new
|
|
1306
|
+
this.contragentType = new se();
|
|
1237
1307
|
break;
|
|
1238
1308
|
case "preferredDeliveryType":
|
|
1239
1309
|
this.preferredDeliveryType = new c();
|
|
@@ -1242,7 +1312,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1242
1312
|
this.partnerGroups = [];
|
|
1243
1313
|
break;
|
|
1244
1314
|
case "contact":
|
|
1245
|
-
this.contact = new
|
|
1315
|
+
this.contact = new fn();
|
|
1246
1316
|
break;
|
|
1247
1317
|
default: this[e] = void 0;
|
|
1248
1318
|
}
|
|
@@ -1252,12 +1322,12 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1252
1322
|
let e = super.asClearRaw();
|
|
1253
1323
|
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
1324
|
}
|
|
1255
|
-
},
|
|
1325
|
+
}, Sn = class extends M {
|
|
1256
1326
|
creator;
|
|
1257
1327
|
constructor(e) {
|
|
1258
1328
|
super(e), this.creator = new F(e?.creator);
|
|
1259
1329
|
}
|
|
1260
|
-
},
|
|
1330
|
+
}, Cn = class extends f {
|
|
1261
1331
|
contacts = [];
|
|
1262
1332
|
preferredDeliveryType;
|
|
1263
1333
|
partnerGroups = [];
|
|
@@ -1266,23 +1336,23 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1266
1336
|
managers;
|
|
1267
1337
|
curators;
|
|
1268
1338
|
constructor(e) {
|
|
1269
|
-
super(e), this.contacts = e.contacts?.map((e) => new J(e)) ?? void 0, this.lastOrder = e.lastOrder ? new
|
|
1339
|
+
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
1340
|
}
|
|
1271
|
-
},
|
|
1341
|
+
}, wn = class extends u {
|
|
1272
1342
|
isPrimary;
|
|
1273
1343
|
constructor(e) {
|
|
1274
1344
|
super(e), this.isPrimary = e.isPrimary;
|
|
1275
1345
|
}
|
|
1276
|
-
},
|
|
1346
|
+
}, Tn = class extends J {
|
|
1277
1347
|
relations = {
|
|
1278
1348
|
clients: [],
|
|
1279
1349
|
contragents: [],
|
|
1280
1350
|
addresses: []
|
|
1281
1351
|
};
|
|
1282
1352
|
constructor(e) {
|
|
1283
|
-
super(e), e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((e) => new
|
|
1353
|
+
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
1354
|
}
|
|
1285
|
-
},
|
|
1355
|
+
}, En = class t extends e {
|
|
1286
1356
|
static transformClientDataToRequest(e) {
|
|
1287
1357
|
return {
|
|
1288
1358
|
name: e.name,
|
|
@@ -1301,7 +1371,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1301
1371
|
static transformContragentClientDataToRequest(e) {
|
|
1302
1372
|
let t, n = e, r = e, i = e;
|
|
1303
1373
|
switch (e.opf.slug) {
|
|
1304
|
-
case
|
|
1374
|
+
case p.Ic:
|
|
1305
1375
|
t = {
|
|
1306
1376
|
opf: n.opf.slug,
|
|
1307
1377
|
name: n.name,
|
|
@@ -1319,7 +1389,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1319
1389
|
actual_address: n.actualAddress
|
|
1320
1390
|
};
|
|
1321
1391
|
break;
|
|
1322
|
-
case
|
|
1392
|
+
case p.UlR:
|
|
1323
1393
|
t = {
|
|
1324
1394
|
opf: r.opf.slug,
|
|
1325
1395
|
name: r.name,
|
|
@@ -1338,7 +1408,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1338
1408
|
actual_address: r.actualAddress
|
|
1339
1409
|
};
|
|
1340
1410
|
break;
|
|
1341
|
-
case
|
|
1411
|
+
case p.UlNr:
|
|
1342
1412
|
t = {
|
|
1343
1413
|
opf: i.opf.slug,
|
|
1344
1414
|
name: i.name,
|
|
@@ -1391,7 +1461,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1391
1461
|
};
|
|
1392
1462
|
}
|
|
1393
1463
|
getClient(e) {
|
|
1394
|
-
return this.get(`/internal/clients/${e}`, {}, (e) => new
|
|
1464
|
+
return this.get(`/internal/clients/${e}`, {}, (e) => new bn(e.data));
|
|
1395
1465
|
}
|
|
1396
1466
|
getClientsList(e, t, n, r, i) {
|
|
1397
1467
|
return this.getTypedPaginated(U, "/internal/clients", e, t, n, r, void 0, i);
|
|
@@ -1405,7 +1475,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1405
1475
|
groups: [],
|
|
1406
1476
|
filters: [{
|
|
1407
1477
|
field: "phone",
|
|
1408
|
-
op:
|
|
1478
|
+
op: ne.Contains,
|
|
1409
1479
|
value: e
|
|
1410
1480
|
}]
|
|
1411
1481
|
});
|
|
@@ -1415,13 +1485,13 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1415
1485
|
return this.post("/internal/clients/additional-data", {
|
|
1416
1486
|
clients: n,
|
|
1417
1487
|
requested_data_types: t
|
|
1418
|
-
}, (e) =>
|
|
1488
|
+
}, (e) => g.instanceListInitializer(Cn, e.data));
|
|
1419
1489
|
}
|
|
1420
1490
|
getAllClientContacts(e) {
|
|
1421
|
-
return this.getTypedList(
|
|
1491
|
+
return this.getTypedList(Tn, `/internal/clients/${e}/contacts/all`);
|
|
1422
1492
|
}
|
|
1423
1493
|
createClientCommonData(e, n = {}) {
|
|
1424
|
-
return this.post("/internal/clients", t.transformClientDataToRequest(e), (e) => new
|
|
1494
|
+
return this.post("/internal/clients", t.transformClientDataToRequest(e), (e) => new bn(e.data), n);
|
|
1425
1495
|
}
|
|
1426
1496
|
updateClientCommonData(e, n = {}) {
|
|
1427
1497
|
return this.patch(`/internal/clients/${e.id}`, t.transformClientDataToRequest(e), void 0, n);
|
|
@@ -1463,10 +1533,10 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1463
1533
|
})) });
|
|
1464
1534
|
}
|
|
1465
1535
|
createContragentClientData(e, n, r = {}) {
|
|
1466
|
-
return this.post(`/internal/clients/${e}/contragents`, t.transformContragentClientDataToRequest(n), (e) =>
|
|
1536
|
+
return this.post(`/internal/clients/${e}/contragents`, t.transformContragentClientDataToRequest(n), (e) => vn.createInstance(e.data), r);
|
|
1467
1537
|
}
|
|
1468
1538
|
updateContragentClientData(e, n, r = {}) {
|
|
1469
|
-
return this.patch(`/internal/clients/${e}/contragents/${n.id}`, t.transformContragentClientDataToRequest(n), (e) =>
|
|
1539
|
+
return this.patch(`/internal/clients/${e}/contragents/${n.id}`, t.transformContragentClientDataToRequest(n), (e) => vn.createInstance(e.data), r);
|
|
1470
1540
|
}
|
|
1471
1541
|
deleteClientContragent(e, t) {
|
|
1472
1542
|
return this.delete(`/internal/clients/${e}/contragents/${t.id}`);
|
|
@@ -1484,10 +1554,10 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1484
1554
|
return this.delete(`/internal/clients/${e}/delivery-addresses/${t.id}`);
|
|
1485
1555
|
}
|
|
1486
1556
|
createContragentBankAccount(e, n, r, i = {}) {
|
|
1487
|
-
return this.post(`/internal/clients/${e}/contragents/${n}/bank-accounts`, t.transformClientContragentBankAccountToRequest(r), (e) => new
|
|
1557
|
+
return this.post(`/internal/clients/${e}/contragents/${n}/bank-accounts`, t.transformClientContragentBankAccountToRequest(r), (e) => new dn(e.data), i);
|
|
1488
1558
|
}
|
|
1489
1559
|
updateContragentBankAccount(e, n, r, i = {}) {
|
|
1490
|
-
return this.patch(`/internal/clients/${e}/contragents/${n}/bank-accounts/${r.id}`, t.transformClientContragentBankAccountToRequest(r), (e) => new
|
|
1560
|
+
return this.patch(`/internal/clients/${e}/contragents/${n}/bank-accounts/${r.id}`, t.transformClientContragentBankAccountToRequest(r), (e) => new dn(e.data), i);
|
|
1491
1561
|
}
|
|
1492
1562
|
deleteContragentBankAccount(e, t, n) {
|
|
1493
1563
|
return this.delete(`/internal/clients/${e}/contragents/${t}/bank-accounts/${n.id}`);
|
|
@@ -1559,7 +1629,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1559
1629
|
sendClientEmailConfirmation(e) {
|
|
1560
1630
|
return this.get(`/internal/clients/${e.id}/verification/email?email=${e.email}`);
|
|
1561
1631
|
}
|
|
1562
|
-
},
|
|
1632
|
+
}, Dn = class extends l {
|
|
1563
1633
|
checkPhoneIsBusy(e) {
|
|
1564
1634
|
return new Promise((t, n) => {
|
|
1565
1635
|
this.request({
|
|
@@ -1571,16 +1641,16 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1571
1641
|
}).catch(n);
|
|
1572
1642
|
});
|
|
1573
1643
|
}
|
|
1574
|
-
},
|
|
1644
|
+
}, On = class {
|
|
1575
1645
|
date;
|
|
1576
1646
|
name;
|
|
1577
1647
|
version;
|
|
1578
1648
|
constructor(e) {
|
|
1579
|
-
this.date =
|
|
1649
|
+
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
1650
|
}
|
|
1581
|
-
},
|
|
1651
|
+
}, kn = /* @__PURE__ */ function(e) {
|
|
1582
1652
|
return e.Kozyrek = "kozyrek", e.Mosquitto = "mosquitto", e.Strip = "strip", e.MetalForDoors = "metal_for_doors", e.Sandwich = "sandwich", e.SandwichM2 = "sandwich_m2", e;
|
|
1583
|
-
}({}),
|
|
1653
|
+
}({}), An = class extends l {
|
|
1584
1654
|
getConfiguratorSettings(e, t) {
|
|
1585
1655
|
return this.get(`internal/catalog/categories/${e.id}/configurators/${e.properties?.configurator}/settings?client_id=${t}`);
|
|
1586
1656
|
}
|
|
@@ -1606,13 +1676,13 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1606
1676
|
...n
|
|
1607
1677
|
});
|
|
1608
1678
|
}
|
|
1609
|
-
},
|
|
1679
|
+
}, jn = class {
|
|
1610
1680
|
page = 1;
|
|
1611
1681
|
pageSize = 50;
|
|
1612
1682
|
constructor(e) {
|
|
1613
1683
|
this.page = e?.page ?? 1, this.pageSize = e?.pageSize ?? 50;
|
|
1614
1684
|
}
|
|
1615
|
-
},
|
|
1685
|
+
}, Mn = class extends jn {
|
|
1616
1686
|
itemCount = 0;
|
|
1617
1687
|
pageCount = 1;
|
|
1618
1688
|
pageSlot = 5;
|
|
@@ -1629,7 +1699,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1629
1699
|
100
|
|
1630
1700
|
], this.showSizePicker = e?.showSizePicker ?? !0;
|
|
1631
1701
|
}
|
|
1632
|
-
},
|
|
1702
|
+
}, Nn = class {
|
|
1633
1703
|
field;
|
|
1634
1704
|
direction;
|
|
1635
1705
|
constructor(e) {
|
|
@@ -1654,47 +1724,47 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1654
1724
|
return new Date(e.getFullYear(), e.getMonth() < 6 ? 0 : 6, 1);
|
|
1655
1725
|
}
|
|
1656
1726
|
static endOfHalfYear(e) {
|
|
1657
|
-
return
|
|
1727
|
+
return w(new Date(e.getFullYear(), e.getMonth() < 6 ? 5 : 11, 1));
|
|
1658
1728
|
}
|
|
1659
1729
|
static addHalfYears(e, t) {
|
|
1660
|
-
return
|
|
1730
|
+
return S(e, t * 6);
|
|
1661
1731
|
}
|
|
1662
1732
|
static intervalTillSameDate(e, t, n) {
|
|
1663
|
-
let r =
|
|
1733
|
+
let r = Ue(O(n), O(e)), i = O(S(t, r)), a = Math.min(Xe(n), Ze(i));
|
|
1664
1734
|
return {
|
|
1665
|
-
from:
|
|
1666
|
-
to:
|
|
1735
|
+
from: D(t),
|
|
1736
|
+
to: C(Qe(i, a))
|
|
1667
1737
|
};
|
|
1668
1738
|
}
|
|
1669
1739
|
static weekTillSameWeekday(e, t) {
|
|
1670
|
-
let n =
|
|
1740
|
+
let n = k(Be(e, t), { weekStartsOn: 1 }), r = He(e, k(e, { weekStartsOn: 1 }));
|
|
1671
1741
|
return {
|
|
1672
1742
|
from: n,
|
|
1673
|
-
to: x(
|
|
1743
|
+
to: C(x(n, r))
|
|
1674
1744
|
};
|
|
1675
1745
|
}
|
|
1676
1746
|
static decadeTillSameDayNumber(t, n) {
|
|
1677
|
-
let [r] = e.shiftedDecadeBounds(t, 0), i =
|
|
1747
|
+
let [r] = e.shiftedDecadeBounds(t, 0), i = He(t, r) + 1, [a, o] = e.shiftedDecadeBounds(t, n), s = He(o, a) + 1;
|
|
1678
1748
|
return {
|
|
1679
1749
|
from: a,
|
|
1680
|
-
to: x(
|
|
1750
|
+
to: C(x(a, Math.min(i, s) - 1))
|
|
1681
1751
|
};
|
|
1682
1752
|
}
|
|
1683
1753
|
static shiftedDecadeBounds(e, t) {
|
|
1684
|
-
let n =
|
|
1754
|
+
let n = Xe(e), r = 2;
|
|
1685
1755
|
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 ?
|
|
1756
|
+
let i = r + t, a = Math.floor(i / 3), o = (i % 3 + 3) % 3, s = O(S(e, a)), c = x(s, o * 10);
|
|
1757
|
+
return [c, o === 2 ? w(s) : C(x(c, 9))];
|
|
1688
1758
|
}
|
|
1689
1759
|
};
|
|
1690
1760
|
//#endregion
|
|
1691
1761
|
//#region src/date-time/helpers/days-ago-iso.ts
|
|
1692
|
-
function
|
|
1693
|
-
return
|
|
1762
|
+
function Pn(e) {
|
|
1763
|
+
return T(rt(et(), e), "yyyy-MM-dd");
|
|
1694
1764
|
}
|
|
1695
1765
|
//#endregion
|
|
1696
1766
|
//#region src/i18n/helpers/pluralize.ts
|
|
1697
|
-
function
|
|
1767
|
+
function Fn(e, t) {
|
|
1698
1768
|
let n = [
|
|
1699
1769
|
2,
|
|
1700
1770
|
0,
|
|
@@ -1707,13 +1777,13 @@ function jn(e, t) {
|
|
|
1707
1777
|
}
|
|
1708
1778
|
//#endregion
|
|
1709
1779
|
//#region src/date-time/helpers/format-relative-date.ts
|
|
1710
|
-
function
|
|
1711
|
-
let t =
|
|
1780
|
+
function In(e) {
|
|
1781
|
+
let t = E(e), n = He(et(), t);
|
|
1712
1782
|
switch (!0) {
|
|
1713
1783
|
case n === 0: return "Сегодня";
|
|
1714
1784
|
case n === 1: return "Вчера";
|
|
1715
1785
|
case n < 0: return e;
|
|
1716
|
-
default: return `${n} ${
|
|
1786
|
+
default: return `${n} ${Fn(n, [
|
|
1717
1787
|
"день",
|
|
1718
1788
|
"дня",
|
|
1719
1789
|
"дней"
|
|
@@ -1722,83 +1792,83 @@ function Mn(e) {
|
|
|
1722
1792
|
}
|
|
1723
1793
|
//#endregion
|
|
1724
1794
|
//#region src/date-time/providers/date-time-provider.ts
|
|
1725
|
-
var
|
|
1795
|
+
var Ln = class {
|
|
1726
1796
|
static defaultDateRanges(e) {
|
|
1727
|
-
let t =
|
|
1797
|
+
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
1798
|
return {
|
|
1729
1799
|
nextWorkingDay: {
|
|
1730
1800
|
label: "Следующий рабочий день",
|
|
1731
|
-
from:
|
|
1732
|
-
to:
|
|
1801
|
+
from: D(t),
|
|
1802
|
+
to: C(t)
|
|
1733
1803
|
},
|
|
1734
1804
|
today: {
|
|
1735
1805
|
label: "Сегодня",
|
|
1736
|
-
from:
|
|
1737
|
-
to:
|
|
1806
|
+
from: et(),
|
|
1807
|
+
to: Ge()
|
|
1738
1808
|
},
|
|
1739
1809
|
yesterday: {
|
|
1740
1810
|
label: "Вчера",
|
|
1741
|
-
from:
|
|
1742
|
-
to:
|
|
1811
|
+
from: nt(),
|
|
1812
|
+
to: Ye()
|
|
1743
1813
|
},
|
|
1744
1814
|
tomorrow: {
|
|
1745
1815
|
label: "Завтра",
|
|
1746
|
-
from:
|
|
1747
|
-
to:
|
|
1816
|
+
from: tt(),
|
|
1817
|
+
to: Ke()
|
|
1748
1818
|
},
|
|
1749
1819
|
currentWeek: {
|
|
1750
1820
|
label: "Неделя",
|
|
1751
|
-
from:
|
|
1752
|
-
to:
|
|
1821
|
+
from: k(n, { weekStartsOn: 1 }),
|
|
1822
|
+
to: qe(n, { weekStartsOn: 1 })
|
|
1753
1823
|
},
|
|
1754
1824
|
currentMonth: {
|
|
1755
1825
|
label: "Месяц",
|
|
1756
|
-
from:
|
|
1757
|
-
to:
|
|
1826
|
+
from: O(n),
|
|
1827
|
+
to: w(n)
|
|
1758
1828
|
},
|
|
1759
1829
|
oneMonth: {
|
|
1760
1830
|
label: "1 месяц",
|
|
1761
1831
|
from: r,
|
|
1762
|
-
to:
|
|
1832
|
+
to: w(r)
|
|
1763
1833
|
},
|
|
1764
1834
|
threeMonths: {
|
|
1765
1835
|
label: "3 месяца",
|
|
1766
1836
|
from: r,
|
|
1767
|
-
to: S(
|
|
1837
|
+
to: w(S(r, 2))
|
|
1768
1838
|
},
|
|
1769
1839
|
nineMonths: {
|
|
1770
1840
|
label: "9 месяцев",
|
|
1771
1841
|
from: r,
|
|
1772
|
-
to: S(
|
|
1842
|
+
to: w(S(r, 8))
|
|
1773
1843
|
},
|
|
1774
1844
|
firstQuarter: {
|
|
1775
1845
|
label: "I квартал",
|
|
1776
1846
|
from: r,
|
|
1777
|
-
to: S(
|
|
1847
|
+
to: w(S(r, 2))
|
|
1778
1848
|
},
|
|
1779
1849
|
secondQuarter: {
|
|
1780
1850
|
label: "II квартал",
|
|
1781
|
-
from:
|
|
1782
|
-
to: S(
|
|
1851
|
+
from: S(r, 3),
|
|
1852
|
+
to: w(S(r, 5))
|
|
1783
1853
|
},
|
|
1784
1854
|
thirdQuarter: {
|
|
1785
1855
|
label: "III квартал",
|
|
1786
|
-
from:
|
|
1787
|
-
to: S(
|
|
1856
|
+
from: S(r, 6),
|
|
1857
|
+
to: w(S(r, 8))
|
|
1788
1858
|
},
|
|
1789
1859
|
fourthQuarter: {
|
|
1790
1860
|
label: "IV квартал",
|
|
1791
|
-
from:
|
|
1792
|
-
to: S(
|
|
1861
|
+
from: S(r, 9),
|
|
1862
|
+
to: w(S(r, 11))
|
|
1793
1863
|
},
|
|
1794
1864
|
firstHalfYear: {
|
|
1795
1865
|
label: "I полугодие",
|
|
1796
1866
|
from: r,
|
|
1797
|
-
to: S(
|
|
1867
|
+
to: w(S(r, 5))
|
|
1798
1868
|
},
|
|
1799
1869
|
secondHalfYear: {
|
|
1800
1870
|
label: "II полугодие",
|
|
1801
|
-
from:
|
|
1871
|
+
from: S(r, 6),
|
|
1802
1872
|
to: i
|
|
1803
1873
|
},
|
|
1804
1874
|
currentYear: {
|
|
@@ -1809,13 +1879,13 @@ var Nn = class {
|
|
|
1809
1879
|
};
|
|
1810
1880
|
}
|
|
1811
1881
|
static standardPeriods(e = /* @__PURE__ */ new Date()) {
|
|
1812
|
-
let t = { weekStartsOn: 1 }, n =
|
|
1882
|
+
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
1883
|
return {
|
|
1814
1884
|
yesterday: {
|
|
1815
1885
|
label: "Вчера",
|
|
1816
1886
|
group: "day",
|
|
1817
|
-
from:
|
|
1818
|
-
to:
|
|
1887
|
+
from: D(rt(e, 1)),
|
|
1888
|
+
to: C(rt(e, 1))
|
|
1819
1889
|
},
|
|
1820
1890
|
today: {
|
|
1821
1891
|
label: "Сегодня",
|
|
@@ -1826,26 +1896,26 @@ var Nn = class {
|
|
|
1826
1896
|
tomorrow: {
|
|
1827
1897
|
label: "Завтра",
|
|
1828
1898
|
group: "day",
|
|
1829
|
-
from:
|
|
1830
|
-
to: x(
|
|
1899
|
+
from: D(x(e, 1)),
|
|
1900
|
+
to: C(x(e, 1))
|
|
1831
1901
|
},
|
|
1832
1902
|
lastWeek: {
|
|
1833
1903
|
label: "Прошлая неделя",
|
|
1834
1904
|
group: "week",
|
|
1835
|
-
from:
|
|
1836
|
-
to:
|
|
1905
|
+
from: k(ot(e, 1), t),
|
|
1906
|
+
to: qe(ot(e, 1), t)
|
|
1837
1907
|
},
|
|
1838
1908
|
thisWeek: {
|
|
1839
1909
|
label: "Эта неделя",
|
|
1840
1910
|
group: "week",
|
|
1841
|
-
from:
|
|
1842
|
-
to:
|
|
1911
|
+
from: k(e, t),
|
|
1912
|
+
to: qe(e, t)
|
|
1843
1913
|
},
|
|
1844
1914
|
nextWeek: {
|
|
1845
1915
|
label: "Следующая неделя",
|
|
1846
1916
|
group: "week",
|
|
1847
|
-
from:
|
|
1848
|
-
to:
|
|
1917
|
+
from: k(Be(e, 1), t),
|
|
1918
|
+
to: qe(Be(e, 1), t)
|
|
1849
1919
|
},
|
|
1850
1920
|
lastTenDays: {
|
|
1851
1921
|
label: "Прошлая декада",
|
|
@@ -1865,44 +1935,44 @@ var Nn = class {
|
|
|
1865
1935
|
lastMonth: {
|
|
1866
1936
|
label: "Прошлый месяц",
|
|
1867
1937
|
group: "month",
|
|
1868
|
-
from:
|
|
1869
|
-
to:
|
|
1938
|
+
from: O(it(e, 1)),
|
|
1939
|
+
to: w(it(e, 1))
|
|
1870
1940
|
},
|
|
1871
1941
|
thisMonth: {
|
|
1872
1942
|
label: "Этот месяц",
|
|
1873
1943
|
group: "month",
|
|
1874
1944
|
from: a,
|
|
1875
|
-
to:
|
|
1945
|
+
to: w(e)
|
|
1876
1946
|
},
|
|
1877
1947
|
nextMonth: {
|
|
1878
1948
|
label: "Следующий месяц",
|
|
1879
1949
|
group: "month",
|
|
1880
|
-
from:
|
|
1881
|
-
to: S(
|
|
1950
|
+
from: O(S(e, 1)),
|
|
1951
|
+
to: w(S(e, 1))
|
|
1882
1952
|
},
|
|
1883
1953
|
lastQuarter: {
|
|
1884
1954
|
label: "Прошлый квартал",
|
|
1885
1955
|
group: "quarter",
|
|
1886
|
-
from:
|
|
1887
|
-
to:
|
|
1956
|
+
from: $e(at(e, 1)),
|
|
1957
|
+
to: We(at(e, 1))
|
|
1888
1958
|
},
|
|
1889
1959
|
thisQuarter: {
|
|
1890
1960
|
label: "Этот квартал",
|
|
1891
1961
|
group: "quarter",
|
|
1892
1962
|
from: o,
|
|
1893
|
-
to:
|
|
1963
|
+
to: We(e)
|
|
1894
1964
|
},
|
|
1895
1965
|
nextQuarter: {
|
|
1896
1966
|
label: "Следующий квартал",
|
|
1897
1967
|
group: "quarter",
|
|
1898
|
-
from:
|
|
1899
|
-
to:
|
|
1968
|
+
from: $e(ze(e, 1)),
|
|
1969
|
+
to: We(ze(e, 1))
|
|
1900
1970
|
},
|
|
1901
1971
|
lastHalfYear: {
|
|
1902
1972
|
label: "Прошлое полугодие",
|
|
1903
1973
|
group: "halfYear",
|
|
1904
|
-
from: X.startOfHalfYear(
|
|
1905
|
-
to: X.endOfHalfYear(
|
|
1974
|
+
from: X.startOfHalfYear(ee),
|
|
1975
|
+
to: X.endOfHalfYear(ee)
|
|
1906
1976
|
},
|
|
1907
1977
|
thisHalfYear: {
|
|
1908
1978
|
label: "Это полугодие",
|
|
@@ -1913,32 +1983,32 @@ var Nn = class {
|
|
|
1913
1983
|
nextHalfYear: {
|
|
1914
1984
|
label: "Следующее полугодие",
|
|
1915
1985
|
group: "halfYear",
|
|
1916
|
-
from: X.startOfHalfYear(
|
|
1917
|
-
to: X.endOfHalfYear(
|
|
1986
|
+
from: X.startOfHalfYear(te),
|
|
1987
|
+
to: X.endOfHalfYear(te)
|
|
1918
1988
|
},
|
|
1919
1989
|
lastYear: {
|
|
1920
1990
|
label: "Прошлый год",
|
|
1921
1991
|
group: "year",
|
|
1922
|
-
from:
|
|
1923
|
-
to:
|
|
1992
|
+
from: A(st(e, 1)),
|
|
1993
|
+
to: Je(st(e, 1))
|
|
1924
1994
|
},
|
|
1925
1995
|
thisYear: {
|
|
1926
1996
|
label: "Этот год",
|
|
1927
1997
|
group: "year",
|
|
1928
1998
|
from: c,
|
|
1929
|
-
to:
|
|
1999
|
+
to: Je(e)
|
|
1930
2000
|
},
|
|
1931
2001
|
nextYear: {
|
|
1932
2002
|
label: "Следующий год",
|
|
1933
2003
|
group: "year",
|
|
1934
|
-
from:
|
|
1935
|
-
to:
|
|
2004
|
+
from: A(Ve(e, 1)),
|
|
2005
|
+
to: Je(Ve(e, 1))
|
|
1936
2006
|
},
|
|
1937
2007
|
fromBeginningOfThisWeek: {
|
|
1938
2008
|
label: "С начала этой недели",
|
|
1939
2009
|
group: "other",
|
|
1940
2010
|
section: "fromBeginning",
|
|
1941
|
-
from:
|
|
2011
|
+
from: k(e, t),
|
|
1942
2012
|
to: r
|
|
1943
2013
|
},
|
|
1944
2014
|
fromBeginningOfThisTenDays: {
|
|
@@ -1981,7 +2051,7 @@ var Nn = class {
|
|
|
1981
2051
|
group: "other",
|
|
1982
2052
|
section: "tillEnd",
|
|
1983
2053
|
from: n,
|
|
1984
|
-
to:
|
|
2054
|
+
to: qe(e, t)
|
|
1985
2055
|
},
|
|
1986
2056
|
tillEndOfThisTenDays: {
|
|
1987
2057
|
label: "До конца этой декады",
|
|
@@ -1995,14 +2065,14 @@ var Nn = class {
|
|
|
1995
2065
|
group: "other",
|
|
1996
2066
|
section: "tillEnd",
|
|
1997
2067
|
from: n,
|
|
1998
|
-
to:
|
|
2068
|
+
to: w(e)
|
|
1999
2069
|
},
|
|
2000
2070
|
tillEndOfThisQuarter: {
|
|
2001
2071
|
label: "До конца этого квартала",
|
|
2002
2072
|
group: "other",
|
|
2003
2073
|
section: "tillEnd",
|
|
2004
2074
|
from: n,
|
|
2005
|
-
to:
|
|
2075
|
+
to: We(e)
|
|
2006
2076
|
},
|
|
2007
2077
|
tillEndOfThisHalfYear: {
|
|
2008
2078
|
label: "До конца этого полугодия",
|
|
@@ -2016,7 +2086,7 @@ var Nn = class {
|
|
|
2016
2086
|
group: "other",
|
|
2017
2087
|
section: "tillEnd",
|
|
2018
2088
|
from: n,
|
|
2019
|
-
to:
|
|
2089
|
+
to: Je(e)
|
|
2020
2090
|
},
|
|
2021
2091
|
lastWeekTillSameWeekDay: {
|
|
2022
2092
|
label: "Прошлая неделя, до такого же дня недели",
|
|
@@ -2034,25 +2104,25 @@ var Nn = class {
|
|
|
2034
2104
|
label: "Прошлый месяц, до такой же даты",
|
|
2035
2105
|
group: "other",
|
|
2036
2106
|
section: "lastTillSame",
|
|
2037
|
-
...X.intervalTillSameDate(a,
|
|
2107
|
+
...X.intervalTillSameDate(a, O(it(e, 1)), e)
|
|
2038
2108
|
},
|
|
2039
2109
|
lastQuarterTillSameDate: {
|
|
2040
2110
|
label: "Прошлый квартал, до такой же даты",
|
|
2041
2111
|
group: "other",
|
|
2042
2112
|
section: "lastTillSame",
|
|
2043
|
-
...X.intervalTillSameDate(o,
|
|
2113
|
+
...X.intervalTillSameDate(o, $e(at(e, 1)), e)
|
|
2044
2114
|
},
|
|
2045
2115
|
lastHalfYearTillSameDate: {
|
|
2046
2116
|
label: "Прошлое полугодие, до такой же даты",
|
|
2047
2117
|
group: "other",
|
|
2048
2118
|
section: "lastTillSame",
|
|
2049
|
-
...X.intervalTillSameDate(s, X.startOfHalfYear(
|
|
2119
|
+
...X.intervalTillSameDate(s, X.startOfHalfYear(ee), e)
|
|
2050
2120
|
},
|
|
2051
2121
|
lastYearTillSameDate: {
|
|
2052
2122
|
label: "Прошлый год, до такой же даты",
|
|
2053
2123
|
group: "other",
|
|
2054
2124
|
section: "lastTillSame",
|
|
2055
|
-
...X.intervalTillSameDate(c,
|
|
2125
|
+
...X.intervalTillSameDate(c, A(st(e, 1)), e)
|
|
2056
2126
|
},
|
|
2057
2127
|
nextWeekTillSameWeekDay: {
|
|
2058
2128
|
label: "Следующая неделя, до такого же дня недели",
|
|
@@ -2070,31 +2140,31 @@ var Nn = class {
|
|
|
2070
2140
|
label: "Следующий месяц, до такой же даты",
|
|
2071
2141
|
group: "other",
|
|
2072
2142
|
section: "nextTillSame",
|
|
2073
|
-
...X.intervalTillSameDate(a,
|
|
2143
|
+
...X.intervalTillSameDate(a, O(S(e, 1)), e)
|
|
2074
2144
|
},
|
|
2075
2145
|
nextQuarterTillSameDate: {
|
|
2076
2146
|
label: "Следующий квартал, до такой же даты",
|
|
2077
2147
|
group: "other",
|
|
2078
2148
|
section: "nextTillSame",
|
|
2079
|
-
...X.intervalTillSameDate(o,
|
|
2149
|
+
...X.intervalTillSameDate(o, $e(ze(e, 1)), e)
|
|
2080
2150
|
},
|
|
2081
2151
|
nextHalfYearTillSameDate: {
|
|
2082
2152
|
label: "Следующее полугодие, до такой же даты",
|
|
2083
2153
|
group: "other",
|
|
2084
2154
|
section: "nextTillSame",
|
|
2085
|
-
...X.intervalTillSameDate(s, X.startOfHalfYear(
|
|
2155
|
+
...X.intervalTillSameDate(s, X.startOfHalfYear(te), e)
|
|
2086
2156
|
},
|
|
2087
2157
|
nextYearTillSameDate: {
|
|
2088
2158
|
label: "Следующий год, до такой же даты",
|
|
2089
2159
|
group: "other",
|
|
2090
2160
|
section: "nextTillSame",
|
|
2091
|
-
...X.intervalTillSameDate(c,
|
|
2161
|
+
...X.intervalTillSameDate(c, A(Ve(e, 1)), e)
|
|
2092
2162
|
},
|
|
2093
2163
|
last7Days: {
|
|
2094
2164
|
label: "Последние 7 дней",
|
|
2095
2165
|
group: "other",
|
|
2096
2166
|
section: "rollingDays",
|
|
2097
|
-
from:
|
|
2167
|
+
from: D(rt(e, 6)),
|
|
2098
2168
|
to: r
|
|
2099
2169
|
},
|
|
2100
2170
|
next7Days: {
|
|
@@ -2102,11 +2172,11 @@ var Nn = class {
|
|
|
2102
2172
|
group: "other",
|
|
2103
2173
|
section: "rollingDays",
|
|
2104
2174
|
from: n,
|
|
2105
|
-
to: x(
|
|
2175
|
+
to: C(x(e, 6))
|
|
2106
2176
|
}
|
|
2107
2177
|
};
|
|
2108
2178
|
}
|
|
2109
|
-
},
|
|
2179
|
+
}, Rn = [
|
|
2110
2180
|
{
|
|
2111
2181
|
key: "day",
|
|
2112
2182
|
label: "День"
|
|
@@ -2139,7 +2209,7 @@ var Nn = class {
|
|
|
2139
2209
|
key: "other",
|
|
2140
2210
|
label: "Прочее"
|
|
2141
2211
|
}
|
|
2142
|
-
],
|
|
2212
|
+
], zn = [
|
|
2143
2213
|
{
|
|
2144
2214
|
key: "fromBeginning",
|
|
2145
2215
|
label: "С начала периода"
|
|
@@ -2160,7 +2230,7 @@ var Nn = class {
|
|
|
2160
2230
|
key: "rollingDays",
|
|
2161
2231
|
label: "7 дней"
|
|
2162
2232
|
}
|
|
2163
|
-
],
|
|
2233
|
+
], Bn = class extends yn {}, Vn = class {
|
|
2164
2234
|
salesDirections;
|
|
2165
2235
|
partnerGroups;
|
|
2166
2236
|
managers;
|
|
@@ -2171,10 +2241,10 @@ var Nn = class {
|
|
|
2171
2241
|
lastLoginDate;
|
|
2172
2242
|
lastOrderDate;
|
|
2173
2243
|
constructor(e) {
|
|
2174
|
-
this.salesDirections =
|
|
2244
|
+
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
2245
|
}
|
|
2176
2246
|
hasClientConditions() {
|
|
2177
|
-
return
|
|
2247
|
+
return Fe([
|
|
2178
2248
|
this.salesDirections,
|
|
2179
2249
|
this.partnerGroups,
|
|
2180
2250
|
this.managers,
|
|
@@ -2182,33 +2252,33 @@ var Nn = class {
|
|
|
2182
2252
|
this.fixedClients,
|
|
2183
2253
|
this.regions,
|
|
2184
2254
|
this.cities
|
|
2185
|
-
], (e) => !
|
|
2255
|
+
], (e) => !Oe(e)) || Fe([this.lastLoginDate, this.lastOrderDate], (e) => !!e.from || !!e.to);
|
|
2186
2256
|
}
|
|
2187
2257
|
setPeriod(e, t) {
|
|
2188
|
-
return this[e] = new
|
|
2189
|
-
from: t?.from ?
|
|
2190
|
-
to: t?.to ?
|
|
2258
|
+
return this[e] = new N({
|
|
2259
|
+
from: t?.from ? D(t.from) : null,
|
|
2260
|
+
to: t?.to ? C(t.to) : null
|
|
2191
2261
|
}), this;
|
|
2192
2262
|
}
|
|
2193
2263
|
toSaveData() {
|
|
2194
2264
|
return {
|
|
2195
|
-
salesDirections:
|
|
2196
|
-
partnerGroups:
|
|
2197
|
-
managers:
|
|
2198
|
-
additionalClients:
|
|
2199
|
-
regions:
|
|
2200
|
-
cities:
|
|
2201
|
-
lastLoginDate: new
|
|
2202
|
-
lastOrderDate: new
|
|
2265
|
+
salesDirections: b(this.salesDirections, "id"),
|
|
2266
|
+
partnerGroups: b(this.partnerGroups, "id"),
|
|
2267
|
+
managers: b(this.managers, "id"),
|
|
2268
|
+
additionalClients: b(this.additionalClients, "id"),
|
|
2269
|
+
regions: b(this.regions, "id"),
|
|
2270
|
+
cities: b(this.cities, "id"),
|
|
2271
|
+
lastLoginDate: new N(this.lastLoginDate),
|
|
2272
|
+
lastOrderDate: new N(this.lastOrderDate)
|
|
2203
2273
|
};
|
|
2204
2274
|
}
|
|
2205
|
-
},
|
|
2275
|
+
}, Hn = /* @__PURE__ */ function(e) {
|
|
2206
2276
|
return e.Active = "active", e.Scheduled = "scheduled", e.Completed = "completed", e;
|
|
2207
|
-
}({}),
|
|
2277
|
+
}({}), Un = class {
|
|
2208
2278
|
static resolve(e, t = /* @__PURE__ */ new Date()) {
|
|
2209
|
-
return e.deletedAt && e.deletedAt.getTime() <= t.getTime() ?
|
|
2279
|
+
return e.deletedAt && e.deletedAt.getTime() <= t.getTime() ? Hn.Completed : e.publishedAt && e.publishedAt.getTime() > t.getTime() ? Hn.Scheduled : Hn.Active;
|
|
2210
2280
|
}
|
|
2211
|
-
},
|
|
2281
|
+
}, Wn = class extends yt {
|
|
2212
2282
|
conditions;
|
|
2213
2283
|
products;
|
|
2214
2284
|
productCategories;
|
|
@@ -2217,10 +2287,10 @@ var Nn = class {
|
|
|
2217
2287
|
countDiscountedProducts;
|
|
2218
2288
|
countDiscountedClients;
|
|
2219
2289
|
constructor(e) {
|
|
2220
|
-
super(e), this.conditions = new
|
|
2290
|
+
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
2291
|
}
|
|
2222
2292
|
getState(e = /* @__PURE__ */ new Date()) {
|
|
2223
|
-
return
|
|
2293
|
+
return Un.resolve(this, e);
|
|
2224
2294
|
}
|
|
2225
2295
|
assignCounters(e) {
|
|
2226
2296
|
this.countDiscountedPrices = e.countDiscountedPrices, this.expectedCountDiscountedPrices = e.expectedCountDiscountedPrices, this.countDiscountedProducts = e.countDiscountedProducts, this.countDiscountedClients = e.countDiscountedClients;
|
|
@@ -2236,12 +2306,12 @@ var Nn = class {
|
|
|
2236
2306
|
publishedAt: this.publishedAt ?? null,
|
|
2237
2307
|
deletedAt: this.deletedAt ?? null,
|
|
2238
2308
|
description: this.description ?? "",
|
|
2239
|
-
products:
|
|
2240
|
-
productCategories:
|
|
2309
|
+
products: b(this.products, "id"),
|
|
2310
|
+
productCategories: b(this.productCategories, "id"),
|
|
2241
2311
|
conditions: this.conditions.toSaveData()
|
|
2242
2312
|
};
|
|
2243
2313
|
}
|
|
2244
|
-
},
|
|
2314
|
+
}, Gn = class {
|
|
2245
2315
|
client;
|
|
2246
2316
|
additionalClientsCondition;
|
|
2247
2317
|
fixedClientsCondition;
|
|
@@ -2251,12 +2321,12 @@ var Nn = class {
|
|
|
2251
2321
|
regionsCondition;
|
|
2252
2322
|
salesDirectionsCondition;
|
|
2253
2323
|
constructor(e) {
|
|
2254
|
-
this.client = new
|
|
2324
|
+
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
2325
|
}
|
|
2256
2326
|
isEligible() {
|
|
2257
2327
|
return this.additionalClientsCondition || this.fixedClientsCondition || this.partnerGroupsCondition || this.managersCondition || this.citiesCondition || this.regionsCondition || this.salesDirectionsCondition;
|
|
2258
2328
|
}
|
|
2259
|
-
},
|
|
2329
|
+
}, Kn = class extends j {
|
|
2260
2330
|
id;
|
|
2261
2331
|
name;
|
|
2262
2332
|
states;
|
|
@@ -2271,7 +2341,7 @@ var Nn = class {
|
|
|
2271
2341
|
}
|
|
2272
2342
|
return this;
|
|
2273
2343
|
}
|
|
2274
|
-
},
|
|
2344
|
+
}, qn = class t extends e {
|
|
2275
2345
|
static prepareSaveData(e, t) {
|
|
2276
2346
|
return {
|
|
2277
2347
|
...e,
|
|
@@ -2286,32 +2356,32 @@ var Nn = class {
|
|
|
2286
2356
|
};
|
|
2287
2357
|
}
|
|
2288
2358
|
getDiscountsList(e, t, n, r) {
|
|
2289
|
-
return this.getTypedPaginated(
|
|
2359
|
+
return this.getTypedPaginated(yt, "/internal/price/discounts", e, t, n, {}, void 0, r);
|
|
2290
2360
|
}
|
|
2291
2361
|
getDiscount(e) {
|
|
2292
|
-
return this.get(`/internal/price/discounts/${e}`, {}, (e) => new
|
|
2362
|
+
return this.get(`/internal/price/discounts/${e}`, {}, (e) => new Wn(e.data));
|
|
2293
2363
|
}
|
|
2294
2364
|
createDiscount(e, n, r = {}) {
|
|
2295
|
-
return this.post("/internal/price/discounts", t.prepareSaveData(e, n), (e) => new
|
|
2365
|
+
return this.post("/internal/price/discounts", t.prepareSaveData(e, n), (e) => new Wn(e.data), r);
|
|
2296
2366
|
}
|
|
2297
2367
|
updateDiscount(e, n, r, i = {}) {
|
|
2298
|
-
return this.patch(`/internal/price/discounts/${e}`, t.prepareSaveData(n, r), (e) => new
|
|
2368
|
+
return this.patch(`/internal/price/discounts/${e}`, t.prepareSaveData(n, r), (e) => new Wn(e.data), i);
|
|
2299
2369
|
}
|
|
2300
2370
|
removeDiscount(e) {
|
|
2301
2371
|
return this.delete(`/internal/price/discounts/${e}`);
|
|
2302
2372
|
}
|
|
2303
2373
|
getEligibleClients(e) {
|
|
2304
|
-
return this.getTypedList(
|
|
2374
|
+
return this.getTypedList(Gn, `/internal/price/discounts/${e}/clients`);
|
|
2305
2375
|
}
|
|
2306
2376
|
checkClient(e, t) {
|
|
2307
|
-
return this.get(`/internal/price/discounts/${e}/clients/${t}/check`, {}, (e) => new
|
|
2377
|
+
return this.get(`/internal/price/discounts/${e}/clients/${t}/check`, {}, (e) => new Gn(e.data));
|
|
2308
2378
|
}
|
|
2309
|
-
},
|
|
2379
|
+
}, Jn = class extends ve {
|
|
2310
2380
|
showAllCosts;
|
|
2311
2381
|
constructor(e) {
|
|
2312
2382
|
super(e), this.showAllCosts = e?.showAllCosts;
|
|
2313
2383
|
}
|
|
2314
|
-
},
|
|
2384
|
+
}, Yn = class extends j {
|
|
2315
2385
|
name;
|
|
2316
2386
|
phone;
|
|
2317
2387
|
email;
|
|
@@ -2328,7 +2398,7 @@ var Nn = class {
|
|
|
2328
2398
|
}
|
|
2329
2399
|
return this;
|
|
2330
2400
|
}
|
|
2331
|
-
},
|
|
2401
|
+
}, Xn = class t extends e {
|
|
2332
2402
|
static transformExternalSeoDataToRequest(e) {
|
|
2333
2403
|
return {
|
|
2334
2404
|
name: e.name,
|
|
@@ -2341,62 +2411,62 @@ var Nn = class {
|
|
|
2341
2411
|
};
|
|
2342
2412
|
}
|
|
2343
2413
|
getExternalSeoList(e, t, n, r) {
|
|
2344
|
-
return this.getTypedPaginated(
|
|
2414
|
+
return this.getTypedPaginated(ve, "/internal/external-seo", e, t, n, {}, void 0, r);
|
|
2345
2415
|
}
|
|
2346
2416
|
getExternalSeo(e, t = !1) {
|
|
2347
|
-
return this.get(`/internal/external-seo/${e}`, {}, (e) => new
|
|
2417
|
+
return this.get(`/internal/external-seo/${e}`, {}, (e) => new Jn(e.data), t);
|
|
2348
2418
|
}
|
|
2349
2419
|
createExternalSeo(e, n = {}) {
|
|
2350
|
-
return this.post("/internal/external-seo", t.transformExternalSeoDataToRequest(e), (e) => new
|
|
2420
|
+
return this.post("/internal/external-seo", t.transformExternalSeoDataToRequest(e), (e) => new Jn(e.data), n);
|
|
2351
2421
|
}
|
|
2352
2422
|
updateExternalSeo(e, n = {}) {
|
|
2353
|
-
return this.patch(`/internal/external-seo/${e.id}`, t.transformExternalSeoDataToRequest(e), (e) => new
|
|
2423
|
+
return this.patch(`/internal/external-seo/${e.id}`, t.transformExternalSeoDataToRequest(e), (e) => new Jn(e.data), n);
|
|
2354
2424
|
}
|
|
2355
2425
|
deleteExternalSeo(e) {
|
|
2356
2426
|
return this.delete(`/internal/external-seo/${e}`);
|
|
2357
2427
|
}
|
|
2358
|
-
},
|
|
2428
|
+
}, Zn = class extends f {
|
|
2359
2429
|
constructor(e) {
|
|
2360
2430
|
super(e);
|
|
2361
2431
|
}
|
|
2362
|
-
},
|
|
2432
|
+
}, Qn = class extends u {
|
|
2363
2433
|
question;
|
|
2364
2434
|
answer;
|
|
2365
2435
|
groups;
|
|
2366
2436
|
constructor(e) {
|
|
2367
|
-
super(e, -1), this.question = e?.question ?? "", this.answer = e?.answer ?? "", this.groups =
|
|
2437
|
+
super(e, -1), this.question = e?.question ?? "", this.answer = e?.answer ?? "", this.groups = b(e?.groups ?? [], (e) => new Zn(e));
|
|
2368
2438
|
}
|
|
2369
2439
|
toSaveData() {
|
|
2370
2440
|
return {
|
|
2371
2441
|
question: this.question,
|
|
2372
2442
|
answer: this.answer,
|
|
2373
|
-
groups:
|
|
2443
|
+
groups: b(this.groups, "id")
|
|
2374
2444
|
};
|
|
2375
2445
|
}
|
|
2376
|
-
},
|
|
2446
|
+
}, $n = class extends e {
|
|
2377
2447
|
getFaqList(e, t) {
|
|
2378
|
-
return this.getTypedPaginated(
|
|
2448
|
+
return this.getTypedPaginated(Qn, "/internal/faq", void 0, void 0, t, v(e) ? {} : { group: e });
|
|
2379
2449
|
}
|
|
2380
2450
|
getFaq(e) {
|
|
2381
|
-
return this.get(`/internal/faq/${e}`, {}, (e) => new
|
|
2451
|
+
return this.get(`/internal/faq/${e}`, {}, (e) => new Qn(e.data));
|
|
2382
2452
|
}
|
|
2383
2453
|
createFaq(e, t = {}) {
|
|
2384
|
-
return this.post("/internal/faq", e, (e) => new
|
|
2454
|
+
return this.post("/internal/faq", e, (e) => new Qn(e.data), t);
|
|
2385
2455
|
}
|
|
2386
2456
|
updateFaq(e, t, n = {}) {
|
|
2387
|
-
return this.patch(`/internal/faq/${e}`, t, (e) => new
|
|
2457
|
+
return this.patch(`/internal/faq/${e}`, t, (e) => new Qn(e.data), n);
|
|
2388
2458
|
}
|
|
2389
2459
|
removeFaq(e) {
|
|
2390
2460
|
return this.delete(`/internal/faq/${e}`);
|
|
2391
2461
|
}
|
|
2392
2462
|
getGroupsList() {
|
|
2393
|
-
return this.getTypedList(
|
|
2463
|
+
return this.getTypedList(Zn, "/internal/faq/groups");
|
|
2394
2464
|
}
|
|
2395
2465
|
createGroup(e, t = {}) {
|
|
2396
|
-
return this.post("/internal/faq/groups", e, (e) => new
|
|
2466
|
+
return this.post("/internal/faq/groups", e, (e) => new Zn(e.data), t);
|
|
2397
2467
|
}
|
|
2398
2468
|
updateGroup(e, t, n = {}) {
|
|
2399
|
-
return this.patch(`/internal/faq/groups/${e}`, t, (e) => new
|
|
2469
|
+
return this.patch(`/internal/faq/groups/${e}`, t, (e) => new Zn(e.data), n);
|
|
2400
2470
|
}
|
|
2401
2471
|
removeGroup(e) {
|
|
2402
2472
|
return this.delete(`/internal/faq/groups/${e}`);
|
|
@@ -2404,13 +2474,13 @@ var Nn = class {
|
|
|
2404
2474
|
};
|
|
2405
2475
|
//#endregion
|
|
2406
2476
|
//#region src/helpers/format-percent-change.ts
|
|
2407
|
-
function
|
|
2408
|
-
let t =
|
|
2477
|
+
function er(e) {
|
|
2478
|
+
let t = Pe(e * 100);
|
|
2409
2479
|
return `${t >= 0 ? "+" : ""}${t}%`;
|
|
2410
2480
|
}
|
|
2411
2481
|
//#endregion
|
|
2412
2482
|
//#region src/helpers/units-helper.ts
|
|
2413
|
-
var
|
|
2483
|
+
var tr = class e {
|
|
2414
2484
|
static productIsMeasurable(e) {
|
|
2415
2485
|
return e.unit.isLinear || e.unit.isSquare;
|
|
2416
2486
|
}
|
|
@@ -2420,9 +2490,9 @@ var Zn = class e {
|
|
|
2420
2490
|
static getProductLengthMultiplicity(e) {
|
|
2421
2491
|
return e.properties?.lengthStep == null ? !e.properties?.ignoreMinCountCheck && e.properties?.minCount != null ? e.properties.minCount : .01 : e.properties.lengthStep;
|
|
2422
2492
|
}
|
|
2423
|
-
},
|
|
2493
|
+
}, nr = class {
|
|
2424
2494
|
static generateUndefinedManagerInstance() {
|
|
2425
|
-
return new
|
|
2495
|
+
return new d({
|
|
2426
2496
|
id: 0,
|
|
2427
2497
|
name: "- Не назначен -",
|
|
2428
2498
|
isActive: !0,
|
|
@@ -2432,7 +2502,7 @@ var Zn = class e {
|
|
|
2432
2502
|
static isUndefinedManagerInstance(e) {
|
|
2433
2503
|
return e.id === 0 && e.guid === "-undefined-";
|
|
2434
2504
|
}
|
|
2435
|
-
},
|
|
2505
|
+
}, rr = class extends j {
|
|
2436
2506
|
name;
|
|
2437
2507
|
phone;
|
|
2438
2508
|
email;
|
|
@@ -2441,7 +2511,7 @@ var Zn = class e {
|
|
|
2441
2511
|
isSupervisor;
|
|
2442
2512
|
canDoReclamations;
|
|
2443
2513
|
constructor(e) {
|
|
2444
|
-
super(), this.name = e?.name, this.phone = e?.phone, this.email = e?.email, this.salesDirections = e?.salesDirections?.map((e) => new
|
|
2514
|
+
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;
|
|
2445
2515
|
}
|
|
2446
2516
|
resetFilterValue(e) {
|
|
2447
2517
|
switch (e) {
|
|
@@ -2455,7 +2525,7 @@ var Zn = class e {
|
|
|
2455
2525
|
}
|
|
2456
2526
|
return this;
|
|
2457
2527
|
}
|
|
2458
|
-
},
|
|
2528
|
+
}, ir = class e extends ae {
|
|
2459
2529
|
static transformManagerDataToRequest(e) {
|
|
2460
2530
|
return {
|
|
2461
2531
|
name: e.name,
|
|
@@ -2469,37 +2539,37 @@ var Zn = class e {
|
|
|
2469
2539
|
salesDirectionId: e.salesDirection.id,
|
|
2470
2540
|
pricingRoleId: e.pricingRole?.id,
|
|
2471
2541
|
showAllCosts: e.showAllCosts ?? !1,
|
|
2472
|
-
storeIds:
|
|
2473
|
-
curatedDirectionIds:
|
|
2474
|
-
managerRegionIds:
|
|
2475
|
-
managerIds:
|
|
2542
|
+
storeIds: b(e.stores, "id"),
|
|
2543
|
+
curatedDirectionIds: b(e.curatedDirections, "id"),
|
|
2544
|
+
managerRegionIds: b(e.managerRegions, "id"),
|
|
2545
|
+
managerIds: b(e.managers, "id"),
|
|
2476
2546
|
photo: e.photoFile
|
|
2477
2547
|
};
|
|
2478
2548
|
}
|
|
2479
2549
|
getManagersList(e, t, n, r) {
|
|
2480
|
-
return this.getTypedPaginated(
|
|
2550
|
+
return this.getTypedPaginated(d, "/internal/managers", e, t, n, {}, void 0, r);
|
|
2481
2551
|
}
|
|
2482
2552
|
createManager(t, n = {}) {
|
|
2483
|
-
return this.post("/internal/managers", e.transformManagerDataToRequest(t), (e) => new
|
|
2553
|
+
return this.post("/internal/managers", e.transformManagerDataToRequest(t), (e) => new d(e.data), n);
|
|
2484
2554
|
}
|
|
2485
2555
|
updateManager(t, n = {}) {
|
|
2486
|
-
return this.patch(`/internal/managers/${t.id}`, e.transformManagerDataToRequest(t), (e) => new
|
|
2556
|
+
return this.patch(`/internal/managers/${t.id}`, e.transformManagerDataToRequest(t), (e) => new d(e.data), n);
|
|
2487
2557
|
}
|
|
2488
2558
|
getManagerRegionsList(e, t, n) {
|
|
2489
|
-
return this.getTypedPaginated(
|
|
2559
|
+
return this.getTypedPaginated(be, "/internal/managers/regions", e, t, n);
|
|
2490
2560
|
}
|
|
2491
|
-
},
|
|
2561
|
+
}, ar = /* @__PURE__ */ function(e) {
|
|
2492
2562
|
return e.Processing = "processing", e.Completed = "completed", e.Error = "error", e.NeedsActualization = "needs_actualization", e;
|
|
2493
|
-
}({}),
|
|
2563
|
+
}({}), or = class {
|
|
2494
2564
|
status;
|
|
2495
2565
|
actualizedAt;
|
|
2496
2566
|
expiresAt;
|
|
2497
2567
|
error;
|
|
2498
2568
|
constructor(e) {
|
|
2499
|
-
this.status = e?.status ??
|
|
2569
|
+
this.status = e?.status ?? ar.Processing, this.actualizedAt = s.parse(e?.actualizedAt), this.expiresAt = s.parse(e?.expiresAt), this.error = e?.error;
|
|
2500
2570
|
}
|
|
2501
2571
|
get isProcessing() {
|
|
2502
|
-
return this.status ===
|
|
2572
|
+
return this.status === ar.Processing;
|
|
2503
2573
|
}
|
|
2504
2574
|
get isOutdated() {
|
|
2505
2575
|
return this.isOutdatedAt(/* @__PURE__ */ new Date());
|
|
@@ -2508,12 +2578,12 @@ var Zn = class e {
|
|
|
2508
2578
|
return this.isOrderAllowedAt(/* @__PURE__ */ new Date());
|
|
2509
2579
|
}
|
|
2510
2580
|
isOutdatedAt(e) {
|
|
2511
|
-
return this.status !==
|
|
2581
|
+
return this.status !== ar.Completed || v(this.actualizedAt) ? !0 : !v(this.expiresAt) && this.expiresAt.getTime() < e.getTime();
|
|
2512
2582
|
}
|
|
2513
2583
|
isOrderAllowedAt(e) {
|
|
2514
|
-
return this.status ===
|
|
2584
|
+
return this.status === ar.Completed && !this.isOutdatedAt(e);
|
|
2515
2585
|
}
|
|
2516
|
-
},
|
|
2586
|
+
}, sr = class extends M {
|
|
2517
2587
|
name;
|
|
2518
2588
|
client;
|
|
2519
2589
|
sum;
|
|
@@ -2521,9 +2591,9 @@ var Zn = class e {
|
|
|
2521
2591
|
actualization;
|
|
2522
2592
|
file;
|
|
2523
2593
|
constructor(e) {
|
|
2524
|
-
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
|
|
2594
|
+
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;
|
|
2525
2595
|
}
|
|
2526
|
-
},
|
|
2596
|
+
}, cr = class extends kt {
|
|
2527
2597
|
groupName;
|
|
2528
2598
|
supplierSku;
|
|
2529
2599
|
isIgnored;
|
|
@@ -2532,24 +2602,24 @@ var Zn = class e {
|
|
|
2532
2602
|
super(e), this.groupName = e.groupName, this.supplierSku = e.supplierSku ?? e.product.supplierSku, this.isIgnored = e.isIgnored, this.lineError = e.lineError;
|
|
2533
2603
|
}
|
|
2534
2604
|
get isProductStub() {
|
|
2535
|
-
return
|
|
2605
|
+
return v(this.product.id);
|
|
2536
2606
|
}
|
|
2537
2607
|
get isOrderable() {
|
|
2538
|
-
return !this.isProductStub && !this.isIgnored &&
|
|
2608
|
+
return !this.isProductStub && !this.isIgnored && Oe(this.lineError);
|
|
2539
2609
|
}
|
|
2540
|
-
}, Z = class extends
|
|
2610
|
+
}, Z = class extends sr {
|
|
2541
2611
|
sum;
|
|
2542
2612
|
products;
|
|
2543
2613
|
constructor(e) {
|
|
2544
|
-
super(e), this.sum = e.sum ?? 0, this.products = (e.products ?? []).map((t) => e.isProfstroy ? new
|
|
2614
|
+
super(e), this.sum = e.sum ?? 0, this.products = (e.products ?? []).map((t) => e.isProfstroy ? new cr(t) : new kt(t));
|
|
2545
2615
|
}
|
|
2546
|
-
},
|
|
2616
|
+
}, lr = class extends j {
|
|
2547
2617
|
id;
|
|
2548
2618
|
clientSearchTerm;
|
|
2549
2619
|
name;
|
|
2550
|
-
createdAt = new
|
|
2620
|
+
createdAt = new N();
|
|
2551
2621
|
constructor(e) {
|
|
2552
|
-
super(), this.id = e?.id, this.clientSearchTerm = e?.clientSearchTerm, this.name = e?.name, this.createdAt = new
|
|
2622
|
+
super(), this.id = e?.id, this.clientSearchTerm = e?.clientSearchTerm, this.name = e?.name, this.createdAt = new N(e?.createdAt);
|
|
2553
2623
|
}
|
|
2554
2624
|
resetFilterValue(e) {
|
|
2555
2625
|
return e === "createdAt" ? (this.createdAt.from = null, this.createdAt.to = null) : this[e] = void 0, this;
|
|
@@ -2558,7 +2628,7 @@ var Zn = class e {
|
|
|
2558
2628
|
let e = super.asClearRaw();
|
|
2559
2629
|
return !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, e;
|
|
2560
2630
|
}
|
|
2561
|
-
},
|
|
2631
|
+
}, ur = class extends Sn {
|
|
2562
2632
|
client;
|
|
2563
2633
|
payment;
|
|
2564
2634
|
delivery;
|
|
@@ -2579,14 +2649,14 @@ var Zn = class e {
|
|
|
2579
2649
|
onlinePaymentLink: e?.payment?.onlinePaymentLink
|
|
2580
2650
|
}, this.delivery = {
|
|
2581
2651
|
type: e?.delivery?.type ?? -1,
|
|
2582
|
-
date:
|
|
2652
|
+
date: y(e?.delivery?.date) ? E(e.delivery.date) : e?.delivery?.date ?? /* @__PURE__ */ new Date(),
|
|
2583
2653
|
address: e?.delivery?.address ? new Y(e.delivery.address) : void 0,
|
|
2584
|
-
warehouse: e?.delivery?.warehouse ? new
|
|
2585
|
-
}, this.attachedUser = e?.attachedUser ? new F(e?.attachedUser) : void 0, this.status = new
|
|
2654
|
+
warehouse: e?.delivery?.warehouse ? new xe(e.delivery.warehouse) : void 0
|
|
2655
|
+
}, 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);
|
|
2586
2656
|
let t = e?.attachedAt;
|
|
2587
|
-
this.attachedAt =
|
|
2657
|
+
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;
|
|
2588
2658
|
}
|
|
2589
|
-
},
|
|
2659
|
+
}, dr = class extends Ot {
|
|
2590
2660
|
product;
|
|
2591
2661
|
cost;
|
|
2592
2662
|
costOne;
|
|
@@ -2600,9 +2670,9 @@ var Zn = class e {
|
|
|
2600
2670
|
changedFields = [];
|
|
2601
2671
|
replacement;
|
|
2602
2672
|
constructor(e, t) {
|
|
2603
|
-
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 =
|
|
2673
|
+
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"));
|
|
2604
2674
|
}
|
|
2605
|
-
}, Q = class extends
|
|
2675
|
+
}, Q = class extends ur {
|
|
2606
2676
|
products;
|
|
2607
2677
|
invoices;
|
|
2608
2678
|
comment;
|
|
@@ -2618,11 +2688,11 @@ var Zn = class e {
|
|
|
2618
2688
|
erpOrderUrl;
|
|
2619
2689
|
numberDoc;
|
|
2620
2690
|
constructor(e) {
|
|
2621
|
-
super(e), this.products = (e.products ?? []).map((t) => new
|
|
2691
|
+
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;
|
|
2622
2692
|
}
|
|
2623
|
-
},
|
|
2693
|
+
}, fr = class extends e {
|
|
2624
2694
|
getOffers(e, t, n, r) {
|
|
2625
|
-
return this.getTypedPaginated(
|
|
2695
|
+
return this.getTypedPaginated(sr, "/internal/orders/offers", e, t, n, {}, void 0, r);
|
|
2626
2696
|
}
|
|
2627
2697
|
createOfferFromCart(e, t, n) {
|
|
2628
2698
|
return this.post(`/internal/orders/offers/${e}`, {
|
|
@@ -2652,12 +2722,12 @@ var Zn = class e {
|
|
|
2652
2722
|
return this.delete(`/internal/orders/offers/${e}`);
|
|
2653
2723
|
}
|
|
2654
2724
|
createOrderFromDraft(e, t, n, r = {}) {
|
|
2655
|
-
let i =
|
|
2725
|
+
let i = _().config.dateFormats.api;
|
|
2656
2726
|
return this.post(`/internal/orders/offers/${e}/create-order`, {
|
|
2657
2727
|
...t,
|
|
2658
|
-
deliveryDate: t.deliveryDate ?
|
|
2728
|
+
deliveryDate: t.deliveryDate ? T(t.deliveryDate, i) : void 0,
|
|
2659
2729
|
items: n?.length ? n : void 0
|
|
2660
|
-
}, (e) =>
|
|
2730
|
+
}, (e) => g.instanceListInitializer(Q, e.data), r);
|
|
2661
2731
|
}
|
|
2662
2732
|
addOfferProduct(e, t, n = {}) {
|
|
2663
2733
|
return this.post(`/internal/orders/offers/${e}/products`, {
|
|
@@ -2706,25 +2776,25 @@ var Zn = class e {
|
|
|
2706
2776
|
sendOffer(e, t) {
|
|
2707
2777
|
return this.post(`/internal/orders/offers/${e}/send`, t);
|
|
2708
2778
|
}
|
|
2709
|
-
},
|
|
2779
|
+
}, pr = class {
|
|
2710
2780
|
static isProfstroy(e) {
|
|
2711
2781
|
return !!e?.isProfstroy;
|
|
2712
2782
|
}
|
|
2713
2783
|
static isProfstroyOffer(e) {
|
|
2714
|
-
return !
|
|
2784
|
+
return !v(e) && e.isProfstroy === !0 && !v(e.actualization);
|
|
2715
2785
|
}
|
|
2716
|
-
},
|
|
2786
|
+
}, mr = class extends ve {
|
|
2717
2787
|
isBillingSupervisor;
|
|
2718
2788
|
constructor(e) {
|
|
2719
2789
|
super(e), this.isBillingSupervisor = e?.isBillingSupervisor ?? !1;
|
|
2720
2790
|
}
|
|
2721
|
-
},
|
|
2791
|
+
}, hr = class extends mr {
|
|
2722
2792
|
showAllCosts;
|
|
2723
2793
|
stores;
|
|
2724
2794
|
constructor(e) {
|
|
2725
|
-
super(e), this.showAllCosts = e?.showAllCosts, this.stores = e?.stores?.map((e) => new
|
|
2795
|
+
super(e), this.showAllCosts = e?.showAllCosts, this.stores = e?.stores?.map((e) => new he(e));
|
|
2726
2796
|
}
|
|
2727
|
-
},
|
|
2797
|
+
}, gr = class extends j {
|
|
2728
2798
|
name;
|
|
2729
2799
|
phone;
|
|
2730
2800
|
email;
|
|
@@ -2733,7 +2803,7 @@ var Zn = class e {
|
|
|
2733
2803
|
isBillingSupervisor;
|
|
2734
2804
|
canDoReclamations;
|
|
2735
2805
|
constructor(e) {
|
|
2736
|
-
super(), this.name = e?.name, this.phone = e?.phone, this.email = e?.email, this.salesDirections = e?.salesDirections?.map((e) => new
|
|
2806
|
+
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;
|
|
2737
2807
|
}
|
|
2738
2808
|
resetFilterValue(e) {
|
|
2739
2809
|
switch (e) {
|
|
@@ -2747,7 +2817,7 @@ var Zn = class e {
|
|
|
2747
2817
|
}
|
|
2748
2818
|
return this;
|
|
2749
2819
|
}
|
|
2750
|
-
},
|
|
2820
|
+
}, _r = class t extends e {
|
|
2751
2821
|
static transformOperatorDataToRequest(e) {
|
|
2752
2822
|
return {
|
|
2753
2823
|
name: e.name,
|
|
@@ -2760,25 +2830,25 @@ var Zn = class e {
|
|
|
2760
2830
|
salesDirectionId: e.salesDirection?.id,
|
|
2761
2831
|
pricingRoleId: e.pricingRole?.id,
|
|
2762
2832
|
showAllCosts: e.showAllCosts ?? !1,
|
|
2763
|
-
storeIds:
|
|
2833
|
+
storeIds: b(e.stores, "id"),
|
|
2764
2834
|
photo: e.photoFile
|
|
2765
2835
|
};
|
|
2766
2836
|
}
|
|
2767
2837
|
getOperatorsList(e, t, n, r) {
|
|
2768
|
-
return this.getTypedPaginated(
|
|
2838
|
+
return this.getTypedPaginated(mr, "/internal/operators", e, t, n, {}, void 0, r);
|
|
2769
2839
|
}
|
|
2770
2840
|
getOperator(e, t = !1) {
|
|
2771
|
-
return this.get(`/internal/operators/${e}`, {}, (e) => new
|
|
2841
|
+
return this.get(`/internal/operators/${e}`, {}, (e) => new hr(e.data), t);
|
|
2772
2842
|
}
|
|
2773
2843
|
createOperator(e, n = {}) {
|
|
2774
|
-
return this.post("/internal/operators", t.transformOperatorDataToRequest(e), (e) => new
|
|
2844
|
+
return this.post("/internal/operators", t.transformOperatorDataToRequest(e), (e) => new hr(e.data), n);
|
|
2775
2845
|
}
|
|
2776
2846
|
updateOperator(e, n = {}) {
|
|
2777
|
-
return this.patch(`/internal/operators/${e.id}`, t.transformOperatorDataToRequest(e), (e) => new
|
|
2847
|
+
return this.patch(`/internal/operators/${e.id}`, t.transformOperatorDataToRequest(e), (e) => new hr(e.data), n);
|
|
2778
2848
|
}
|
|
2779
|
-
},
|
|
2849
|
+
}, vr = /* @__PURE__ */ function(e) {
|
|
2780
2850
|
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;
|
|
2781
|
-
}({}),
|
|
2851
|
+
}({}), yr = class {
|
|
2782
2852
|
paymentType;
|
|
2783
2853
|
deliveryType;
|
|
2784
2854
|
contragentId;
|
|
@@ -2796,21 +2866,21 @@ var Zn = class e {
|
|
|
2796
2866
|
constructor(e) {
|
|
2797
2867
|
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;
|
|
2798
2868
|
}
|
|
2799
|
-
},
|
|
2869
|
+
}, br = class extends j {
|
|
2800
2870
|
attachedUsers;
|
|
2801
2871
|
clientSearchTerm;
|
|
2802
2872
|
client;
|
|
2803
2873
|
contragent;
|
|
2804
|
-
createdAt = new
|
|
2874
|
+
createdAt = new N();
|
|
2805
2875
|
creator;
|
|
2806
|
-
deliveryDate = new
|
|
2876
|
+
deliveryDate = new N();
|
|
2807
2877
|
deliveryAddressSearch;
|
|
2808
2878
|
clientCities;
|
|
2809
2879
|
id;
|
|
2810
2880
|
isApproved;
|
|
2811
2881
|
isNotInStock;
|
|
2812
2882
|
isOnOrder;
|
|
2813
|
-
attachedAt = new
|
|
2883
|
+
attachedAt = new N();
|
|
2814
2884
|
salesDirections;
|
|
2815
2885
|
status;
|
|
2816
2886
|
statusDetail;
|
|
@@ -2819,9 +2889,10 @@ var Zn = class e {
|
|
|
2819
2889
|
warehouses;
|
|
2820
2890
|
isLargeOrder;
|
|
2821
2891
|
isToProcess;
|
|
2892
|
+
userRegions;
|
|
2822
2893
|
onlyMyRegions;
|
|
2823
2894
|
constructor(e) {
|
|
2824
|
-
super(), this.attachedUsers = e?.attachedUsers?.map((e) => "isActive" in e ? new
|
|
2895
|
+
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, this.userRegions = e?.userRegions?.map((e) => new be(e));
|
|
2825
2896
|
}
|
|
2826
2897
|
resetFilterValue(e) {
|
|
2827
2898
|
switch (e) {
|
|
@@ -2854,6 +2925,9 @@ var Zn = class e {
|
|
|
2854
2925
|
case "warehouses":
|
|
2855
2926
|
this.warehouses = [];
|
|
2856
2927
|
break;
|
|
2928
|
+
case "userRegions":
|
|
2929
|
+
this.userRegions = [];
|
|
2930
|
+
break;
|
|
2857
2931
|
default: this[e] = void 0;
|
|
2858
2932
|
}
|
|
2859
2933
|
return this;
|
|
@@ -2862,22 +2936,22 @@ var Zn = class e {
|
|
|
2862
2936
|
let e = super.asClearRaw();
|
|
2863
2937
|
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;
|
|
2864
2938
|
}
|
|
2865
|
-
},
|
|
2939
|
+
}, xr = class {
|
|
2866
2940
|
user;
|
|
2867
2941
|
status;
|
|
2868
2942
|
statusDetail;
|
|
2869
2943
|
createdAt;
|
|
2870
2944
|
constructor(e) {
|
|
2871
|
-
this.user = new F(e?.user), this.status = new
|
|
2945
|
+
this.user = new F(e?.user), this.status = new ce(e?.status), this.statusDetail = e?.statusDetail ? new fe(e.statusDetail) : void 0;
|
|
2872
2946
|
let t = e?.createdAt;
|
|
2873
|
-
this.createdAt =
|
|
2947
|
+
this.createdAt = y(t) ? E(t) : e?.createdAt ?? /* @__PURE__ */ new Date();
|
|
2874
2948
|
}
|
|
2875
|
-
},
|
|
2949
|
+
}, Sr = class extends e {
|
|
2876
2950
|
getOrders(e, t, n, r) {
|
|
2877
|
-
return this.getTypedPaginated(
|
|
2951
|
+
return this.getTypedPaginated(ur, "/internal/orders", e, t, n, {}, void 0, r);
|
|
2878
2952
|
}
|
|
2879
2953
|
getOrdersCount(e, t) {
|
|
2880
|
-
return this.get("/internal/orders/count", e ? { filters: JSON.stringify((e instanceof
|
|
2954
|
+
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);
|
|
2881
2955
|
}
|
|
2882
2956
|
getClientOrderStatistics(e, t) {
|
|
2883
2957
|
return this.get(`/internal/clients/${e}/orders/statistics`, t ? { period: t } : {});
|
|
@@ -2886,12 +2960,12 @@ var Zn = class e {
|
|
|
2886
2960
|
return this.get(`/internal/orders/${e}`, {}, (e) => new Q(e.data));
|
|
2887
2961
|
}
|
|
2888
2962
|
createClientOrder(e, t, n, r = {}) {
|
|
2889
|
-
let i =
|
|
2963
|
+
let i = _().config.dateFormats.api;
|
|
2890
2964
|
return this.post(`/internal/clients/${e}/orders`, {
|
|
2891
2965
|
...t,
|
|
2892
|
-
deliveryDate:
|
|
2966
|
+
deliveryDate: T(t.deliveryDate, i),
|
|
2893
2967
|
items: n?.length ? n : void 0
|
|
2894
|
-
}, (e) =>
|
|
2968
|
+
}, (e) => g.instanceListInitializer(Q, e.data), r);
|
|
2895
2969
|
}
|
|
2896
2970
|
attachOrder(e) {
|
|
2897
2971
|
return this.patch(`/internal/orders/${e}/attach`, {}, (e) => new Q(e.data));
|
|
@@ -2909,10 +2983,10 @@ var Zn = class e {
|
|
|
2909
2983
|
return this.get(`/internal/orders/${e}/clone`, {});
|
|
2910
2984
|
}
|
|
2911
2985
|
updateOrder(e, t, n = {}) {
|
|
2912
|
-
let r =
|
|
2986
|
+
let r = _().config.dateFormats.api;
|
|
2913
2987
|
return this.patch(`/internal/orders/${e}`, {
|
|
2914
2988
|
...t,
|
|
2915
|
-
deliveryDate: t.deliveryDate ?
|
|
2989
|
+
deliveryDate: t.deliveryDate ? T(t.deliveryDate, r) : void 0
|
|
2916
2990
|
}, (e) => new Q(e.data), n);
|
|
2917
2991
|
}
|
|
2918
2992
|
addOrderProduct(e, t, n = {}) {
|
|
@@ -2939,7 +3013,7 @@ var Zn = class e {
|
|
|
2939
3013
|
return this.patch(`/internal/orders/${e}/status`, { statusDetail: t }, (e) => new Q(e.data));
|
|
2940
3014
|
}
|
|
2941
3015
|
getOrderStatusHistory(e) {
|
|
2942
|
-
return this.getTypedList(
|
|
3016
|
+
return this.getTypedList(xr, `/internal/orders/${e}/history`);
|
|
2943
3017
|
}
|
|
2944
3018
|
getOrderPrintHtml(e, t) {
|
|
2945
3019
|
return this.get(`/internal/orders/${e}/print/view`, { ...t }, (e) => new Blob([e.data], { type: "text/html" }));
|
|
@@ -2980,51 +3054,51 @@ var Zn = class e {
|
|
|
2980
3054
|
return this.get(`/internal/orders/self-delivery/${e}/nearest-dates`, {}, (e) => e.data, void 0, t);
|
|
2981
3055
|
}
|
|
2982
3056
|
getDeliveryCost(e, t, n, r) {
|
|
2983
|
-
let i =
|
|
3057
|
+
let i = _().config.dateFormats.api;
|
|
2984
3058
|
return this.get(`/internal/orders/delivery/${e}/cost`, {
|
|
2985
|
-
date:
|
|
3059
|
+
date: T(t, i),
|
|
2986
3060
|
warehouse_id: n
|
|
2987
3061
|
}, (e) => e.data, void 0, r);
|
|
2988
3062
|
}
|
|
2989
|
-
},
|
|
3063
|
+
}, Cr = Symbol("currentOrder"), wr = class {
|
|
2990
3064
|
client;
|
|
2991
3065
|
product;
|
|
2992
3066
|
cost;
|
|
2993
3067
|
costCoefficient;
|
|
2994
3068
|
source;
|
|
2995
3069
|
constructor(e) {
|
|
2996
|
-
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 ??
|
|
3070
|
+
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;
|
|
2997
3071
|
}
|
|
2998
|
-
},
|
|
3072
|
+
}, Tr = (e) => e ? Ne({
|
|
2999
3073
|
cities: e.cities?.map((e) => e.id),
|
|
3000
3074
|
clients: e.clients?.map((e) => e.id),
|
|
3001
3075
|
managers: e.managers?.map((e) => e.id),
|
|
3002
3076
|
partnerGroups: e.partnerGroups?.map((e) => e.id),
|
|
3003
3077
|
salesDirections: e.salesDirections?.map((e) => e.id),
|
|
3004
3078
|
hideNotActive: e.hideNotActive
|
|
3005
|
-
}, (e) =>
|
|
3079
|
+
}, (e) => v(e) || (Ee(e) || Ae(e)) && Oe(e)) : {}, Er = (e) => {
|
|
3006
3080
|
let t = {};
|
|
3007
3081
|
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;
|
|
3008
|
-
},
|
|
3082
|
+
}, Dr = class extends l {
|
|
3009
3083
|
analyzeProductPrices(e, t, n) {
|
|
3010
3084
|
return this.get(`/internal/price/products/${e}/analyze`, {
|
|
3011
|
-
...
|
|
3012
|
-
filters:
|
|
3013
|
-
}, (e) =>
|
|
3085
|
+
...Er(t),
|
|
3086
|
+
filters: Tr(n)
|
|
3087
|
+
}, (e) => g.instanceListInitializer(wr, e.data));
|
|
3014
3088
|
}
|
|
3015
3089
|
analyzeCategoryPrices(e, t, n) {
|
|
3016
3090
|
return this.get(`/internal/price/categories/${e}/analyze`, {
|
|
3017
|
-
...
|
|
3018
|
-
filters:
|
|
3019
|
-
}, (e) =>
|
|
3091
|
+
...Er(t),
|
|
3092
|
+
filters: Tr(n)
|
|
3093
|
+
}, (e) => g.instanceListInitializer(wr, e.data));
|
|
3020
3094
|
}
|
|
3021
3095
|
analyzeCategoryPricesBySquare(e, t, n) {
|
|
3022
3096
|
return this.get(`/internal/price/categories/${e}/analyze/square`, {
|
|
3023
3097
|
...t,
|
|
3024
|
-
filters:
|
|
3025
|
-
}, (e) =>
|
|
3098
|
+
filters: Tr(n)
|
|
3099
|
+
}, (e) => g.instanceListInitializer(wr, e.data));
|
|
3026
3100
|
}
|
|
3027
|
-
},
|
|
3101
|
+
}, Or = class {
|
|
3028
3102
|
cost;
|
|
3029
3103
|
isLowCost;
|
|
3030
3104
|
isRetail;
|
|
@@ -3036,43 +3110,43 @@ var Zn = class e {
|
|
|
3036
3110
|
executor;
|
|
3037
3111
|
currency;
|
|
3038
3112
|
constructor(e) {
|
|
3039
|
-
this.cost = e.cost ?? 0, this.isLowCost = e.isLowCost ?? !1, this.isRetail = e.isRetail ?? !1, this.costDate =
|
|
3113
|
+
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;
|
|
3040
3114
|
}
|
|
3041
|
-
},
|
|
3115
|
+
}, kr = class extends L {
|
|
3042
3116
|
history;
|
|
3043
3117
|
constructor(e) {
|
|
3044
|
-
super(e), this.history =
|
|
3118
|
+
super(e), this.history = b(e.history, (e) => new Or(e));
|
|
3045
3119
|
}
|
|
3046
|
-
},
|
|
3120
|
+
}, Ar = class extends l {
|
|
3047
3121
|
getProductPriceHistory(e) {
|
|
3048
|
-
let t =
|
|
3049
|
-
from:
|
|
3050
|
-
to:
|
|
3051
|
-
} }), (e) =>
|
|
3052
|
-
return delete n.product, this.get(`/internal/price/products/${r}/history`, n).then((e) => [new
|
|
3122
|
+
let t = _().config.dateFormats.api, n = Ne(Me(e, { costDate: {
|
|
3123
|
+
from: De(e.costDate?.from) ? T(e.costDate.from, t) : e.costDate?.from,
|
|
3124
|
+
to: De(e.costDate?.to) ? T(e.costDate.to, t) : e.costDate?.to
|
|
3125
|
+
} }), (e) => v(e) || (Ee(e) || Ae(e)) && Oe(e)), r = e.product?.[0] ?? 0;
|
|
3126
|
+
return delete n.product, this.get(`/internal/price/products/${r}/history`, n).then((e) => [new kr(Me(e[0], { history: e }))]);
|
|
3053
3127
|
}
|
|
3054
|
-
},
|
|
3128
|
+
}, jr = class {
|
|
3055
3129
|
createdAt;
|
|
3056
3130
|
creator;
|
|
3057
3131
|
files;
|
|
3058
3132
|
text;
|
|
3059
3133
|
status;
|
|
3060
3134
|
constructor(e) {
|
|
3061
|
-
this.createdAt = s.parse(e?.createdAt) ?? /* @__PURE__ */ new Date(), this.creator =
|
|
3135
|
+
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;
|
|
3062
3136
|
}
|
|
3063
3137
|
isStatusChanged() {
|
|
3064
|
-
return !
|
|
3138
|
+
return !v(this.status);
|
|
3065
3139
|
}
|
|
3066
3140
|
}, $ = /* @__PURE__ */ function(e) {
|
|
3067
3141
|
return e[e.Initiated = 1] = "Initiated", e[e.InfoRequired = 2] = "InfoRequired", e[e.Pending = 3] = "Pending", e[e.Completed = 4] = "Completed", e;
|
|
3068
|
-
}({}),
|
|
3142
|
+
}({}), Mr = class extends M {
|
|
3069
3143
|
status;
|
|
3070
3144
|
closedAt;
|
|
3071
3145
|
isRead;
|
|
3072
3146
|
isDeleted;
|
|
3073
3147
|
client;
|
|
3074
3148
|
constructor(e) {
|
|
3075
|
-
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
|
|
3149
|
+
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);
|
|
3076
3150
|
}
|
|
3077
3151
|
isClosed() {
|
|
3078
3152
|
return this.status === $.Completed;
|
|
@@ -3084,17 +3158,17 @@ var Zn = class e {
|
|
|
3084
3158
|
return !this.isClosed();
|
|
3085
3159
|
}
|
|
3086
3160
|
getConsiderationDays(e = /* @__PURE__ */ new Date()) {
|
|
3087
|
-
return Math.max(
|
|
3161
|
+
return Math.max(He(this.closedAt ?? e, this.createdAt), 0);
|
|
3088
3162
|
}
|
|
3089
|
-
},
|
|
3163
|
+
}, Nr = class extends Mr {
|
|
3090
3164
|
items;
|
|
3091
3165
|
constructor(e) {
|
|
3092
|
-
super(e), this.items =
|
|
3166
|
+
super(e), this.items = b(e?.items ?? [], (e) => new jr(e));
|
|
3093
3167
|
}
|
|
3094
3168
|
isClientMessage(e) {
|
|
3095
3169
|
return e.creator?.id === this.client.id;
|
|
3096
3170
|
}
|
|
3097
|
-
},
|
|
3171
|
+
}, Pr = class extends j {
|
|
3098
3172
|
id;
|
|
3099
3173
|
statuses;
|
|
3100
3174
|
createdAt;
|
|
@@ -3107,7 +3181,7 @@ var Zn = class e {
|
|
|
3107
3181
|
super(), this.id = {
|
|
3108
3182
|
from: e?.id?.from ?? null,
|
|
3109
3183
|
to: e?.id?.to ?? null
|
|
3110
|
-
}, this.statuses = e?.statuses, this.createdAt = new
|
|
3184
|
+
}, 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;
|
|
3111
3185
|
}
|
|
3112
3186
|
resetFilterValue(e) {
|
|
3113
3187
|
switch (e) {
|
|
@@ -3130,7 +3204,7 @@ var Zn = class e {
|
|
|
3130
3204
|
}
|
|
3131
3205
|
return this;
|
|
3132
3206
|
}
|
|
3133
|
-
},
|
|
3207
|
+
}, Fr = class e {
|
|
3134
3208
|
static apiCodes = {
|
|
3135
3209
|
[$.Initiated]: "initiated",
|
|
3136
3210
|
[$.InfoRequired]: "info_required",
|
|
@@ -3141,23 +3215,23 @@ var Zn = class e {
|
|
|
3141
3215
|
return e.apiCodes[t];
|
|
3142
3216
|
}
|
|
3143
3217
|
static toApiCodes(t) {
|
|
3144
|
-
return
|
|
3218
|
+
return b(t, (t) => e.toApiCode(t));
|
|
3145
3219
|
}
|
|
3146
|
-
},
|
|
3220
|
+
}, Ir = class extends e {
|
|
3147
3221
|
getReclamationsList(e, t, n, r, i = !1) {
|
|
3148
|
-
return this.getTypedPaginated(
|
|
3222
|
+
return this.getTypedPaginated(Mr, "/internal/reclamations", e, t, n, {}, i, r);
|
|
3149
3223
|
}
|
|
3150
3224
|
getReclamation(e, t, n = !1) {
|
|
3151
|
-
return this.get(`/internal/reclamations/${e}`, {}, (e) => new
|
|
3225
|
+
return this.get(`/internal/reclamations/${e}`, {}, (e) => new Nr(e.data), n, t);
|
|
3152
3226
|
}
|
|
3153
3227
|
createMessage(e, t, n = {}) {
|
|
3154
|
-
return this.post(`/internal/reclamations/${e}/messages`, t, (e) => new
|
|
3228
|
+
return this.post(`/internal/reclamations/${e}/messages`, t, (e) => new Nr(e.data), n);
|
|
3155
3229
|
}
|
|
3156
3230
|
deleteReclamation(e) {
|
|
3157
3231
|
return this.delete(`/internal/reclamations/${e}`);
|
|
3158
3232
|
}
|
|
3159
3233
|
restoreReclamation(e) {
|
|
3160
|
-
return this.post(`/internal/reclamations/${e}/restore`, {}, (e) => new
|
|
3234
|
+
return this.post(`/internal/reclamations/${e}/restore`, {}, (e) => new Nr(e.data));
|
|
3161
3235
|
}
|
|
3162
3236
|
downloadReclamation(e, t = !1) {
|
|
3163
3237
|
return this.getBlob(`/internal/reclamations/${e}/download`, {}, (e) => new Blob([e.request.response], { type: "application/pdf" }), t);
|
|
@@ -3165,18 +3239,18 @@ var Zn = class e {
|
|
|
3165
3239
|
getUpdates(e, t = !1) {
|
|
3166
3240
|
return this.get("/internal/reclamations/updates", {}, void 0, t, e);
|
|
3167
3241
|
}
|
|
3168
|
-
},
|
|
3242
|
+
}, Lr = class {
|
|
3169
3243
|
products = [];
|
|
3170
3244
|
productCategories = [];
|
|
3171
3245
|
constructor(e) {
|
|
3172
3246
|
e?.products && (this.products = e.products.map((e) => new L(e))), e?.productCategories && (this.productCategories = e.productCategories.map((e) => new L(e)));
|
|
3173
3247
|
}
|
|
3174
|
-
},
|
|
3248
|
+
}, Rr = class extends l {
|
|
3175
3249
|
getProductCategoryRecommendations(e) {
|
|
3176
|
-
return this.get(`/internal/catalog/recommendations/categories/${e.id}`, {}, (e) => new
|
|
3250
|
+
return this.get(`/internal/catalog/recommendations/categories/${e.id}`, {}, (e) => new Lr(e.data));
|
|
3177
3251
|
}
|
|
3178
3252
|
getProductRecommendations(e) {
|
|
3179
|
-
return this.get(`/internal/catalog/recommendations/products/${e.id}`, {}, (e) => new
|
|
3253
|
+
return this.get(`/internal/catalog/recommendations/products/${e.id}`, {}, (e) => new Lr(e.data));
|
|
3180
3254
|
}
|
|
3181
3255
|
saveProductCategoryRecommendations(e, t) {
|
|
3182
3256
|
return this.post(`/internal/catalog/recommendations/categories/${e.id}`, {
|
|
@@ -3190,7 +3264,7 @@ var Zn = class e {
|
|
|
3190
3264
|
products: t.products.map((e) => e.id)
|
|
3191
3265
|
});
|
|
3192
3266
|
}
|
|
3193
|
-
},
|
|
3267
|
+
}, zr = class {
|
|
3194
3268
|
static generateUndefinedInstance(e, t = "- Не определён -") {
|
|
3195
3269
|
return new e({
|
|
3196
3270
|
id: 0,
|
|
@@ -3201,13 +3275,13 @@ var Zn = class e {
|
|
|
3201
3275
|
static isUndefinedInstance(e) {
|
|
3202
3276
|
return e.id === 0 && e.slug === "-undefined-";
|
|
3203
3277
|
}
|
|
3204
|
-
},
|
|
3278
|
+
}, Br = class {
|
|
3205
3279
|
name;
|
|
3206
3280
|
content;
|
|
3207
3281
|
constructor(e) {
|
|
3208
3282
|
this.name = e.name, this.content = e.content;
|
|
3209
3283
|
}
|
|
3210
|
-
},
|
|
3284
|
+
}, Vr = class {
|
|
3211
3285
|
resourceType;
|
|
3212
3286
|
resourceId;
|
|
3213
3287
|
h1;
|
|
@@ -3217,42 +3291,42 @@ var Zn = class e {
|
|
|
3217
3291
|
meta;
|
|
3218
3292
|
tags;
|
|
3219
3293
|
constructor(e) {
|
|
3220
|
-
this.resourceType = new
|
|
3294
|
+
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;
|
|
3221
3295
|
}
|
|
3222
|
-
},
|
|
3296
|
+
}, Hr = class extends l {
|
|
3223
3297
|
getResourceSeoData(e, t) {
|
|
3224
|
-
return this.get(`/internal/seo/${e.slug}/${t}`, {}, (e) => new
|
|
3298
|
+
return this.get(`/internal/seo/${e.slug}/${t}`, {}, (e) => new Vr(e.data));
|
|
3225
3299
|
}
|
|
3226
3300
|
saveResourceSeoData(e, t = {}) {
|
|
3227
|
-
return this.post(`/internal/seo/${e.resourceType.slug}/${e.resourceId}`, e, (e) => new
|
|
3301
|
+
return this.post(`/internal/seo/${e.resourceType.slug}/${e.resourceId}`, e, (e) => new Vr(e.data), t);
|
|
3228
3302
|
}
|
|
3229
3303
|
deleteResourceSeoData(e, t) {
|
|
3230
3304
|
return this.delete(`/internal/seo/${e.slug}/${t}`);
|
|
3231
3305
|
}
|
|
3232
|
-
},
|
|
3306
|
+
}, Ur = class extends u {
|
|
3233
3307
|
text;
|
|
3234
3308
|
searchCount;
|
|
3235
3309
|
lastSearchedAt;
|
|
3236
3310
|
constructor(e) {
|
|
3237
3311
|
super(e), this.text = e?.text ?? "", this.searchCount = e?.searchCount ?? 0, this.lastSearchedAt = s.parse(e?.lastSearchedAt);
|
|
3238
3312
|
}
|
|
3239
|
-
},
|
|
3313
|
+
}, Wr = class extends l {
|
|
3240
3314
|
getSearchProductsStatistics(e, t) {
|
|
3241
|
-
return this.getTypedList(
|
|
3315
|
+
return this.getTypedList(Ur, "/internal/statistics/search/products", { date: s.periodToApiFormat(e) }, !1, t);
|
|
3242
3316
|
}
|
|
3243
3317
|
removeSearchProductStatistic(e) {
|
|
3244
3318
|
return this.delete(`/internal/statistics/search/products/${e}`);
|
|
3245
3319
|
}
|
|
3246
|
-
},
|
|
3320
|
+
}, Gr = /* @__PURE__ */ function(e) {
|
|
3247
3321
|
return e[e.Undetermined = 0] = "Undetermined", e[e.Complete = 1] = "Complete", e[e.Incomplete = 2] = "Incomplete", e;
|
|
3248
|
-
}({}),
|
|
3322
|
+
}({}), Kr = class e {
|
|
3249
3323
|
static isBlocked(e, t) {
|
|
3250
|
-
return t && e ===
|
|
3324
|
+
return t && e === Gr.Incomplete;
|
|
3251
3325
|
}
|
|
3252
3326
|
static getValidationResult(t, n) {
|
|
3253
|
-
return e.isBlocked(t, n) ? new
|
|
3327
|
+
return e.isBlocked(t, n) ? new ee("Проверьте адрес и выберите более точный вариант из подсказок", "error") : t === Gr.Incomplete || t === Gr.Undetermined ? new ee("Проверьте правильность адреса", "warning") : void 0;
|
|
3254
3328
|
}
|
|
3255
|
-
},
|
|
3329
|
+
}, qr = class extends l {
|
|
3256
3330
|
searchAddresses(e) {
|
|
3257
3331
|
return this.execSuggestionQuery("/public/suggestions/address", e);
|
|
3258
3332
|
}
|
|
@@ -3270,26 +3344,26 @@ var Zn = class e {
|
|
|
3270
3344
|
}), t;
|
|
3271
3345
|
});
|
|
3272
3346
|
}
|
|
3273
|
-
},
|
|
3347
|
+
}, Jr = class extends l {
|
|
3274
3348
|
constructor() {
|
|
3275
|
-
super(), this.baseUrl = `${
|
|
3349
|
+
super(), this.baseUrl = `${_().config.http.portalApiUrl}/api`, this.interceptorIds.request.authRequestInterceptor && this.httpClient.interceptors.request.eject(this.interceptorIds.request.authRequestInterceptor);
|
|
3276
3350
|
}
|
|
3277
3351
|
getAccessToken() {
|
|
3278
3352
|
return this.get("internal/users/current-tokens").then((e) => e.accessToken);
|
|
3279
3353
|
}
|
|
3280
|
-
},
|
|
3354
|
+
}, Yr = class {
|
|
3281
3355
|
user;
|
|
3282
3356
|
salesDirection;
|
|
3283
3357
|
constructor(e) {
|
|
3284
|
-
this.user = new F(e?.user), this.salesDirection = new
|
|
3358
|
+
this.user = new F(e?.user), this.salesDirection = new h(e?.salesDirection);
|
|
3285
3359
|
}
|
|
3286
|
-
},
|
|
3360
|
+
}, Xr = class extends be {
|
|
3287
3361
|
cities;
|
|
3288
3362
|
users;
|
|
3289
3363
|
constructor(e) {
|
|
3290
|
-
super(e), this.cities = e?.cities?.map((e) => new n(e)) ?? [], this.users = e?.users?.map((e) => new
|
|
3364
|
+
super(e), this.cities = e?.cities?.map((e) => new n(e)) ?? [], this.users = e?.users?.map((e) => new Yr(e)) ?? [];
|
|
3291
3365
|
}
|
|
3292
|
-
},
|
|
3366
|
+
}, Zr = class extends j {
|
|
3293
3367
|
id;
|
|
3294
3368
|
name;
|
|
3295
3369
|
abbr;
|
|
@@ -3304,27 +3378,27 @@ var Zn = class e {
|
|
|
3304
3378
|
}
|
|
3305
3379
|
return this;
|
|
3306
3380
|
}
|
|
3307
|
-
},
|
|
3381
|
+
}, Qr = class extends e {
|
|
3308
3382
|
getRegionsList(e, t, n) {
|
|
3309
|
-
return this.getTypedPaginated(
|
|
3383
|
+
return this.getTypedPaginated(be, "/internal/users/regions", e, t, n);
|
|
3310
3384
|
}
|
|
3311
3385
|
getRegion(e) {
|
|
3312
|
-
return this.get(`/internal/users/regions/${e}`, {}, (e) => new
|
|
3386
|
+
return this.get(`/internal/users/regions/${e}`, {}, (e) => new Xr(e.data));
|
|
3313
3387
|
}
|
|
3314
3388
|
createRegion(e, t = {}) {
|
|
3315
|
-
return this.post("/internal/users/regions", e, (e) => new
|
|
3389
|
+
return this.post("/internal/users/regions", e, (e) => new Xr(e.data), t);
|
|
3316
3390
|
}
|
|
3317
3391
|
updateRegion(e, t, n = {}) {
|
|
3318
|
-
return this.patch(`/internal/users/regions/${e}`, t, (e) => new
|
|
3392
|
+
return this.patch(`/internal/users/regions/${e}`, t, (e) => new Xr(e.data), n);
|
|
3319
3393
|
}
|
|
3320
3394
|
removeRegion(e) {
|
|
3321
3395
|
return this.delete(`/internal/users/regions/${e}`);
|
|
3322
3396
|
}
|
|
3323
3397
|
getRegionEmployees(e) {
|
|
3324
|
-
return this.getTypedList(
|
|
3398
|
+
return this.getTypedList(Yr, `/internal/users/regions/${e}/users`);
|
|
3325
3399
|
}
|
|
3326
3400
|
attachRegionEmployee(e, t, n) {
|
|
3327
|
-
return this.post(`/internal/users/regions/${e}/users/${t}`, { salesDirectionId: n }, (e) => new
|
|
3401
|
+
return this.post(`/internal/users/regions/${e}/users/${t}`, { salesDirectionId: n }, (e) => new Yr(e.data));
|
|
3328
3402
|
}
|
|
3329
3403
|
detachRegionEmployee(e, t, n) {
|
|
3330
3404
|
return this.request({
|
|
@@ -3335,4 +3409,4 @@ var Zn = class e {
|
|
|
3335
3409
|
}
|
|
3336
3410
|
};
|
|
3337
3411
|
//#endregion
|
|
3338
|
-
export {
|
|
3412
|
+
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 };
|