@snabcentr/common-lib 4.2.0-dev → 4.4.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 +466 -347
- 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/external-seo/classes/external-seo-full-info.d.ts +18 -0
- package/dist/src/external-seo/classes/external-seo-full-info.d.ts.map +1 -0
- package/dist/src/external-seo/classes/external-seo-list-filters.d.ts +34 -0
- package/dist/src/external-seo/classes/external-seo-list-filters.d.ts.map +1 -0
- package/dist/src/external-seo/classes/index.d.ts +3 -0
- package/dist/src/external-seo/classes/index.d.ts.map +1 -0
- package/dist/src/external-seo/index.d.ts +4 -0
- package/dist/src/external-seo/index.d.ts.map +1 -0
- package/dist/src/external-seo/interfaces/i-external-seo-full-info.d.ts +11 -0
- package/dist/src/external-seo/interfaces/i-external-seo-full-info.d.ts.map +1 -0
- package/dist/src/external-seo/interfaces/i-external-seo-list-filters.d.ts +23 -0
- package/dist/src/external-seo/interfaces/i-external-seo-list-filters.d.ts.map +1 -0
- package/dist/src/external-seo/interfaces/index.d.ts +3 -0
- package/dist/src/external-seo/interfaces/index.d.ts.map +1 -0
- package/dist/src/external-seo/providers/external-seo-provider.d.ts +68 -0
- package/dist/src/external-seo/providers/external-seo-provider.d.ts.map +1 -0
- package/dist/src/external-seo/providers/index.d.ts +2 -0
- package/dist/src/external-seo/providers/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/managers/interfaces/index.d.ts +0 -1
- package/dist/src/managers/interfaces/index.d.ts.map +1 -1
- package/dist/src/managers/providers/manager-provider.d.ts +4 -4
- package/dist/src/managers/providers/manager-provider.d.ts.map +1 -1
- package/dist/src/offers/providers/offers-data-provider.d.ts +9 -0
- package/dist/src/offers/providers/offers-data-provider.d.ts.map +1 -1
- package/dist/src/operators/classes/index.d.ts +4 -0
- package/dist/src/operators/classes/index.d.ts.map +1 -0
- package/dist/src/operators/classes/operator-full-info.d.ts +23 -0
- package/dist/src/operators/classes/operator-full-info.d.ts.map +1 -0
- package/dist/src/operators/classes/operator-short-info.d.ts +18 -0
- package/dist/src/operators/classes/operator-short-info.d.ts.map +1 -0
- package/dist/src/operators/classes/operators-list-filters.d.ts +47 -0
- package/dist/src/operators/classes/operators-list-filters.d.ts.map +1 -0
- package/dist/src/operators/index.d.ts +4 -0
- package/dist/src/operators/index.d.ts.map +1 -0
- package/dist/src/operators/interfaces/i-operator-full-info.d.ts +16 -0
- package/dist/src/operators/interfaces/i-operator-full-info.d.ts.map +1 -0
- package/dist/src/operators/interfaces/i-operator-short-info.d.ts +11 -0
- package/dist/src/operators/interfaces/i-operator-short-info.d.ts.map +1 -0
- package/dist/src/operators/interfaces/i-operators-list-filters.d.ts +36 -0
- package/dist/src/operators/interfaces/i-operators-list-filters.d.ts.map +1 -0
- package/dist/src/operators/interfaces/index.d.ts +4 -0
- package/dist/src/operators/interfaces/index.d.ts.map +1 -0
- package/dist/src/operators/providers/index.d.ts +2 -0
- package/dist/src/operators/providers/index.d.ts.map +1 -0
- package/dist/src/operators/providers/operator-provider.d.ts +61 -0
- package/dist/src/operators/providers/operator-provider.d.ts.map +1 -0
- package/dist/src/user/interfaces/i-user-save-data.d.ts +18 -0
- package/dist/src/user/interfaces/i-user-save-data.d.ts.map +1 -0
- package/dist/src/user/interfaces/index.d.ts +1 -0
- package/dist/src/user/interfaces/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/src/managers/interfaces/i-manager-save-data.d.ts +0 -18
- package/dist/src/managers/interfaces/i-manager-save-data.d.ts.map +0 -1
package/dist/sc-common-lib.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
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 { addBusinessDays as
|
|
3
|
-
import { cloneDeep as
|
|
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 l, FilterGroup as ee, FilterOpEnum as te, GeoCoordinates as ne, HttpRequester as u, Identity as d, Manager as f, ManagerCommon as re, ManagerDataProvider as ie, NamedIdentity as p, Operator as ae, Opf as oe, OpfEnum as m, OrderStatus as se, PartnerGroup as h, PaymentType as ce, PriceCoefficient as le, PropertyType as ue, Reference as de, Region as fe, ResourceType as pe, SalesDirection as g, Shop as me, SourcePrimaryInterest as he, TypedInstanceFactory as _, UpdatableNamedIdentity as ge, User as _e, UserCommonInfo as ve, UserRegionShortInfo as ye, Warehouse as be, useBaseConfigStore as v } from "@snabcentr/common-core";
|
|
2
|
+
import { addBusinessDays as xe, addDays as y, addMonths as b, addQuarters as Se, addWeeks as Ce, addYears as we, differenceInCalendarDays as Te, differenceInCalendarMonths as Ee, endOfDay as x, endOfMonth as S, endOfQuarter as De, endOfToday as Oe, endOfTomorrow as ke, endOfWeek as Ae, endOfYear as je, endOfYesterday as Me, format as C, getDate as Ne, getDaysInMonth as Pe, parseISO as w, setDate as Fe, startOfDay as T, startOfMonth as E, startOfQuarter as Ie, startOfToday as Le, startOfTomorrow as Re, startOfWeek as D, startOfYear as O, startOfYesterday as ze, subDays as Be, subMonths as Ve, subQuarters as He, subWeeks as Ue, subYears as We } from "date-fns";
|
|
3
|
+
import { cloneDeep as Ge, endsWith as Ke, forEach as qe, includes as Je, isArray as Ye, isDate as Xe, isEmpty as Ze, isFunction as Qe, isNil as k, isObject as $e, isString as A, isUndefined as et, map as j, merge as tt, omitBy as nt, round as rt, some as it, startsWith as at, toUpper as ot } from "lodash-es";
|
|
4
4
|
export * from "@snabcentr/common-core";
|
|
5
5
|
//#region src/blog/enums/blog-post-media-type-enum.ts
|
|
6
|
-
var
|
|
6
|
+
var st = /* @__PURE__ */ function(e) {
|
|
7
7
|
return e.Image = "image", e.Video = "video", e;
|
|
8
|
-
}({}),
|
|
8
|
+
}({}), ct = class extends d {
|
|
9
9
|
mediaType;
|
|
10
10
|
isCover;
|
|
11
11
|
isUnused;
|
|
12
12
|
url;
|
|
13
13
|
urlWebp;
|
|
14
14
|
constructor(e) {
|
|
15
|
-
super(e, ""), this.mediaType = e?.mediaType ??
|
|
15
|
+
super(e, ""), this.mediaType = e?.mediaType ?? st.Image, this.isCover = e?.isCover ?? !1, this.isUnused = e?.isUnused ?? !1, this.url = e?.url ?? "", this.urlWebp = e?.urlWebp;
|
|
16
16
|
}
|
|
17
17
|
isImage() {
|
|
18
|
-
return this.mediaType ===
|
|
18
|
+
return this.mediaType === st.Image;
|
|
19
19
|
}
|
|
20
20
|
isVideo() {
|
|
21
|
-
return this.mediaType ===
|
|
21
|
+
return this.mediaType === st.Video;
|
|
22
22
|
}
|
|
23
|
-
},
|
|
23
|
+
}, lt = /* @__PURE__ */ function(e) {
|
|
24
24
|
return e.Draft = "draft", e.Published = "published", e.Scheduled = "scheduled", e;
|
|
25
25
|
}({}), M = class extends d {
|
|
26
26
|
createdAt;
|
|
27
27
|
constructor(e, t) {
|
|
28
28
|
super(e, t), this.createdAt = s.parse(e?.createdAt) ?? /* @__PURE__ */ new Date();
|
|
29
29
|
}
|
|
30
|
-
},
|
|
30
|
+
}, ut = class e extends M {
|
|
31
31
|
static resolvePublicationStatus(e) {
|
|
32
|
-
return k(e) ?
|
|
32
|
+
return k(e) ? lt.Draft : e.getTime() > Date.now() ? lt.Scheduled : lt.Published;
|
|
33
33
|
}
|
|
34
34
|
static getSlugError(e) {
|
|
35
|
-
return e ? /[^a-z0-9-]/.test(e) ? "Допустимы только строчные латинские буквы, цифры и дефис: пример «kak-vybrat-podokonnik»." :
|
|
35
|
+
return e ? /[^a-z0-9-]/.test(e) ? "Допустимы только строчные латинские буквы, цифры и дефис: пример «kak-vybrat-podokonnik»." : at(e, "-") || Ke(e, "-") ? "Обозначение не может начинаться или заканчиваться дефисом." : Je(e, "--") ? "Дефисы не могут идти подряд: разделяйте слова одним дефисом." : "" : "";
|
|
36
36
|
}
|
|
37
37
|
static parseDate(e) {
|
|
38
38
|
return k(e) ? null : A(e) ? w(e) : e;
|
|
@@ -46,11 +46,11 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
46
46
|
getPublicationStatus() {
|
|
47
47
|
return e.resolvePublicationStatus(this.publishedAt);
|
|
48
48
|
}
|
|
49
|
-
},
|
|
49
|
+
}, dt = class extends ut {
|
|
50
50
|
content;
|
|
51
51
|
media;
|
|
52
52
|
constructor(e) {
|
|
53
|
-
super(e), this.content = e?.content ?? "", this.media = (e?.media ?? []).map((e) => new
|
|
53
|
+
super(e), this.content = e?.content ?? "", this.media = (e?.media ?? []).map((e) => new ct(e));
|
|
54
54
|
}
|
|
55
55
|
toSaveData(e = !1) {
|
|
56
56
|
return {
|
|
@@ -71,7 +71,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
71
71
|
let e = {};
|
|
72
72
|
return Object.keys(this).forEach((t) => {
|
|
73
73
|
let n = this[t];
|
|
74
|
-
k(n) || A(n) && n.trim().length === 0 ||
|
|
74
|
+
k(n) || A(n) && n.trim().length === 0 || Qe(n.isNewRec) && n.isNewRec() || (e[t] = n);
|
|
75
75
|
}), e;
|
|
76
76
|
}
|
|
77
77
|
}, P = class {
|
|
@@ -80,7 +80,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
80
80
|
constructor(e) {
|
|
81
81
|
this.from = A(e?.from) ? w(e.from) : e?.from ?? null, this.to = A(e?.to) ? w(e.to) : e?.to ?? null;
|
|
82
82
|
}
|
|
83
|
-
},
|
|
83
|
+
}, ft = class extends N {
|
|
84
84
|
id;
|
|
85
85
|
title;
|
|
86
86
|
slug;
|
|
@@ -111,10 +111,10 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
111
111
|
let e = super.asClearRaw();
|
|
112
112
|
return !e?.publishedAt?.from && !e?.publishedAt?.to && delete e.publishedAt, !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, e;
|
|
113
113
|
}
|
|
114
|
-
},
|
|
114
|
+
}, pt = class t extends e {
|
|
115
115
|
static preparePostSaveData(e) {
|
|
116
116
|
let t = {};
|
|
117
|
-
if (
|
|
117
|
+
if (et(e.title) || (t.title = e.title), et(e.slug) || (t.slug = e.slug), et(e.content) || (t.content = e.content), !et(e.publishedAt)) {
|
|
118
118
|
let n = v().config.dateFormats.api;
|
|
119
119
|
t.publishedAt = k(e.publishedAt) ? null : C(e.publishedAt, n);
|
|
120
120
|
}
|
|
@@ -123,17 +123,17 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
123
123
|
getPostList(e, t, n) {
|
|
124
124
|
return this.getPaginated("/internal/blog", e, t, n, {}, (e) => ({
|
|
125
125
|
...e.data,
|
|
126
|
-
data: e.data.data.map((e) => new
|
|
126
|
+
data: e.data.data.map((e) => new ut(e))
|
|
127
127
|
}));
|
|
128
128
|
}
|
|
129
129
|
getPost(e) {
|
|
130
|
-
return this.get(`/internal/blog/${e}`, {}, (e) => new
|
|
130
|
+
return this.get(`/internal/blog/${e}`, {}, (e) => new dt(e.data));
|
|
131
131
|
}
|
|
132
132
|
createPost(e, n = {}) {
|
|
133
|
-
return this.post("/internal/blog", t.preparePostSaveData(e), (e) => new
|
|
133
|
+
return this.post("/internal/blog", t.preparePostSaveData(e), (e) => new dt(e.data), n);
|
|
134
134
|
}
|
|
135
135
|
updatePost(e, n, r = {}) {
|
|
136
|
-
return this.patch(`/internal/blog/${e}`, t.preparePostSaveData(n), (e) => new
|
|
136
|
+
return this.patch(`/internal/blog/${e}`, t.preparePostSaveData(n), (e) => new dt(e.data), r);
|
|
137
137
|
}
|
|
138
138
|
removePost(e) {
|
|
139
139
|
return this.delete(`/internal/blog/${e}`);
|
|
@@ -149,15 +149,15 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
149
149
|
onUploadProgress: (e) => {
|
|
150
150
|
r && r(e.total ? Math.round(e.loaded / e.total * 100) : 0);
|
|
151
151
|
}
|
|
152
|
-
}, (e) => new
|
|
152
|
+
}, (e) => new ct(e.data), i);
|
|
153
153
|
}
|
|
154
154
|
updateMedia(e, t, n, r = {}) {
|
|
155
|
-
return this.patch(`/internal/blog/${e}/media/${t}`, { isCover: n }, (e) => new
|
|
155
|
+
return this.patch(`/internal/blog/${e}/media/${t}`, { isCover: n }, (e) => new ct(e.data), r);
|
|
156
156
|
}
|
|
157
157
|
removeMedia(e, t) {
|
|
158
158
|
return this.delete(`/internal/blog/${e}/media/${t}`);
|
|
159
159
|
}
|
|
160
|
-
},
|
|
160
|
+
}, mt = class extends ge {
|
|
161
161
|
deletedAt;
|
|
162
162
|
constructor(e) {
|
|
163
163
|
super(e), this.deletedAt = s.parse(e?.deletedAt);
|
|
@@ -168,7 +168,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
168
168
|
constructor(e) {
|
|
169
169
|
super(e), this.type = e?.type, this.isActive = e?.isActive ?? !0;
|
|
170
170
|
}
|
|
171
|
-
},
|
|
171
|
+
}, ht = class extends mt {
|
|
172
172
|
costCoefficient;
|
|
173
173
|
isLowPriceAllowed;
|
|
174
174
|
publishedAt;
|
|
@@ -178,13 +178,13 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
178
178
|
constructor(e) {
|
|
179
179
|
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
180
|
}
|
|
181
|
-
}, I = class extends
|
|
181
|
+
}, I = class extends ge {
|
|
182
182
|
description;
|
|
183
183
|
owner;
|
|
184
184
|
constructor(e) {
|
|
185
185
|
super(e), this.description = e?.description ?? "", this.owner = e?.owner ? new F(e.owner) : void 0;
|
|
186
186
|
}
|
|
187
|
-
},
|
|
187
|
+
}, gt = class {
|
|
188
188
|
coefficient;
|
|
189
189
|
value;
|
|
190
190
|
cost;
|
|
@@ -193,13 +193,13 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
193
193
|
constructor(e) {
|
|
194
194
|
this.coefficient = new le(e?.coefficient), this.value = e?.value ?? 0, this.cost = e?.cost ?? 0, this.percent = e?.percent ?? 0, this.readOnly = e?.readOnly ?? !0;
|
|
195
195
|
}
|
|
196
|
-
},
|
|
196
|
+
}, _t = class {
|
|
197
197
|
warehouse;
|
|
198
198
|
count;
|
|
199
199
|
constructor(e) {
|
|
200
|
-
this.warehouse = new
|
|
200
|
+
this.warehouse = new be(e?.warehouse), this.count = e?.count ?? 0;
|
|
201
201
|
}
|
|
202
|
-
},
|
|
202
|
+
}, vt = class extends p {
|
|
203
203
|
slug = "";
|
|
204
204
|
description;
|
|
205
205
|
isSquare = !1;
|
|
@@ -212,30 +212,30 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
212
212
|
constructor(e) {
|
|
213
213
|
super(e), this.code = e?.code ?? "";
|
|
214
214
|
}
|
|
215
|
-
},
|
|
215
|
+
}, yt = class extends L {
|
|
216
216
|
slug;
|
|
217
217
|
type;
|
|
218
218
|
constructor(e) {
|
|
219
219
|
super(e), this.slug = e?.slug ?? "";
|
|
220
220
|
}
|
|
221
|
-
},
|
|
221
|
+
}, bt = class extends yt {
|
|
222
222
|
isHidden;
|
|
223
223
|
constructor(e) {
|
|
224
224
|
super(e), this.isHidden = e?.isHidden ?? !1;
|
|
225
225
|
}
|
|
226
|
-
},
|
|
226
|
+
}, xt = class {
|
|
227
227
|
image;
|
|
228
228
|
preview;
|
|
229
229
|
isDefault;
|
|
230
230
|
constructor(e, t) {
|
|
231
231
|
this.image = `${t ?? ""}${e.image}`, this.preview = `${t ?? ""}${e.preview}`, this.isDefault = e.isDefault;
|
|
232
232
|
}
|
|
233
|
-
},
|
|
233
|
+
}, St = class extends yt {
|
|
234
234
|
isPrimary;
|
|
235
235
|
constructor(e) {
|
|
236
236
|
super(e), this.isPrimary = e?.isPrimary ?? !1;
|
|
237
237
|
}
|
|
238
|
-
}, R = class extends
|
|
238
|
+
}, R = class extends bt {
|
|
239
239
|
supplierSku;
|
|
240
240
|
unit;
|
|
241
241
|
pack;
|
|
@@ -254,12 +254,12 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
254
254
|
retailCostRub;
|
|
255
255
|
priceCoefficients;
|
|
256
256
|
constructor(e) {
|
|
257
|
-
super(e), this.supplierSku = e?.supplierSku, this.unit = e?.unit ? new
|
|
257
|
+
super(e), this.supplierSku = e?.supplierSku, this.unit = e?.unit ? new vt(e.unit) : new vt(), 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 = A(e?.costDate) ? w(e.costDate) : e?.costDate, this.onOrder = e?.onOrder ?? !1, this.stockCount = e?.stockCount?.map((e) => new _t(e)) ?? [], this.type = "product";
|
|
258
258
|
let t = e?.category ?? e?.categories?.find((e) => e.isPrimary);
|
|
259
|
-
t && (this.category = new
|
|
259
|
+
t && (this.category = new St({
|
|
260
260
|
...t,
|
|
261
261
|
isPrimary: !0
|
|
262
|
-
}), this.categories = [this.category]), e?.categories && (this.categories = e.categories.map((e) => new
|
|
262
|
+
}), this.categories = [this.category]), e?.categories && (this.categories = e.categories.map((e) => new St(e))), this.images = e?.images?.map((e) => new xt(e, v().config.http.mediaUrl)) ?? [], this.properties = e?.properties ?? {}, this.retailCost = e?.retailCost, this.retailCostRub = e?.retailCostRub, this.priceCoefficients = e?.priceCoefficients?.map((e) => new gt(e)) ?? [], e && "codeNumber" in e && !e.code && (this.code = e?.codeNumber);
|
|
263
263
|
}
|
|
264
264
|
getIsMeasurable() {
|
|
265
265
|
return this.unit.isLinear || this.unit.isSquare;
|
|
@@ -270,7 +270,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
270
270
|
getRetailCostRub() {
|
|
271
271
|
return this.retailCostRub ?? this.costRub;
|
|
272
272
|
}
|
|
273
|
-
},
|
|
273
|
+
}, Ct = /* @__PURE__ */ function(e) {
|
|
274
274
|
return e.Discount = "discount", e.PriceTemplate = "price_template", e.ClientPrice = "client_price", e.Product = "product", e;
|
|
275
275
|
}({}), z = class extends R {
|
|
276
276
|
costCoefficient;
|
|
@@ -283,17 +283,17 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
283
283
|
isRequired;
|
|
284
284
|
isFavorite;
|
|
285
285
|
constructor(e) {
|
|
286
|
-
super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.costSource = e?.costSource ??
|
|
286
|
+
super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.costSource = e?.costSource ?? Ct.Product, this.discount = e?.discount ? new ht(e.discount) : void 0, this.priceTemplate = e?.priceTemplate ? new I(e.priceTemplate) : void 0, this.priceCoefficient = e?.priceCoefficient ? new le(e.priceCoefficient) : void 0, this.increasePercent = e?.increasePercent, this.isPreviouslyOrdered = e?.isPreviouslyOrdered, this.isRequired = e?.isRequired, this.isFavorite = e?.isFavorite;
|
|
287
287
|
}
|
|
288
|
-
}, B = class extends
|
|
288
|
+
}, B = class extends St {
|
|
289
289
|
isHidden;
|
|
290
290
|
parentCategoryId;
|
|
291
291
|
properties;
|
|
292
292
|
currencyRates;
|
|
293
293
|
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]) => [
|
|
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]) => [ot(e), t])) : void 0;
|
|
295
295
|
}
|
|
296
|
-
},
|
|
296
|
+
}, wt = class extends d {
|
|
297
297
|
category;
|
|
298
298
|
product;
|
|
299
299
|
quantity;
|
|
@@ -312,9 +312,9 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
312
312
|
originalId;
|
|
313
313
|
replacementId;
|
|
314
314
|
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 &&
|
|
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 && Ge(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
316
|
}
|
|
317
|
-
},
|
|
317
|
+
}, Tt = class extends wt {
|
|
318
318
|
cost;
|
|
319
319
|
costOne;
|
|
320
320
|
costOneRub;
|
|
@@ -325,16 +325,16 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
325
325
|
sawing;
|
|
326
326
|
currency;
|
|
327
327
|
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 =
|
|
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 = Ye(e.sawing) ? e.sawing : e.sawing ? [e.sawing] : void 0, this.currency = new o(e.currency);
|
|
329
329
|
}
|
|
330
330
|
}, V = class {
|
|
331
331
|
items;
|
|
332
332
|
resultSum;
|
|
333
333
|
directionsSum;
|
|
334
334
|
constructor(e) {
|
|
335
|
-
this.items = e.items.map((e) => new
|
|
335
|
+
this.items = e.items.map((e) => new Tt(e)), this.resultSum = e.resultSum, this.directionsSum = e.directionsSum;
|
|
336
336
|
}
|
|
337
|
-
},
|
|
337
|
+
}, Et = class extends u {
|
|
338
338
|
getCart(e) {
|
|
339
339
|
return this.get(`internal/clients/${e.id}/cart`, {}, (e) => new V(e.data));
|
|
340
340
|
}
|
|
@@ -378,9 +378,9 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
378
378
|
getCartItemFromCSVExample(e) {
|
|
379
379
|
return this.get(`internal/clients/${e.id}/cart/add-products-from-csv/example`, {}, (e) => new Blob([e.data], { type: "text/csv" }));
|
|
380
380
|
}
|
|
381
|
-
},
|
|
381
|
+
}, Dt = /* @__PURE__ */ function(e) {
|
|
382
382
|
return e.m2Cost = "m2Cost", e.percent = "percent", e.value = "value", e;
|
|
383
|
-
}({}),
|
|
383
|
+
}({}), Ot = /* @__PURE__ */ function(e) {
|
|
384
384
|
return e.Checkbox = "checkbox", e.Range = "range", e.Toggle = "toggle", e;
|
|
385
385
|
}({}), H = class e extends B {
|
|
386
386
|
categories;
|
|
@@ -388,7 +388,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
388
388
|
constructor(t) {
|
|
389
389
|
super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new R(e));
|
|
390
390
|
}
|
|
391
|
-
},
|
|
391
|
+
}, kt = class extends B {
|
|
392
392
|
isDisabled;
|
|
393
393
|
isRequired;
|
|
394
394
|
isFavorite;
|
|
@@ -397,35 +397,35 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
397
397
|
constructor(e) {
|
|
398
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 f(e.manager) : void 0;
|
|
399
399
|
}
|
|
400
|
-
},
|
|
400
|
+
}, At = class e extends kt {
|
|
401
401
|
categories;
|
|
402
402
|
products;
|
|
403
403
|
constructor(t) {
|
|
404
404
|
super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new z(e));
|
|
405
405
|
}
|
|
406
|
-
},
|
|
406
|
+
}, jt = class {
|
|
407
407
|
priceCoefficient;
|
|
408
408
|
increasePercent;
|
|
409
409
|
constructor(e) {
|
|
410
410
|
this.priceCoefficient = e?.priceCoefficient && new le(e.priceCoefficient), this.increasePercent = e?.increasePercent;
|
|
411
411
|
}
|
|
412
|
-
},
|
|
412
|
+
}, Mt = class extends jt {
|
|
413
413
|
constructor(e) {
|
|
414
414
|
super(e);
|
|
415
415
|
}
|
|
416
|
-
},
|
|
416
|
+
}, Nt = class extends Mt {
|
|
417
417
|
productCategory;
|
|
418
418
|
constructor(e) {
|
|
419
419
|
super(e), this.productCategory = new B(e?.productCategory);
|
|
420
420
|
}
|
|
421
|
-
},
|
|
421
|
+
}, Pt = class extends p {
|
|
422
422
|
photo;
|
|
423
423
|
contacts;
|
|
424
424
|
curatedDirection;
|
|
425
425
|
constructor(e) {
|
|
426
426
|
super(e), this.photo = e.photo, this.contacts = new r(e.contacts), this.curatedDirection = new a(e.curatedDirection);
|
|
427
427
|
}
|
|
428
|
-
}, U = class extends
|
|
428
|
+
}, U = class extends ve {
|
|
429
429
|
salesDirection;
|
|
430
430
|
debt;
|
|
431
431
|
alternativeName;
|
|
@@ -436,20 +436,20 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
436
436
|
managers;
|
|
437
437
|
curators;
|
|
438
438
|
constructor(e) {
|
|
439
|
-
super(e), this.salesDirection = new g(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 re(e)) ?? [], this.curators = e?.curators?.map((e) => new
|
|
439
|
+
super(e), this.salesDirection = new g(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 re(e)) ?? [], this.curators = e?.curators?.map((e) => new Pt(e)) ?? void 0;
|
|
440
440
|
}
|
|
441
|
-
},
|
|
441
|
+
}, Ft = class extends M {
|
|
442
442
|
deletedAt;
|
|
443
443
|
constructor(e, t) {
|
|
444
444
|
super(e, t), this.deletedAt = s.parse(e?.deletedAt);
|
|
445
445
|
}
|
|
446
|
-
}, W = class extends
|
|
446
|
+
}, W = class extends Ft {
|
|
447
447
|
client;
|
|
448
448
|
priceTemplate;
|
|
449
449
|
constructor(e) {
|
|
450
450
|
super(e), this.client = new U(e?.client), this.priceTemplate = new I(e?.priceTemplate);
|
|
451
451
|
}
|
|
452
|
-
},
|
|
452
|
+
}, It = class extends Mt {
|
|
453
453
|
product;
|
|
454
454
|
constructor(e) {
|
|
455
455
|
super(e), this.product = new R(e?.product);
|
|
@@ -468,7 +468,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
468
468
|
constructor(e) {
|
|
469
469
|
this.property = new G(e?.property), this.value = e?.value ?? "";
|
|
470
470
|
}
|
|
471
|
-
},
|
|
471
|
+
}, Lt = class {
|
|
472
472
|
id;
|
|
473
473
|
name;
|
|
474
474
|
description;
|
|
@@ -497,21 +497,21 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
497
497
|
let e = {};
|
|
498
498
|
return Object.keys(this).forEach((t) => {
|
|
499
499
|
let n = this[t];
|
|
500
|
-
k(n) || A(n) && n.trim().length === 0 ||
|
|
500
|
+
k(n) || A(n) && n.trim().length === 0 || Qe(n.isNewRec) && n.isNewRec() || (e[t] = n);
|
|
501
501
|
}), !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, !e?.updatedAt?.from && !e?.updatedAt?.to && delete e.updatedAt, e;
|
|
502
502
|
}
|
|
503
|
-
},
|
|
503
|
+
}, Rt = class extends jt {
|
|
504
504
|
executor;
|
|
505
505
|
createdAt;
|
|
506
506
|
constructor(e) {
|
|
507
507
|
super(e), this.executor = e?.executor ? new F(e.executor) : void 0, this.createdAt = s.parse(e?.createdAt);
|
|
508
508
|
}
|
|
509
|
-
},
|
|
509
|
+
}, zt = class extends Rt {
|
|
510
510
|
product;
|
|
511
511
|
constructor(e) {
|
|
512
512
|
super(e), this.product = new R(e?.product);
|
|
513
513
|
}
|
|
514
|
-
},
|
|
514
|
+
}, Bt = class extends Rt {
|
|
515
515
|
productCategory;
|
|
516
516
|
constructor(e) {
|
|
517
517
|
super(e), this.productCategory = new B(e?.productCategory);
|
|
@@ -526,14 +526,14 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
526
526
|
constructor(e) {
|
|
527
527
|
super(e), this.description = e?.description, this.canChangeLowCost = e?.canChangeLowCost ?? !1, this.parentRoleId = e?.parentRoleId;
|
|
528
528
|
}
|
|
529
|
-
},
|
|
529
|
+
}, Vt = class {
|
|
530
530
|
role;
|
|
531
531
|
category;
|
|
532
532
|
minCoefficient;
|
|
533
533
|
constructor(e) {
|
|
534
534
|
this.role = new q(e?.role), this.category = new B(e?.category), this.minCoefficient = new le(e?.minCoefficient);
|
|
535
535
|
}
|
|
536
|
-
},
|
|
536
|
+
}, Ht = class {
|
|
537
537
|
isFake;
|
|
538
538
|
isHidden;
|
|
539
539
|
isMultiple;
|
|
@@ -542,20 +542,20 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
542
542
|
constructor(e) {
|
|
543
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;
|
|
544
544
|
}
|
|
545
|
-
},
|
|
545
|
+
}, Ut = class {
|
|
546
546
|
category;
|
|
547
547
|
property;
|
|
548
548
|
settings;
|
|
549
549
|
constructor(e) {
|
|
550
|
-
this.category = new B(e?.category), this.property = new G(e?.property), this.settings = new
|
|
550
|
+
this.category = new B(e?.category), this.property = new G(e?.property), this.settings = new Ht(e?.settings);
|
|
551
551
|
}
|
|
552
|
-
},
|
|
552
|
+
}, Wt = class {
|
|
553
553
|
id;
|
|
554
554
|
label;
|
|
555
555
|
constructor(e) {
|
|
556
556
|
this.id = e?.id ?? "", this.label = e?.label ?? "";
|
|
557
557
|
}
|
|
558
|
-
},
|
|
558
|
+
}, Gt = class {
|
|
559
559
|
id;
|
|
560
560
|
label;
|
|
561
561
|
type;
|
|
@@ -565,9 +565,9 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
565
565
|
min;
|
|
566
566
|
max;
|
|
567
567
|
constructor(e) {
|
|
568
|
-
this.id = e?.id ?? "", this.label = e?.label ?? "", this.type = e?.type ??
|
|
568
|
+
this.id = e?.id ?? "", this.label = e?.label ?? "", this.type = e?.type ?? Ot.Checkbox, this.ord = e?.ord ?? 0, this.isMultiple = e?.isMultiple ?? null, this.values = e?.values?.map((e) => new Wt(e)) ?? [], this.min = e?.min ?? null, this.max = e?.max ?? null;
|
|
569
569
|
}
|
|
570
|
-
},
|
|
570
|
+
}, Kt = class extends u {
|
|
571
571
|
search(e, t = !1) {
|
|
572
572
|
return this.get("/internal/catalog/search", {
|
|
573
573
|
term: e,
|
|
@@ -578,15 +578,15 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
578
578
|
let i = `${v().config.http.portalApiUrl}/api/internal/price/export?format=${e}&show_hidden=${t}`;
|
|
579
579
|
return n && (i += `&category_id=${n}`), r && (i += `&client_id=${r}`), i;
|
|
580
580
|
}
|
|
581
|
-
},
|
|
581
|
+
}, qt = class extends u {
|
|
582
582
|
importPrices(e, t, n = !1) {
|
|
583
583
|
return this.post(`/internal/clients/${e}/price/import`, t, void 0, {}, n);
|
|
584
584
|
}
|
|
585
585
|
getCategoryPrices(e) {
|
|
586
|
-
return this.getTypedList(
|
|
586
|
+
return this.getTypedList(Bt, `/internal/clients/${e}/price/categories`);
|
|
587
587
|
}
|
|
588
588
|
getCategoryPrice(e, t) {
|
|
589
|
-
return this.get(`/internal/clients/${e}/price/categories/${t}`, {}, (e) => new
|
|
589
|
+
return this.get(`/internal/clients/${e}/price/categories/${t}`, {}, (e) => new Bt(e.data));
|
|
590
590
|
}
|
|
591
591
|
updateCategoryPrices(e, t, n, r = !1) {
|
|
592
592
|
return this.request({
|
|
@@ -632,16 +632,16 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
632
632
|
return this.delete(`/internal/clients/${e}/price/categories/${t}/manager`);
|
|
633
633
|
}
|
|
634
634
|
getProductPrices(e) {
|
|
635
|
-
return this.getTypedList(
|
|
635
|
+
return this.getTypedList(zt, `/internal/clients/${e}/price/products`);
|
|
636
636
|
}
|
|
637
637
|
getProductPrice(e, t) {
|
|
638
|
-
return this.get(`/internal/clients/${e}/price/products/${t}`, {}, (e) => new
|
|
638
|
+
return this.get(`/internal/clients/${e}/price/products/${t}`, {}, (e) => new zt(e.data));
|
|
639
639
|
}
|
|
640
640
|
updateProductPrice(e, t, n) {
|
|
641
641
|
return this.patch(`/internal/clients/${e}/price/products/${t}`, {
|
|
642
642
|
price_coefficient_id: n.coefficient?.id,
|
|
643
643
|
increase_percent: n.value
|
|
644
|
-
}, (e) => new
|
|
644
|
+
}, (e) => new zt(e.data));
|
|
645
645
|
}
|
|
646
646
|
removeProductPrice(e, t) {
|
|
647
647
|
return this.delete(`/internal/clients/${e}/price/products/${t}`);
|
|
@@ -661,7 +661,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
661
661
|
sendCommercialOffer(e, t) {
|
|
662
662
|
return this.post(`/internal/clients/${e}/price/commercial-offer/send`, t);
|
|
663
663
|
}
|
|
664
|
-
},
|
|
664
|
+
}, Jt = class extends u {
|
|
665
665
|
getTemplateList(e) {
|
|
666
666
|
return this.getTypedList(W, `/internal/clients/${e}/price/templates`);
|
|
667
667
|
}
|
|
@@ -688,7 +688,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
688
688
|
detachTemplate(e, t, n) {
|
|
689
689
|
return this.delete(`/internal/clients/${e}/price/templates/${t}/${n}`);
|
|
690
690
|
}
|
|
691
|
-
},
|
|
691
|
+
}, Yt = class extends u {
|
|
692
692
|
getRootCategoriesList(e = !1) {
|
|
693
693
|
return this.getTypedList(H, "/internal/catalog/categories", { showHidden: e });
|
|
694
694
|
}
|
|
@@ -710,7 +710,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
710
710
|
getCategoryProductsCoefficients(e) {
|
|
711
711
|
return this.get(`/internal/catalog/categories/${e}/products/coefficients`, {}, (e) => {
|
|
712
712
|
let { data: t } = e;
|
|
713
|
-
return
|
|
713
|
+
return qe(t, (e) => e.map((e) => new gt(e))), t;
|
|
714
714
|
});
|
|
715
715
|
}
|
|
716
716
|
publicSimpleSearch(e, t = 10) {
|
|
@@ -722,7 +722,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
722
722
|
});
|
|
723
723
|
});
|
|
724
724
|
}
|
|
725
|
-
},
|
|
725
|
+
}, Xt = class extends e {
|
|
726
726
|
getProductData(e, t = !1) {
|
|
727
727
|
return this.get(`/internal/catalog/products/${e}`, { withPriceCoefficients: t }, (e) => new R(e.data));
|
|
728
728
|
}
|
|
@@ -730,7 +730,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
730
730
|
return this.get(`/public/catalog/products/${e}`, {}, (e) => new R(e.data));
|
|
731
731
|
}
|
|
732
732
|
getProductPriceCoefficients(e) {
|
|
733
|
-
return this.get(`/internal/catalog/products/${e}/coefficients`, {}, (e) => j(e.data, (e) => new
|
|
733
|
+
return this.get(`/internal/catalog/products/${e}/coefficients`, {}, (e) => j(e.data, (e) => new gt(e)));
|
|
734
734
|
}
|
|
735
735
|
getNewProducts(e, t, n = !0) {
|
|
736
736
|
let r = v().config.dateFormats.api;
|
|
@@ -748,9 +748,9 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
748
748
|
});
|
|
749
749
|
});
|
|
750
750
|
}
|
|
751
|
-
},
|
|
751
|
+
}, Zt = class extends u {
|
|
752
752
|
getRootCategoriesList(e, t = !1) {
|
|
753
|
-
return this.getTypedList(
|
|
753
|
+
return this.getTypedList(At, "/internal/catalog/categories", {
|
|
754
754
|
clientId: e,
|
|
755
755
|
showHidden: t
|
|
756
756
|
});
|
|
@@ -760,7 +760,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
760
760
|
clientId: e,
|
|
761
761
|
showHidden: n,
|
|
762
762
|
withNestedCategories: r
|
|
763
|
-
}, (e) => new
|
|
763
|
+
}, (e) => new At(e.data));
|
|
764
764
|
}
|
|
765
765
|
getCategoryProductsList(e, t, n = !0, r = !1) {
|
|
766
766
|
return this.get(`/internal/catalog/categories/${t}/products`, {
|
|
@@ -769,7 +769,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
769
769
|
withPriceCoefficients: n
|
|
770
770
|
}, (e) => j(e.data, (e) => new z(e)));
|
|
771
771
|
}
|
|
772
|
-
},
|
|
772
|
+
}, Qt = class extends e {
|
|
773
773
|
getProductData(e, t, n = !1) {
|
|
774
774
|
return this.get(`/internal/catalog/products/${e}`, {
|
|
775
775
|
clientId: t,
|
|
@@ -784,7 +784,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
784
784
|
withPriceCoefficients: r
|
|
785
785
|
});
|
|
786
786
|
}
|
|
787
|
-
},
|
|
787
|
+
}, $t = class extends e {
|
|
788
788
|
getTemplateList(e, t, n) {
|
|
789
789
|
return this.getTypedPaginated(I, "/internal/price/templates", e, t, n);
|
|
790
790
|
}
|
|
@@ -801,25 +801,25 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
801
801
|
return this.delete(`/internal/price/templates/${e}`);
|
|
802
802
|
}
|
|
803
803
|
getProductTemplatePrices(e) {
|
|
804
|
-
return this.getTypedList(
|
|
804
|
+
return this.getTypedList(It, `/internal/price/templates/${e}/products`);
|
|
805
805
|
}
|
|
806
806
|
getProductTemplatePrice(e, t) {
|
|
807
|
-
return this.get(`/internal/price/templates/${e}/products/${t}`, {}, (e) => new
|
|
807
|
+
return this.get(`/internal/price/templates/${e}/products/${t}`, {}, (e) => new It(e.data));
|
|
808
808
|
}
|
|
809
809
|
saveProductTemplatePrice(e, t, n) {
|
|
810
810
|
return this.post(`/internal/price/templates/${e}/products/${t}`, {
|
|
811
811
|
price_coefficient_id: n.coefficient?.id,
|
|
812
812
|
increase_percent: n.value
|
|
813
|
-
}, (e) => new
|
|
813
|
+
}, (e) => new It(e.data));
|
|
814
814
|
}
|
|
815
815
|
deleteProductTemplatePrice(e, t) {
|
|
816
816
|
return this.delete(`/internal/price/templates/${e}/products/${t}`);
|
|
817
817
|
}
|
|
818
818
|
getCategoryTemplatePrices(e) {
|
|
819
|
-
return this.getTypedList(
|
|
819
|
+
return this.getTypedList(Nt, `/internal/price/templates/${e}/categories`);
|
|
820
820
|
}
|
|
821
821
|
getCategoryTemplatePrice(e, t) {
|
|
822
|
-
return this.get(`/internal/price/templates/${e}/categories/${t}`, {}, (e) => new
|
|
822
|
+
return this.get(`/internal/price/templates/${e}/categories/${t}`, {}, (e) => new Nt(e.data));
|
|
823
823
|
}
|
|
824
824
|
saveCategoryTemplatePrice(e, t, n, r = !1) {
|
|
825
825
|
return this.request({
|
|
@@ -830,7 +830,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
830
830
|
increase_percent: n.value
|
|
831
831
|
},
|
|
832
832
|
params: r ? { recursively: !0 } : {}
|
|
833
|
-
}, (e) => new
|
|
833
|
+
}, (e) => new Nt(e.data));
|
|
834
834
|
}
|
|
835
835
|
deleteCategoryTemplatePrice(e, t, n = !1) {
|
|
836
836
|
return this.request({
|
|
@@ -842,7 +842,7 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
842
842
|
getTemplateClients(e) {
|
|
843
843
|
return this.getTypedList(W, `/internal/price/templates/${e}/clients`);
|
|
844
844
|
}
|
|
845
|
-
},
|
|
845
|
+
}, en = class extends u {
|
|
846
846
|
getRoles() {
|
|
847
847
|
return this.getTypedList(q, "/internal/price/roles");
|
|
848
848
|
}
|
|
@@ -859,12 +859,12 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
859
859
|
return this.delete(`/internal/price/roles/${e}`);
|
|
860
860
|
}
|
|
861
861
|
getCategoryRules(e) {
|
|
862
|
-
return this.getTypedList(
|
|
862
|
+
return this.getTypedList(Vt, `/internal/price/roles/rules/categories/${e}`);
|
|
863
863
|
}
|
|
864
864
|
updateCategoryRules(e, t) {
|
|
865
|
-
return this.patch(`/internal/price/roles/rules/categories/${e}`, t, (e) => _.instanceListInitializer(
|
|
865
|
+
return this.patch(`/internal/price/roles/rules/categories/${e}`, t, (e) => _.instanceListInitializer(Vt, e.data));
|
|
866
866
|
}
|
|
867
|
-
},
|
|
867
|
+
}, tn = class extends e {
|
|
868
868
|
getProperties(e, t, n) {
|
|
869
869
|
return this.getTypedPaginated(G, "/internal/catalog/properties", e, t, n);
|
|
870
870
|
}
|
|
@@ -982,18 +982,18 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
982
982
|
return this.post(`/internal/catalog/categories/${e}/image`, { image: t });
|
|
983
983
|
}
|
|
984
984
|
getCategoryFilters(e, t = !1) {
|
|
985
|
-
return this.get(`/internal/catalog/categories/${e}/filters`, { recursively: t }, (e) => e.data.map((e) => new
|
|
985
|
+
return this.get(`/internal/catalog/categories/${e}/filters`, { recursively: t }, (e) => e.data.map((e) => new Gt(e)));
|
|
986
986
|
}
|
|
987
987
|
getCategoryFilterSettings(e) {
|
|
988
|
-
return this.getTypedList(
|
|
988
|
+
return this.getTypedList(Ut, `/internal/catalog/categories/${e}/filter-settings`);
|
|
989
989
|
}
|
|
990
990
|
saveCategoryFilterSetting(e, t, n) {
|
|
991
|
-
return this.patch(`/internal/catalog/categories/${e}/filter-settings/${t}`, n, (e) => new
|
|
991
|
+
return this.patch(`/internal/catalog/categories/${e}/filter-settings/${t}`, n, (e) => new Ut(e.data));
|
|
992
992
|
}
|
|
993
993
|
deleteCategoryFilterSetting(e, t) {
|
|
994
994
|
return this.delete(`/internal/catalog/categories/${e}/filter-settings/${t}`);
|
|
995
995
|
}
|
|
996
|
-
},
|
|
996
|
+
}, nn = class extends u {
|
|
997
997
|
getRootCategoriesList(e, t = !1) {
|
|
998
998
|
return this.getTypedList(H, "/internal/catalog/categories", {
|
|
999
999
|
priceTemplateId: e,
|
|
@@ -1017,18 +1017,18 @@ var at = /* @__PURE__ */ function(e) {
|
|
|
1017
1017
|
};
|
|
1018
1018
|
//#endregion
|
|
1019
1019
|
//#region src/catalog/methods/find-catalog-item.ts
|
|
1020
|
-
function
|
|
1020
|
+
function rn(e, t, n) {
|
|
1021
1021
|
let r;
|
|
1022
1022
|
return e.some((e) => {
|
|
1023
1023
|
if (e.type === n && e.id === t) return r = e, !0;
|
|
1024
1024
|
if (e.type === "product") return !1;
|
|
1025
1025
|
let i = e;
|
|
1026
1026
|
if (i.products && i.products.length > 0) {
|
|
1027
|
-
let e =
|
|
1027
|
+
let e = rn(i.products, t, n);
|
|
1028
1028
|
if (e) return r = e, !0;
|
|
1029
1029
|
}
|
|
1030
1030
|
if (i.categories && i.categories.length > 0) {
|
|
1031
|
-
let e =
|
|
1031
|
+
let e = rn(i.categories, t, n);
|
|
1032
1032
|
if (e) return r = e, !0;
|
|
1033
1033
|
}
|
|
1034
1034
|
return !1;
|
|
@@ -1036,20 +1036,20 @@ function tn(e, t, n) {
|
|
|
1036
1036
|
}
|
|
1037
1037
|
//#endregion
|
|
1038
1038
|
//#region src/catalog/methods/flatten-catalog-items.ts
|
|
1039
|
-
function
|
|
1039
|
+
function an(e) {
|
|
1040
1040
|
let t = [];
|
|
1041
1041
|
return e.forEach((e) => {
|
|
1042
1042
|
if (t.push(e), e.type === "category") {
|
|
1043
1043
|
let n = e;
|
|
1044
|
-
n.products && n.products.length > 0 && t.push(...
|
|
1044
|
+
n.products && n.products.length > 0 && t.push(...an(n.products)), n.categories && n.categories.length > 0 && t.push(...an(n.categories));
|
|
1045
1045
|
}
|
|
1046
1046
|
}), t;
|
|
1047
1047
|
}
|
|
1048
1048
|
//#endregion
|
|
1049
1049
|
//#region src/clients/enums/clients-additional-data-request-type-enum.ts
|
|
1050
|
-
var
|
|
1050
|
+
var on = /* @__PURE__ */ function(e) {
|
|
1051
1051
|
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
|
-
}({}),
|
|
1052
|
+
}({}), sn = class extends d {
|
|
1053
1053
|
bankName = "";
|
|
1054
1054
|
bic = "";
|
|
1055
1055
|
accountNumber = "";
|
|
@@ -1058,13 +1058,13 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1058
1058
|
constructor(e) {
|
|
1059
1059
|
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
1060
|
}
|
|
1061
|
-
},
|
|
1061
|
+
}, cn = class extends mt {
|
|
1062
1062
|
phone;
|
|
1063
1063
|
email;
|
|
1064
1064
|
constructor(e) {
|
|
1065
1065
|
super(e), this.email = e?.email, this.phone = /^\d+$/.test(e?.phone ?? "") ? `+${e?.phone}` : e?.phone;
|
|
1066
1066
|
}
|
|
1067
|
-
}, J = class extends
|
|
1067
|
+
}, J = class extends cn {
|
|
1068
1068
|
isPrimary;
|
|
1069
1069
|
position;
|
|
1070
1070
|
notDisturb;
|
|
@@ -1072,7 +1072,7 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1072
1072
|
constructor(e) {
|
|
1073
1073
|
super(e), this.isPrimary = e?.isPrimary ?? !1, this.position = e?.position, this.notDisturb = e?.notDisturb ?? !1, this.comment = e?.comment;
|
|
1074
1074
|
}
|
|
1075
|
-
},
|
|
1075
|
+
}, ln = class extends mt {
|
|
1076
1076
|
opf = oe.generatePersonItem();
|
|
1077
1077
|
partnerGroup = new h();
|
|
1078
1078
|
contacts = [];
|
|
@@ -1092,16 +1092,16 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1092
1092
|
if (e.bankAccounts) {
|
|
1093
1093
|
let t = [];
|
|
1094
1094
|
e.bankAccounts.forEach((e) => {
|
|
1095
|
-
t.push(new
|
|
1095
|
+
t.push(new sn(e));
|
|
1096
1096
|
}), this.bankAccounts = t;
|
|
1097
1097
|
}
|
|
1098
1098
|
}
|
|
1099
1099
|
}
|
|
1100
|
-
},
|
|
1100
|
+
}, un = class extends ln {
|
|
1101
1101
|
constructor(e) {
|
|
1102
1102
|
super(e);
|
|
1103
1103
|
}
|
|
1104
|
-
},
|
|
1104
|
+
}, dn = class extends ln {
|
|
1105
1105
|
inn = "";
|
|
1106
1106
|
okpo = "";
|
|
1107
1107
|
ogrn = "";
|
|
@@ -1114,34 +1114,34 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1114
1114
|
constructor(e) {
|
|
1115
1115
|
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
1116
|
}
|
|
1117
|
-
},
|
|
1117
|
+
}, fn = class extends dn {
|
|
1118
1118
|
kpp = "";
|
|
1119
1119
|
constructor(e) {
|
|
1120
1120
|
super(e), e && (this.kpp = e.kpp ?? "");
|
|
1121
1121
|
}
|
|
1122
|
-
},
|
|
1122
|
+
}, pn = class extends fn {
|
|
1123
1123
|
registrationCountry = new i();
|
|
1124
1124
|
registrationNumber = "";
|
|
1125
1125
|
taxNumber = "";
|
|
1126
1126
|
constructor(e) {
|
|
1127
1127
|
super(e), e && (this.registrationCountry = new i(e.registrationCountry), this.registrationNumber = e.registrationNumber ?? "", this.taxNumber = e.taxNumber ?? "");
|
|
1128
1128
|
}
|
|
1129
|
-
},
|
|
1129
|
+
}, mn = class {
|
|
1130
1130
|
static createInstance(e) {
|
|
1131
1131
|
switch (e.opf.slug) {
|
|
1132
|
-
case m.Ic: return new
|
|
1133
|
-
case m.UlR: return new
|
|
1134
|
-
case m.UlNr: return new
|
|
1135
|
-
default: return new
|
|
1132
|
+
case m.Ic: return new dn(e);
|
|
1133
|
+
case m.UlR: return new fn(e);
|
|
1134
|
+
case m.UlNr: return new pn(e);
|
|
1135
|
+
default: return new un(e);
|
|
1136
1136
|
}
|
|
1137
1137
|
}
|
|
1138
|
-
},
|
|
1138
|
+
}, hn = class extends p {
|
|
1139
1139
|
city;
|
|
1140
1140
|
isActive;
|
|
1141
1141
|
constructor(e) {
|
|
1142
1142
|
super(e), this.city = e?.city ? new n(e.city) : void 0, this.isActive = e?.isActive ?? !1;
|
|
1143
1143
|
}
|
|
1144
|
-
}, Y = class extends
|
|
1144
|
+
}, Y = class extends mt {
|
|
1145
1145
|
address = "";
|
|
1146
1146
|
coordinates;
|
|
1147
1147
|
contacts;
|
|
@@ -1152,7 +1152,7 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1152
1152
|
constructor(e) {
|
|
1153
1153
|
super(e), this.address = e?.address ?? "", this.coordinates = new ne(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
1154
|
}
|
|
1155
|
-
},
|
|
1155
|
+
}, gn = class extends U {
|
|
1156
1156
|
contragents;
|
|
1157
1157
|
partnerGroups;
|
|
1158
1158
|
contacts;
|
|
@@ -1164,9 +1164,9 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1164
1164
|
preferredWarehouse;
|
|
1165
1165
|
extraData;
|
|
1166
1166
|
constructor(e) {
|
|
1167
|
-
super(e), this.contragents = e?.contragents?.map((e) =>
|
|
1167
|
+
super(e), this.contragents = e?.contragents?.map((e) => mn.createInstance(e)) ?? [], this.partnerGroups = e?.partnerGroups?.map((e) => new h(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 he(e?.sourcePrimaryInterest), this.preferredDeliveryType = new c(e?.preferredDeliveryType), this.primaryDemand = e?.primaryDemand, this.preferredWarehouse = e?.preferredWarehouse ? new be(e.preferredWarehouse) : void 0, this.extraData = e?.extraData ?? {};
|
|
1168
1168
|
}
|
|
1169
|
-
},
|
|
1169
|
+
}, _n = class extends N {
|
|
1170
1170
|
id;
|
|
1171
1171
|
guid;
|
|
1172
1172
|
name;
|
|
@@ -1194,7 +1194,7 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1194
1194
|
lastOrder;
|
|
1195
1195
|
noOrdersPeriod = new P();
|
|
1196
1196
|
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 fe(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 P(e?.createdAt), this.lastLoginDate = new P(e?.lastLoginDate), this.lastLoginDateHasOrder = e?.lastLoginDateHasOrder ?? void 0, this.managers = e?.managers?.map((e) => new f(e)) ?? [], this.includeSubordinateManagers = e?.includeSubordinateManagers ?? !0, this.curators = e?.curators?.map((e) => new
|
|
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 fe(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 P(e?.createdAt), this.lastLoginDate = new P(e?.lastLoginDate), this.lastLoginDateHasOrder = e?.lastLoginDateHasOrder ?? void 0, this.managers = e?.managers?.map((e) => new f(e)) ?? [], this.includeSubordinateManagers = e?.includeSubordinateManagers ?? !0, this.curators = e?.curators?.map((e) => new Pt(e)) ?? [], this.salesDirections = e?.salesDirections?.map((e) => new g(e)), this.contragentInn = e?.contragentInn, this.contragentType = new oe(e?.contragentType), this.preferredDeliveryType = e?.preferredDeliveryType ? new c(e?.preferredDeliveryType) : void 0, this.partnerGroups = e?.partnerGroups?.map((e) => new h(e)), this.contact = new cn(e?.contact), this.lastOrder = {
|
|
1198
1198
|
createdAt: new P(e?.lastOrder?.createdAt),
|
|
1199
1199
|
creator: e?.lastOrder?.creator,
|
|
1200
1200
|
isApproved: e?.lastOrder?.isApproved
|
|
@@ -1242,7 +1242,7 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1242
1242
|
this.partnerGroups = [];
|
|
1243
1243
|
break;
|
|
1244
1244
|
case "contact":
|
|
1245
|
-
this.contact = new
|
|
1245
|
+
this.contact = new cn();
|
|
1246
1246
|
break;
|
|
1247
1247
|
default: this[e] = void 0;
|
|
1248
1248
|
}
|
|
@@ -1252,12 +1252,12 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1252
1252
|
let e = super.asClearRaw();
|
|
1253
1253
|
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
1254
|
}
|
|
1255
|
-
},
|
|
1255
|
+
}, vn = class extends M {
|
|
1256
1256
|
creator;
|
|
1257
1257
|
constructor(e) {
|
|
1258
1258
|
super(e), this.creator = new F(e?.creator);
|
|
1259
1259
|
}
|
|
1260
|
-
},
|
|
1260
|
+
}, yn = class extends p {
|
|
1261
1261
|
contacts = [];
|
|
1262
1262
|
preferredDeliveryType;
|
|
1263
1263
|
partnerGroups = [];
|
|
@@ -1266,23 +1266,23 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1266
1266
|
managers;
|
|
1267
1267
|
curators;
|
|
1268
1268
|
constructor(e) {
|
|
1269
|
-
super(e), this.contacts = e.contacts?.map((e) => new J(e)) ?? void 0, this.lastOrder = e.lastOrder ? new
|
|
1269
|
+
super(e), this.contacts = e.contacts?.map((e) => new J(e)) ?? void 0, this.lastOrder = e.lastOrder ? new vn(e.lastOrder) : void 0, this.partnerGroups = e.partnerGroups?.map((e) => new h(e)) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new c(e.preferredDeliveryType) : void 0, this.salesDirection = e.salesDirection ? new g(e.salesDirection) : void 0, this.managers = e.managers?.map((e) => new re(e)) ?? void 0, this.curators = e.curators?.map((e) => new Pt(e)) ?? void 0;
|
|
1270
1270
|
}
|
|
1271
|
-
},
|
|
1271
|
+
}, bn = class extends d {
|
|
1272
1272
|
isPrimary;
|
|
1273
1273
|
constructor(e) {
|
|
1274
1274
|
super(e), this.isPrimary = e.isPrimary;
|
|
1275
1275
|
}
|
|
1276
|
-
},
|
|
1276
|
+
}, xn = class extends J {
|
|
1277
1277
|
relations = {
|
|
1278
1278
|
clients: [],
|
|
1279
1279
|
contragents: [],
|
|
1280
1280
|
addresses: []
|
|
1281
1281
|
};
|
|
1282
1282
|
constructor(e) {
|
|
1283
|
-
super(e), e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((e) => new
|
|
1283
|
+
super(e), e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((e) => new bn(e))), e.relations.clients && (this.relations.clients = e.relations.clients.map((e) => new bn(e))), e.relations.contragents && (this.relations.contragents = e.relations.contragents.map((e) => new bn(e))));
|
|
1284
1284
|
}
|
|
1285
|
-
},
|
|
1285
|
+
}, Sn = class t extends e {
|
|
1286
1286
|
static transformClientDataToRequest(e) {
|
|
1287
1287
|
return {
|
|
1288
1288
|
name: e.name,
|
|
@@ -1391,7 +1391,7 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1391
1391
|
};
|
|
1392
1392
|
}
|
|
1393
1393
|
getClient(e) {
|
|
1394
|
-
return this.get(`/internal/clients/${e}`, {}, (e) => new
|
|
1394
|
+
return this.get(`/internal/clients/${e}`, {}, (e) => new gn(e.data));
|
|
1395
1395
|
}
|
|
1396
1396
|
getClientsList(e, t, n, r, i) {
|
|
1397
1397
|
return this.getTypedPaginated(U, "/internal/clients", e, t, n, r, void 0, i);
|
|
@@ -1415,13 +1415,13 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1415
1415
|
return this.post("/internal/clients/additional-data", {
|
|
1416
1416
|
clients: n,
|
|
1417
1417
|
requested_data_types: t
|
|
1418
|
-
}, (e) => _.instanceListInitializer(
|
|
1418
|
+
}, (e) => _.instanceListInitializer(yn, e.data));
|
|
1419
1419
|
}
|
|
1420
1420
|
getAllClientContacts(e) {
|
|
1421
|
-
return this.getTypedList(
|
|
1421
|
+
return this.getTypedList(xn, `/internal/clients/${e}/contacts/all`);
|
|
1422
1422
|
}
|
|
1423
1423
|
createClientCommonData(e, n = {}) {
|
|
1424
|
-
return this.post("/internal/clients", t.transformClientDataToRequest(e), (e) => new
|
|
1424
|
+
return this.post("/internal/clients", t.transformClientDataToRequest(e), (e) => new gn(e.data), n);
|
|
1425
1425
|
}
|
|
1426
1426
|
updateClientCommonData(e, n = {}) {
|
|
1427
1427
|
return this.patch(`/internal/clients/${e.id}`, t.transformClientDataToRequest(e), void 0, n);
|
|
@@ -1463,10 +1463,10 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1463
1463
|
})) });
|
|
1464
1464
|
}
|
|
1465
1465
|
createContragentClientData(e, n, r = {}) {
|
|
1466
|
-
return this.post(`/internal/clients/${e}/contragents`, t.transformContragentClientDataToRequest(n), (e) =>
|
|
1466
|
+
return this.post(`/internal/clients/${e}/contragents`, t.transformContragentClientDataToRequest(n), (e) => mn.createInstance(e.data), r);
|
|
1467
1467
|
}
|
|
1468
1468
|
updateContragentClientData(e, n, r = {}) {
|
|
1469
|
-
return this.patch(`/internal/clients/${e}/contragents/${n.id}`, t.transformContragentClientDataToRequest(n), (e) =>
|
|
1469
|
+
return this.patch(`/internal/clients/${e}/contragents/${n.id}`, t.transformContragentClientDataToRequest(n), (e) => mn.createInstance(e.data), r);
|
|
1470
1470
|
}
|
|
1471
1471
|
deleteClientContragent(e, t) {
|
|
1472
1472
|
return this.delete(`/internal/clients/${e}/contragents/${t.id}`);
|
|
@@ -1484,10 +1484,10 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1484
1484
|
return this.delete(`/internal/clients/${e}/delivery-addresses/${t.id}`);
|
|
1485
1485
|
}
|
|
1486
1486
|
createContragentBankAccount(e, n, r, i = {}) {
|
|
1487
|
-
return this.post(`/internal/clients/${e}/contragents/${n}/bank-accounts`, t.transformClientContragentBankAccountToRequest(r), (e) => new
|
|
1487
|
+
return this.post(`/internal/clients/${e}/contragents/${n}/bank-accounts`, t.transformClientContragentBankAccountToRequest(r), (e) => new sn(e.data), i);
|
|
1488
1488
|
}
|
|
1489
1489
|
updateContragentBankAccount(e, n, r, i = {}) {
|
|
1490
|
-
return this.patch(`/internal/clients/${e}/contragents/${n}/bank-accounts/${r.id}`, t.transformClientContragentBankAccountToRequest(r), (e) => new
|
|
1490
|
+
return this.patch(`/internal/clients/${e}/contragents/${n}/bank-accounts/${r.id}`, t.transformClientContragentBankAccountToRequest(r), (e) => new sn(e.data), i);
|
|
1491
1491
|
}
|
|
1492
1492
|
deleteContragentBankAccount(e, t, n) {
|
|
1493
1493
|
return this.delete(`/internal/clients/${e}/contragents/${t}/bank-accounts/${n.id}`);
|
|
@@ -1559,7 +1559,7 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1559
1559
|
sendClientEmailConfirmation(e) {
|
|
1560
1560
|
return this.get(`/internal/clients/${e.id}/verification/email?email=${e.email}`);
|
|
1561
1561
|
}
|
|
1562
|
-
},
|
|
1562
|
+
}, Cn = class extends u {
|
|
1563
1563
|
checkPhoneIsBusy(e) {
|
|
1564
1564
|
return new Promise((t, n) => {
|
|
1565
1565
|
this.request({
|
|
@@ -1571,16 +1571,16 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1571
1571
|
}).catch(n);
|
|
1572
1572
|
});
|
|
1573
1573
|
}
|
|
1574
|
-
},
|
|
1574
|
+
}, wn = class {
|
|
1575
1575
|
date;
|
|
1576
1576
|
name;
|
|
1577
1577
|
version;
|
|
1578
1578
|
constructor(e) {
|
|
1579
1579
|
this.date = A(e?.date) ? w(e.date) : e?.date ?? /* @__PURE__ */ new Date(), this.name = e?.name ?? "", this.version = e?.version ?? "0.0.0";
|
|
1580
1580
|
}
|
|
1581
|
-
},
|
|
1581
|
+
}, Tn = /* @__PURE__ */ function(e) {
|
|
1582
1582
|
return e.Kozyrek = "kozyrek", e.Mosquitto = "mosquitto", e.Strip = "strip", e.MetalForDoors = "metal_for_doors", e.Sandwich = "sandwich", e.SandwichM2 = "sandwich_m2", e;
|
|
1583
|
-
}({}),
|
|
1583
|
+
}({}), En = class extends u {
|
|
1584
1584
|
getConfiguratorSettings(e, t) {
|
|
1585
1585
|
return this.get(`internal/catalog/categories/${e.id}/configurators/${e.properties?.configurator}/settings?client_id=${t}`);
|
|
1586
1586
|
}
|
|
@@ -1606,13 +1606,13 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1606
1606
|
...n
|
|
1607
1607
|
});
|
|
1608
1608
|
}
|
|
1609
|
-
},
|
|
1609
|
+
}, Dn = class {
|
|
1610
1610
|
page = 1;
|
|
1611
1611
|
pageSize = 50;
|
|
1612
1612
|
constructor(e) {
|
|
1613
1613
|
this.page = e?.page ?? 1, this.pageSize = e?.pageSize ?? 50;
|
|
1614
1614
|
}
|
|
1615
|
-
},
|
|
1615
|
+
}, On = class extends Dn {
|
|
1616
1616
|
itemCount = 0;
|
|
1617
1617
|
pageCount = 1;
|
|
1618
1618
|
pageSlot = 5;
|
|
@@ -1629,7 +1629,7 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1629
1629
|
100
|
|
1630
1630
|
], this.showSizePicker = e?.showSizePicker ?? !0;
|
|
1631
1631
|
}
|
|
1632
|
-
},
|
|
1632
|
+
}, kn = class {
|
|
1633
1633
|
field;
|
|
1634
1634
|
direction;
|
|
1635
1635
|
constructor(e) {
|
|
@@ -1660,28 +1660,28 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1660
1660
|
return b(e, t * 6);
|
|
1661
1661
|
}
|
|
1662
1662
|
static intervalTillSameDate(e, t, n) {
|
|
1663
|
-
let r =
|
|
1663
|
+
let r = Ee(E(n), E(e)), i = E(b(t, r)), a = Math.min(Ne(n), Pe(i));
|
|
1664
1664
|
return {
|
|
1665
1665
|
from: T(t),
|
|
1666
|
-
to: x(
|
|
1666
|
+
to: x(Fe(i, a))
|
|
1667
1667
|
};
|
|
1668
1668
|
}
|
|
1669
1669
|
static weekTillSameWeekday(e, t) {
|
|
1670
|
-
let n = D(
|
|
1670
|
+
let n = D(Ce(e, t), { weekStartsOn: 1 }), r = Te(e, D(e, { weekStartsOn: 1 }));
|
|
1671
1671
|
return {
|
|
1672
1672
|
from: n,
|
|
1673
1673
|
to: x(y(n, r))
|
|
1674
1674
|
};
|
|
1675
1675
|
}
|
|
1676
1676
|
static decadeTillSameDayNumber(t, n) {
|
|
1677
|
-
let [r] = e.shiftedDecadeBounds(t, 0), i =
|
|
1677
|
+
let [r] = e.shiftedDecadeBounds(t, 0), i = Te(t, r) + 1, [a, o] = e.shiftedDecadeBounds(t, n), s = Te(o, a) + 1;
|
|
1678
1678
|
return {
|
|
1679
1679
|
from: a,
|
|
1680
1680
|
to: x(y(a, Math.min(i, s) - 1))
|
|
1681
1681
|
};
|
|
1682
1682
|
}
|
|
1683
1683
|
static shiftedDecadeBounds(e, t) {
|
|
1684
|
-
let n =
|
|
1684
|
+
let n = Ne(e), r = 2;
|
|
1685
1685
|
n <= 10 ? r = 0 : n <= 20 && (r = 1);
|
|
1686
1686
|
let i = r + t, a = Math.floor(i / 3), o = (i % 3 + 3) % 3, s = E(b(e, a)), c = y(s, o * 10);
|
|
1687
1687
|
return [c, o === 2 ? S(s) : x(y(c, 9))];
|
|
@@ -1689,12 +1689,12 @@ var rn = /* @__PURE__ */ function(e) {
|
|
|
1689
1689
|
};
|
|
1690
1690
|
//#endregion
|
|
1691
1691
|
//#region src/date-time/helpers/days-ago-iso.ts
|
|
1692
|
-
function
|
|
1693
|
-
return C(
|
|
1692
|
+
function An(e) {
|
|
1693
|
+
return C(Be(Le(), e), "yyyy-MM-dd");
|
|
1694
1694
|
}
|
|
1695
1695
|
//#endregion
|
|
1696
1696
|
//#region src/i18n/helpers/pluralize.ts
|
|
1697
|
-
function
|
|
1697
|
+
function jn(e, t) {
|
|
1698
1698
|
let n = [
|
|
1699
1699
|
2,
|
|
1700
1700
|
0,
|
|
@@ -1707,13 +1707,13 @@ function kn(e, t) {
|
|
|
1707
1707
|
}
|
|
1708
1708
|
//#endregion
|
|
1709
1709
|
//#region src/date-time/helpers/format-relative-date.ts
|
|
1710
|
-
function
|
|
1711
|
-
let t = w(e), n =
|
|
1710
|
+
function Mn(e) {
|
|
1711
|
+
let t = w(e), n = Te(Le(), t);
|
|
1712
1712
|
switch (!0) {
|
|
1713
1713
|
case n === 0: return "Сегодня";
|
|
1714
1714
|
case n === 1: return "Вчера";
|
|
1715
1715
|
case n < 0: return e;
|
|
1716
|
-
default: return `${n} ${
|
|
1716
|
+
default: return `${n} ${jn(n, [
|
|
1717
1717
|
"день",
|
|
1718
1718
|
"дня",
|
|
1719
1719
|
"дней"
|
|
@@ -1722,9 +1722,9 @@ function An(e) {
|
|
|
1722
1722
|
}
|
|
1723
1723
|
//#endregion
|
|
1724
1724
|
//#region src/date-time/providers/date-time-provider.ts
|
|
1725
|
-
var
|
|
1725
|
+
var Nn = class {
|
|
1726
1726
|
static defaultDateRanges(e) {
|
|
1727
|
-
let t =
|
|
1727
|
+
let t = xe(/* @__PURE__ */ new Date(), 1), n = /* @__PURE__ */ new Date(), r = O(e === void 0 ? n : new Date(e, 0, 1)), i = je(r);
|
|
1728
1728
|
return {
|
|
1729
1729
|
nextWorkingDay: {
|
|
1730
1730
|
label: "Следующий рабочий день",
|
|
@@ -1733,23 +1733,23 @@ var jn = class {
|
|
|
1733
1733
|
},
|
|
1734
1734
|
today: {
|
|
1735
1735
|
label: "Сегодня",
|
|
1736
|
-
from:
|
|
1737
|
-
to:
|
|
1736
|
+
from: Le(),
|
|
1737
|
+
to: Oe()
|
|
1738
1738
|
},
|
|
1739
1739
|
yesterday: {
|
|
1740
1740
|
label: "Вчера",
|
|
1741
|
-
from:
|
|
1742
|
-
to:
|
|
1741
|
+
from: ze(),
|
|
1742
|
+
to: Me()
|
|
1743
1743
|
},
|
|
1744
1744
|
tomorrow: {
|
|
1745
1745
|
label: "Завтра",
|
|
1746
|
-
from:
|
|
1747
|
-
to:
|
|
1746
|
+
from: Re(),
|
|
1747
|
+
to: ke()
|
|
1748
1748
|
},
|
|
1749
1749
|
currentWeek: {
|
|
1750
1750
|
label: "Неделя",
|
|
1751
1751
|
from: D(n, { weekStartsOn: 1 }),
|
|
1752
|
-
to:
|
|
1752
|
+
to: Ae(n, { weekStartsOn: 1 })
|
|
1753
1753
|
},
|
|
1754
1754
|
currentMonth: {
|
|
1755
1755
|
label: "Месяц",
|
|
@@ -1809,13 +1809,13 @@ var jn = class {
|
|
|
1809
1809
|
};
|
|
1810
1810
|
}
|
|
1811
1811
|
static standardPeriods(e = /* @__PURE__ */ new Date()) {
|
|
1812
|
-
let t = { weekStartsOn: 1 }, n = T(e), r = x(e), i = X.decadeInterval(e), a = E(e), o =
|
|
1812
|
+
let t = { weekStartsOn: 1 }, n = T(e), r = x(e), i = X.decadeInterval(e), a = E(e), o = Ie(e), s = X.startOfHalfYear(e), c = O(e), l = X.addHalfYears(e, -1), ee = X.addHalfYears(e, 1);
|
|
1813
1813
|
return {
|
|
1814
1814
|
yesterday: {
|
|
1815
1815
|
label: "Вчера",
|
|
1816
1816
|
group: "day",
|
|
1817
|
-
from: T(
|
|
1818
|
-
to: x(
|
|
1817
|
+
from: T(Be(e, 1)),
|
|
1818
|
+
to: x(Be(e, 1))
|
|
1819
1819
|
},
|
|
1820
1820
|
today: {
|
|
1821
1821
|
label: "Сегодня",
|
|
@@ -1832,20 +1832,20 @@ var jn = class {
|
|
|
1832
1832
|
lastWeek: {
|
|
1833
1833
|
label: "Прошлая неделя",
|
|
1834
1834
|
group: "week",
|
|
1835
|
-
from: D(
|
|
1836
|
-
to:
|
|
1835
|
+
from: D(Ue(e, 1), t),
|
|
1836
|
+
to: Ae(Ue(e, 1), t)
|
|
1837
1837
|
},
|
|
1838
1838
|
thisWeek: {
|
|
1839
1839
|
label: "Эта неделя",
|
|
1840
1840
|
group: "week",
|
|
1841
1841
|
from: D(e, t),
|
|
1842
|
-
to:
|
|
1842
|
+
to: Ae(e, t)
|
|
1843
1843
|
},
|
|
1844
1844
|
nextWeek: {
|
|
1845
1845
|
label: "Следующая неделя",
|
|
1846
1846
|
group: "week",
|
|
1847
|
-
from: D(
|
|
1848
|
-
to:
|
|
1847
|
+
from: D(Ce(e, 1), t),
|
|
1848
|
+
to: Ae(Ce(e, 1), t)
|
|
1849
1849
|
},
|
|
1850
1850
|
lastTenDays: {
|
|
1851
1851
|
label: "Прошлая декада",
|
|
@@ -1865,8 +1865,8 @@ var jn = class {
|
|
|
1865
1865
|
lastMonth: {
|
|
1866
1866
|
label: "Прошлый месяц",
|
|
1867
1867
|
group: "month",
|
|
1868
|
-
from: E(
|
|
1869
|
-
to: S(
|
|
1868
|
+
from: E(Ve(e, 1)),
|
|
1869
|
+
to: S(Ve(e, 1))
|
|
1870
1870
|
},
|
|
1871
1871
|
thisMonth: {
|
|
1872
1872
|
label: "Этот месяц",
|
|
@@ -1883,26 +1883,26 @@ var jn = class {
|
|
|
1883
1883
|
lastQuarter: {
|
|
1884
1884
|
label: "Прошлый квартал",
|
|
1885
1885
|
group: "quarter",
|
|
1886
|
-
from:
|
|
1887
|
-
to:
|
|
1886
|
+
from: Ie(He(e, 1)),
|
|
1887
|
+
to: De(He(e, 1))
|
|
1888
1888
|
},
|
|
1889
1889
|
thisQuarter: {
|
|
1890
1890
|
label: "Этот квартал",
|
|
1891
1891
|
group: "quarter",
|
|
1892
1892
|
from: o,
|
|
1893
|
-
to:
|
|
1893
|
+
to: De(e)
|
|
1894
1894
|
},
|
|
1895
1895
|
nextQuarter: {
|
|
1896
1896
|
label: "Следующий квартал",
|
|
1897
1897
|
group: "quarter",
|
|
1898
|
-
from:
|
|
1899
|
-
to:
|
|
1898
|
+
from: Ie(Se(e, 1)),
|
|
1899
|
+
to: De(Se(e, 1))
|
|
1900
1900
|
},
|
|
1901
1901
|
lastHalfYear: {
|
|
1902
1902
|
label: "Прошлое полугодие",
|
|
1903
1903
|
group: "halfYear",
|
|
1904
|
-
from: X.startOfHalfYear(
|
|
1905
|
-
to: X.endOfHalfYear(
|
|
1904
|
+
from: X.startOfHalfYear(l),
|
|
1905
|
+
to: X.endOfHalfYear(l)
|
|
1906
1906
|
},
|
|
1907
1907
|
thisHalfYear: {
|
|
1908
1908
|
label: "Это полугодие",
|
|
@@ -1913,26 +1913,26 @@ var jn = class {
|
|
|
1913
1913
|
nextHalfYear: {
|
|
1914
1914
|
label: "Следующее полугодие",
|
|
1915
1915
|
group: "halfYear",
|
|
1916
|
-
from: X.startOfHalfYear(
|
|
1917
|
-
to: X.endOfHalfYear(
|
|
1916
|
+
from: X.startOfHalfYear(ee),
|
|
1917
|
+
to: X.endOfHalfYear(ee)
|
|
1918
1918
|
},
|
|
1919
1919
|
lastYear: {
|
|
1920
1920
|
label: "Прошлый год",
|
|
1921
1921
|
group: "year",
|
|
1922
|
-
from: O(
|
|
1923
|
-
to:
|
|
1922
|
+
from: O(We(e, 1)),
|
|
1923
|
+
to: je(We(e, 1))
|
|
1924
1924
|
},
|
|
1925
1925
|
thisYear: {
|
|
1926
1926
|
label: "Этот год",
|
|
1927
1927
|
group: "year",
|
|
1928
1928
|
from: c,
|
|
1929
|
-
to:
|
|
1929
|
+
to: je(e)
|
|
1930
1930
|
},
|
|
1931
1931
|
nextYear: {
|
|
1932
1932
|
label: "Следующий год",
|
|
1933
1933
|
group: "year",
|
|
1934
|
-
from: O(
|
|
1935
|
-
to:
|
|
1934
|
+
from: O(we(e, 1)),
|
|
1935
|
+
to: je(we(e, 1))
|
|
1936
1936
|
},
|
|
1937
1937
|
fromBeginningOfThisWeek: {
|
|
1938
1938
|
label: "С начала этой недели",
|
|
@@ -1981,7 +1981,7 @@ var jn = class {
|
|
|
1981
1981
|
group: "other",
|
|
1982
1982
|
section: "tillEnd",
|
|
1983
1983
|
from: n,
|
|
1984
|
-
to:
|
|
1984
|
+
to: Ae(e, t)
|
|
1985
1985
|
},
|
|
1986
1986
|
tillEndOfThisTenDays: {
|
|
1987
1987
|
label: "До конца этой декады",
|
|
@@ -2002,7 +2002,7 @@ var jn = class {
|
|
|
2002
2002
|
group: "other",
|
|
2003
2003
|
section: "tillEnd",
|
|
2004
2004
|
from: n,
|
|
2005
|
-
to:
|
|
2005
|
+
to: De(e)
|
|
2006
2006
|
},
|
|
2007
2007
|
tillEndOfThisHalfYear: {
|
|
2008
2008
|
label: "До конца этого полугодия",
|
|
@@ -2016,7 +2016,7 @@ var jn = class {
|
|
|
2016
2016
|
group: "other",
|
|
2017
2017
|
section: "tillEnd",
|
|
2018
2018
|
from: n,
|
|
2019
|
-
to:
|
|
2019
|
+
to: je(e)
|
|
2020
2020
|
},
|
|
2021
2021
|
lastWeekTillSameWeekDay: {
|
|
2022
2022
|
label: "Прошлая неделя, до такого же дня недели",
|
|
@@ -2034,25 +2034,25 @@ var jn = class {
|
|
|
2034
2034
|
label: "Прошлый месяц, до такой же даты",
|
|
2035
2035
|
group: "other",
|
|
2036
2036
|
section: "lastTillSame",
|
|
2037
|
-
...X.intervalTillSameDate(a, E(
|
|
2037
|
+
...X.intervalTillSameDate(a, E(Ve(e, 1)), e)
|
|
2038
2038
|
},
|
|
2039
2039
|
lastQuarterTillSameDate: {
|
|
2040
2040
|
label: "Прошлый квартал, до такой же даты",
|
|
2041
2041
|
group: "other",
|
|
2042
2042
|
section: "lastTillSame",
|
|
2043
|
-
...X.intervalTillSameDate(o,
|
|
2043
|
+
...X.intervalTillSameDate(o, Ie(He(e, 1)), e)
|
|
2044
2044
|
},
|
|
2045
2045
|
lastHalfYearTillSameDate: {
|
|
2046
2046
|
label: "Прошлое полугодие, до такой же даты",
|
|
2047
2047
|
group: "other",
|
|
2048
2048
|
section: "lastTillSame",
|
|
2049
|
-
...X.intervalTillSameDate(s, X.startOfHalfYear(
|
|
2049
|
+
...X.intervalTillSameDate(s, X.startOfHalfYear(l), e)
|
|
2050
2050
|
},
|
|
2051
2051
|
lastYearTillSameDate: {
|
|
2052
2052
|
label: "Прошлый год, до такой же даты",
|
|
2053
2053
|
group: "other",
|
|
2054
2054
|
section: "lastTillSame",
|
|
2055
|
-
...X.intervalTillSameDate(c, O(
|
|
2055
|
+
...X.intervalTillSameDate(c, O(We(e, 1)), e)
|
|
2056
2056
|
},
|
|
2057
2057
|
nextWeekTillSameWeekDay: {
|
|
2058
2058
|
label: "Следующая неделя, до такого же дня недели",
|
|
@@ -2076,25 +2076,25 @@ var jn = class {
|
|
|
2076
2076
|
label: "Следующий квартал, до такой же даты",
|
|
2077
2077
|
group: "other",
|
|
2078
2078
|
section: "nextTillSame",
|
|
2079
|
-
...X.intervalTillSameDate(o,
|
|
2079
|
+
...X.intervalTillSameDate(o, Ie(Se(e, 1)), e)
|
|
2080
2080
|
},
|
|
2081
2081
|
nextHalfYearTillSameDate: {
|
|
2082
2082
|
label: "Следующее полугодие, до такой же даты",
|
|
2083
2083
|
group: "other",
|
|
2084
2084
|
section: "nextTillSame",
|
|
2085
|
-
...X.intervalTillSameDate(s, X.startOfHalfYear(
|
|
2085
|
+
...X.intervalTillSameDate(s, X.startOfHalfYear(ee), e)
|
|
2086
2086
|
},
|
|
2087
2087
|
nextYearTillSameDate: {
|
|
2088
2088
|
label: "Следующий год, до такой же даты",
|
|
2089
2089
|
group: "other",
|
|
2090
2090
|
section: "nextTillSame",
|
|
2091
|
-
...X.intervalTillSameDate(c, O(
|
|
2091
|
+
...X.intervalTillSameDate(c, O(we(e, 1)), e)
|
|
2092
2092
|
},
|
|
2093
2093
|
last7Days: {
|
|
2094
2094
|
label: "Последние 7 дней",
|
|
2095
2095
|
group: "other",
|
|
2096
2096
|
section: "rollingDays",
|
|
2097
|
-
from: T(
|
|
2097
|
+
from: T(Be(e, 6)),
|
|
2098
2098
|
to: r
|
|
2099
2099
|
},
|
|
2100
2100
|
next7Days: {
|
|
@@ -2106,7 +2106,7 @@ var jn = class {
|
|
|
2106
2106
|
}
|
|
2107
2107
|
};
|
|
2108
2108
|
}
|
|
2109
|
-
},
|
|
2109
|
+
}, Pn = [
|
|
2110
2110
|
{
|
|
2111
2111
|
key: "day",
|
|
2112
2112
|
label: "День"
|
|
@@ -2139,7 +2139,7 @@ var jn = class {
|
|
|
2139
2139
|
key: "other",
|
|
2140
2140
|
label: "Прочее"
|
|
2141
2141
|
}
|
|
2142
|
-
],
|
|
2142
|
+
], Fn = [
|
|
2143
2143
|
{
|
|
2144
2144
|
key: "fromBeginning",
|
|
2145
2145
|
label: "С начала периода"
|
|
@@ -2160,7 +2160,7 @@ var jn = class {
|
|
|
2160
2160
|
key: "rollingDays",
|
|
2161
2161
|
label: "7 дней"
|
|
2162
2162
|
}
|
|
2163
|
-
],
|
|
2163
|
+
], In = class extends hn {}, Ln = class {
|
|
2164
2164
|
salesDirections;
|
|
2165
2165
|
partnerGroups;
|
|
2166
2166
|
managers;
|
|
@@ -2171,10 +2171,10 @@ var jn = class {
|
|
|
2171
2171
|
lastLoginDate;
|
|
2172
2172
|
lastOrderDate;
|
|
2173
2173
|
constructor(e) {
|
|
2174
|
-
this.salesDirections = j(e?.salesDirections ?? [], (e) => new g(e)), this.partnerGroups = j(e?.partnerGroups ?? [], (e) => new h(e)), this.managers = j(e?.managers ?? [], (e) => new F(e)), this.additionalClients = j(e?.additionalClients ?? [], (e) => new
|
|
2174
|
+
this.salesDirections = j(e?.salesDirections ?? [], (e) => new g(e)), this.partnerGroups = j(e?.partnerGroups ?? [], (e) => new h(e)), this.managers = j(e?.managers ?? [], (e) => new F(e)), this.additionalClients = j(e?.additionalClients ?? [], (e) => new In(e)), this.fixedClients = j(e?.fixedClients ?? [], (e) => new In(e)), this.regions = j(e?.regions ?? [], (e) => new fe(e)), this.cities = j(e?.cities ?? [], (e) => new n(e)), this.lastLoginDate = new P(e?.lastLoginDate), this.lastOrderDate = new P(e?.lastOrderDate);
|
|
2175
2175
|
}
|
|
2176
2176
|
hasClientConditions() {
|
|
2177
|
-
return
|
|
2177
|
+
return it([
|
|
2178
2178
|
this.salesDirections,
|
|
2179
2179
|
this.partnerGroups,
|
|
2180
2180
|
this.managers,
|
|
@@ -2182,7 +2182,7 @@ var jn = class {
|
|
|
2182
2182
|
this.fixedClients,
|
|
2183
2183
|
this.regions,
|
|
2184
2184
|
this.cities
|
|
2185
|
-
], (e) => !
|
|
2185
|
+
], (e) => !Ze(e)) || it([this.lastLoginDate, this.lastOrderDate], (e) => !!e.from || !!e.to);
|
|
2186
2186
|
}
|
|
2187
2187
|
setPeriod(e, t) {
|
|
2188
2188
|
return this[e] = new P({
|
|
@@ -2202,13 +2202,13 @@ var jn = class {
|
|
|
2202
2202
|
lastOrderDate: new P(this.lastOrderDate)
|
|
2203
2203
|
};
|
|
2204
2204
|
}
|
|
2205
|
-
},
|
|
2205
|
+
}, Rn = /* @__PURE__ */ function(e) {
|
|
2206
2206
|
return e.Active = "active", e.Scheduled = "scheduled", e.Completed = "completed", e;
|
|
2207
|
-
}({}),
|
|
2207
|
+
}({}), zn = class {
|
|
2208
2208
|
static resolve(e, t = /* @__PURE__ */ new Date()) {
|
|
2209
|
-
return e.deletedAt && e.deletedAt.getTime() <= t.getTime() ?
|
|
2209
|
+
return e.deletedAt && e.deletedAt.getTime() <= t.getTime() ? Rn.Completed : e.publishedAt && e.publishedAt.getTime() > t.getTime() ? Rn.Scheduled : Rn.Active;
|
|
2210
2210
|
}
|
|
2211
|
-
},
|
|
2211
|
+
}, Bn = class extends ht {
|
|
2212
2212
|
conditions;
|
|
2213
2213
|
products;
|
|
2214
2214
|
productCategories;
|
|
@@ -2217,10 +2217,10 @@ var jn = class {
|
|
|
2217
2217
|
countDiscountedProducts;
|
|
2218
2218
|
countDiscountedClients;
|
|
2219
2219
|
constructor(e) {
|
|
2220
|
-
super(e), this.conditions = new
|
|
2220
|
+
super(e), this.conditions = new Ln(e?.conditions), this.products = j(e?.products ?? [], (e) => new R(e)), this.productCategories = j(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
2221
|
}
|
|
2222
2222
|
getState(e = /* @__PURE__ */ new Date()) {
|
|
2223
|
-
return
|
|
2223
|
+
return zn.resolve(this, e);
|
|
2224
2224
|
}
|
|
2225
2225
|
assignCounters(e) {
|
|
2226
2226
|
this.countDiscountedPrices = e.countDiscountedPrices, this.expectedCountDiscountedPrices = e.expectedCountDiscountedPrices, this.countDiscountedProducts = e.countDiscountedProducts, this.countDiscountedClients = e.countDiscountedClients;
|
|
@@ -2241,7 +2241,7 @@ var jn = class {
|
|
|
2241
2241
|
conditions: this.conditions.toSaveData()
|
|
2242
2242
|
};
|
|
2243
2243
|
}
|
|
2244
|
-
},
|
|
2244
|
+
}, Vn = class {
|
|
2245
2245
|
client;
|
|
2246
2246
|
additionalClientsCondition;
|
|
2247
2247
|
fixedClientsCondition;
|
|
@@ -2251,12 +2251,12 @@ var jn = class {
|
|
|
2251
2251
|
regionsCondition;
|
|
2252
2252
|
salesDirectionsCondition;
|
|
2253
2253
|
constructor(e) {
|
|
2254
|
-
this.client = new
|
|
2254
|
+
this.client = new In(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
2255
|
}
|
|
2256
2256
|
isEligible() {
|
|
2257
2257
|
return this.additionalClientsCondition || this.fixedClientsCondition || this.partnerGroupsCondition || this.managersCondition || this.citiesCondition || this.regionsCondition || this.salesDirectionsCondition;
|
|
2258
2258
|
}
|
|
2259
|
-
},
|
|
2259
|
+
}, Hn = class extends N {
|
|
2260
2260
|
id;
|
|
2261
2261
|
name;
|
|
2262
2262
|
states;
|
|
@@ -2271,7 +2271,7 @@ var jn = class {
|
|
|
2271
2271
|
}
|
|
2272
2272
|
return this;
|
|
2273
2273
|
}
|
|
2274
|
-
},
|
|
2274
|
+
}, Un = class t extends e {
|
|
2275
2275
|
static prepareSaveData(e, t) {
|
|
2276
2276
|
return {
|
|
2277
2277
|
...e,
|
|
@@ -2286,36 +2286,85 @@ var jn = class {
|
|
|
2286
2286
|
};
|
|
2287
2287
|
}
|
|
2288
2288
|
getDiscountsList(e, t, n, r) {
|
|
2289
|
-
return this.getTypedPaginated(
|
|
2289
|
+
return this.getTypedPaginated(ht, "/internal/price/discounts", e, t, n, {}, void 0, r);
|
|
2290
2290
|
}
|
|
2291
2291
|
getDiscount(e) {
|
|
2292
|
-
return this.get(`/internal/price/discounts/${e}`, {}, (e) => new
|
|
2292
|
+
return this.get(`/internal/price/discounts/${e}`, {}, (e) => new Bn(e.data));
|
|
2293
2293
|
}
|
|
2294
2294
|
createDiscount(e, n, r = {}) {
|
|
2295
|
-
return this.post("/internal/price/discounts", t.prepareSaveData(e, n), (e) => new
|
|
2295
|
+
return this.post("/internal/price/discounts", t.prepareSaveData(e, n), (e) => new Bn(e.data), r);
|
|
2296
2296
|
}
|
|
2297
2297
|
updateDiscount(e, n, r, i = {}) {
|
|
2298
|
-
return this.patch(`/internal/price/discounts/${e}`, t.prepareSaveData(n, r), (e) => new
|
|
2298
|
+
return this.patch(`/internal/price/discounts/${e}`, t.prepareSaveData(n, r), (e) => new Bn(e.data), i);
|
|
2299
2299
|
}
|
|
2300
2300
|
removeDiscount(e) {
|
|
2301
2301
|
return this.delete(`/internal/price/discounts/${e}`);
|
|
2302
2302
|
}
|
|
2303
2303
|
getEligibleClients(e) {
|
|
2304
|
-
return this.getTypedList(
|
|
2304
|
+
return this.getTypedList(Vn, `/internal/price/discounts/${e}/clients`);
|
|
2305
2305
|
}
|
|
2306
2306
|
checkClient(e, t) {
|
|
2307
|
-
return this.get(`/internal/price/discounts/${e}/clients/${t}/check`, {}, (e) => new
|
|
2307
|
+
return this.get(`/internal/price/discounts/${e}/clients/${t}/check`, {}, (e) => new Vn(e.data));
|
|
2308
|
+
}
|
|
2309
|
+
}, Wn = class extends _e {
|
|
2310
|
+
showAllCosts;
|
|
2311
|
+
constructor(e) {
|
|
2312
|
+
super(e), this.showAllCosts = e?.showAllCosts;
|
|
2313
|
+
}
|
|
2314
|
+
}, Gn = class extends N {
|
|
2315
|
+
name;
|
|
2316
|
+
phone;
|
|
2317
|
+
email;
|
|
2318
|
+
isActive;
|
|
2319
|
+
constructor(e) {
|
|
2320
|
+
super(), this.name = e?.name, this.phone = e?.phone, this.email = e?.email, this.isActive = e?.isActive;
|
|
2321
|
+
}
|
|
2322
|
+
resetFilterValue(e) {
|
|
2323
|
+
switch (e) {
|
|
2324
|
+
case "name":
|
|
2325
|
+
case "phone":
|
|
2326
|
+
case "email":
|
|
2327
|
+
case "isActive": this[e] = void 0;
|
|
2328
|
+
}
|
|
2329
|
+
return this;
|
|
2330
|
+
}
|
|
2331
|
+
}, Kn = class t extends e {
|
|
2332
|
+
static transformExternalSeoDataToRequest(e) {
|
|
2333
|
+
return {
|
|
2334
|
+
name: e.name,
|
|
2335
|
+
phone: e.phone,
|
|
2336
|
+
email: e.email,
|
|
2337
|
+
password: e.password,
|
|
2338
|
+
isActive: e.isActive,
|
|
2339
|
+
pricingRoleId: e.pricingRole?.id,
|
|
2340
|
+
showAllCosts: e.showAllCosts ?? !1
|
|
2341
|
+
};
|
|
2342
|
+
}
|
|
2343
|
+
getExternalSeoList(e, t, n, r) {
|
|
2344
|
+
return this.getTypedPaginated(_e, "/internal/external-seo", e, t, n, {}, void 0, r);
|
|
2345
|
+
}
|
|
2346
|
+
getExternalSeo(e, t = !1) {
|
|
2347
|
+
return this.get(`/internal/external-seo/${e}`, {}, (e) => new Wn(e.data), t);
|
|
2348
|
+
}
|
|
2349
|
+
createExternalSeo(e, n = {}) {
|
|
2350
|
+
return this.post("/internal/external-seo", t.transformExternalSeoDataToRequest(e), (e) => new Wn(e.data), n);
|
|
2351
|
+
}
|
|
2352
|
+
updateExternalSeo(e, n = {}) {
|
|
2353
|
+
return this.patch(`/internal/external-seo/${e.id}`, t.transformExternalSeoDataToRequest(e), (e) => new Wn(e.data), n);
|
|
2354
|
+
}
|
|
2355
|
+
deleteExternalSeo(e) {
|
|
2356
|
+
return this.delete(`/internal/external-seo/${e}`);
|
|
2308
2357
|
}
|
|
2309
|
-
},
|
|
2358
|
+
}, qn = class extends p {
|
|
2310
2359
|
constructor(e) {
|
|
2311
2360
|
super(e);
|
|
2312
2361
|
}
|
|
2313
|
-
},
|
|
2362
|
+
}, Jn = class extends d {
|
|
2314
2363
|
question;
|
|
2315
2364
|
answer;
|
|
2316
2365
|
groups;
|
|
2317
2366
|
constructor(e) {
|
|
2318
|
-
super(e, -1), this.question = e?.question ?? "", this.answer = e?.answer ?? "", this.groups = j(e?.groups ?? [], (e) => new
|
|
2367
|
+
super(e, -1), this.question = e?.question ?? "", this.answer = e?.answer ?? "", this.groups = j(e?.groups ?? [], (e) => new qn(e));
|
|
2319
2368
|
}
|
|
2320
2369
|
toSaveData() {
|
|
2321
2370
|
return {
|
|
@@ -2324,30 +2373,30 @@ var jn = class {
|
|
|
2324
2373
|
groups: j(this.groups, "id")
|
|
2325
2374
|
};
|
|
2326
2375
|
}
|
|
2327
|
-
},
|
|
2376
|
+
}, Yn = class extends e {
|
|
2328
2377
|
getFaqList(e, t) {
|
|
2329
|
-
return this.getTypedPaginated(
|
|
2378
|
+
return this.getTypedPaginated(Jn, "/internal/faq", void 0, void 0, t, k(e) ? {} : { group: e });
|
|
2330
2379
|
}
|
|
2331
2380
|
getFaq(e) {
|
|
2332
|
-
return this.get(`/internal/faq/${e}`, {}, (e) => new
|
|
2381
|
+
return this.get(`/internal/faq/${e}`, {}, (e) => new Jn(e.data));
|
|
2333
2382
|
}
|
|
2334
2383
|
createFaq(e, t = {}) {
|
|
2335
|
-
return this.post("/internal/faq", e, (e) => new
|
|
2384
|
+
return this.post("/internal/faq", e, (e) => new Jn(e.data), t);
|
|
2336
2385
|
}
|
|
2337
2386
|
updateFaq(e, t, n = {}) {
|
|
2338
|
-
return this.patch(`/internal/faq/${e}`, t, (e) => new
|
|
2387
|
+
return this.patch(`/internal/faq/${e}`, t, (e) => new Jn(e.data), n);
|
|
2339
2388
|
}
|
|
2340
2389
|
removeFaq(e) {
|
|
2341
2390
|
return this.delete(`/internal/faq/${e}`);
|
|
2342
2391
|
}
|
|
2343
2392
|
getGroupsList() {
|
|
2344
|
-
return this.getTypedList(
|
|
2393
|
+
return this.getTypedList(qn, "/internal/faq/groups");
|
|
2345
2394
|
}
|
|
2346
2395
|
createGroup(e, t = {}) {
|
|
2347
|
-
return this.post("/internal/faq/groups", e, (e) => new
|
|
2396
|
+
return this.post("/internal/faq/groups", e, (e) => new qn(e.data), t);
|
|
2348
2397
|
}
|
|
2349
2398
|
updateGroup(e, t, n = {}) {
|
|
2350
|
-
return this.patch(`/internal/faq/groups/${e}`, t, (e) => new
|
|
2399
|
+
return this.patch(`/internal/faq/groups/${e}`, t, (e) => new qn(e.data), n);
|
|
2351
2400
|
}
|
|
2352
2401
|
removeGroup(e) {
|
|
2353
2402
|
return this.delete(`/internal/faq/groups/${e}`);
|
|
@@ -2355,13 +2404,13 @@ var jn = class {
|
|
|
2355
2404
|
};
|
|
2356
2405
|
//#endregion
|
|
2357
2406
|
//#region src/helpers/format-percent-change.ts
|
|
2358
|
-
function
|
|
2359
|
-
let t =
|
|
2407
|
+
function Xn(e) {
|
|
2408
|
+
let t = rt(e * 100);
|
|
2360
2409
|
return `${t >= 0 ? "+" : ""}${t}%`;
|
|
2361
2410
|
}
|
|
2362
2411
|
//#endregion
|
|
2363
2412
|
//#region src/helpers/units-helper.ts
|
|
2364
|
-
var
|
|
2413
|
+
var Zn = class e {
|
|
2365
2414
|
static productIsMeasurable(e) {
|
|
2366
2415
|
return e.unit.isLinear || e.unit.isSquare;
|
|
2367
2416
|
}
|
|
@@ -2371,7 +2420,7 @@ var Kn = class e {
|
|
|
2371
2420
|
static getProductLengthMultiplicity(e) {
|
|
2372
2421
|
return e.properties?.lengthStep == null ? !e.properties?.ignoreMinCountCheck && e.properties?.minCount != null ? e.properties.minCount : .01 : e.properties.lengthStep;
|
|
2373
2422
|
}
|
|
2374
|
-
},
|
|
2423
|
+
}, Qn = class {
|
|
2375
2424
|
static generateUndefinedManagerInstance() {
|
|
2376
2425
|
return new f({
|
|
2377
2426
|
id: 0,
|
|
@@ -2383,7 +2432,7 @@ var Kn = class e {
|
|
|
2383
2432
|
static isUndefinedManagerInstance(e) {
|
|
2384
2433
|
return e.id === 0 && e.guid === "-undefined-";
|
|
2385
2434
|
}
|
|
2386
|
-
},
|
|
2435
|
+
}, $n = class extends N {
|
|
2387
2436
|
name;
|
|
2388
2437
|
phone;
|
|
2389
2438
|
email;
|
|
@@ -2406,7 +2455,7 @@ var Kn = class e {
|
|
|
2406
2455
|
}
|
|
2407
2456
|
return this;
|
|
2408
2457
|
}
|
|
2409
|
-
},
|
|
2458
|
+
}, er = class e extends ie {
|
|
2410
2459
|
static transformManagerDataToRequest(e) {
|
|
2411
2460
|
return {
|
|
2412
2461
|
name: e.name,
|
|
@@ -2437,20 +2486,20 @@ var Kn = class e {
|
|
|
2437
2486
|
return this.patch(`/internal/managers/${t.id}`, e.transformManagerDataToRequest(t), (e) => new f(e.data), n);
|
|
2438
2487
|
}
|
|
2439
2488
|
getManagerRegionsList(e, t, n) {
|
|
2440
|
-
return this.getTypedPaginated(
|
|
2489
|
+
return this.getTypedPaginated(ye, "/internal/managers/regions", e, t, n);
|
|
2441
2490
|
}
|
|
2442
|
-
},
|
|
2491
|
+
}, tr = /* @__PURE__ */ function(e) {
|
|
2443
2492
|
return e.Processing = "processing", e.Completed = "completed", e.Error = "error", e.NeedsActualization = "needs_actualization", e;
|
|
2444
|
-
}({}),
|
|
2493
|
+
}({}), nr = class {
|
|
2445
2494
|
status;
|
|
2446
2495
|
actualizedAt;
|
|
2447
2496
|
expiresAt;
|
|
2448
2497
|
error;
|
|
2449
2498
|
constructor(e) {
|
|
2450
|
-
this.status = e?.status ??
|
|
2499
|
+
this.status = e?.status ?? tr.Processing, this.actualizedAt = s.parse(e?.actualizedAt), this.expiresAt = s.parse(e?.expiresAt), this.error = e?.error;
|
|
2451
2500
|
}
|
|
2452
2501
|
get isProcessing() {
|
|
2453
|
-
return this.status ===
|
|
2502
|
+
return this.status === tr.Processing;
|
|
2454
2503
|
}
|
|
2455
2504
|
get isOutdated() {
|
|
2456
2505
|
return this.isOutdatedAt(/* @__PURE__ */ new Date());
|
|
@@ -2459,12 +2508,12 @@ var Kn = class e {
|
|
|
2459
2508
|
return this.isOrderAllowedAt(/* @__PURE__ */ new Date());
|
|
2460
2509
|
}
|
|
2461
2510
|
isOutdatedAt(e) {
|
|
2462
|
-
return this.status !==
|
|
2511
|
+
return this.status !== tr.Completed || k(this.actualizedAt) ? !0 : !k(this.expiresAt) && this.expiresAt.getTime() < e.getTime();
|
|
2463
2512
|
}
|
|
2464
2513
|
isOrderAllowedAt(e) {
|
|
2465
|
-
return this.status ===
|
|
2514
|
+
return this.status === tr.Completed && !this.isOutdatedAt(e);
|
|
2466
2515
|
}
|
|
2467
|
-
},
|
|
2516
|
+
}, rr = class extends M {
|
|
2468
2517
|
name;
|
|
2469
2518
|
client;
|
|
2470
2519
|
sum;
|
|
@@ -2472,9 +2521,9 @@ var Kn = class e {
|
|
|
2472
2521
|
actualization;
|
|
2473
2522
|
file;
|
|
2474
2523
|
constructor(e) {
|
|
2475
|
-
super(e), this.name = e?.name, this.client = new U(e?.client), this.sum = e?.sum, this.isProfstroy = e?.isProfstroy, this.actualization = e?.actualization && new
|
|
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 nr(e.actualization), this.file = e?.file;
|
|
2476
2525
|
}
|
|
2477
|
-
},
|
|
2526
|
+
}, ir = class extends Tt {
|
|
2478
2527
|
groupName;
|
|
2479
2528
|
supplierSku;
|
|
2480
2529
|
isIgnored;
|
|
@@ -2486,15 +2535,15 @@ var Kn = class e {
|
|
|
2486
2535
|
return k(this.product.id);
|
|
2487
2536
|
}
|
|
2488
2537
|
get isOrderable() {
|
|
2489
|
-
return !this.isProductStub && !this.isIgnored &&
|
|
2538
|
+
return !this.isProductStub && !this.isIgnored && Ze(this.lineError);
|
|
2490
2539
|
}
|
|
2491
|
-
}, Z = class extends
|
|
2540
|
+
}, Z = class extends rr {
|
|
2492
2541
|
sum;
|
|
2493
2542
|
products;
|
|
2494
2543
|
constructor(e) {
|
|
2495
|
-
super(e), this.sum = e.sum ?? 0, this.products = (e.products ?? []).map((t) => e.isProfstroy ? new
|
|
2544
|
+
super(e), this.sum = e.sum ?? 0, this.products = (e.products ?? []).map((t) => e.isProfstroy ? new ir(t) : new Tt(t));
|
|
2496
2545
|
}
|
|
2497
|
-
},
|
|
2546
|
+
}, ar = class extends N {
|
|
2498
2547
|
id;
|
|
2499
2548
|
clientSearchTerm;
|
|
2500
2549
|
name;
|
|
@@ -2509,7 +2558,7 @@ var Kn = class e {
|
|
|
2509
2558
|
let e = super.asClearRaw();
|
|
2510
2559
|
return !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, e;
|
|
2511
2560
|
}
|
|
2512
|
-
},
|
|
2561
|
+
}, or = class extends vn {
|
|
2513
2562
|
client;
|
|
2514
2563
|
payment;
|
|
2515
2564
|
delivery;
|
|
@@ -2532,12 +2581,12 @@ var Kn = class e {
|
|
|
2532
2581
|
type: e?.delivery?.type ?? -1,
|
|
2533
2582
|
date: A(e?.delivery?.date) ? w(e.delivery.date) : e?.delivery?.date ?? /* @__PURE__ */ new Date(),
|
|
2534
2583
|
address: e?.delivery?.address ? new Y(e.delivery.address) : void 0,
|
|
2535
|
-
warehouse: e?.delivery?.warehouse ? new
|
|
2584
|
+
warehouse: e?.delivery?.warehouse ? new be(e.delivery.warehouse) : void 0
|
|
2536
2585
|
}, this.attachedUser = e?.attachedUser ? new F(e?.attachedUser) : void 0, this.status = new se(e?.status), this.statusDetail = e?.statusDetail ? new de(e.statusDetail) : void 0, this.salesDirection = new g(e?.salesDirection);
|
|
2537
2586
|
let t = e?.attachedAt;
|
|
2538
2587
|
this.attachedAt = A(t) ? w(t) : e?.attachedAt, this.isOnOrder = e?.isOnOrder ?? !1, this.isProfstroy = e?.isProfstroy ?? !1, this.isNotInStock = e?.isNotInStock ?? !1, this.sum = e?.sum ?? 0, this.isLargeOrder = e?.isLargeOrder ?? !1;
|
|
2539
2588
|
}
|
|
2540
|
-
},
|
|
2589
|
+
}, sr = class extends wt {
|
|
2541
2590
|
product;
|
|
2542
2591
|
cost;
|
|
2543
2592
|
costOne;
|
|
@@ -2551,9 +2600,9 @@ var Kn = class e {
|
|
|
2551
2600
|
changedFields = [];
|
|
2552
2601
|
replacement;
|
|
2553
2602
|
constructor(e, t) {
|
|
2554
|
-
super(e), this.product = new z(e.product), this.currency = new o(e.currency), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing =
|
|
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 = Ye(e.sawing) ? e.sawing : e.sawing ? [e.sawing] : void 0, t && (this.replacement = t, this.quantity !== t.quantity && this.changedFields.push("quantity"), this.length !== t.length && this.changedFields.push("length"));
|
|
2555
2604
|
}
|
|
2556
|
-
}, Q = class extends
|
|
2605
|
+
}, Q = class extends or {
|
|
2557
2606
|
products;
|
|
2558
2607
|
invoices;
|
|
2559
2608
|
comment;
|
|
@@ -2569,11 +2618,11 @@ var Kn = class e {
|
|
|
2569
2618
|
erpOrderUrl;
|
|
2570
2619
|
numberDoc;
|
|
2571
2620
|
constructor(e) {
|
|
2572
|
-
super(e), this.products = (e.products ?? []).map((t) => new
|
|
2621
|
+
super(e), this.products = (e.products ?? []).map((t) => new sr(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 ? mn.createInstance(e.contragent) : void 0, this.barcode = e.barcode, this.orderSource = e.orderSource ? new de(e.orderSource) : void 0, this.isAllowProcessingWithoutPayment = e.isAllowProcessingWithoutPayment, this.nextStatuses = e.nextStatuses?.map((e) => new se(e)), this.actions = e.actions, this.operatorsComment = e.operatorsComment, this.operatorsForWarehouseComment = e.operatorsForWarehouseComment, this.erpOrderUrl = e.erpOrderUrl, this.numberDoc = e.numberDoc;
|
|
2573
2622
|
}
|
|
2574
|
-
},
|
|
2623
|
+
}, cr = class extends e {
|
|
2575
2624
|
getOffers(e, t, n, r) {
|
|
2576
|
-
return this.getTypedPaginated(
|
|
2625
|
+
return this.getTypedPaginated(rr, "/internal/orders/offers", e, t, n, {}, void 0, r);
|
|
2577
2626
|
}
|
|
2578
2627
|
createOfferFromCart(e, t, n) {
|
|
2579
2628
|
return this.post(`/internal/orders/offers/${e}`, {
|
|
@@ -2641,6 +2690,13 @@ var Kn = class e {
|
|
|
2641
2690
|
deleteOfferProduct(e, t) {
|
|
2642
2691
|
return this.delete(`/internal/orders/offers/${e}/products/${t}`, (e) => new Z(e.data));
|
|
2643
2692
|
}
|
|
2693
|
+
deleteOfferProducts(e, t) {
|
|
2694
|
+
return this.request({
|
|
2695
|
+
method: "DELETE",
|
|
2696
|
+
url: `/internal/orders/offers/${e}/products`,
|
|
2697
|
+
data: { items: t }
|
|
2698
|
+
}, (e) => new Z(e.data));
|
|
2699
|
+
}
|
|
2644
2700
|
getOfferHtml(e, t) {
|
|
2645
2701
|
return this.get(`/internal/orders/offers/${e}/view`, t ? { recipientText: t } : {}, (e) => new Blob([e.data], { type: "text/html" }));
|
|
2646
2702
|
}
|
|
@@ -2650,16 +2706,79 @@ var Kn = class e {
|
|
|
2650
2706
|
sendOffer(e, t) {
|
|
2651
2707
|
return this.post(`/internal/orders/offers/${e}/send`, t);
|
|
2652
2708
|
}
|
|
2653
|
-
},
|
|
2709
|
+
}, lr = class {
|
|
2654
2710
|
static isProfstroy(e) {
|
|
2655
2711
|
return !!e?.isProfstroy;
|
|
2656
2712
|
}
|
|
2657
2713
|
static isProfstroyOffer(e) {
|
|
2658
2714
|
return !k(e) && e.isProfstroy === !0 && !k(e.actualization);
|
|
2659
2715
|
}
|
|
2660
|
-
},
|
|
2716
|
+
}, ur = class extends _e {
|
|
2717
|
+
isBillingSupervisor;
|
|
2718
|
+
constructor(e) {
|
|
2719
|
+
super(e), this.isBillingSupervisor = e?.isBillingSupervisor ?? !1;
|
|
2720
|
+
}
|
|
2721
|
+
}, dr = class extends ur {
|
|
2722
|
+
showAllCosts;
|
|
2723
|
+
stores;
|
|
2724
|
+
constructor(e) {
|
|
2725
|
+
super(e), this.showAllCosts = e?.showAllCosts, this.stores = e?.stores?.map((e) => new me(e));
|
|
2726
|
+
}
|
|
2727
|
+
}, fr = class extends N {
|
|
2728
|
+
name;
|
|
2729
|
+
phone;
|
|
2730
|
+
email;
|
|
2731
|
+
salesDirections;
|
|
2732
|
+
isActive;
|
|
2733
|
+
isBillingSupervisor;
|
|
2734
|
+
canDoReclamations;
|
|
2735
|
+
constructor(e) {
|
|
2736
|
+
super(), this.name = e?.name, this.phone = e?.phone, this.email = e?.email, this.salesDirections = e?.salesDirections?.map((e) => new g(e)), this.isActive = e?.isActive, this.isBillingSupervisor = e?.isBillingSupervisor, this.canDoReclamations = e?.canDoReclamations;
|
|
2737
|
+
}
|
|
2738
|
+
resetFilterValue(e) {
|
|
2739
|
+
switch (e) {
|
|
2740
|
+
case "name":
|
|
2741
|
+
case "phone":
|
|
2742
|
+
case "email":
|
|
2743
|
+
case "salesDirections":
|
|
2744
|
+
case "isActive":
|
|
2745
|
+
case "isBillingSupervisor":
|
|
2746
|
+
case "canDoReclamations": this[e] = void 0;
|
|
2747
|
+
}
|
|
2748
|
+
return this;
|
|
2749
|
+
}
|
|
2750
|
+
}, pr = class t extends e {
|
|
2751
|
+
static transformOperatorDataToRequest(e) {
|
|
2752
|
+
return {
|
|
2753
|
+
name: e.name,
|
|
2754
|
+
phone: e.phone,
|
|
2755
|
+
email: e.email,
|
|
2756
|
+
password: e.password,
|
|
2757
|
+
isActive: e.isActive,
|
|
2758
|
+
isBillingSupervisor: e.isBillingSupervisor,
|
|
2759
|
+
canDoReclamations: e.canDoReclamations,
|
|
2760
|
+
salesDirectionId: e.salesDirection?.id,
|
|
2761
|
+
pricingRoleId: e.pricingRole?.id,
|
|
2762
|
+
showAllCosts: e.showAllCosts ?? !1,
|
|
2763
|
+
storeIds: j(e.stores, "id"),
|
|
2764
|
+
photo: e.photoFile
|
|
2765
|
+
};
|
|
2766
|
+
}
|
|
2767
|
+
getOperatorsList(e, t, n, r) {
|
|
2768
|
+
return this.getTypedPaginated(ur, "/internal/operators", e, t, n, {}, void 0, r);
|
|
2769
|
+
}
|
|
2770
|
+
getOperator(e, t = !1) {
|
|
2771
|
+
return this.get(`/internal/operators/${e}`, {}, (e) => new dr(e.data), t);
|
|
2772
|
+
}
|
|
2773
|
+
createOperator(e, n = {}) {
|
|
2774
|
+
return this.post("/internal/operators", t.transformOperatorDataToRequest(e), (e) => new dr(e.data), n);
|
|
2775
|
+
}
|
|
2776
|
+
updateOperator(e, n = {}) {
|
|
2777
|
+
return this.patch(`/internal/operators/${e.id}`, t.transformOperatorDataToRequest(e), (e) => new dr(e.data), n);
|
|
2778
|
+
}
|
|
2779
|
+
}, mr = /* @__PURE__ */ function(e) {
|
|
2661
2780
|
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;
|
|
2662
|
-
}({}),
|
|
2781
|
+
}({}), hr = class {
|
|
2663
2782
|
paymentType;
|
|
2664
2783
|
deliveryType;
|
|
2665
2784
|
contragentId;
|
|
@@ -2677,7 +2796,7 @@ var Kn = class e {
|
|
|
2677
2796
|
constructor(e) {
|
|
2678
2797
|
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;
|
|
2679
2798
|
}
|
|
2680
|
-
},
|
|
2799
|
+
}, gr = class extends N {
|
|
2681
2800
|
attachedUsers;
|
|
2682
2801
|
clientSearchTerm;
|
|
2683
2802
|
client;
|
|
@@ -2702,7 +2821,7 @@ var Kn = class e {
|
|
|
2702
2821
|
isToProcess;
|
|
2703
2822
|
onlyMyRegions;
|
|
2704
2823
|
constructor(e) {
|
|
2705
|
-
super(), this.attachedUsers = e?.attachedUsers?.map((e) => "isActive" in e ? new f(e) : new ae(e)), this.clientSearchTerm = e?.clientSearchTerm, this.client = e?.client ? new U(e.client) : void 0, this.contragent = e?.contragent, this.createdAt = new P(e?.createdAt), this.creator = e?.creator ? new F(e.creator) : void 0, this.deliveryDate = new P(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 P(e?.attachedAt), this.salesDirections = e?.salesDirections?.map((e) => new g(e)), this.status = e?.status, this.statusDetail = e?.statusDetail, this.deliveryType = e?.deliveryType ? new c(e.deliveryType) : void 0, this.paymentType = e?.paymentType ? new ce(e.paymentType) : void 0, this.warehouses = e?.warehouses?.map((e) => new
|
|
2824
|
+
super(), this.attachedUsers = e?.attachedUsers?.map((e) => "isActive" in e ? new f(e) : new ae(e)), this.clientSearchTerm = e?.clientSearchTerm, this.client = e?.client ? new U(e.client) : void 0, this.contragent = e?.contragent, this.createdAt = new P(e?.createdAt), this.creator = e?.creator ? new F(e.creator) : void 0, this.deliveryDate = new P(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 P(e?.attachedAt), this.salesDirections = e?.salesDirections?.map((e) => new g(e)), this.status = e?.status, this.statusDetail = e?.statusDetail, this.deliveryType = e?.deliveryType ? new c(e.deliveryType) : void 0, this.paymentType = e?.paymentType ? new ce(e.paymentType) : void 0, this.warehouses = e?.warehouses?.map((e) => new be(e)), this.isToProcess = e?.isToProcess;
|
|
2706
2825
|
}
|
|
2707
2826
|
resetFilterValue(e) {
|
|
2708
2827
|
switch (e) {
|
|
@@ -2743,7 +2862,7 @@ var Kn = class e {
|
|
|
2743
2862
|
let e = super.asClearRaw();
|
|
2744
2863
|
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;
|
|
2745
2864
|
}
|
|
2746
|
-
},
|
|
2865
|
+
}, _r = class {
|
|
2747
2866
|
user;
|
|
2748
2867
|
status;
|
|
2749
2868
|
statusDetail;
|
|
@@ -2753,12 +2872,12 @@ var Kn = class e {
|
|
|
2753
2872
|
let t = e?.createdAt;
|
|
2754
2873
|
this.createdAt = A(t) ? w(t) : e?.createdAt ?? /* @__PURE__ */ new Date();
|
|
2755
2874
|
}
|
|
2756
|
-
},
|
|
2875
|
+
}, vr = class extends e {
|
|
2757
2876
|
getOrders(e, t, n, r) {
|
|
2758
|
-
return this.getTypedPaginated(
|
|
2877
|
+
return this.getTypedPaginated(or, "/internal/orders", e, t, n, {}, void 0, r);
|
|
2759
2878
|
}
|
|
2760
2879
|
getOrdersCount(e, t) {
|
|
2761
|
-
return this.get("/internal/orders/count", e ? { filters: JSON.stringify((e instanceof
|
|
2880
|
+
return this.get("/internal/orders/count", e ? { filters: JSON.stringify((e instanceof ee ? e : new ee(e)).toPrimitive()) } : {}, void 0, void 0, t).then((e) => e.count);
|
|
2762
2881
|
}
|
|
2763
2882
|
getClientOrderStatistics(e, t) {
|
|
2764
2883
|
return this.get(`/internal/clients/${e}/orders/statistics`, t ? { period: t } : {});
|
|
@@ -2820,7 +2939,7 @@ var Kn = class e {
|
|
|
2820
2939
|
return this.patch(`/internal/orders/${e}/status`, { statusDetail: t }, (e) => new Q(e.data));
|
|
2821
2940
|
}
|
|
2822
2941
|
getOrderStatusHistory(e) {
|
|
2823
|
-
return this.getTypedList(
|
|
2942
|
+
return this.getTypedList(_r, `/internal/orders/${e}/history`);
|
|
2824
2943
|
}
|
|
2825
2944
|
getOrderPrintHtml(e, t) {
|
|
2826
2945
|
return this.get(`/internal/orders/${e}/print/view`, { ...t }, (e) => new Blob([e.data], { type: "text/html" }));
|
|
@@ -2867,45 +2986,45 @@ var Kn = class e {
|
|
|
2867
2986
|
warehouse_id: n
|
|
2868
2987
|
}, (e) => e.data, void 0, r);
|
|
2869
2988
|
}
|
|
2870
|
-
},
|
|
2989
|
+
}, yr = Symbol("currentOrder"), br = class {
|
|
2871
2990
|
client;
|
|
2872
2991
|
product;
|
|
2873
2992
|
cost;
|
|
2874
2993
|
costCoefficient;
|
|
2875
2994
|
source;
|
|
2876
2995
|
constructor(e) {
|
|
2877
|
-
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 ??
|
|
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 ?? Ct.Product;
|
|
2878
2997
|
}
|
|
2879
|
-
},
|
|
2998
|
+
}, xr = (e) => e ? nt({
|
|
2880
2999
|
cities: e.cities?.map((e) => e.id),
|
|
2881
3000
|
clients: e.clients?.map((e) => e.id),
|
|
2882
3001
|
managers: e.managers?.map((e) => e.id),
|
|
2883
3002
|
partnerGroups: e.partnerGroups?.map((e) => e.id),
|
|
2884
3003
|
salesDirections: e.salesDirections?.map((e) => e.id),
|
|
2885
3004
|
hideNotActive: e.hideNotActive
|
|
2886
|
-
}, (e) => k(e) || (
|
|
3005
|
+
}, (e) => k(e) || (Ye(e) || $e(e)) && Ze(e)) : {}, Sr = (e) => {
|
|
2887
3006
|
let t = {};
|
|
2888
3007
|
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;
|
|
2889
|
-
},
|
|
3008
|
+
}, Cr = class extends u {
|
|
2890
3009
|
analyzeProductPrices(e, t, n) {
|
|
2891
3010
|
return this.get(`/internal/price/products/${e}/analyze`, {
|
|
2892
|
-
...
|
|
2893
|
-
filters:
|
|
2894
|
-
}, (e) => _.instanceListInitializer(
|
|
3011
|
+
...Sr(t),
|
|
3012
|
+
filters: xr(n)
|
|
3013
|
+
}, (e) => _.instanceListInitializer(br, e.data));
|
|
2895
3014
|
}
|
|
2896
3015
|
analyzeCategoryPrices(e, t, n) {
|
|
2897
3016
|
return this.get(`/internal/price/categories/${e}/analyze`, {
|
|
2898
|
-
...
|
|
2899
|
-
filters:
|
|
2900
|
-
}, (e) => _.instanceListInitializer(
|
|
3017
|
+
...Sr(t),
|
|
3018
|
+
filters: xr(n)
|
|
3019
|
+
}, (e) => _.instanceListInitializer(br, e.data));
|
|
2901
3020
|
}
|
|
2902
3021
|
analyzeCategoryPricesBySquare(e, t, n) {
|
|
2903
3022
|
return this.get(`/internal/price/categories/${e}/analyze/square`, {
|
|
2904
3023
|
...t,
|
|
2905
|
-
filters:
|
|
2906
|
-
}, (e) => _.instanceListInitializer(
|
|
3024
|
+
filters: xr(n)
|
|
3025
|
+
}, (e) => _.instanceListInitializer(br, e.data));
|
|
2907
3026
|
}
|
|
2908
|
-
},
|
|
3027
|
+
}, wr = class {
|
|
2909
3028
|
cost;
|
|
2910
3029
|
isLowCost;
|
|
2911
3030
|
isRetail;
|
|
@@ -2919,20 +3038,20 @@ var Kn = class e {
|
|
|
2919
3038
|
constructor(e) {
|
|
2920
3039
|
this.cost = e.cost ?? 0, this.isLowCost = e.isLowCost ?? !1, this.isRetail = e.isRetail ?? !1, this.costDate = A(e.costDate) ? w(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;
|
|
2921
3040
|
}
|
|
2922
|
-
},
|
|
3041
|
+
}, Tr = class extends L {
|
|
2923
3042
|
history;
|
|
2924
3043
|
constructor(e) {
|
|
2925
|
-
super(e), this.history = j(e.history, (e) => new
|
|
3044
|
+
super(e), this.history = j(e.history, (e) => new wr(e));
|
|
2926
3045
|
}
|
|
2927
|
-
},
|
|
3046
|
+
}, Er = class extends u {
|
|
2928
3047
|
getProductPriceHistory(e) {
|
|
2929
|
-
let t = v().config.dateFormats.api, n =
|
|
2930
|
-
from:
|
|
2931
|
-
to:
|
|
2932
|
-
} }), (e) => k(e) || (
|
|
2933
|
-
return delete n.product, this.get(`/internal/price/products/${r}/history`, n).then((e) => [new
|
|
3048
|
+
let t = v().config.dateFormats.api, n = nt(tt(e, { costDate: {
|
|
3049
|
+
from: Xe(e.costDate?.from) ? C(e.costDate.from, t) : e.costDate?.from,
|
|
3050
|
+
to: Xe(e.costDate?.to) ? C(e.costDate.to, t) : e.costDate?.to
|
|
3051
|
+
} }), (e) => k(e) || (Ye(e) || $e(e)) && Ze(e)), r = e.product?.[0] ?? 0;
|
|
3052
|
+
return delete n.product, this.get(`/internal/price/products/${r}/history`, n).then((e) => [new Tr(tt(e[0], { history: e }))]);
|
|
2934
3053
|
}
|
|
2935
|
-
},
|
|
3054
|
+
}, Dr = class {
|
|
2936
3055
|
createdAt;
|
|
2937
3056
|
creator;
|
|
2938
3057
|
files;
|
|
@@ -2946,14 +3065,14 @@ var Kn = class e {
|
|
|
2946
3065
|
}
|
|
2947
3066
|
}, $ = /* @__PURE__ */ function(e) {
|
|
2948
3067
|
return e[e.Initiated = 1] = "Initiated", e[e.InfoRequired = 2] = "InfoRequired", e[e.Pending = 3] = "Pending", e[e.Completed = 4] = "Completed", e;
|
|
2949
|
-
}({}),
|
|
3068
|
+
}({}), Or = class extends M {
|
|
2950
3069
|
status;
|
|
2951
3070
|
closedAt;
|
|
2952
3071
|
isRead;
|
|
2953
3072
|
isDeleted;
|
|
2954
3073
|
client;
|
|
2955
3074
|
constructor(e) {
|
|
2956
|
-
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
|
|
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 hn(e?.client);
|
|
2957
3076
|
}
|
|
2958
3077
|
isClosed() {
|
|
2959
3078
|
return this.status === $.Completed;
|
|
@@ -2965,17 +3084,17 @@ var Kn = class e {
|
|
|
2965
3084
|
return !this.isClosed();
|
|
2966
3085
|
}
|
|
2967
3086
|
getConsiderationDays(e = /* @__PURE__ */ new Date()) {
|
|
2968
|
-
return Math.max(
|
|
3087
|
+
return Math.max(Te(this.closedAt ?? e, this.createdAt), 0);
|
|
2969
3088
|
}
|
|
2970
|
-
},
|
|
3089
|
+
}, kr = class extends Or {
|
|
2971
3090
|
items;
|
|
2972
3091
|
constructor(e) {
|
|
2973
|
-
super(e), this.items = j(e?.items ?? [], (e) => new
|
|
3092
|
+
super(e), this.items = j(e?.items ?? [], (e) => new Dr(e));
|
|
2974
3093
|
}
|
|
2975
3094
|
isClientMessage(e) {
|
|
2976
3095
|
return e.creator?.id === this.client.id;
|
|
2977
3096
|
}
|
|
2978
|
-
},
|
|
3097
|
+
}, Ar = class extends N {
|
|
2979
3098
|
id;
|
|
2980
3099
|
statuses;
|
|
2981
3100
|
createdAt;
|
|
@@ -3011,7 +3130,7 @@ var Kn = class e {
|
|
|
3011
3130
|
}
|
|
3012
3131
|
return this;
|
|
3013
3132
|
}
|
|
3014
|
-
},
|
|
3133
|
+
}, jr = class e {
|
|
3015
3134
|
static apiCodes = {
|
|
3016
3135
|
[$.Initiated]: "initiated",
|
|
3017
3136
|
[$.InfoRequired]: "info_required",
|
|
@@ -3024,21 +3143,21 @@ var Kn = class e {
|
|
|
3024
3143
|
static toApiCodes(t) {
|
|
3025
3144
|
return j(t, (t) => e.toApiCode(t));
|
|
3026
3145
|
}
|
|
3027
|
-
},
|
|
3146
|
+
}, Mr = class extends e {
|
|
3028
3147
|
getReclamationsList(e, t, n, r, i = !1) {
|
|
3029
|
-
return this.getTypedPaginated(
|
|
3148
|
+
return this.getTypedPaginated(Or, "/internal/reclamations", e, t, n, {}, i, r);
|
|
3030
3149
|
}
|
|
3031
3150
|
getReclamation(e, t, n = !1) {
|
|
3032
|
-
return this.get(`/internal/reclamations/${e}`, {}, (e) => new
|
|
3151
|
+
return this.get(`/internal/reclamations/${e}`, {}, (e) => new kr(e.data), n, t);
|
|
3033
3152
|
}
|
|
3034
3153
|
createMessage(e, t, n = {}) {
|
|
3035
|
-
return this.post(`/internal/reclamations/${e}/messages`, t, (e) => new
|
|
3154
|
+
return this.post(`/internal/reclamations/${e}/messages`, t, (e) => new kr(e.data), n);
|
|
3036
3155
|
}
|
|
3037
3156
|
deleteReclamation(e) {
|
|
3038
3157
|
return this.delete(`/internal/reclamations/${e}`);
|
|
3039
3158
|
}
|
|
3040
3159
|
restoreReclamation(e) {
|
|
3041
|
-
return this.post(`/internal/reclamations/${e}/restore`, {}, (e) => new
|
|
3160
|
+
return this.post(`/internal/reclamations/${e}/restore`, {}, (e) => new kr(e.data));
|
|
3042
3161
|
}
|
|
3043
3162
|
downloadReclamation(e, t = !1) {
|
|
3044
3163
|
return this.getBlob(`/internal/reclamations/${e}/download`, {}, (e) => new Blob([e.request.response], { type: "application/pdf" }), t);
|
|
@@ -3046,18 +3165,18 @@ var Kn = class e {
|
|
|
3046
3165
|
getUpdates(e, t = !1) {
|
|
3047
3166
|
return this.get("/internal/reclamations/updates", {}, void 0, t, e);
|
|
3048
3167
|
}
|
|
3049
|
-
},
|
|
3168
|
+
}, Nr = class {
|
|
3050
3169
|
products = [];
|
|
3051
3170
|
productCategories = [];
|
|
3052
3171
|
constructor(e) {
|
|
3053
3172
|
e?.products && (this.products = e.products.map((e) => new L(e))), e?.productCategories && (this.productCategories = e.productCategories.map((e) => new L(e)));
|
|
3054
3173
|
}
|
|
3055
|
-
},
|
|
3174
|
+
}, Pr = class extends u {
|
|
3056
3175
|
getProductCategoryRecommendations(e) {
|
|
3057
|
-
return this.get(`/internal/catalog/recommendations/categories/${e.id}`, {}, (e) => new
|
|
3176
|
+
return this.get(`/internal/catalog/recommendations/categories/${e.id}`, {}, (e) => new Nr(e.data));
|
|
3058
3177
|
}
|
|
3059
3178
|
getProductRecommendations(e) {
|
|
3060
|
-
return this.get(`/internal/catalog/recommendations/products/${e.id}`, {}, (e) => new
|
|
3179
|
+
return this.get(`/internal/catalog/recommendations/products/${e.id}`, {}, (e) => new Nr(e.data));
|
|
3061
3180
|
}
|
|
3062
3181
|
saveProductCategoryRecommendations(e, t) {
|
|
3063
3182
|
return this.post(`/internal/catalog/recommendations/categories/${e.id}`, {
|
|
@@ -3071,7 +3190,7 @@ var Kn = class e {
|
|
|
3071
3190
|
products: t.products.map((e) => e.id)
|
|
3072
3191
|
});
|
|
3073
3192
|
}
|
|
3074
|
-
},
|
|
3193
|
+
}, Fr = class {
|
|
3075
3194
|
static generateUndefinedInstance(e, t = "- Не определён -") {
|
|
3076
3195
|
return new e({
|
|
3077
3196
|
id: 0,
|
|
@@ -3082,13 +3201,13 @@ var Kn = class e {
|
|
|
3082
3201
|
static isUndefinedInstance(e) {
|
|
3083
3202
|
return e.id === 0 && e.slug === "-undefined-";
|
|
3084
3203
|
}
|
|
3085
|
-
},
|
|
3204
|
+
}, Ir = class {
|
|
3086
3205
|
name;
|
|
3087
3206
|
content;
|
|
3088
3207
|
constructor(e) {
|
|
3089
3208
|
this.name = e.name, this.content = e.content;
|
|
3090
3209
|
}
|
|
3091
|
-
},
|
|
3210
|
+
}, Lr = class {
|
|
3092
3211
|
resourceType;
|
|
3093
3212
|
resourceId;
|
|
3094
3213
|
h1;
|
|
@@ -3098,42 +3217,42 @@ var Kn = class e {
|
|
|
3098
3217
|
meta;
|
|
3099
3218
|
tags;
|
|
3100
3219
|
constructor(e) {
|
|
3101
|
-
this.resourceType = new pe(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
|
|
3220
|
+
this.resourceType = new pe(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 Ir(e)) ?? [], this.tags = e?.tags;
|
|
3102
3221
|
}
|
|
3103
|
-
},
|
|
3222
|
+
}, Rr = class extends u {
|
|
3104
3223
|
getResourceSeoData(e, t) {
|
|
3105
|
-
return this.get(`/internal/seo/${e.slug}/${t}`, {}, (e) => new
|
|
3224
|
+
return this.get(`/internal/seo/${e.slug}/${t}`, {}, (e) => new Lr(e.data));
|
|
3106
3225
|
}
|
|
3107
3226
|
saveResourceSeoData(e, t = {}) {
|
|
3108
|
-
return this.post(`/internal/seo/${e.resourceType.slug}/${e.resourceId}`, e, (e) => new
|
|
3227
|
+
return this.post(`/internal/seo/${e.resourceType.slug}/${e.resourceId}`, e, (e) => new Lr(e.data), t);
|
|
3109
3228
|
}
|
|
3110
3229
|
deleteResourceSeoData(e, t) {
|
|
3111
3230
|
return this.delete(`/internal/seo/${e.slug}/${t}`);
|
|
3112
3231
|
}
|
|
3113
|
-
},
|
|
3232
|
+
}, zr = class extends d {
|
|
3114
3233
|
text;
|
|
3115
3234
|
searchCount;
|
|
3116
3235
|
lastSearchedAt;
|
|
3117
3236
|
constructor(e) {
|
|
3118
3237
|
super(e), this.text = e?.text ?? "", this.searchCount = e?.searchCount ?? 0, this.lastSearchedAt = s.parse(e?.lastSearchedAt);
|
|
3119
3238
|
}
|
|
3120
|
-
},
|
|
3239
|
+
}, Br = class extends u {
|
|
3121
3240
|
getSearchProductsStatistics(e, t) {
|
|
3122
|
-
return this.getTypedList(
|
|
3241
|
+
return this.getTypedList(zr, "/internal/statistics/search/products", { date: s.periodToApiFormat(e) }, !1, t);
|
|
3123
3242
|
}
|
|
3124
3243
|
removeSearchProductStatistic(e) {
|
|
3125
3244
|
return this.delete(`/internal/statistics/search/products/${e}`);
|
|
3126
3245
|
}
|
|
3127
|
-
},
|
|
3246
|
+
}, Vr = /* @__PURE__ */ function(e) {
|
|
3128
3247
|
return e[e.Undetermined = 0] = "Undetermined", e[e.Complete = 1] = "Complete", e[e.Incomplete = 2] = "Incomplete", e;
|
|
3129
|
-
}({}),
|
|
3248
|
+
}({}), Hr = class e {
|
|
3130
3249
|
static isBlocked(e, t) {
|
|
3131
|
-
return t && e ===
|
|
3250
|
+
return t && e === Vr.Incomplete;
|
|
3132
3251
|
}
|
|
3133
3252
|
static getValidationResult(t, n) {
|
|
3134
|
-
return e.isBlocked(t, n) ? new
|
|
3253
|
+
return e.isBlocked(t, n) ? new l("Проверьте адрес и выберите более точный вариант из подсказок", "error") : t === Vr.Incomplete || t === Vr.Undetermined ? new l("Проверьте правильность адреса", "warning") : void 0;
|
|
3135
3254
|
}
|
|
3136
|
-
},
|
|
3255
|
+
}, Ur = class extends u {
|
|
3137
3256
|
searchAddresses(e) {
|
|
3138
3257
|
return this.execSuggestionQuery("/public/suggestions/address", e);
|
|
3139
3258
|
}
|
|
@@ -3151,26 +3270,26 @@ var Kn = class e {
|
|
|
3151
3270
|
}), t;
|
|
3152
3271
|
});
|
|
3153
3272
|
}
|
|
3154
|
-
},
|
|
3273
|
+
}, Wr = class extends u {
|
|
3155
3274
|
constructor() {
|
|
3156
3275
|
super(), this.baseUrl = `${v().config.http.portalApiUrl}/api`, this.interceptorIds.request.authRequestInterceptor && this.httpClient.interceptors.request.eject(this.interceptorIds.request.authRequestInterceptor);
|
|
3157
3276
|
}
|
|
3158
3277
|
getAccessToken() {
|
|
3159
3278
|
return this.get("internal/users/current-tokens").then((e) => e.accessToken);
|
|
3160
3279
|
}
|
|
3161
|
-
},
|
|
3280
|
+
}, Gr = class {
|
|
3162
3281
|
user;
|
|
3163
3282
|
salesDirection;
|
|
3164
3283
|
constructor(e) {
|
|
3165
3284
|
this.user = new F(e?.user), this.salesDirection = new g(e?.salesDirection);
|
|
3166
3285
|
}
|
|
3167
|
-
},
|
|
3286
|
+
}, Kr = class extends ye {
|
|
3168
3287
|
cities;
|
|
3169
3288
|
users;
|
|
3170
3289
|
constructor(e) {
|
|
3171
|
-
super(e), this.cities = e?.cities?.map((e) => new n(e)) ?? [], this.users = e?.users?.map((e) => new
|
|
3290
|
+
super(e), this.cities = e?.cities?.map((e) => new n(e)) ?? [], this.users = e?.users?.map((e) => new Gr(e)) ?? [];
|
|
3172
3291
|
}
|
|
3173
|
-
},
|
|
3292
|
+
}, qr = class extends N {
|
|
3174
3293
|
id;
|
|
3175
3294
|
name;
|
|
3176
3295
|
abbr;
|
|
@@ -3185,27 +3304,27 @@ var Kn = class e {
|
|
|
3185
3304
|
}
|
|
3186
3305
|
return this;
|
|
3187
3306
|
}
|
|
3188
|
-
},
|
|
3307
|
+
}, Jr = class extends e {
|
|
3189
3308
|
getRegionsList(e, t, n) {
|
|
3190
|
-
return this.getTypedPaginated(
|
|
3309
|
+
return this.getTypedPaginated(ye, "/internal/users/regions", e, t, n);
|
|
3191
3310
|
}
|
|
3192
3311
|
getRegion(e) {
|
|
3193
|
-
return this.get(`/internal/users/regions/${e}`, {}, (e) => new
|
|
3312
|
+
return this.get(`/internal/users/regions/${e}`, {}, (e) => new Kr(e.data));
|
|
3194
3313
|
}
|
|
3195
3314
|
createRegion(e, t = {}) {
|
|
3196
|
-
return this.post("/internal/users/regions", e, (e) => new
|
|
3315
|
+
return this.post("/internal/users/regions", e, (e) => new Kr(e.data), t);
|
|
3197
3316
|
}
|
|
3198
3317
|
updateRegion(e, t, n = {}) {
|
|
3199
|
-
return this.patch(`/internal/users/regions/${e}`, t, (e) => new
|
|
3318
|
+
return this.patch(`/internal/users/regions/${e}`, t, (e) => new Kr(e.data), n);
|
|
3200
3319
|
}
|
|
3201
3320
|
removeRegion(e) {
|
|
3202
3321
|
return this.delete(`/internal/users/regions/${e}`);
|
|
3203
3322
|
}
|
|
3204
3323
|
getRegionEmployees(e) {
|
|
3205
|
-
return this.getTypedList(
|
|
3324
|
+
return this.getTypedList(Gr, `/internal/users/regions/${e}/users`);
|
|
3206
3325
|
}
|
|
3207
3326
|
attachRegionEmployee(e, t, n) {
|
|
3208
|
-
return this.post(`/internal/users/regions/${e}/users/${t}`, { salesDirectionId: n }, (e) => new
|
|
3327
|
+
return this.post(`/internal/users/regions/${e}/users/${t}`, { salesDirectionId: n }, (e) => new Gr(e.data));
|
|
3209
3328
|
}
|
|
3210
3329
|
detachRegionEmployee(e, t, n) {
|
|
3211
3330
|
return this.request({
|
|
@@ -3216,4 +3335,4 @@ var Kn = class e {
|
|
|
3216
3335
|
}
|
|
3217
3336
|
};
|
|
3218
3337
|
//#endregion
|
|
3219
|
-
export {
|
|
3338
|
+
export { Vr as AddressQualityEnum, Hr as AddressQualityHelper, sn as BankAccount, dt as BlogPost, ct as BlogPostMediaFile, st as BlogPostMediaTypeEnum, lt as BlogPostPublicationStatusEnum, ut as BlogPostShortInfo, ft as BlogPostsListFilters, pt as BlogProvider, Dt as CalculationTypeEnum, X as CalendarHelper, V as Cart, Et as CartProvider, Kt as CatalogProvider, yt as CatalogableItem, H as Category, Gt as CategoryFilter, Ut as CategoryFilterSetting, Wt as CategoryFilterValue, Vt as CategoryPricingRule, gn as Client, yn as ClientAdditionalData, hn as ClientBaseInfo, At as ClientCategory, Sn as ClientDataProvider, Rt as ClientPriceCatalogableItem, Bt as ClientPriceCategory, zt as ClientPriceProduct, qt as ClientPriceProvider, Jt as ClientPriceTemplateProvider, z as ClientProduct, Zt as ClientProductCategoryDataProvider, Qt as ClientProductDataProvider, U as ClientShortInfo, on as ClientsAdditionalDataRequestTypeEnum, _n as ClientsListFilters, L as CodedIdentity, En as ConfiguratorProvider, Tn as ConfiguratorsEnum, cn as Contact, J as ContactPerson, xn as ContactPersonRelated, bn as ContactRelation, ln as ContragentBase, mn as ContragentFactory, dn as ContragentIc, un as ContragentPerson, pn as ContragentUlNr, fn as ContragentUlR, Ct as CostSourceEnum, M as CreatableIdentity, Pt as Curator, Ur as DataSuggestionProvider, Nn as DateTimeProvider, Ft as DeletableIdentity, mt as DeletableNamedIdentity, Y as DeliveryAddress, Bn as Discount, In as DiscountClient, Vn as DiscountClientEligibility, Ln as DiscountConditions, Un as DiscountProvider, ht as DiscountShortInfo, Rn as DiscountStateEnum, zn as DiscountStateHelper, Hn as DiscountsListFilters, Wn as ExternalSeoFullInfo, Gn as ExternalSeoListFilters, Kn as ExternalSeoProvider, Jn as Faq, qn as FaqGroup, Yn as FaqProvider, Ht as FilterSettings, bt as HiddenCatalogableItem, xt as Image, Qn as ManagerDataFactory, er as ManagerProvider, $n as ManagersListFilters, Ir as MetaTagItem, Z as Offer, nr as OfferActualization, tr as OfferActualizationStatus, lr as OfferHelper, rr as OfferShortInfo, cr as OffersDataProvider, ar as OffersListFilters, dr as OperatorFullInfo, pr as OperatorProvider, ur as OperatorShortInfo, fr as OperatorsListFilters, Q as Order, mr as OrderAction, hr as OrderEditorData, or as OrderInfo, sr as OrderItem, wt as OrderItemBase, vn as OrderShortInfo, _r as OrderStatusHistoryInfo, vr as OrdersDataProvider, gr as OrdersListFilters, N as PaginationFiltersBase, br as PriceAnalyze, Cr as PriceAnalyzeProvider, jt as PriceCatalogableItem, Er as PriceHistoryDataProvider, wr as PriceHistoryItem, I as PriceTemplate, Nt as PriceTemplateCategory, W as PriceTemplateClient, Mt as PriceTemplateICatalogableItem, It as PriceTemplateProduct, $t as PriceTemplateProvider, q as PricingRole, en as PricingRoleProvider, St as PrimaryCatalogableItem, R as Product, Yt as ProductCategoryDataProvider, Xt as ProductDataProvider, Ot as ProductFilterTypeEnum, gt as ProductPriceCoefficient, Tr as ProductPriceHistory, vt as ProductUnit, ir as ProfstroyOfferItem, tn as PropertiesProvider, G as Property, K as PropertyValue, kr as Reclamation, Dr as ReclamationItem, Mr as ReclamationProvider, Or as ReclamationShortInfo, $ as ReclamationStatusEnum, jr as ReclamationStatusHelper, Ar as ReclamationsListFilters, Pr as RecommendationsDataProvider, Nr as RecommendationsList, Fr as ReferenceDataFactory, Pn as STANDARD_PERIOD_GROUPS, Fn as STANDARD_PERIOD_SECTIONS, zr as SearchProductStatistic, Lr as Seo, Rr as SeoDataProvider, Br as StatisticsProvider, _t as StockCount, On as TableDataPagination, Dn as TableDataPaginationRequestParams, kn as TableDataSortRequestParams, nn as TemplateProductCategoryDataProvider, Lt as TemplatesListFilters, Zn as UnitsHelper, Cn as UnknownClientDataProvider, Wr as UserAuthDataProvider, Kr as UserRegion, Gr as UserRegionEmployee, Jr as UserRegionProvider, qr as UserRegionsListFilters, F as UserShortInfo, wn as VersionConfig, yr as currentOrderInjectionKey, An as daysAgoIso, rn as findCatalogItemByIdRecursive, an as flattenCatalogItems, Xn as formatPercentChange, Mn as formatRelativeDate, jn as pluralize };
|