@snabcentr/common-lib 4.1.0-dev → 4.2.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 +634 -633
- 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/blog/providers/blog-provider.d.ts +1 -5
- package/dist/src/blog/providers/blog-provider.d.ts.map +1 -1
- package/dist/src/catalog/providers/client-product-data-provider.d.ts +1 -3
- package/dist/src/catalog/providers/client-product-data-provider.d.ts.map +1 -1
- package/dist/src/catalog/providers/price-template-provider.d.ts +1 -5
- package/dist/src/catalog/providers/price-template-provider.d.ts.map +1 -1
- package/dist/src/catalog/providers/product-data-provider.d.ts +1 -3
- package/dist/src/catalog/providers/product-data-provider.d.ts.map +1 -1
- package/dist/src/catalog/providers/properties-provider.d.ts +1 -5
- package/dist/src/catalog/providers/properties-provider.d.ts.map +1 -1
- package/dist/src/clients/providers/client-data-provider.d.ts +1 -5
- package/dist/src/clients/providers/client-data-provider.d.ts.map +1 -1
- package/dist/src/discounts/providers/discount-provider.d.ts +1 -5
- package/dist/src/discounts/providers/discount-provider.d.ts.map +1 -1
- package/dist/src/faq/providers/faq-provider.d.ts +1 -3
- package/dist/src/faq/providers/faq-provider.d.ts.map +1 -1
- package/dist/src/managers/classes/index.d.ts +1 -0
- package/dist/src/managers/classes/index.d.ts.map +1 -1
- package/dist/src/managers/classes/managers-list-filters.d.ts +47 -0
- package/dist/src/managers/classes/managers-list-filters.d.ts.map +1 -0
- package/dist/src/managers/index.d.ts +1 -0
- package/dist/src/managers/index.d.ts.map +1 -1
- package/dist/src/managers/interfaces/i-manager-save-data.d.ts +18 -0
- package/dist/src/managers/interfaces/i-manager-save-data.d.ts.map +1 -0
- package/dist/src/managers/interfaces/i-managers-list-filters.d.ts +36 -0
- package/dist/src/managers/interfaces/i-managers-list-filters.d.ts.map +1 -0
- package/dist/src/managers/interfaces/index.d.ts +2 -0
- package/dist/src/managers/interfaces/index.d.ts.map +1 -1
- package/dist/src/managers/providers/index.d.ts +2 -0
- package/dist/src/managers/providers/index.d.ts.map +1 -0
- package/dist/src/managers/providers/manager-provider.d.ts +63 -0
- package/dist/src/managers/providers/manager-provider.d.ts.map +1 -0
- package/dist/src/offers/providers/offers-data-provider.d.ts +1 -5
- package/dist/src/offers/providers/offers-data-provider.d.ts.map +1 -1
- package/dist/src/orders/providers/orders-data-provider.d.ts +1 -5
- package/dist/src/orders/providers/orders-data-provider.d.ts.map +1 -1
- package/dist/src/pagination/index.d.ts +0 -1
- package/dist/src/pagination/index.d.ts.map +1 -1
- package/dist/src/reclamations/providers/reclamation-provider.d.ts +1 -5
- package/dist/src/reclamations/providers/reclamation-provider.d.ts.map +1 -1
- package/dist/src/table-data/classes/index.d.ts +0 -2
- package/dist/src/table-data/classes/index.d.ts.map +1 -1
- package/dist/src/table-data/classes/table-data-pagination-request-params.d.ts +1 -1
- package/dist/src/table-data/classes/table-data-pagination-request-params.d.ts.map +1 -1
- package/dist/src/table-data/classes/table-data-sort-request-params.d.ts +1 -1
- package/dist/src/table-data/classes/table-data-sort-request-params.d.ts.map +1 -1
- package/dist/src/table-data/index.d.ts +0 -1
- package/dist/src/table-data/index.d.ts.map +1 -1
- package/dist/src/table-data/interfaces/i-pagination.d.ts +1 -1
- package/dist/src/table-data/interfaces/i-pagination.d.ts.map +1 -1
- package/dist/src/table-data/interfaces/index.d.ts +0 -4
- package/dist/src/table-data/interfaces/index.d.ts.map +1 -1
- package/dist/src/user-regions/providers/user-region-provider.d.ts +1 -5
- package/dist/src/user-regions/providers/user-region-provider.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/src/pagination/providers/base-pagination-provider.d.ts +0 -37
- package/dist/src/pagination/providers/base-pagination-provider.d.ts.map +0 -1
- package/dist/src/pagination/providers/index.d.ts +0 -2
- package/dist/src/pagination/providers/index.d.ts.map +0 -1
- package/dist/src/table-data/classes/filter-group.d.ts +0 -32
- package/dist/src/table-data/classes/filter-group.d.ts.map +0 -1
- package/dist/src/table-data/classes/filter-item.d.ts +0 -33
- package/dist/src/table-data/classes/filter-item.d.ts.map +0 -1
- package/dist/src/table-data/enums/filter-op-enum.d.ts +0 -74
- package/dist/src/table-data/enums/filter-op-enum.d.ts.map +0 -1
- package/dist/src/table-data/enums/index.d.ts +0 -2
- package/dist/src/table-data/enums/index.d.ts.map +0 -1
- package/dist/src/table-data/interfaces/i-filter-group.d.ts +0 -19
- package/dist/src/table-data/interfaces/i-filter-group.d.ts.map +0 -1
- package/dist/src/table-data/interfaces/i-filter-item.d.ts +0 -20
- package/dist/src/table-data/interfaces/i-filter-item.d.ts.map +0 -1
- package/dist/src/table-data/interfaces/i-pagination-request-params.d.ts +0 -14
- package/dist/src/table-data/interfaces/i-pagination-request-params.d.ts.map +0 -1
- package/dist/src/table-data/interfaces/i-sort-request-params.d.ts +0 -14
- package/dist/src/table-data/interfaces/i-sort-request-params.d.ts.map +0 -1
package/dist/sc-common-lib.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import {
|
|
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 ee, FilterGroup as l, 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, SourcePrimaryInterest as me, TypedInstanceFactory as _, UpdatableNamedIdentity as he, UserCommonInfo as ge, UserRegionShortInfo as _e, Warehouse as ve, useBaseConfigStore as v } from "@snabcentr/common-core";
|
|
2
|
+
import { addBusinessDays as ye, addDays as y, addMonths as b, addQuarters as be, addWeeks as xe, addYears as Se, differenceInCalendarDays as Ce, differenceInCalendarMonths as we, endOfDay as x, endOfMonth as S, endOfQuarter as Te, endOfToday as Ee, endOfTomorrow as De, endOfWeek as Oe, endOfYear as ke, endOfYesterday as Ae, format as C, getDate as je, getDaysInMonth as Me, parseISO as w, setDate as Ne, startOfDay as T, startOfMonth as E, startOfQuarter as Pe, startOfToday as Fe, startOfTomorrow as Ie, startOfWeek as D, startOfYear as O, startOfYesterday as Le, subDays as Re, subMonths as ze, subQuarters as Be, subWeeks as Ve, subYears as He } from "date-fns";
|
|
3
|
+
import { cloneDeep as Ue, endsWith as We, forEach as Ge, includes as Ke, isArray as qe, isDate as Je, isEmpty as Ye, isFunction as Xe, isNil as k, isObject as Ze, isString as A, isUndefined as Qe, map as j, merge as $e, omitBy as et, round as tt, some as nt, startsWith as rt, toUpper as it } 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 at = /* @__PURE__ */ function(e) {
|
|
7
7
|
return e.Image = "image", e.Video = "video", e;
|
|
8
|
-
}({}),
|
|
8
|
+
}({}), ot = 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 ?? at.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 === at.Image;
|
|
19
19
|
}
|
|
20
20
|
isVideo() {
|
|
21
|
-
return this.mediaType ===
|
|
21
|
+
return this.mediaType === at.Video;
|
|
22
22
|
}
|
|
23
|
-
},
|
|
23
|
+
}, st = /* @__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
|
-
super(e, t), this.createdAt =
|
|
28
|
+
super(e, t), this.createdAt = s.parse(e?.createdAt) ?? /* @__PURE__ */ new Date();
|
|
29
29
|
}
|
|
30
|
-
},
|
|
30
|
+
}, ct = class e extends M {
|
|
31
31
|
static resolvePublicationStatus(e) {
|
|
32
|
-
return
|
|
32
|
+
return k(e) ? st.Draft : e.getTime() > Date.now() ? st.Scheduled : st.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»." : rt(e, "-") || We(e, "-") ? "Обозначение не может начинаться или заканчиваться дефисом." : Ke(e, "--") ? "Дефисы не могут идти подряд: разделяйте слова одним дефисом." : "" : "";
|
|
36
36
|
}
|
|
37
37
|
static parseDate(e) {
|
|
38
|
-
return
|
|
38
|
+
return k(e) ? null : A(e) ? w(e) : e;
|
|
39
39
|
}
|
|
40
40
|
slug;
|
|
41
41
|
title;
|
|
@@ -46,11 +46,11 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
46
46
|
getPublicationStatus() {
|
|
47
47
|
return e.resolvePublicationStatus(this.publishedAt);
|
|
48
48
|
}
|
|
49
|
-
},
|
|
49
|
+
}, lt = class extends ct {
|
|
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 ot(e));
|
|
54
54
|
}
|
|
55
55
|
toSaveData(e = !1) {
|
|
56
56
|
return {
|
|
@@ -66,21 +66,21 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
66
66
|
getUnusedMedia() {
|
|
67
67
|
return this.media.filter((e) => e.isUnused);
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, N = class {
|
|
70
70
|
asClearRaw() {
|
|
71
71
|
let e = {};
|
|
72
72
|
return Object.keys(this).forEach((t) => {
|
|
73
73
|
let n = this[t];
|
|
74
|
-
|
|
74
|
+
k(n) || A(n) && n.trim().length === 0 || Xe(n.isNewRec) && n.isNewRec() || (e[t] = n);
|
|
75
75
|
}), e;
|
|
76
76
|
}
|
|
77
|
-
},
|
|
77
|
+
}, P = class {
|
|
78
78
|
from;
|
|
79
79
|
to;
|
|
80
80
|
constructor(e) {
|
|
81
|
-
this.from =
|
|
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
|
+
}, ut = class extends N {
|
|
84
84
|
id;
|
|
85
85
|
title;
|
|
86
86
|
slug;
|
|
@@ -89,7 +89,7 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
89
89
|
publishedAt;
|
|
90
90
|
createdAt;
|
|
91
91
|
constructor(e) {
|
|
92
|
-
super(), this.id = e?.id, this.title = e?.title, this.slug = e?.slug, this.content = e?.content, this.publicationStatus = e?.publicationStatus, this.publishedAt = new
|
|
92
|
+
super(), this.id = e?.id, this.title = e?.title, this.slug = e?.slug, this.content = e?.content, this.publicationStatus = e?.publicationStatus, this.publishedAt = new P(e?.publishedAt), this.createdAt = new P(e?.createdAt);
|
|
93
93
|
}
|
|
94
94
|
resetFilterValue(e) {
|
|
95
95
|
switch (e) {
|
|
@@ -111,84 +111,29 @@ var it = /* @__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
|
-
},
|
|
115
|
-
return e.BeginWith = "bw", e.Contains = "cn", e.Custom = "custom", e.EndsWith = "ew", e.Equals = "eq", e.GreaterOrEqual = "ge", e.GreaterThan = "gt", e.InList = "in", e.LessOrEqual = "le", e.LessThan = "lt", e.NotBeginWith = "bn", e.NotContains = "nc", e.NotEndsWith = "en", e.NotEqual = "ne", e.NotInList = "ni", e.NotNull = "nn", e.Null = "nu", e;
|
|
116
|
-
}({}), dt = class {
|
|
117
|
-
field;
|
|
118
|
-
op;
|
|
119
|
-
value;
|
|
120
|
-
constructor(e) {
|
|
121
|
-
this.field = e?.field ?? "", this.op = e?.op ?? ut.Equals, this.value = e?.value ?? "";
|
|
122
|
-
}
|
|
123
|
-
toPrimitive() {
|
|
124
|
-
let e = g().config.dateFormats.api, t = {
|
|
125
|
-
field: this.field,
|
|
126
|
-
op: this.op
|
|
127
|
-
};
|
|
128
|
-
if (Ke(this.value)) t.value = x(this.value, e);
|
|
129
|
-
else if (Xe(this.value)) {
|
|
130
|
-
let n = this.value;
|
|
131
|
-
t.value = {
|
|
132
|
-
from: n.from ? x(n.from, e) : null,
|
|
133
|
-
to: n.to ? x(n.to, e) : null
|
|
134
|
-
};
|
|
135
|
-
} else t.value = this.value;
|
|
136
|
-
return t;
|
|
137
|
-
}
|
|
138
|
-
}, ft = class e {
|
|
139
|
-
groupOp;
|
|
140
|
-
filters;
|
|
141
|
-
groups;
|
|
142
|
-
constructor(t) {
|
|
143
|
-
this.groupOp = t?.groupOp ?? "and", this.filters = t?.filters?.map((e) => new dt(e)) ?? [], this.groups = t?.groups?.map((t) => new e(t)) ?? [];
|
|
144
|
-
}
|
|
145
|
-
toPrimitive() {
|
|
146
|
-
return {
|
|
147
|
-
groupOp: this.groupOp,
|
|
148
|
-
filters: this.filters.map((e) => e instanceof dt && Je(e.toPrimitive) ? e.toPrimitive() : e),
|
|
149
|
-
groups: this.groups.map((t) => t instanceof e ? t.toPrimitive() : t)
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
}, N = class extends l {
|
|
153
|
-
getPaginated(e, t, n, r, i, a, o, s) {
|
|
154
|
-
let c = {
|
|
155
|
-
page: r?.page ?? 1,
|
|
156
|
-
perPage: r?.pageSize ?? 10
|
|
157
|
-
};
|
|
158
|
-
return t && (c.filters = JSON.stringify((t instanceof ft ? t : new ft(t)).toPrimitive())), qe(n) || (c.sort = Ge(n) ? n : [n]), i && (c = {
|
|
159
|
-
...c,
|
|
160
|
-
...i
|
|
161
|
-
}), this.get(e, c, a, o, s);
|
|
162
|
-
}
|
|
163
|
-
getTypedPaginated(e, t, n, r, i, a, o, s) {
|
|
164
|
-
return this.getPaginated(t, n, r, i, a, (t) => ({
|
|
165
|
-
...t.data,
|
|
166
|
-
data: h.instanceListInitializer(e, t.data.data)
|
|
167
|
-
}), o, s);
|
|
168
|
-
}
|
|
169
|
-
}, pt = class e extends N {
|
|
114
|
+
}, dt = class t extends e {
|
|
170
115
|
static preparePostSaveData(e) {
|
|
171
116
|
let t = {};
|
|
172
|
-
if (
|
|
173
|
-
let n =
|
|
174
|
-
t.publishedAt =
|
|
117
|
+
if (Qe(e.title) || (t.title = e.title), Qe(e.slug) || (t.slug = e.slug), Qe(e.content) || (t.content = e.content), !Qe(e.publishedAt)) {
|
|
118
|
+
let n = v().config.dateFormats.api;
|
|
119
|
+
t.publishedAt = k(e.publishedAt) ? null : C(e.publishedAt, n);
|
|
175
120
|
}
|
|
176
121
|
return t;
|
|
177
122
|
}
|
|
178
123
|
getPostList(e, t, n) {
|
|
179
124
|
return this.getPaginated("/internal/blog", e, t, n, {}, (e) => ({
|
|
180
125
|
...e.data,
|
|
181
|
-
data: e.data.data.map((e) => new
|
|
126
|
+
data: e.data.data.map((e) => new ct(e))
|
|
182
127
|
}));
|
|
183
128
|
}
|
|
184
129
|
getPost(e) {
|
|
185
|
-
return this.get(`/internal/blog/${e}`, {}, (e) => new
|
|
130
|
+
return this.get(`/internal/blog/${e}`, {}, (e) => new lt(e.data));
|
|
186
131
|
}
|
|
187
|
-
createPost(
|
|
188
|
-
return this.post("/internal/blog",
|
|
132
|
+
createPost(e, n = {}) {
|
|
133
|
+
return this.post("/internal/blog", t.preparePostSaveData(e), (e) => new lt(e.data), n);
|
|
189
134
|
}
|
|
190
|
-
updatePost(
|
|
191
|
-
return this.patch(`/internal/blog/${
|
|
135
|
+
updatePost(e, n, r = {}) {
|
|
136
|
+
return this.patch(`/internal/blog/${e}`, t.preparePostSaveData(n), (e) => new lt(e.data), r);
|
|
192
137
|
}
|
|
193
138
|
removePost(e) {
|
|
194
139
|
return this.delete(`/internal/blog/${e}`);
|
|
@@ -204,26 +149,26 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
204
149
|
onUploadProgress: (e) => {
|
|
205
150
|
r && r(e.total ? Math.round(e.loaded / e.total * 100) : 0);
|
|
206
151
|
}
|
|
207
|
-
}, (e) => new
|
|
152
|
+
}, (e) => new ot(e.data), i);
|
|
208
153
|
}
|
|
209
154
|
updateMedia(e, t, n, r = {}) {
|
|
210
|
-
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 ot(e.data), r);
|
|
211
156
|
}
|
|
212
157
|
removeMedia(e, t) {
|
|
213
158
|
return this.delete(`/internal/blog/${e}/media/${t}`);
|
|
214
159
|
}
|
|
215
|
-
},
|
|
160
|
+
}, ft = class extends he {
|
|
216
161
|
deletedAt;
|
|
217
162
|
constructor(e) {
|
|
218
|
-
super(e), this.deletedAt =
|
|
163
|
+
super(e), this.deletedAt = s.parse(e?.deletedAt);
|
|
219
164
|
}
|
|
220
|
-
},
|
|
165
|
+
}, F = class extends p {
|
|
221
166
|
type;
|
|
222
167
|
isActive;
|
|
223
168
|
constructor(e) {
|
|
224
169
|
super(e), this.type = e?.type, this.isActive = e?.isActive ?? !0;
|
|
225
170
|
}
|
|
226
|
-
},
|
|
171
|
+
}, pt = class extends ft {
|
|
227
172
|
costCoefficient;
|
|
228
173
|
isLowPriceAllowed;
|
|
229
174
|
publishedAt;
|
|
@@ -231,30 +176,30 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
231
176
|
percent;
|
|
232
177
|
owner;
|
|
233
178
|
constructor(e) {
|
|
234
|
-
super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.isLowPriceAllowed = e?.isLowPriceAllowed ?? !1, this.publishedAt =
|
|
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);
|
|
235
180
|
}
|
|
236
|
-
},
|
|
181
|
+
}, I = class extends he {
|
|
237
182
|
description;
|
|
238
183
|
owner;
|
|
239
184
|
constructor(e) {
|
|
240
|
-
super(e), this.description = e?.description ?? "", this.owner = e?.owner ? new
|
|
185
|
+
super(e), this.description = e?.description ?? "", this.owner = e?.owner ? new F(e.owner) : void 0;
|
|
241
186
|
}
|
|
242
|
-
},
|
|
187
|
+
}, mt = class {
|
|
243
188
|
coefficient;
|
|
244
189
|
value;
|
|
245
190
|
cost;
|
|
246
191
|
percent;
|
|
247
192
|
readOnly;
|
|
248
193
|
constructor(e) {
|
|
249
|
-
this.coefficient = new
|
|
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;
|
|
250
195
|
}
|
|
251
|
-
},
|
|
196
|
+
}, ht = class {
|
|
252
197
|
warehouse;
|
|
253
198
|
count;
|
|
254
199
|
constructor(e) {
|
|
255
|
-
this.warehouse = new
|
|
200
|
+
this.warehouse = new ve(e?.warehouse), this.count = e?.count ?? 0;
|
|
256
201
|
}
|
|
257
|
-
},
|
|
202
|
+
}, gt = class extends p {
|
|
258
203
|
slug = "";
|
|
259
204
|
description;
|
|
260
205
|
isSquare = !1;
|
|
@@ -262,35 +207,35 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
262
207
|
constructor(e) {
|
|
263
208
|
super(e), e && (this.slug = e.slug ?? "", this.description = e.description, this.isSquare = e.isSquare ?? !1, this.isLinear = e.isLinear ?? !1);
|
|
264
209
|
}
|
|
265
|
-
},
|
|
210
|
+
}, L = class extends p {
|
|
266
211
|
code = "";
|
|
267
212
|
constructor(e) {
|
|
268
213
|
super(e), this.code = e?.code ?? "";
|
|
269
214
|
}
|
|
270
|
-
},
|
|
215
|
+
}, _t = class extends L {
|
|
271
216
|
slug;
|
|
272
217
|
type;
|
|
273
218
|
constructor(e) {
|
|
274
219
|
super(e), this.slug = e?.slug ?? "";
|
|
275
220
|
}
|
|
276
|
-
},
|
|
221
|
+
}, vt = class extends _t {
|
|
277
222
|
isHidden;
|
|
278
223
|
constructor(e) {
|
|
279
224
|
super(e), this.isHidden = e?.isHidden ?? !1;
|
|
280
225
|
}
|
|
281
|
-
},
|
|
226
|
+
}, yt = class {
|
|
282
227
|
image;
|
|
283
228
|
preview;
|
|
284
229
|
isDefault;
|
|
285
230
|
constructor(e, t) {
|
|
286
231
|
this.image = `${t ?? ""}${e.image}`, this.preview = `${t ?? ""}${e.preview}`, this.isDefault = e.isDefault;
|
|
287
232
|
}
|
|
288
|
-
},
|
|
233
|
+
}, bt = class extends _t {
|
|
289
234
|
isPrimary;
|
|
290
235
|
constructor(e) {
|
|
291
236
|
super(e), this.isPrimary = e?.isPrimary ?? !1;
|
|
292
237
|
}
|
|
293
|
-
},
|
|
238
|
+
}, R = class extends vt {
|
|
294
239
|
supplierSku;
|
|
295
240
|
unit;
|
|
296
241
|
pack;
|
|
@@ -309,12 +254,12 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
309
254
|
retailCostRub;
|
|
310
255
|
priceCoefficients;
|
|
311
256
|
constructor(e) {
|
|
312
|
-
super(e), this.supplierSku = e?.supplierSku, this.unit = e?.unit ? new
|
|
257
|
+
super(e), this.supplierSku = e?.supplierSku, this.unit = e?.unit ? new gt(e.unit) : new gt(), 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 ht(e)) ?? [], this.type = "product";
|
|
313
258
|
let t = e?.category ?? e?.categories?.find((e) => e.isPrimary);
|
|
314
|
-
t && (this.category = new
|
|
259
|
+
t && (this.category = new bt({
|
|
315
260
|
...t,
|
|
316
261
|
isPrimary: !0
|
|
317
|
-
}), 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 bt(e))), this.images = e?.images?.map((e) => new yt(e, v().config.http.mediaUrl)) ?? [], this.properties = e?.properties ?? {}, this.retailCost = e?.retailCost, this.retailCostRub = e?.retailCostRub, this.priceCoefficients = e?.priceCoefficients?.map((e) => new mt(e)) ?? [], e && "codeNumber" in e && !e.code && (this.code = e?.codeNumber);
|
|
318
263
|
}
|
|
319
264
|
getIsMeasurable() {
|
|
320
265
|
return this.unit.isLinear || this.unit.isSquare;
|
|
@@ -325,9 +270,9 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
325
270
|
getRetailCostRub() {
|
|
326
271
|
return this.retailCostRub ?? this.costRub;
|
|
327
272
|
}
|
|
328
|
-
},
|
|
273
|
+
}, xt = /* @__PURE__ */ function(e) {
|
|
329
274
|
return e.Discount = "discount", e.PriceTemplate = "price_template", e.ClientPrice = "client_price", e.Product = "product", e;
|
|
330
|
-
}({}),
|
|
275
|
+
}({}), z = class extends R {
|
|
331
276
|
costCoefficient;
|
|
332
277
|
costSource;
|
|
333
278
|
discount;
|
|
@@ -338,17 +283,17 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
338
283
|
isRequired;
|
|
339
284
|
isFavorite;
|
|
340
285
|
constructor(e) {
|
|
341
|
-
super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.costSource = e?.costSource ??
|
|
286
|
+
super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.costSource = e?.costSource ?? xt.Product, this.discount = e?.discount ? new pt(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;
|
|
342
287
|
}
|
|
343
|
-
},
|
|
288
|
+
}, B = class extends bt {
|
|
344
289
|
isHidden;
|
|
345
290
|
parentCategoryId;
|
|
346
291
|
properties;
|
|
347
292
|
currencyRates;
|
|
348
293
|
constructor(e) {
|
|
349
|
-
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]) => [it(e), t])) : void 0;
|
|
350
295
|
}
|
|
351
|
-
},
|
|
296
|
+
}, St = class extends d {
|
|
352
297
|
category;
|
|
353
298
|
product;
|
|
354
299
|
quantity;
|
|
@@ -367,9 +312,9 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
367
312
|
originalId;
|
|
368
313
|
replacementId;
|
|
369
314
|
constructor(e) {
|
|
370
|
-
super(e), this.product = new
|
|
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 && Ue(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;
|
|
371
316
|
}
|
|
372
|
-
},
|
|
317
|
+
}, Ct = class extends St {
|
|
373
318
|
cost;
|
|
374
319
|
costOne;
|
|
375
320
|
costOneRub;
|
|
@@ -380,18 +325,18 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
380
325
|
sawing;
|
|
381
326
|
currency;
|
|
382
327
|
constructor(e) {
|
|
383
|
-
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 = qe(e.sawing) ? e.sawing : e.sawing ? [e.sawing] : void 0, this.currency = new o(e.currency);
|
|
384
329
|
}
|
|
385
|
-
},
|
|
330
|
+
}, V = class {
|
|
386
331
|
items;
|
|
387
332
|
resultSum;
|
|
388
333
|
directionsSum;
|
|
389
334
|
constructor(e) {
|
|
390
|
-
this.items = e.items.map((e) => new
|
|
335
|
+
this.items = e.items.map((e) => new Ct(e)), this.resultSum = e.resultSum, this.directionsSum = e.directionsSum;
|
|
391
336
|
}
|
|
392
|
-
},
|
|
337
|
+
}, wt = class extends u {
|
|
393
338
|
getCart(e) {
|
|
394
|
-
return this.get(`internal/clients/${e.id}/cart`, {}, (e) => new
|
|
339
|
+
return this.get(`internal/clients/${e.id}/cart`, {}, (e) => new V(e.data));
|
|
395
340
|
}
|
|
396
341
|
deleteCart(e) {
|
|
397
342
|
return this.delete(`internal/clients/${e.id}/cart`);
|
|
@@ -408,7 +353,7 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
408
353
|
marker: t.marker,
|
|
409
354
|
is_additional_sale: t.isAdditionalSale,
|
|
410
355
|
...t.configuratorParams
|
|
411
|
-
}, (e) => new
|
|
356
|
+
}, (e) => new V(e.data), n);
|
|
412
357
|
}
|
|
413
358
|
patchCartItem(e, t, n = {}) {
|
|
414
359
|
return this.patch(`internal/clients/${e.id}/cart/${t.id}`, {
|
|
@@ -422,65 +367,65 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
422
367
|
marker: t.marker,
|
|
423
368
|
is_additional_sale: t.isAdditionalSale,
|
|
424
369
|
...t.configuratorParams
|
|
425
|
-
}, (e) => new
|
|
370
|
+
}, (e) => new V(e.data), n);
|
|
426
371
|
}
|
|
427
372
|
deleteCartItem(e, t) {
|
|
428
|
-
return this.delete(`internal/clients/${e.id}/cart/${t.id}`, (e) => new
|
|
373
|
+
return this.delete(`internal/clients/${e.id}/cart/${t.id}`, (e) => new V(e.data));
|
|
429
374
|
}
|
|
430
375
|
addCartItemFromCSV(e, t) {
|
|
431
|
-
return this.post(`internal/clients/${e.id}/cart/add-products-from-csv`, t, (e) => new
|
|
376
|
+
return this.post(`internal/clients/${e.id}/cart/add-products-from-csv`, t, (e) => new V(e.data));
|
|
432
377
|
}
|
|
433
378
|
getCartItemFromCSVExample(e) {
|
|
434
379
|
return this.get(`internal/clients/${e.id}/cart/add-products-from-csv/example`, {}, (e) => new Blob([e.data], { type: "text/csv" }));
|
|
435
380
|
}
|
|
436
|
-
},
|
|
381
|
+
}, Tt = /* @__PURE__ */ function(e) {
|
|
437
382
|
return e.m2Cost = "m2Cost", e.percent = "percent", e.value = "value", e;
|
|
438
|
-
}({}),
|
|
383
|
+
}({}), Et = /* @__PURE__ */ function(e) {
|
|
439
384
|
return e.Checkbox = "checkbox", e.Range = "range", e.Toggle = "toggle", e;
|
|
440
|
-
}({}),
|
|
385
|
+
}({}), H = class e extends B {
|
|
441
386
|
categories;
|
|
442
387
|
products;
|
|
443
388
|
constructor(t) {
|
|
444
|
-
super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new
|
|
389
|
+
super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new R(e));
|
|
445
390
|
}
|
|
446
|
-
},
|
|
391
|
+
}, Dt = class extends B {
|
|
447
392
|
isDisabled;
|
|
448
393
|
isRequired;
|
|
449
394
|
isFavorite;
|
|
450
395
|
hidingComment;
|
|
451
396
|
manager;
|
|
452
397
|
constructor(e) {
|
|
453
|
-
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
|
|
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;
|
|
454
399
|
}
|
|
455
|
-
},
|
|
400
|
+
}, Ot = class e extends Dt {
|
|
456
401
|
categories;
|
|
457
402
|
products;
|
|
458
403
|
constructor(t) {
|
|
459
|
-
super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new
|
|
404
|
+
super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new z(e));
|
|
460
405
|
}
|
|
461
|
-
},
|
|
406
|
+
}, kt = class {
|
|
462
407
|
priceCoefficient;
|
|
463
408
|
increasePercent;
|
|
464
409
|
constructor(e) {
|
|
465
|
-
this.priceCoefficient = e?.priceCoefficient && new
|
|
410
|
+
this.priceCoefficient = e?.priceCoefficient && new le(e.priceCoefficient), this.increasePercent = e?.increasePercent;
|
|
466
411
|
}
|
|
467
|
-
},
|
|
412
|
+
}, At = class extends kt {
|
|
468
413
|
constructor(e) {
|
|
469
414
|
super(e);
|
|
470
415
|
}
|
|
471
|
-
},
|
|
416
|
+
}, jt = class extends At {
|
|
472
417
|
productCategory;
|
|
473
418
|
constructor(e) {
|
|
474
|
-
super(e), this.productCategory = new
|
|
419
|
+
super(e), this.productCategory = new B(e?.productCategory);
|
|
475
420
|
}
|
|
476
|
-
},
|
|
421
|
+
}, Mt = class extends p {
|
|
477
422
|
photo;
|
|
478
423
|
contacts;
|
|
479
424
|
curatedDirection;
|
|
480
425
|
constructor(e) {
|
|
481
|
-
super(e), this.photo = e.photo, this.contacts = new
|
|
426
|
+
super(e), this.photo = e.photo, this.contacts = new r(e.contacts), this.curatedDirection = new a(e.curatedDirection);
|
|
482
427
|
}
|
|
483
|
-
},
|
|
428
|
+
}, U = class extends ge {
|
|
484
429
|
salesDirection;
|
|
485
430
|
debt;
|
|
486
431
|
alternativeName;
|
|
@@ -491,47 +436,47 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
491
436
|
managers;
|
|
492
437
|
curators;
|
|
493
438
|
constructor(e) {
|
|
494
|
-
super(e), this.salesDirection = 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 Mt(e)) ?? void 0;
|
|
495
440
|
}
|
|
496
|
-
},
|
|
441
|
+
}, Nt = class extends M {
|
|
497
442
|
deletedAt;
|
|
498
443
|
constructor(e, t) {
|
|
499
|
-
super(e, t), this.deletedAt =
|
|
444
|
+
super(e, t), this.deletedAt = s.parse(e?.deletedAt);
|
|
500
445
|
}
|
|
501
|
-
},
|
|
446
|
+
}, W = class extends Nt {
|
|
502
447
|
client;
|
|
503
448
|
priceTemplate;
|
|
504
449
|
constructor(e) {
|
|
505
|
-
super(e), this.client = new
|
|
450
|
+
super(e), this.client = new U(e?.client), this.priceTemplate = new I(e?.priceTemplate);
|
|
506
451
|
}
|
|
507
|
-
},
|
|
452
|
+
}, Pt = class extends At {
|
|
508
453
|
product;
|
|
509
454
|
constructor(e) {
|
|
510
|
-
super(e), this.product = new
|
|
455
|
+
super(e), this.product = new R(e?.product);
|
|
511
456
|
}
|
|
512
|
-
},
|
|
457
|
+
}, G = class extends p {
|
|
513
458
|
type;
|
|
514
459
|
description;
|
|
515
460
|
metadata;
|
|
516
461
|
isFilterable;
|
|
517
462
|
constructor(e) {
|
|
518
|
-
super(e), this.type = new
|
|
463
|
+
super(e), this.type = new ue(e?.type), this.description = e?.description ?? "", this.metadata = e?.metadata, this.isFilterable = e?.isFilterable;
|
|
519
464
|
}
|
|
520
|
-
},
|
|
465
|
+
}, K = class {
|
|
521
466
|
property;
|
|
522
467
|
value;
|
|
523
468
|
constructor(e) {
|
|
524
|
-
this.property = new
|
|
469
|
+
this.property = new G(e?.property), this.value = e?.value ?? "";
|
|
525
470
|
}
|
|
526
|
-
},
|
|
471
|
+
}, Ft = class {
|
|
527
472
|
id;
|
|
528
473
|
name;
|
|
529
474
|
description;
|
|
530
475
|
ownerName;
|
|
531
|
-
createdAt = new
|
|
532
|
-
updatedAt = new
|
|
476
|
+
createdAt = new P();
|
|
477
|
+
updatedAt = new P();
|
|
533
478
|
constructor(e) {
|
|
534
|
-
this.id = e?.id, this.name = e?.name, this.description = e?.description, this.ownerName = e?.ownerName, this.createdAt = new
|
|
479
|
+
this.id = e?.id, this.name = e?.name, this.description = e?.description, this.ownerName = e?.ownerName, this.createdAt = new P(e?.createdAt), this.updatedAt = new P(e?.updatedAt);
|
|
535
480
|
}
|
|
536
481
|
resetFilterValue(e) {
|
|
537
482
|
switch (e) {
|
|
@@ -552,26 +497,26 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
552
497
|
let e = {};
|
|
553
498
|
return Object.keys(this).forEach((t) => {
|
|
554
499
|
let n = this[t];
|
|
555
|
-
|
|
500
|
+
k(n) || A(n) && n.trim().length === 0 || Xe(n.isNewRec) && n.isNewRec() || (e[t] = n);
|
|
556
501
|
}), !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, !e?.updatedAt?.from && !e?.updatedAt?.to && delete e.updatedAt, e;
|
|
557
502
|
}
|
|
558
|
-
},
|
|
503
|
+
}, It = class extends kt {
|
|
559
504
|
executor;
|
|
560
505
|
createdAt;
|
|
561
506
|
constructor(e) {
|
|
562
|
-
super(e), this.executor = e?.executor ? new
|
|
507
|
+
super(e), this.executor = e?.executor ? new F(e.executor) : void 0, this.createdAt = s.parse(e?.createdAt);
|
|
563
508
|
}
|
|
564
|
-
},
|
|
509
|
+
}, Lt = class extends It {
|
|
565
510
|
product;
|
|
566
511
|
constructor(e) {
|
|
567
|
-
super(e), this.product = new
|
|
512
|
+
super(e), this.product = new R(e?.product);
|
|
568
513
|
}
|
|
569
|
-
},
|
|
514
|
+
}, Rt = class extends It {
|
|
570
515
|
productCategory;
|
|
571
516
|
constructor(e) {
|
|
572
|
-
super(e), this.productCategory = new
|
|
517
|
+
super(e), this.productCategory = new B(e?.productCategory);
|
|
573
518
|
}
|
|
574
|
-
},
|
|
519
|
+
}, q = class extends p {
|
|
575
520
|
description;
|
|
576
521
|
canChangeLowCost;
|
|
577
522
|
parentRoleId;
|
|
@@ -581,14 +526,14 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
581
526
|
constructor(e) {
|
|
582
527
|
super(e), this.description = e?.description, this.canChangeLowCost = e?.canChangeLowCost ?? !1, this.parentRoleId = e?.parentRoleId;
|
|
583
528
|
}
|
|
584
|
-
},
|
|
529
|
+
}, zt = class {
|
|
585
530
|
role;
|
|
586
531
|
category;
|
|
587
532
|
minCoefficient;
|
|
588
533
|
constructor(e) {
|
|
589
|
-
this.role = new
|
|
534
|
+
this.role = new q(e?.role), this.category = new B(e?.category), this.minCoefficient = new le(e?.minCoefficient);
|
|
590
535
|
}
|
|
591
|
-
},
|
|
536
|
+
}, Bt = class {
|
|
592
537
|
isFake;
|
|
593
538
|
isHidden;
|
|
594
539
|
isMultiple;
|
|
@@ -597,20 +542,20 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
597
542
|
constructor(e) {
|
|
598
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;
|
|
599
544
|
}
|
|
600
|
-
},
|
|
545
|
+
}, Vt = class {
|
|
601
546
|
category;
|
|
602
547
|
property;
|
|
603
548
|
settings;
|
|
604
549
|
constructor(e) {
|
|
605
|
-
this.category = new
|
|
550
|
+
this.category = new B(e?.category), this.property = new G(e?.property), this.settings = new Bt(e?.settings);
|
|
606
551
|
}
|
|
607
|
-
},
|
|
552
|
+
}, Ht = class {
|
|
608
553
|
id;
|
|
609
554
|
label;
|
|
610
555
|
constructor(e) {
|
|
611
556
|
this.id = e?.id ?? "", this.label = e?.label ?? "";
|
|
612
557
|
}
|
|
613
|
-
},
|
|
558
|
+
}, Ut = class {
|
|
614
559
|
id;
|
|
615
560
|
label;
|
|
616
561
|
type;
|
|
@@ -620,9 +565,9 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
620
565
|
min;
|
|
621
566
|
max;
|
|
622
567
|
constructor(e) {
|
|
623
|
-
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 ?? Et.Checkbox, this.ord = e?.ord ?? 0, this.isMultiple = e?.isMultiple ?? null, this.values = e?.values?.map((e) => new Ht(e)) ?? [], this.min = e?.min ?? null, this.max = e?.max ?? null;
|
|
624
569
|
}
|
|
625
|
-
},
|
|
570
|
+
}, Wt = class extends u {
|
|
626
571
|
search(e, t = !1) {
|
|
627
572
|
return this.get("/internal/catalog/search", {
|
|
628
573
|
term: e,
|
|
@@ -630,18 +575,18 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
630
575
|
});
|
|
631
576
|
}
|
|
632
577
|
getPriceExportLink(e = "csv", t = !1, n = void 0, r = void 0) {
|
|
633
|
-
let i = `${
|
|
578
|
+
let i = `${v().config.http.portalApiUrl}/api/internal/price/export?format=${e}&show_hidden=${t}`;
|
|
634
579
|
return n && (i += `&category_id=${n}`), r && (i += `&client_id=${r}`), i;
|
|
635
580
|
}
|
|
636
|
-
},
|
|
581
|
+
}, Gt = class extends u {
|
|
637
582
|
importPrices(e, t, n = !1) {
|
|
638
583
|
return this.post(`/internal/clients/${e}/price/import`, t, void 0, {}, n);
|
|
639
584
|
}
|
|
640
585
|
getCategoryPrices(e) {
|
|
641
|
-
return this.getTypedList(
|
|
586
|
+
return this.getTypedList(Rt, `/internal/clients/${e}/price/categories`);
|
|
642
587
|
}
|
|
643
588
|
getCategoryPrice(e, t) {
|
|
644
|
-
return this.get(`/internal/clients/${e}/price/categories/${t}`, {}, (e) => new
|
|
589
|
+
return this.get(`/internal/clients/${e}/price/categories/${t}`, {}, (e) => new Rt(e.data));
|
|
645
590
|
}
|
|
646
591
|
updateCategoryPrices(e, t, n, r = !1) {
|
|
647
592
|
return this.request({
|
|
@@ -687,16 +632,16 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
687
632
|
return this.delete(`/internal/clients/${e}/price/categories/${t}/manager`);
|
|
688
633
|
}
|
|
689
634
|
getProductPrices(e) {
|
|
690
|
-
return this.getTypedList(
|
|
635
|
+
return this.getTypedList(Lt, `/internal/clients/${e}/price/products`);
|
|
691
636
|
}
|
|
692
637
|
getProductPrice(e, t) {
|
|
693
|
-
return this.get(`/internal/clients/${e}/price/products/${t}`, {}, (e) => new
|
|
638
|
+
return this.get(`/internal/clients/${e}/price/products/${t}`, {}, (e) => new Lt(e.data));
|
|
694
639
|
}
|
|
695
640
|
updateProductPrice(e, t, n) {
|
|
696
641
|
return this.patch(`/internal/clients/${e}/price/products/${t}`, {
|
|
697
642
|
price_coefficient_id: n.coefficient?.id,
|
|
698
643
|
increase_percent: n.value
|
|
699
|
-
}, (e) => new
|
|
644
|
+
}, (e) => new Lt(e.data));
|
|
700
645
|
}
|
|
701
646
|
removeProductPrice(e, t) {
|
|
702
647
|
return this.delete(`/internal/clients/${e}/price/products/${t}`);
|
|
@@ -716,96 +661,96 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
716
661
|
sendCommercialOffer(e, t) {
|
|
717
662
|
return this.post(`/internal/clients/${e}/price/commercial-offer/send`, t);
|
|
718
663
|
}
|
|
719
|
-
},
|
|
664
|
+
}, Kt = class extends u {
|
|
720
665
|
getTemplateList(e) {
|
|
721
|
-
return this.getTypedList(
|
|
666
|
+
return this.getTypedList(W, `/internal/clients/${e}/price/templates`);
|
|
722
667
|
}
|
|
723
668
|
getActiveTemplate(e) {
|
|
724
|
-
return this.get(`/internal/clients/${e}/price/templates/active`, {}, (e) => new
|
|
669
|
+
return this.get(`/internal/clients/${e}/price/templates/active`, {}, (e) => new W(e.data), !0);
|
|
725
670
|
}
|
|
726
671
|
attachTemplate(e, t, n) {
|
|
727
|
-
let r =
|
|
672
|
+
let r = v().config.dateFormats.api;
|
|
728
673
|
return this.post(`/internal/clients/${e}/price/templates/${t}`, n && {
|
|
729
|
-
startAt: n.startAt &&
|
|
730
|
-
endAt: n.endAt &&
|
|
731
|
-
}, (e) => new
|
|
674
|
+
startAt: n.startAt && C(n.startAt, r),
|
|
675
|
+
endAt: n.endAt && C(n.endAt, r)
|
|
676
|
+
}, (e) => new W(e.data), {}, !0);
|
|
732
677
|
}
|
|
733
678
|
applyTemplate(e, t) {
|
|
734
679
|
return this.post(`/internal/clients/${e}/price/templates/${t}/apply`, {}, void 0, {}, !0);
|
|
735
680
|
}
|
|
736
681
|
changeTemplate(e, t, n, r) {
|
|
737
|
-
let i =
|
|
682
|
+
let i = v().config.dateFormats.api;
|
|
738
683
|
return this.patch(`/internal/clients/${e}/price/templates/${t}/${n}`, r && {
|
|
739
|
-
startAt: r.startAt &&
|
|
740
|
-
endAt: r.endAt &&
|
|
741
|
-
}, (e) => new
|
|
684
|
+
startAt: r.startAt && C(r.startAt, i),
|
|
685
|
+
endAt: r.endAt && C(r.endAt, i)
|
|
686
|
+
}, (e) => new W(e.data));
|
|
742
687
|
}
|
|
743
688
|
detachTemplate(e, t, n) {
|
|
744
689
|
return this.delete(`/internal/clients/${e}/price/templates/${t}/${n}`);
|
|
745
690
|
}
|
|
746
|
-
},
|
|
691
|
+
}, qt = class extends u {
|
|
747
692
|
getRootCategoriesList(e = !1) {
|
|
748
|
-
return this.getTypedList(
|
|
693
|
+
return this.getTypedList(H, "/internal/catalog/categories", { showHidden: e });
|
|
749
694
|
}
|
|
750
695
|
getCategoryData(e, t = !1, n = !1) {
|
|
751
696
|
return this.get(`/internal/catalog/categories/${e}`, {
|
|
752
697
|
showHidden: t,
|
|
753
698
|
withNestedCategories: n
|
|
754
|
-
}, (e) => new
|
|
699
|
+
}, (e) => new H(e.data));
|
|
755
700
|
}
|
|
756
701
|
getPublicCategoryData(e) {
|
|
757
|
-
return this.get(`/public/catalog/categories/${e}`, {}, (e) => new
|
|
702
|
+
return this.get(`/public/catalog/categories/${e}`, {}, (e) => new H(e.data));
|
|
758
703
|
}
|
|
759
704
|
getCategoryProductsList(e, t = !0, n = !1) {
|
|
760
705
|
return this.get(`/internal/catalog/categories/${e}/products`, {
|
|
761
706
|
showHidden: n,
|
|
762
707
|
withPriceCoefficients: t
|
|
763
|
-
}, (e) =>
|
|
708
|
+
}, (e) => j(e.data, (e) => new R(e)));
|
|
764
709
|
}
|
|
765
710
|
getCategoryProductsCoefficients(e) {
|
|
766
711
|
return this.get(`/internal/catalog/categories/${e}/products/coefficients`, {}, (e) => {
|
|
767
712
|
let { data: t } = e;
|
|
768
|
-
return
|
|
713
|
+
return Ge(t, (e) => e.map((e) => new mt(e))), t;
|
|
769
714
|
});
|
|
770
715
|
}
|
|
771
716
|
publicSimpleSearch(e, t = 10) {
|
|
772
717
|
return new Promise((n, r) => {
|
|
773
718
|
this.get(`/public/catalog/search/simple?limit=${t}&term=${e}`).then((e) => {
|
|
774
|
-
n(e.categories.map((e) => new
|
|
719
|
+
n(e.categories.map((e) => new H(e)));
|
|
775
720
|
}).catch((e) => {
|
|
776
721
|
r(e);
|
|
777
722
|
});
|
|
778
723
|
});
|
|
779
724
|
}
|
|
780
|
-
},
|
|
725
|
+
}, Jt = class extends e {
|
|
781
726
|
getProductData(e, t = !1) {
|
|
782
|
-
return this.get(`/internal/catalog/products/${e}`, { withPriceCoefficients: t }, (e) => new
|
|
727
|
+
return this.get(`/internal/catalog/products/${e}`, { withPriceCoefficients: t }, (e) => new R(e.data));
|
|
783
728
|
}
|
|
784
729
|
getPublicProductData(e) {
|
|
785
|
-
return this.get(`/public/catalog/products/${e}`, {}, (e) => new
|
|
730
|
+
return this.get(`/public/catalog/products/${e}`, {}, (e) => new R(e.data));
|
|
786
731
|
}
|
|
787
732
|
getProductPriceCoefficients(e) {
|
|
788
|
-
return this.get(`/internal/catalog/products/${e}/coefficients`, {}, (e) =>
|
|
733
|
+
return this.get(`/internal/catalog/products/${e}/coefficients`, {}, (e) => j(e.data, (e) => new mt(e)));
|
|
789
734
|
}
|
|
790
735
|
getNewProducts(e, t, n = !0) {
|
|
791
|
-
let r =
|
|
792
|
-
return this.getTypedPaginated(
|
|
793
|
-
period: { from:
|
|
736
|
+
let r = v().config.dateFormats.api;
|
|
737
|
+
return this.getTypedPaginated(R, "/internal/catalog/products/new", void 0, void 0, t, {
|
|
738
|
+
period: { from: C(e, r) },
|
|
794
739
|
withPriceCoefficients: n
|
|
795
740
|
});
|
|
796
741
|
}
|
|
797
742
|
publicSimpleSearch(e, t = 10) {
|
|
798
743
|
return new Promise((n, r) => {
|
|
799
744
|
this.get(`/public/catalog/search/simple?limit=${t}&term=${e}`).then((e) => {
|
|
800
|
-
n(e.products.map((e) => new
|
|
745
|
+
n(e.products.map((e) => new R(e)));
|
|
801
746
|
}).catch((e) => {
|
|
802
747
|
r(e);
|
|
803
748
|
});
|
|
804
749
|
});
|
|
805
750
|
}
|
|
806
|
-
},
|
|
751
|
+
}, Yt = class extends u {
|
|
807
752
|
getRootCategoriesList(e, t = !1) {
|
|
808
|
-
return this.getTypedList(
|
|
753
|
+
return this.getTypedList(Ot, "/internal/catalog/categories", {
|
|
809
754
|
clientId: e,
|
|
810
755
|
showHidden: t
|
|
811
756
|
});
|
|
@@ -815,66 +760,66 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
815
760
|
clientId: e,
|
|
816
761
|
showHidden: n,
|
|
817
762
|
withNestedCategories: r
|
|
818
|
-
}, (e) => new
|
|
763
|
+
}, (e) => new Ot(e.data));
|
|
819
764
|
}
|
|
820
765
|
getCategoryProductsList(e, t, n = !0, r = !1) {
|
|
821
766
|
return this.get(`/internal/catalog/categories/${t}/products`, {
|
|
822
767
|
client_id: e,
|
|
823
768
|
showHidden: r,
|
|
824
769
|
withPriceCoefficients: n
|
|
825
|
-
}, (e) =>
|
|
770
|
+
}, (e) => j(e.data, (e) => new z(e)));
|
|
826
771
|
}
|
|
827
|
-
},
|
|
772
|
+
}, Xt = class extends e {
|
|
828
773
|
getProductData(e, t, n = !1) {
|
|
829
774
|
return this.get(`/internal/catalog/products/${e}`, {
|
|
830
775
|
clientId: t,
|
|
831
776
|
withPriceCoefficients: n
|
|
832
|
-
}, (e) => new
|
|
777
|
+
}, (e) => new z(e.data));
|
|
833
778
|
}
|
|
834
779
|
getNewProducts(e, t, n, r = !0) {
|
|
835
|
-
let i =
|
|
836
|
-
return this.getTypedPaginated(
|
|
780
|
+
let i = v().config.dateFormats.api;
|
|
781
|
+
return this.getTypedPaginated(z, "/internal/catalog/products/new", void 0, void 0, n, {
|
|
837
782
|
clientId: e,
|
|
838
|
-
period: { from:
|
|
783
|
+
period: { from: C(t, i) },
|
|
839
784
|
withPriceCoefficients: r
|
|
840
785
|
});
|
|
841
786
|
}
|
|
842
|
-
},
|
|
787
|
+
}, Zt = class extends e {
|
|
843
788
|
getTemplateList(e, t, n) {
|
|
844
|
-
return this.getTypedPaginated(
|
|
789
|
+
return this.getTypedPaginated(I, "/internal/price/templates", e, t, n);
|
|
845
790
|
}
|
|
846
791
|
createTemplate(e, t = {}) {
|
|
847
|
-
return this.post("/internal/price/templates", e, (e) => new
|
|
792
|
+
return this.post("/internal/price/templates", e, (e) => new I(e.data), t);
|
|
848
793
|
}
|
|
849
794
|
getTemplate(e) {
|
|
850
|
-
return this.get(`/internal/price/templates/${e}`, {}, (e) => new
|
|
795
|
+
return this.get(`/internal/price/templates/${e}`, {}, (e) => new I(e.data));
|
|
851
796
|
}
|
|
852
797
|
updateTemplate(e, t, n = {}) {
|
|
853
|
-
return this.patch(`/internal/price/templates/${e}`, t, (e) => new
|
|
798
|
+
return this.patch(`/internal/price/templates/${e}`, t, (e) => new I(e.data), n);
|
|
854
799
|
}
|
|
855
800
|
removeTemplate(e) {
|
|
856
801
|
return this.delete(`/internal/price/templates/${e}`);
|
|
857
802
|
}
|
|
858
803
|
getProductTemplatePrices(e) {
|
|
859
|
-
return this.getTypedList(
|
|
804
|
+
return this.getTypedList(Pt, `/internal/price/templates/${e}/products`);
|
|
860
805
|
}
|
|
861
806
|
getProductTemplatePrice(e, t) {
|
|
862
|
-
return this.get(`/internal/price/templates/${e}/products/${t}`, {}, (e) => new
|
|
807
|
+
return this.get(`/internal/price/templates/${e}/products/${t}`, {}, (e) => new Pt(e.data));
|
|
863
808
|
}
|
|
864
809
|
saveProductTemplatePrice(e, t, n) {
|
|
865
810
|
return this.post(`/internal/price/templates/${e}/products/${t}`, {
|
|
866
811
|
price_coefficient_id: n.coefficient?.id,
|
|
867
812
|
increase_percent: n.value
|
|
868
|
-
}, (e) => new
|
|
813
|
+
}, (e) => new Pt(e.data));
|
|
869
814
|
}
|
|
870
815
|
deleteProductTemplatePrice(e, t) {
|
|
871
816
|
return this.delete(`/internal/price/templates/${e}/products/${t}`);
|
|
872
817
|
}
|
|
873
818
|
getCategoryTemplatePrices(e) {
|
|
874
|
-
return this.getTypedList(
|
|
819
|
+
return this.getTypedList(jt, `/internal/price/templates/${e}/categories`);
|
|
875
820
|
}
|
|
876
821
|
getCategoryTemplatePrice(e, t) {
|
|
877
|
-
return this.get(`/internal/price/templates/${e}/categories/${t}`, {}, (e) => new
|
|
822
|
+
return this.get(`/internal/price/templates/${e}/categories/${t}`, {}, (e) => new jt(e.data));
|
|
878
823
|
}
|
|
879
824
|
saveCategoryTemplatePrice(e, t, n, r = !1) {
|
|
880
825
|
return this.request({
|
|
@@ -885,7 +830,7 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
885
830
|
increase_percent: n.value
|
|
886
831
|
},
|
|
887
832
|
params: r ? { recursively: !0 } : {}
|
|
888
|
-
}, (e) => new
|
|
833
|
+
}, (e) => new jt(e.data));
|
|
889
834
|
}
|
|
890
835
|
deleteCategoryTemplatePrice(e, t, n = !1) {
|
|
891
836
|
return this.request({
|
|
@@ -895,62 +840,62 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
895
840
|
});
|
|
896
841
|
}
|
|
897
842
|
getTemplateClients(e) {
|
|
898
|
-
return this.getTypedList(
|
|
843
|
+
return this.getTypedList(W, `/internal/price/templates/${e}/clients`);
|
|
899
844
|
}
|
|
900
|
-
},
|
|
845
|
+
}, Qt = class extends u {
|
|
901
846
|
getRoles() {
|
|
902
|
-
return this.getTypedList(
|
|
847
|
+
return this.getTypedList(q, "/internal/price/roles");
|
|
903
848
|
}
|
|
904
849
|
createRole(e) {
|
|
905
|
-
return this.post("/internal/price/roles", e, (e) => new
|
|
850
|
+
return this.post("/internal/price/roles", e, (e) => new q(e.data));
|
|
906
851
|
}
|
|
907
852
|
getRole(e) {
|
|
908
|
-
return this.get(`/internal/price/roles/${e}`, {}, (e) => new
|
|
853
|
+
return this.get(`/internal/price/roles/${e}`, {}, (e) => new q(e.data));
|
|
909
854
|
}
|
|
910
855
|
updateRole(e, t) {
|
|
911
|
-
return this.patch(`/internal/price/roles/${e}`, t, (e) => new
|
|
856
|
+
return this.patch(`/internal/price/roles/${e}`, t, (e) => new q(e.data));
|
|
912
857
|
}
|
|
913
858
|
deleteRole(e) {
|
|
914
859
|
return this.delete(`/internal/price/roles/${e}`);
|
|
915
860
|
}
|
|
916
861
|
getCategoryRules(e) {
|
|
917
|
-
return this.getTypedList(
|
|
862
|
+
return this.getTypedList(zt, `/internal/price/roles/rules/categories/${e}`);
|
|
918
863
|
}
|
|
919
864
|
updateCategoryRules(e, t) {
|
|
920
|
-
return this.patch(`/internal/price/roles/rules/categories/${e}`, t, (e) =>
|
|
865
|
+
return this.patch(`/internal/price/roles/rules/categories/${e}`, t, (e) => _.instanceListInitializer(zt, e.data));
|
|
921
866
|
}
|
|
922
|
-
},
|
|
867
|
+
}, $t = class extends e {
|
|
923
868
|
getProperties(e, t, n) {
|
|
924
|
-
return this.getTypedPaginated(
|
|
869
|
+
return this.getTypedPaginated(G, "/internal/catalog/properties", e, t, n);
|
|
925
870
|
}
|
|
926
871
|
createProperty(e) {
|
|
927
872
|
let { typeId: t, ...n } = e;
|
|
928
873
|
return this.post("/internal/catalog/properties", {
|
|
929
874
|
...n,
|
|
930
875
|
type: t
|
|
931
|
-
}, (e) => new
|
|
876
|
+
}, (e) => new G(e.data));
|
|
932
877
|
}
|
|
933
878
|
getProperty(e) {
|
|
934
|
-
return this.get(`/internal/catalog/properties/${e}`, {}, (e) => new
|
|
879
|
+
return this.get(`/internal/catalog/properties/${e}`, {}, (e) => new G(e.data));
|
|
935
880
|
}
|
|
936
881
|
updateProperty(e, t) {
|
|
937
882
|
let { typeId: n, ...r } = t;
|
|
938
883
|
return this.patch(`/internal/catalog/properties/${e}`, {
|
|
939
884
|
...r,
|
|
940
885
|
type: n
|
|
941
|
-
}, (e) => new
|
|
886
|
+
}, (e) => new G(e.data));
|
|
942
887
|
}
|
|
943
888
|
deleteProperty(e) {
|
|
944
889
|
return this.delete(`/internal/catalog/properties/${e}`);
|
|
945
890
|
}
|
|
946
891
|
getProductProperties(e) {
|
|
947
|
-
return this.getTypedList(
|
|
892
|
+
return this.getTypedList(K, `/internal/catalog/products/${e}/properties`);
|
|
948
893
|
}
|
|
949
894
|
getProductProperty(e, t) {
|
|
950
|
-
return this.get(`/internal/catalog/products/${e}/properties/${t}`, {}, (e) => new
|
|
895
|
+
return this.get(`/internal/catalog/products/${e}/properties/${t}`, {}, (e) => new K(e.data));
|
|
951
896
|
}
|
|
952
897
|
updateProductProperty(e, t, n) {
|
|
953
|
-
return this.patch(`/internal/catalog/products/${e}/properties/${t}`, { value: n }, (e) => new
|
|
898
|
+
return this.patch(`/internal/catalog/products/${e}/properties/${t}`, { value: n }, (e) => new K(e.data));
|
|
954
899
|
}
|
|
955
900
|
deleteProductProperty(e, t) {
|
|
956
901
|
return this.delete(`/internal/catalog/products/${e}/properties/${t}`);
|
|
@@ -989,13 +934,13 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
989
934
|
return this.patch(`/internal/catalog/products/${e}/properties/slug`, { slug: t });
|
|
990
935
|
}
|
|
991
936
|
getCategoryProperties(e) {
|
|
992
|
-
return this.getTypedList(
|
|
937
|
+
return this.getTypedList(K, `/internal/catalog/categories/${e}/properties`);
|
|
993
938
|
}
|
|
994
939
|
getCategoryProperty(e, t) {
|
|
995
|
-
return this.get(`/internal/catalog/categories/${e}/properties/${t}`, {}, (e) => new
|
|
940
|
+
return this.get(`/internal/catalog/categories/${e}/properties/${t}`, {}, (e) => new K(e.data));
|
|
996
941
|
}
|
|
997
942
|
updateCategoryProperty(e, t, n) {
|
|
998
|
-
return this.patch(`/internal/catalog/categories/${e}/properties/${t}`, { value: n }, (e) => new
|
|
943
|
+
return this.patch(`/internal/catalog/categories/${e}/properties/${t}`, { value: n }, (e) => new K(e.data));
|
|
999
944
|
}
|
|
1000
945
|
deleteCategoryProperty(e, t) {
|
|
1001
946
|
return this.delete(`/internal/catalog/categories/${e}/properties/${t}`);
|
|
@@ -1037,20 +982,20 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
1037
982
|
return this.post(`/internal/catalog/categories/${e}/image`, { image: t });
|
|
1038
983
|
}
|
|
1039
984
|
getCategoryFilters(e, t = !1) {
|
|
1040
|
-
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 Ut(e)));
|
|
1041
986
|
}
|
|
1042
987
|
getCategoryFilterSettings(e) {
|
|
1043
|
-
return this.getTypedList(
|
|
988
|
+
return this.getTypedList(Vt, `/internal/catalog/categories/${e}/filter-settings`);
|
|
1044
989
|
}
|
|
1045
990
|
saveCategoryFilterSetting(e, t, n) {
|
|
1046
|
-
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 Vt(e.data));
|
|
1047
992
|
}
|
|
1048
993
|
deleteCategoryFilterSetting(e, t) {
|
|
1049
994
|
return this.delete(`/internal/catalog/categories/${e}/filter-settings/${t}`);
|
|
1050
995
|
}
|
|
1051
|
-
},
|
|
996
|
+
}, en = class extends u {
|
|
1052
997
|
getRootCategoriesList(e, t = !1) {
|
|
1053
|
-
return this.getTypedList(
|
|
998
|
+
return this.getTypedList(H, "/internal/catalog/categories", {
|
|
1054
999
|
priceTemplateId: e,
|
|
1055
1000
|
showHidden: t
|
|
1056
1001
|
});
|
|
@@ -1060,30 +1005,30 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
1060
1005
|
priceTemplateId: e,
|
|
1061
1006
|
showHidden: n,
|
|
1062
1007
|
withNestedCategories: r
|
|
1063
|
-
}, (e) => new
|
|
1008
|
+
}, (e) => new H(e.data));
|
|
1064
1009
|
}
|
|
1065
1010
|
getCategoryProductsList(e, t, n = !0, r = !1) {
|
|
1066
1011
|
return this.get(`/internal/catalog/categories/${t}/products`, {
|
|
1067
1012
|
priceTemplateId: e,
|
|
1068
1013
|
showHidden: r,
|
|
1069
1014
|
withPriceCoefficients: n
|
|
1070
|
-
}, (e) =>
|
|
1015
|
+
}, (e) => j(e.data, (e) => new R(e)));
|
|
1071
1016
|
}
|
|
1072
1017
|
};
|
|
1073
1018
|
//#endregion
|
|
1074
1019
|
//#region src/catalog/methods/find-catalog-item.ts
|
|
1075
|
-
function
|
|
1020
|
+
function tn(e, t, n) {
|
|
1076
1021
|
let r;
|
|
1077
1022
|
return e.some((e) => {
|
|
1078
1023
|
if (e.type === n && e.id === t) return r = e, !0;
|
|
1079
1024
|
if (e.type === "product") return !1;
|
|
1080
1025
|
let i = e;
|
|
1081
1026
|
if (i.products && i.products.length > 0) {
|
|
1082
|
-
let e =
|
|
1027
|
+
let e = tn(i.products, t, n);
|
|
1083
1028
|
if (e) return r = e, !0;
|
|
1084
1029
|
}
|
|
1085
1030
|
if (i.categories && i.categories.length > 0) {
|
|
1086
|
-
let e =
|
|
1031
|
+
let e = tn(i.categories, t, n);
|
|
1087
1032
|
if (e) return r = e, !0;
|
|
1088
1033
|
}
|
|
1089
1034
|
return !1;
|
|
@@ -1091,35 +1036,35 @@ function rn(e, t, n) {
|
|
|
1091
1036
|
}
|
|
1092
1037
|
//#endregion
|
|
1093
1038
|
//#region src/catalog/methods/flatten-catalog-items.ts
|
|
1094
|
-
function
|
|
1039
|
+
function nn(e) {
|
|
1095
1040
|
let t = [];
|
|
1096
1041
|
return e.forEach((e) => {
|
|
1097
1042
|
if (t.push(e), e.type === "category") {
|
|
1098
1043
|
let n = e;
|
|
1099
|
-
n.products && n.products.length > 0 && t.push(...
|
|
1044
|
+
n.products && n.products.length > 0 && t.push(...nn(n.products)), n.categories && n.categories.length > 0 && t.push(...nn(n.categories));
|
|
1100
1045
|
}
|
|
1101
1046
|
}), t;
|
|
1102
1047
|
}
|
|
1103
1048
|
//#endregion
|
|
1104
1049
|
//#region src/clients/enums/clients-additional-data-request-type-enum.ts
|
|
1105
|
-
var
|
|
1050
|
+
var rn = /* @__PURE__ */ function(e) {
|
|
1106
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;
|
|
1107
|
-
}({}),
|
|
1052
|
+
}({}), an = class extends d {
|
|
1108
1053
|
bankName = "";
|
|
1109
1054
|
bic = "";
|
|
1110
1055
|
accountNumber = "";
|
|
1111
1056
|
correspondentAccount = "";
|
|
1112
|
-
currency = new
|
|
1057
|
+
currency = new o();
|
|
1113
1058
|
constructor(e) {
|
|
1114
|
-
super(e), e && (this.bankName = e.bankName ?? "", this.bic = e.bic ?? "", this.accountNumber = e.accountNumber ?? "", this.correspondentAccount = e.correspondentAccount ?? "", this.currency = new
|
|
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));
|
|
1115
1060
|
}
|
|
1116
|
-
},
|
|
1061
|
+
}, on = class extends ft {
|
|
1117
1062
|
phone;
|
|
1118
1063
|
email;
|
|
1119
1064
|
constructor(e) {
|
|
1120
1065
|
super(e), this.email = e?.email, this.phone = /^\d+$/.test(e?.phone ?? "") ? `+${e?.phone}` : e?.phone;
|
|
1121
1066
|
}
|
|
1122
|
-
},
|
|
1067
|
+
}, J = class extends on {
|
|
1123
1068
|
isPrimary;
|
|
1124
1069
|
position;
|
|
1125
1070
|
notDisturb;
|
|
@@ -1127,9 +1072,9 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1127
1072
|
constructor(e) {
|
|
1128
1073
|
super(e), this.isPrimary = e?.isPrimary ?? !1, this.position = e?.position, this.notDisturb = e?.notDisturb ?? !1, this.comment = e?.comment;
|
|
1129
1074
|
}
|
|
1130
|
-
},
|
|
1131
|
-
opf =
|
|
1132
|
-
partnerGroup = new
|
|
1075
|
+
}, sn = class extends ft {
|
|
1076
|
+
opf = oe.generatePersonItem();
|
|
1077
|
+
partnerGroup = new h();
|
|
1133
1078
|
contacts = [];
|
|
1134
1079
|
bankAccounts = [];
|
|
1135
1080
|
comment;
|
|
@@ -1138,25 +1083,25 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1138
1083
|
updater;
|
|
1139
1084
|
constructor(e) {
|
|
1140
1085
|
if (super(e), e) {
|
|
1141
|
-
if (this.opf = new
|
|
1086
|
+
if (this.opf = new oe(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.creator = e.creator ? new F(e.creator) : void 0, this.updater = e.updater ? new F(e.updater) : void 0, e.partnerGroup && (this.partnerGroup = new h(e.partnerGroup)), e.contacts) {
|
|
1142
1087
|
let t = [];
|
|
1143
1088
|
e.contacts.forEach((e) => {
|
|
1144
|
-
t.push(new
|
|
1089
|
+
t.push(new J(e));
|
|
1145
1090
|
}), this.contacts = t;
|
|
1146
1091
|
}
|
|
1147
1092
|
if (e.bankAccounts) {
|
|
1148
1093
|
let t = [];
|
|
1149
1094
|
e.bankAccounts.forEach((e) => {
|
|
1150
|
-
t.push(new
|
|
1095
|
+
t.push(new an(e));
|
|
1151
1096
|
}), this.bankAccounts = t;
|
|
1152
1097
|
}
|
|
1153
1098
|
}
|
|
1154
1099
|
}
|
|
1155
|
-
},
|
|
1100
|
+
}, cn = class extends sn {
|
|
1156
1101
|
constructor(e) {
|
|
1157
1102
|
super(e);
|
|
1158
1103
|
}
|
|
1159
|
-
},
|
|
1104
|
+
}, ln = class extends sn {
|
|
1160
1105
|
inn = "";
|
|
1161
1106
|
okpo = "";
|
|
1162
1107
|
ogrn = "";
|
|
@@ -1169,34 +1114,34 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1169
1114
|
constructor(e) {
|
|
1170
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 ?? "");
|
|
1171
1116
|
}
|
|
1172
|
-
},
|
|
1117
|
+
}, un = class extends ln {
|
|
1173
1118
|
kpp = "";
|
|
1174
1119
|
constructor(e) {
|
|
1175
1120
|
super(e), e && (this.kpp = e.kpp ?? "");
|
|
1176
1121
|
}
|
|
1177
|
-
},
|
|
1178
|
-
registrationCountry = new
|
|
1122
|
+
}, dn = class extends un {
|
|
1123
|
+
registrationCountry = new i();
|
|
1179
1124
|
registrationNumber = "";
|
|
1180
1125
|
taxNumber = "";
|
|
1181
1126
|
constructor(e) {
|
|
1182
|
-
super(e), e && (this.registrationCountry = new
|
|
1127
|
+
super(e), e && (this.registrationCountry = new i(e.registrationCountry), this.registrationNumber = e.registrationNumber ?? "", this.taxNumber = e.taxNumber ?? "");
|
|
1183
1128
|
}
|
|
1184
|
-
},
|
|
1129
|
+
}, fn = class {
|
|
1185
1130
|
static createInstance(e) {
|
|
1186
1131
|
switch (e.opf.slug) {
|
|
1187
|
-
case
|
|
1188
|
-
case
|
|
1189
|
-
case
|
|
1190
|
-
default: return new
|
|
1132
|
+
case m.Ic: return new ln(e);
|
|
1133
|
+
case m.UlR: return new un(e);
|
|
1134
|
+
case m.UlNr: return new dn(e);
|
|
1135
|
+
default: return new cn(e);
|
|
1191
1136
|
}
|
|
1192
1137
|
}
|
|
1193
|
-
},
|
|
1138
|
+
}, pn = class extends p {
|
|
1194
1139
|
city;
|
|
1195
1140
|
isActive;
|
|
1196
1141
|
constructor(e) {
|
|
1197
|
-
super(e), this.city = e?.city ? new
|
|
1142
|
+
super(e), this.city = e?.city ? new n(e.city) : void 0, this.isActive = e?.isActive ?? !1;
|
|
1198
1143
|
}
|
|
1199
|
-
},
|
|
1144
|
+
}, Y = class extends ft {
|
|
1200
1145
|
address = "";
|
|
1201
1146
|
coordinates;
|
|
1202
1147
|
contacts;
|
|
@@ -1205,9 +1150,9 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1205
1150
|
isOneTime;
|
|
1206
1151
|
isTransportCompanyAddress;
|
|
1207
1152
|
constructor(e) {
|
|
1208
|
-
super(e), this.address = e?.address ?? "", this.coordinates = new
|
|
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;
|
|
1209
1154
|
}
|
|
1210
|
-
},
|
|
1155
|
+
}, mn = class extends U {
|
|
1211
1156
|
contragents;
|
|
1212
1157
|
partnerGroups;
|
|
1213
1158
|
contacts;
|
|
@@ -1218,10 +1163,10 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1218
1163
|
primaryDemand;
|
|
1219
1164
|
preferredWarehouse;
|
|
1220
1165
|
extraData;
|
|
1221
|
-
constructor(
|
|
1222
|
-
super(
|
|
1166
|
+
constructor(e) {
|
|
1167
|
+
super(e), this.contragents = e?.contragents?.map((e) => fn.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 me(e?.sourcePrimaryInterest), this.preferredDeliveryType = new c(e?.preferredDeliveryType), this.primaryDemand = e?.primaryDemand, this.preferredWarehouse = e?.preferredWarehouse ? new ve(e.preferredWarehouse) : void 0, this.extraData = e?.extraData ?? {};
|
|
1223
1168
|
}
|
|
1224
|
-
},
|
|
1169
|
+
}, hn = class extends N {
|
|
1225
1170
|
id;
|
|
1226
1171
|
guid;
|
|
1227
1172
|
name;
|
|
@@ -1233,8 +1178,8 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1233
1178
|
phone;
|
|
1234
1179
|
email;
|
|
1235
1180
|
isActive;
|
|
1236
|
-
createdAt = new
|
|
1237
|
-
lastLoginDate = new
|
|
1181
|
+
createdAt = new P();
|
|
1182
|
+
lastLoginDate = new P();
|
|
1238
1183
|
lastLoginDateHasOrder;
|
|
1239
1184
|
managers;
|
|
1240
1185
|
includeSubordinateManagers;
|
|
@@ -1247,13 +1192,13 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1247
1192
|
partnerGroups;
|
|
1248
1193
|
contact;
|
|
1249
1194
|
lastOrder;
|
|
1250
|
-
noOrdersPeriod = new
|
|
1195
|
+
noOrdersPeriod = new P();
|
|
1251
1196
|
constructor(e) {
|
|
1252
|
-
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
|
|
1253
|
-
createdAt: 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 Mt(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 on(e?.contact), this.lastOrder = {
|
|
1198
|
+
createdAt: new P(e?.lastOrder?.createdAt),
|
|
1254
1199
|
creator: e?.lastOrder?.creator,
|
|
1255
1200
|
isApproved: e?.lastOrder?.isApproved
|
|
1256
|
-
}, this.noOrdersPeriod = new
|
|
1201
|
+
}, this.noOrdersPeriod = new P(e?.noOrdersPeriod);
|
|
1257
1202
|
}
|
|
1258
1203
|
resetFilterValue(e) {
|
|
1259
1204
|
switch (e) {
|
|
@@ -1261,7 +1206,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1261
1206
|
this.cities = [];
|
|
1262
1207
|
break;
|
|
1263
1208
|
case "region":
|
|
1264
|
-
this.region = new
|
|
1209
|
+
this.region = new fe();
|
|
1265
1210
|
break;
|
|
1266
1211
|
case "isActive":
|
|
1267
1212
|
this.isActive = !0;
|
|
@@ -1288,16 +1233,16 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1288
1233
|
this.salesDirections = [];
|
|
1289
1234
|
break;
|
|
1290
1235
|
case "contragentType":
|
|
1291
|
-
this.contragentType = new
|
|
1236
|
+
this.contragentType = new oe();
|
|
1292
1237
|
break;
|
|
1293
1238
|
case "preferredDeliveryType":
|
|
1294
|
-
this.preferredDeliveryType = new
|
|
1239
|
+
this.preferredDeliveryType = new c();
|
|
1295
1240
|
break;
|
|
1296
1241
|
case "partnerGroups":
|
|
1297
1242
|
this.partnerGroups = [];
|
|
1298
1243
|
break;
|
|
1299
1244
|
case "contact":
|
|
1300
|
-
this.contact = new
|
|
1245
|
+
this.contact = new on();
|
|
1301
1246
|
break;
|
|
1302
1247
|
default: this[e] = void 0;
|
|
1303
1248
|
}
|
|
@@ -1307,12 +1252,12 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1307
1252
|
let e = super.asClearRaw();
|
|
1308
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;
|
|
1309
1254
|
}
|
|
1310
|
-
},
|
|
1255
|
+
}, gn = class extends M {
|
|
1311
1256
|
creator;
|
|
1312
1257
|
constructor(e) {
|
|
1313
|
-
super(e), this.creator = new
|
|
1258
|
+
super(e), this.creator = new F(e?.creator);
|
|
1314
1259
|
}
|
|
1315
|
-
},
|
|
1260
|
+
}, _n = class extends p {
|
|
1316
1261
|
contacts = [];
|
|
1317
1262
|
preferredDeliveryType;
|
|
1318
1263
|
partnerGroups = [];
|
|
@@ -1321,23 +1266,23 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1321
1266
|
managers;
|
|
1322
1267
|
curators;
|
|
1323
1268
|
constructor(e) {
|
|
1324
|
-
super(e), this.contacts = e.contacts?.map((e) => new
|
|
1269
|
+
super(e), this.contacts = e.contacts?.map((e) => new J(e)) ?? void 0, this.lastOrder = e.lastOrder ? new gn(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 Mt(e)) ?? void 0;
|
|
1325
1270
|
}
|
|
1326
|
-
},
|
|
1271
|
+
}, vn = class extends d {
|
|
1327
1272
|
isPrimary;
|
|
1328
1273
|
constructor(e) {
|
|
1329
1274
|
super(e), this.isPrimary = e.isPrimary;
|
|
1330
1275
|
}
|
|
1331
|
-
},
|
|
1276
|
+
}, yn = class extends J {
|
|
1332
1277
|
relations = {
|
|
1333
1278
|
clients: [],
|
|
1334
1279
|
contragents: [],
|
|
1335
1280
|
addresses: []
|
|
1336
1281
|
};
|
|
1337
1282
|
constructor(e) {
|
|
1338
|
-
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 vn(e))), e.relations.clients && (this.relations.clients = e.relations.clients.map((e) => new vn(e))), e.relations.contragents && (this.relations.contragents = e.relations.contragents.map((e) => new vn(e))));
|
|
1339
1284
|
}
|
|
1340
|
-
},
|
|
1285
|
+
}, bn = class t extends e {
|
|
1341
1286
|
static transformClientDataToRequest(e) {
|
|
1342
1287
|
return {
|
|
1343
1288
|
name: e.name,
|
|
@@ -1356,7 +1301,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1356
1301
|
static transformContragentClientDataToRequest(e) {
|
|
1357
1302
|
let t, n = e, r = e, i = e;
|
|
1358
1303
|
switch (e.opf.slug) {
|
|
1359
|
-
case
|
|
1304
|
+
case m.Ic:
|
|
1360
1305
|
t = {
|
|
1361
1306
|
opf: n.opf.slug,
|
|
1362
1307
|
name: n.name,
|
|
@@ -1374,7 +1319,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1374
1319
|
actual_address: n.actualAddress
|
|
1375
1320
|
};
|
|
1376
1321
|
break;
|
|
1377
|
-
case
|
|
1322
|
+
case m.UlR:
|
|
1378
1323
|
t = {
|
|
1379
1324
|
opf: r.opf.slug,
|
|
1380
1325
|
name: r.name,
|
|
@@ -1393,7 +1338,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1393
1338
|
actual_address: r.actualAddress
|
|
1394
1339
|
};
|
|
1395
1340
|
break;
|
|
1396
|
-
case
|
|
1341
|
+
case m.UlNr:
|
|
1397
1342
|
t = {
|
|
1398
1343
|
opf: i.opf.slug,
|
|
1399
1344
|
name: i.name,
|
|
@@ -1446,10 +1391,10 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1446
1391
|
};
|
|
1447
1392
|
}
|
|
1448
1393
|
getClient(e) {
|
|
1449
|
-
return this.get(`/internal/clients/${e}`, {}, (e) => new
|
|
1394
|
+
return this.get(`/internal/clients/${e}`, {}, (e) => new mn(e.data));
|
|
1450
1395
|
}
|
|
1451
1396
|
getClientsList(e, t, n, r, i) {
|
|
1452
|
-
return this.getTypedPaginated(
|
|
1397
|
+
return this.getTypedPaginated(U, "/internal/clients", e, t, n, r, void 0, i);
|
|
1453
1398
|
}
|
|
1454
1399
|
searchClient(e) {
|
|
1455
1400
|
return this.getClientsList(void 0, void 0, void 0, { searchTerm: e }).then((e) => e.data);
|
|
@@ -1460,7 +1405,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1460
1405
|
groups: [],
|
|
1461
1406
|
filters: [{
|
|
1462
1407
|
field: "phone",
|
|
1463
|
-
op:
|
|
1408
|
+
op: te.Contains,
|
|
1464
1409
|
value: e
|
|
1465
1410
|
}]
|
|
1466
1411
|
});
|
|
@@ -1470,16 +1415,16 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1470
1415
|
return this.post("/internal/clients/additional-data", {
|
|
1471
1416
|
clients: n,
|
|
1472
1417
|
requested_data_types: t
|
|
1473
|
-
}, (e) =>
|
|
1418
|
+
}, (e) => _.instanceListInitializer(_n, e.data));
|
|
1474
1419
|
}
|
|
1475
1420
|
getAllClientContacts(e) {
|
|
1476
|
-
return this.getTypedList(
|
|
1421
|
+
return this.getTypedList(yn, `/internal/clients/${e}/contacts/all`);
|
|
1477
1422
|
}
|
|
1478
|
-
createClientCommonData(
|
|
1479
|
-
return this.post("/internal/clients",
|
|
1423
|
+
createClientCommonData(e, n = {}) {
|
|
1424
|
+
return this.post("/internal/clients", t.transformClientDataToRequest(e), (e) => new mn(e.data), n);
|
|
1480
1425
|
}
|
|
1481
|
-
updateClientCommonData(
|
|
1482
|
-
return this.patch(`/internal/clients/${
|
|
1426
|
+
updateClientCommonData(e, n = {}) {
|
|
1427
|
+
return this.patch(`/internal/clients/${e.id}`, t.transformClientDataToRequest(e), void 0, n);
|
|
1483
1428
|
}
|
|
1484
1429
|
updateClientNotDistribCommonData(e, t = {}) {
|
|
1485
1430
|
let n = { get_news: e.getNews };
|
|
@@ -1517,32 +1462,32 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1517
1462
|
curated_direction_id: e.curatedDirection.id
|
|
1518
1463
|
})) });
|
|
1519
1464
|
}
|
|
1520
|
-
createContragentClientData(
|
|
1521
|
-
return this.post(`/internal/clients/${
|
|
1465
|
+
createContragentClientData(e, n, r = {}) {
|
|
1466
|
+
return this.post(`/internal/clients/${e}/contragents`, t.transformContragentClientDataToRequest(n), (e) => fn.createInstance(e.data), r);
|
|
1522
1467
|
}
|
|
1523
|
-
updateContragentClientData(
|
|
1524
|
-
return this.patch(`/internal/clients/${
|
|
1468
|
+
updateContragentClientData(e, n, r = {}) {
|
|
1469
|
+
return this.patch(`/internal/clients/${e}/contragents/${n.id}`, t.transformContragentClientDataToRequest(n), (e) => fn.createInstance(e.data), r);
|
|
1525
1470
|
}
|
|
1526
1471
|
deleteClientContragent(e, t) {
|
|
1527
1472
|
return this.delete(`/internal/clients/${e}/contragents/${t.id}`);
|
|
1528
1473
|
}
|
|
1529
1474
|
getClientDeliveryAddresses(e) {
|
|
1530
|
-
return this.getTypedList(
|
|
1475
|
+
return this.getTypedList(Y, `/internal/clients/${e}/delivery-addresses`);
|
|
1531
1476
|
}
|
|
1532
|
-
createClientDeliveryAddress(
|
|
1533
|
-
return this.post(`/internal/clients/${
|
|
1477
|
+
createClientDeliveryAddress(e, n, r = {}) {
|
|
1478
|
+
return this.post(`/internal/clients/${e}/delivery-addresses`, t.transformClientDeliveryAddressToRequest(n), (e) => new Y(e.data), r);
|
|
1534
1479
|
}
|
|
1535
|
-
updateClientDeliveryAddress(
|
|
1536
|
-
return this.patch(`/internal/clients/${
|
|
1480
|
+
updateClientDeliveryAddress(e, n, r = {}) {
|
|
1481
|
+
return this.patch(`/internal/clients/${e}/delivery-addresses/${n.id}`, t.transformClientDeliveryAddressToRequest(n), (e) => new Y(e.data), r);
|
|
1537
1482
|
}
|
|
1538
1483
|
deleteClientDeliveryAddress(e, t) {
|
|
1539
1484
|
return this.delete(`/internal/clients/${e}/delivery-addresses/${t.id}`);
|
|
1540
1485
|
}
|
|
1541
|
-
createContragentBankAccount(
|
|
1542
|
-
return this.post(`/internal/clients/${
|
|
1486
|
+
createContragentBankAccount(e, n, r, i = {}) {
|
|
1487
|
+
return this.post(`/internal/clients/${e}/contragents/${n}/bank-accounts`, t.transformClientContragentBankAccountToRequest(r), (e) => new an(e.data), i);
|
|
1543
1488
|
}
|
|
1544
|
-
updateContragentBankAccount(
|
|
1545
|
-
return this.patch(`/internal/clients/${
|
|
1489
|
+
updateContragentBankAccount(e, n, r, i = {}) {
|
|
1490
|
+
return this.patch(`/internal/clients/${e}/contragents/${n}/bank-accounts/${r.id}`, t.transformClientContragentBankAccountToRequest(r), (e) => new an(e.data), i);
|
|
1546
1491
|
}
|
|
1547
1492
|
deleteContragentBankAccount(e, t, n) {
|
|
1548
1493
|
return this.delete(`/internal/clients/${e}/contragents/${t}/bank-accounts/${n.id}`);
|
|
@@ -1562,7 +1507,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1562
1507
|
email: t.email,
|
|
1563
1508
|
comment: t.comment,
|
|
1564
1509
|
not_disturb: t.notDisturb
|
|
1565
|
-
}, (e) => new
|
|
1510
|
+
}, (e) => new J(e.data), n);
|
|
1566
1511
|
}
|
|
1567
1512
|
setPrimaryClientContact(e, t) {
|
|
1568
1513
|
return this.setPrimaryContact(`/internal/clients/${e}/contacts/${t.id}/primary`, t.isPrimary ?? !1);
|
|
@@ -1603,7 +1548,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1603
1548
|
comment: t.comment,
|
|
1604
1549
|
...n
|
|
1605
1550
|
};
|
|
1606
|
-
return t.phone?.length && (i.phone = t.phone), t.email?.length && (i.email = t.email), this.post(`/internal/clients/${e}/contacts`, i, (e) => new
|
|
1551
|
+
return t.phone?.length && (i.phone = t.phone), t.email?.length && (i.email = t.email), this.post(`/internal/clients/${e}/contacts`, i, (e) => new J(e.data), r);
|
|
1607
1552
|
}
|
|
1608
1553
|
setPrimaryContact(e, t) {
|
|
1609
1554
|
return this.patch(e, { is_primary: t });
|
|
@@ -1614,7 +1559,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1614
1559
|
sendClientEmailConfirmation(e) {
|
|
1615
1560
|
return this.get(`/internal/clients/${e.id}/verification/email?email=${e.email}`);
|
|
1616
1561
|
}
|
|
1617
|
-
},
|
|
1562
|
+
}, xn = class extends u {
|
|
1618
1563
|
checkPhoneIsBusy(e) {
|
|
1619
1564
|
return new Promise((t, n) => {
|
|
1620
1565
|
this.request({
|
|
@@ -1626,16 +1571,16 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1626
1571
|
}).catch(n);
|
|
1627
1572
|
});
|
|
1628
1573
|
}
|
|
1629
|
-
},
|
|
1574
|
+
}, Sn = class {
|
|
1630
1575
|
date;
|
|
1631
1576
|
name;
|
|
1632
1577
|
version;
|
|
1633
1578
|
constructor(e) {
|
|
1634
|
-
this.date =
|
|
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";
|
|
1635
1580
|
}
|
|
1636
|
-
},
|
|
1581
|
+
}, Cn = /* @__PURE__ */ function(e) {
|
|
1637
1582
|
return e.Kozyrek = "kozyrek", e.Mosquitto = "mosquitto", e.Strip = "strip", e.MetalForDoors = "metal_for_doors", e.Sandwich = "sandwich", e.SandwichM2 = "sandwich_m2", e;
|
|
1638
|
-
}({}),
|
|
1583
|
+
}({}), wn = class extends u {
|
|
1639
1584
|
getConfiguratorSettings(e, t) {
|
|
1640
1585
|
return this.get(`internal/catalog/categories/${e.id}/configurators/${e.properties?.configurator}/settings?client_id=${t}`);
|
|
1641
1586
|
}
|
|
@@ -1647,7 +1592,7 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1647
1592
|
params: n,
|
|
1648
1593
|
client_id: t
|
|
1649
1594
|
}
|
|
1650
|
-
}, (e) => new
|
|
1595
|
+
}, (e) => new R(e.data), r);
|
|
1651
1596
|
}
|
|
1652
1597
|
createTemplate(e, t, n, r = {}) {
|
|
1653
1598
|
return this.post(`internal/catalog/categories/${e.id}/configurators/${e.properties?.configurator}/template?client_id=${t}`, { ...n }, () => {}, r);
|
|
@@ -1661,13 +1606,13 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1661
1606
|
...n
|
|
1662
1607
|
});
|
|
1663
1608
|
}
|
|
1664
|
-
},
|
|
1609
|
+
}, Tn = class {
|
|
1665
1610
|
page = 1;
|
|
1666
1611
|
pageSize = 50;
|
|
1667
1612
|
constructor(e) {
|
|
1668
1613
|
this.page = e?.page ?? 1, this.pageSize = e?.pageSize ?? 50;
|
|
1669
1614
|
}
|
|
1670
|
-
},
|
|
1615
|
+
}, En = class extends Tn {
|
|
1671
1616
|
itemCount = 0;
|
|
1672
1617
|
pageCount = 1;
|
|
1673
1618
|
pageSlot = 5;
|
|
@@ -1684,13 +1629,13 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1684
1629
|
100
|
|
1685
1630
|
], this.showSizePicker = e?.showSizePicker ?? !0;
|
|
1686
1631
|
}
|
|
1687
|
-
},
|
|
1632
|
+
}, Dn = class {
|
|
1688
1633
|
field;
|
|
1689
1634
|
direction;
|
|
1690
1635
|
constructor(e) {
|
|
1691
1636
|
this.field = e?.field ?? "", this.direction = e?.direction ?? "asc";
|
|
1692
1637
|
}
|
|
1693
|
-
},
|
|
1638
|
+
}, X = class e {
|
|
1694
1639
|
static decadeInterval(t) {
|
|
1695
1640
|
let [n, r] = e.shiftedDecadeBounds(t, 0);
|
|
1696
1641
|
return {
|
|
@@ -1709,47 +1654,47 @@ var on = /* @__PURE__ */ function(e) {
|
|
|
1709
1654
|
return new Date(e.getFullYear(), e.getMonth() < 6 ? 0 : 6, 1);
|
|
1710
1655
|
}
|
|
1711
1656
|
static endOfHalfYear(e) {
|
|
1712
|
-
return
|
|
1657
|
+
return S(new Date(e.getFullYear(), e.getMonth() < 6 ? 5 : 11, 1));
|
|
1713
1658
|
}
|
|
1714
1659
|
static addHalfYears(e, t) {
|
|
1715
|
-
return
|
|
1660
|
+
return b(e, t * 6);
|
|
1716
1661
|
}
|
|
1717
1662
|
static intervalTillSameDate(e, t, n) {
|
|
1718
|
-
let r =
|
|
1663
|
+
let r = we(E(n), E(e)), i = E(b(t, r)), a = Math.min(je(n), Me(i));
|
|
1719
1664
|
return {
|
|
1720
|
-
from:
|
|
1721
|
-
to:
|
|
1665
|
+
from: T(t),
|
|
1666
|
+
to: x(Ne(i, a))
|
|
1722
1667
|
};
|
|
1723
1668
|
}
|
|
1724
1669
|
static weekTillSameWeekday(e, t) {
|
|
1725
|
-
let n =
|
|
1670
|
+
let n = D(xe(e, t), { weekStartsOn: 1 }), r = Ce(e, D(e, { weekStartsOn: 1 }));
|
|
1726
1671
|
return {
|
|
1727
1672
|
from: n,
|
|
1728
|
-
to: y(
|
|
1673
|
+
to: x(y(n, r))
|
|
1729
1674
|
};
|
|
1730
1675
|
}
|
|
1731
1676
|
static decadeTillSameDayNumber(t, n) {
|
|
1732
|
-
let [r] = e.shiftedDecadeBounds(t, 0), i =
|
|
1677
|
+
let [r] = e.shiftedDecadeBounds(t, 0), i = Ce(t, r) + 1, [a, o] = e.shiftedDecadeBounds(t, n), s = Ce(o, a) + 1;
|
|
1733
1678
|
return {
|
|
1734
1679
|
from: a,
|
|
1735
|
-
to: y(
|
|
1680
|
+
to: x(y(a, Math.min(i, s) - 1))
|
|
1736
1681
|
};
|
|
1737
1682
|
}
|
|
1738
1683
|
static shiftedDecadeBounds(e, t) {
|
|
1739
|
-
let n =
|
|
1684
|
+
let n = je(e), r = 2;
|
|
1740
1685
|
n <= 10 ? r = 0 : n <= 20 && (r = 1);
|
|
1741
|
-
let i = r + t, a = Math.floor(i / 3), o = (i % 3 + 3) % 3, s =
|
|
1742
|
-
return [c, o === 2 ?
|
|
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
|
+
return [c, o === 2 ? S(s) : x(y(c, 9))];
|
|
1743
1688
|
}
|
|
1744
1689
|
};
|
|
1745
1690
|
//#endregion
|
|
1746
1691
|
//#region src/date-time/helpers/days-ago-iso.ts
|
|
1747
|
-
function
|
|
1748
|
-
return
|
|
1692
|
+
function On(e) {
|
|
1693
|
+
return C(Re(Fe(), e), "yyyy-MM-dd");
|
|
1749
1694
|
}
|
|
1750
1695
|
//#endregion
|
|
1751
1696
|
//#region src/i18n/helpers/pluralize.ts
|
|
1752
|
-
function
|
|
1697
|
+
function kn(e, t) {
|
|
1753
1698
|
let n = [
|
|
1754
1699
|
2,
|
|
1755
1700
|
0,
|
|
@@ -1762,13 +1707,13 @@ function jn(e, t) {
|
|
|
1762
1707
|
}
|
|
1763
1708
|
//#endregion
|
|
1764
1709
|
//#region src/date-time/helpers/format-relative-date.ts
|
|
1765
|
-
function
|
|
1766
|
-
let t =
|
|
1710
|
+
function An(e) {
|
|
1711
|
+
let t = w(e), n = Ce(Fe(), t);
|
|
1767
1712
|
switch (!0) {
|
|
1768
1713
|
case n === 0: return "Сегодня";
|
|
1769
1714
|
case n === 1: return "Вчера";
|
|
1770
1715
|
case n < 0: return e;
|
|
1771
|
-
default: return `${n} ${
|
|
1716
|
+
default: return `${n} ${kn(n, [
|
|
1772
1717
|
"день",
|
|
1773
1718
|
"дня",
|
|
1774
1719
|
"дней"
|
|
@@ -1777,83 +1722,83 @@ function Mn(e) {
|
|
|
1777
1722
|
}
|
|
1778
1723
|
//#endregion
|
|
1779
1724
|
//#region src/date-time/providers/date-time-provider.ts
|
|
1780
|
-
var
|
|
1725
|
+
var jn = class {
|
|
1781
1726
|
static defaultDateRanges(e) {
|
|
1782
|
-
let t =
|
|
1727
|
+
let t = ye(/* @__PURE__ */ new Date(), 1), n = /* @__PURE__ */ new Date(), r = O(e === void 0 ? n : new Date(e, 0, 1)), i = ke(r);
|
|
1783
1728
|
return {
|
|
1784
1729
|
nextWorkingDay: {
|
|
1785
1730
|
label: "Следующий рабочий день",
|
|
1786
|
-
from:
|
|
1787
|
-
to:
|
|
1731
|
+
from: T(t),
|
|
1732
|
+
to: x(t)
|
|
1788
1733
|
},
|
|
1789
1734
|
today: {
|
|
1790
1735
|
label: "Сегодня",
|
|
1791
|
-
from:
|
|
1792
|
-
to:
|
|
1736
|
+
from: Fe(),
|
|
1737
|
+
to: Ee()
|
|
1793
1738
|
},
|
|
1794
1739
|
yesterday: {
|
|
1795
1740
|
label: "Вчера",
|
|
1796
|
-
from:
|
|
1797
|
-
to:
|
|
1741
|
+
from: Le(),
|
|
1742
|
+
to: Ae()
|
|
1798
1743
|
},
|
|
1799
1744
|
tomorrow: {
|
|
1800
1745
|
label: "Завтра",
|
|
1801
|
-
from:
|
|
1802
|
-
to:
|
|
1746
|
+
from: Ie(),
|
|
1747
|
+
to: De()
|
|
1803
1748
|
},
|
|
1804
1749
|
currentWeek: {
|
|
1805
1750
|
label: "Неделя",
|
|
1806
|
-
from:
|
|
1807
|
-
to:
|
|
1751
|
+
from: D(n, { weekStartsOn: 1 }),
|
|
1752
|
+
to: Oe(n, { weekStartsOn: 1 })
|
|
1808
1753
|
},
|
|
1809
1754
|
currentMonth: {
|
|
1810
1755
|
label: "Месяц",
|
|
1811
|
-
from:
|
|
1812
|
-
to:
|
|
1756
|
+
from: E(n),
|
|
1757
|
+
to: S(n)
|
|
1813
1758
|
},
|
|
1814
1759
|
oneMonth: {
|
|
1815
1760
|
label: "1 месяц",
|
|
1816
1761
|
from: r,
|
|
1817
|
-
to:
|
|
1762
|
+
to: S(r)
|
|
1818
1763
|
},
|
|
1819
1764
|
threeMonths: {
|
|
1820
1765
|
label: "3 месяца",
|
|
1821
1766
|
from: r,
|
|
1822
|
-
to: b(
|
|
1767
|
+
to: S(b(r, 2))
|
|
1823
1768
|
},
|
|
1824
1769
|
nineMonths: {
|
|
1825
1770
|
label: "9 месяцев",
|
|
1826
1771
|
from: r,
|
|
1827
|
-
to: b(
|
|
1772
|
+
to: S(b(r, 8))
|
|
1828
1773
|
},
|
|
1829
1774
|
firstQuarter: {
|
|
1830
1775
|
label: "I квартал",
|
|
1831
1776
|
from: r,
|
|
1832
|
-
to: b(
|
|
1777
|
+
to: S(b(r, 2))
|
|
1833
1778
|
},
|
|
1834
1779
|
secondQuarter: {
|
|
1835
1780
|
label: "II квартал",
|
|
1836
|
-
from:
|
|
1837
|
-
to: b(
|
|
1781
|
+
from: b(r, 3),
|
|
1782
|
+
to: S(b(r, 5))
|
|
1838
1783
|
},
|
|
1839
1784
|
thirdQuarter: {
|
|
1840
1785
|
label: "III квартал",
|
|
1841
|
-
from:
|
|
1842
|
-
to: b(
|
|
1786
|
+
from: b(r, 6),
|
|
1787
|
+
to: S(b(r, 8))
|
|
1843
1788
|
},
|
|
1844
1789
|
fourthQuarter: {
|
|
1845
1790
|
label: "IV квартал",
|
|
1846
|
-
from:
|
|
1847
|
-
to: b(
|
|
1791
|
+
from: b(r, 9),
|
|
1792
|
+
to: S(b(r, 11))
|
|
1848
1793
|
},
|
|
1849
1794
|
firstHalfYear: {
|
|
1850
1795
|
label: "I полугодие",
|
|
1851
1796
|
from: r,
|
|
1852
|
-
to: b(
|
|
1797
|
+
to: S(b(r, 5))
|
|
1853
1798
|
},
|
|
1854
1799
|
secondHalfYear: {
|
|
1855
1800
|
label: "II полугодие",
|
|
1856
|
-
from:
|
|
1801
|
+
from: b(r, 6),
|
|
1857
1802
|
to: i
|
|
1858
1803
|
},
|
|
1859
1804
|
currentYear: {
|
|
@@ -1864,13 +1809,13 @@ var Nn = class {
|
|
|
1864
1809
|
};
|
|
1865
1810
|
}
|
|
1866
1811
|
static standardPeriods(e = /* @__PURE__ */ new Date()) {
|
|
1867
|
-
let t = { weekStartsOn: 1 }, n =
|
|
1812
|
+
let t = { weekStartsOn: 1 }, n = T(e), r = x(e), i = X.decadeInterval(e), a = E(e), o = Pe(e), s = X.startOfHalfYear(e), c = O(e), ee = X.addHalfYears(e, -1), l = X.addHalfYears(e, 1);
|
|
1868
1813
|
return {
|
|
1869
1814
|
yesterday: {
|
|
1870
1815
|
label: "Вчера",
|
|
1871
1816
|
group: "day",
|
|
1872
|
-
from:
|
|
1873
|
-
to:
|
|
1817
|
+
from: T(Re(e, 1)),
|
|
1818
|
+
to: x(Re(e, 1))
|
|
1874
1819
|
},
|
|
1875
1820
|
today: {
|
|
1876
1821
|
label: "Сегодня",
|
|
@@ -1881,31 +1826,31 @@ var Nn = class {
|
|
|
1881
1826
|
tomorrow: {
|
|
1882
1827
|
label: "Завтра",
|
|
1883
1828
|
group: "day",
|
|
1884
|
-
from:
|
|
1885
|
-
to: y(
|
|
1829
|
+
from: T(y(e, 1)),
|
|
1830
|
+
to: x(y(e, 1))
|
|
1886
1831
|
},
|
|
1887
1832
|
lastWeek: {
|
|
1888
1833
|
label: "Прошлая неделя",
|
|
1889
1834
|
group: "week",
|
|
1890
|
-
from:
|
|
1891
|
-
to:
|
|
1835
|
+
from: D(Ve(e, 1), t),
|
|
1836
|
+
to: Oe(Ve(e, 1), t)
|
|
1892
1837
|
},
|
|
1893
1838
|
thisWeek: {
|
|
1894
1839
|
label: "Эта неделя",
|
|
1895
1840
|
group: "week",
|
|
1896
|
-
from:
|
|
1897
|
-
to:
|
|
1841
|
+
from: D(e, t),
|
|
1842
|
+
to: Oe(e, t)
|
|
1898
1843
|
},
|
|
1899
1844
|
nextWeek: {
|
|
1900
1845
|
label: "Следующая неделя",
|
|
1901
1846
|
group: "week",
|
|
1902
|
-
from:
|
|
1903
|
-
to:
|
|
1847
|
+
from: D(xe(e, 1), t),
|
|
1848
|
+
to: Oe(xe(e, 1), t)
|
|
1904
1849
|
},
|
|
1905
1850
|
lastTenDays: {
|
|
1906
1851
|
label: "Прошлая декада",
|
|
1907
1852
|
group: "decade",
|
|
1908
|
-
...
|
|
1853
|
+
...X.shiftDecadeInterval(e, -1)
|
|
1909
1854
|
},
|
|
1910
1855
|
thisTenDays: {
|
|
1911
1856
|
label: "Эта декада",
|
|
@@ -1915,85 +1860,85 @@ var Nn = class {
|
|
|
1915
1860
|
nextTenDays: {
|
|
1916
1861
|
label: "Следующая декада",
|
|
1917
1862
|
group: "decade",
|
|
1918
|
-
...
|
|
1863
|
+
...X.shiftDecadeInterval(e, 1)
|
|
1919
1864
|
},
|
|
1920
1865
|
lastMonth: {
|
|
1921
1866
|
label: "Прошлый месяц",
|
|
1922
1867
|
group: "month",
|
|
1923
|
-
from:
|
|
1924
|
-
to:
|
|
1868
|
+
from: E(ze(e, 1)),
|
|
1869
|
+
to: S(ze(e, 1))
|
|
1925
1870
|
},
|
|
1926
1871
|
thisMonth: {
|
|
1927
1872
|
label: "Этот месяц",
|
|
1928
1873
|
group: "month",
|
|
1929
1874
|
from: a,
|
|
1930
|
-
to:
|
|
1875
|
+
to: S(e)
|
|
1931
1876
|
},
|
|
1932
1877
|
nextMonth: {
|
|
1933
1878
|
label: "Следующий месяц",
|
|
1934
1879
|
group: "month",
|
|
1935
|
-
from:
|
|
1936
|
-
to: b(
|
|
1880
|
+
from: E(b(e, 1)),
|
|
1881
|
+
to: S(b(e, 1))
|
|
1937
1882
|
},
|
|
1938
1883
|
lastQuarter: {
|
|
1939
1884
|
label: "Прошлый квартал",
|
|
1940
1885
|
group: "quarter",
|
|
1941
|
-
from:
|
|
1942
|
-
to:
|
|
1886
|
+
from: Pe(Be(e, 1)),
|
|
1887
|
+
to: Te(Be(e, 1))
|
|
1943
1888
|
},
|
|
1944
1889
|
thisQuarter: {
|
|
1945
1890
|
label: "Этот квартал",
|
|
1946
1891
|
group: "quarter",
|
|
1947
1892
|
from: o,
|
|
1948
|
-
to:
|
|
1893
|
+
to: Te(e)
|
|
1949
1894
|
},
|
|
1950
1895
|
nextQuarter: {
|
|
1951
1896
|
label: "Следующий квартал",
|
|
1952
1897
|
group: "quarter",
|
|
1953
|
-
from:
|
|
1954
|
-
to:
|
|
1898
|
+
from: Pe(be(e, 1)),
|
|
1899
|
+
to: Te(be(e, 1))
|
|
1955
1900
|
},
|
|
1956
1901
|
lastHalfYear: {
|
|
1957
1902
|
label: "Прошлое полугодие",
|
|
1958
1903
|
group: "halfYear",
|
|
1959
|
-
from:
|
|
1960
|
-
to:
|
|
1904
|
+
from: X.startOfHalfYear(ee),
|
|
1905
|
+
to: X.endOfHalfYear(ee)
|
|
1961
1906
|
},
|
|
1962
1907
|
thisHalfYear: {
|
|
1963
1908
|
label: "Это полугодие",
|
|
1964
1909
|
group: "halfYear",
|
|
1965
1910
|
from: s,
|
|
1966
|
-
to:
|
|
1911
|
+
to: X.endOfHalfYear(e)
|
|
1967
1912
|
},
|
|
1968
1913
|
nextHalfYear: {
|
|
1969
1914
|
label: "Следующее полугодие",
|
|
1970
1915
|
group: "halfYear",
|
|
1971
|
-
from:
|
|
1972
|
-
to:
|
|
1916
|
+
from: X.startOfHalfYear(l),
|
|
1917
|
+
to: X.endOfHalfYear(l)
|
|
1973
1918
|
},
|
|
1974
1919
|
lastYear: {
|
|
1975
1920
|
label: "Прошлый год",
|
|
1976
1921
|
group: "year",
|
|
1977
|
-
from:
|
|
1978
|
-
to:
|
|
1922
|
+
from: O(He(e, 1)),
|
|
1923
|
+
to: ke(He(e, 1))
|
|
1979
1924
|
},
|
|
1980
1925
|
thisYear: {
|
|
1981
1926
|
label: "Этот год",
|
|
1982
1927
|
group: "year",
|
|
1983
1928
|
from: c,
|
|
1984
|
-
to:
|
|
1929
|
+
to: ke(e)
|
|
1985
1930
|
},
|
|
1986
1931
|
nextYear: {
|
|
1987
1932
|
label: "Следующий год",
|
|
1988
1933
|
group: "year",
|
|
1989
|
-
from:
|
|
1990
|
-
to:
|
|
1934
|
+
from: O(Se(e, 1)),
|
|
1935
|
+
to: ke(Se(e, 1))
|
|
1991
1936
|
},
|
|
1992
1937
|
fromBeginningOfThisWeek: {
|
|
1993
1938
|
label: "С начала этой недели",
|
|
1994
1939
|
group: "other",
|
|
1995
1940
|
section: "fromBeginning",
|
|
1996
|
-
from:
|
|
1941
|
+
from: D(e, t),
|
|
1997
1942
|
to: r
|
|
1998
1943
|
},
|
|
1999
1944
|
fromBeginningOfThisTenDays: {
|
|
@@ -2036,7 +1981,7 @@ var Nn = class {
|
|
|
2036
1981
|
group: "other",
|
|
2037
1982
|
section: "tillEnd",
|
|
2038
1983
|
from: n,
|
|
2039
|
-
to:
|
|
1984
|
+
to: Oe(e, t)
|
|
2040
1985
|
},
|
|
2041
1986
|
tillEndOfThisTenDays: {
|
|
2042
1987
|
label: "До конца этой декады",
|
|
@@ -2050,106 +1995,106 @@ var Nn = class {
|
|
|
2050
1995
|
group: "other",
|
|
2051
1996
|
section: "tillEnd",
|
|
2052
1997
|
from: n,
|
|
2053
|
-
to:
|
|
1998
|
+
to: S(e)
|
|
2054
1999
|
},
|
|
2055
2000
|
tillEndOfThisQuarter: {
|
|
2056
2001
|
label: "До конца этого квартала",
|
|
2057
2002
|
group: "other",
|
|
2058
2003
|
section: "tillEnd",
|
|
2059
2004
|
from: n,
|
|
2060
|
-
to:
|
|
2005
|
+
to: Te(e)
|
|
2061
2006
|
},
|
|
2062
2007
|
tillEndOfThisHalfYear: {
|
|
2063
2008
|
label: "До конца этого полугодия",
|
|
2064
2009
|
group: "other",
|
|
2065
2010
|
section: "tillEnd",
|
|
2066
2011
|
from: n,
|
|
2067
|
-
to:
|
|
2012
|
+
to: X.endOfHalfYear(e)
|
|
2068
2013
|
},
|
|
2069
2014
|
tillEndOfThisYear: {
|
|
2070
2015
|
label: "До конца этого года",
|
|
2071
2016
|
group: "other",
|
|
2072
2017
|
section: "tillEnd",
|
|
2073
2018
|
from: n,
|
|
2074
|
-
to:
|
|
2019
|
+
to: ke(e)
|
|
2075
2020
|
},
|
|
2076
2021
|
lastWeekTillSameWeekDay: {
|
|
2077
2022
|
label: "Прошлая неделя, до такого же дня недели",
|
|
2078
2023
|
group: "other",
|
|
2079
2024
|
section: "lastTillSame",
|
|
2080
|
-
...
|
|
2025
|
+
...X.weekTillSameWeekday(e, -1)
|
|
2081
2026
|
},
|
|
2082
2027
|
lastTenDaysTillSameDayNumber: {
|
|
2083
2028
|
label: "Прошлая декада, до такого же номера дня",
|
|
2084
2029
|
group: "other",
|
|
2085
2030
|
section: "lastTillSame",
|
|
2086
|
-
...
|
|
2031
|
+
...X.decadeTillSameDayNumber(e, -1)
|
|
2087
2032
|
},
|
|
2088
2033
|
lastMonthTillSameDate: {
|
|
2089
2034
|
label: "Прошлый месяц, до такой же даты",
|
|
2090
2035
|
group: "other",
|
|
2091
2036
|
section: "lastTillSame",
|
|
2092
|
-
...
|
|
2037
|
+
...X.intervalTillSameDate(a, E(ze(e, 1)), e)
|
|
2093
2038
|
},
|
|
2094
2039
|
lastQuarterTillSameDate: {
|
|
2095
2040
|
label: "Прошлый квартал, до такой же даты",
|
|
2096
2041
|
group: "other",
|
|
2097
2042
|
section: "lastTillSame",
|
|
2098
|
-
...
|
|
2043
|
+
...X.intervalTillSameDate(o, Pe(Be(e, 1)), e)
|
|
2099
2044
|
},
|
|
2100
2045
|
lastHalfYearTillSameDate: {
|
|
2101
2046
|
label: "Прошлое полугодие, до такой же даты",
|
|
2102
2047
|
group: "other",
|
|
2103
2048
|
section: "lastTillSame",
|
|
2104
|
-
...
|
|
2049
|
+
...X.intervalTillSameDate(s, X.startOfHalfYear(ee), e)
|
|
2105
2050
|
},
|
|
2106
2051
|
lastYearTillSameDate: {
|
|
2107
2052
|
label: "Прошлый год, до такой же даты",
|
|
2108
2053
|
group: "other",
|
|
2109
2054
|
section: "lastTillSame",
|
|
2110
|
-
...
|
|
2055
|
+
...X.intervalTillSameDate(c, O(He(e, 1)), e)
|
|
2111
2056
|
},
|
|
2112
2057
|
nextWeekTillSameWeekDay: {
|
|
2113
2058
|
label: "Следующая неделя, до такого же дня недели",
|
|
2114
2059
|
group: "other",
|
|
2115
2060
|
section: "nextTillSame",
|
|
2116
|
-
...
|
|
2061
|
+
...X.weekTillSameWeekday(e, 1)
|
|
2117
2062
|
},
|
|
2118
2063
|
nextTenDaysTillSameDayNumber: {
|
|
2119
2064
|
label: "Следующая декада, до такого же номера дня",
|
|
2120
2065
|
group: "other",
|
|
2121
2066
|
section: "nextTillSame",
|
|
2122
|
-
...
|
|
2067
|
+
...X.decadeTillSameDayNumber(e, 1)
|
|
2123
2068
|
},
|
|
2124
2069
|
nextMonthTillSameDate: {
|
|
2125
2070
|
label: "Следующий месяц, до такой же даты",
|
|
2126
2071
|
group: "other",
|
|
2127
2072
|
section: "nextTillSame",
|
|
2128
|
-
...
|
|
2073
|
+
...X.intervalTillSameDate(a, E(b(e, 1)), e)
|
|
2129
2074
|
},
|
|
2130
2075
|
nextQuarterTillSameDate: {
|
|
2131
2076
|
label: "Следующий квартал, до такой же даты",
|
|
2132
2077
|
group: "other",
|
|
2133
2078
|
section: "nextTillSame",
|
|
2134
|
-
...
|
|
2079
|
+
...X.intervalTillSameDate(o, Pe(be(e, 1)), e)
|
|
2135
2080
|
},
|
|
2136
2081
|
nextHalfYearTillSameDate: {
|
|
2137
2082
|
label: "Следующее полугодие, до такой же даты",
|
|
2138
2083
|
group: "other",
|
|
2139
2084
|
section: "nextTillSame",
|
|
2140
|
-
...
|
|
2085
|
+
...X.intervalTillSameDate(s, X.startOfHalfYear(l), e)
|
|
2141
2086
|
},
|
|
2142
2087
|
nextYearTillSameDate: {
|
|
2143
2088
|
label: "Следующий год, до такой же даты",
|
|
2144
2089
|
group: "other",
|
|
2145
2090
|
section: "nextTillSame",
|
|
2146
|
-
...
|
|
2091
|
+
...X.intervalTillSameDate(c, O(Se(e, 1)), e)
|
|
2147
2092
|
},
|
|
2148
2093
|
last7Days: {
|
|
2149
2094
|
label: "Последние 7 дней",
|
|
2150
2095
|
group: "other",
|
|
2151
2096
|
section: "rollingDays",
|
|
2152
|
-
from:
|
|
2097
|
+
from: T(Re(e, 6)),
|
|
2153
2098
|
to: r
|
|
2154
2099
|
},
|
|
2155
2100
|
next7Days: {
|
|
@@ -2157,11 +2102,11 @@ var Nn = class {
|
|
|
2157
2102
|
group: "other",
|
|
2158
2103
|
section: "rollingDays",
|
|
2159
2104
|
from: n,
|
|
2160
|
-
to: y(
|
|
2105
|
+
to: x(y(e, 6))
|
|
2161
2106
|
}
|
|
2162
2107
|
};
|
|
2163
2108
|
}
|
|
2164
|
-
},
|
|
2109
|
+
}, Mn = [
|
|
2165
2110
|
{
|
|
2166
2111
|
key: "day",
|
|
2167
2112
|
label: "День"
|
|
@@ -2194,7 +2139,7 @@ var Nn = class {
|
|
|
2194
2139
|
key: "other",
|
|
2195
2140
|
label: "Прочее"
|
|
2196
2141
|
}
|
|
2197
|
-
],
|
|
2142
|
+
], Nn = [
|
|
2198
2143
|
{
|
|
2199
2144
|
key: "fromBeginning",
|
|
2200
2145
|
label: "С начала периода"
|
|
@@ -2215,7 +2160,7 @@ var Nn = class {
|
|
|
2215
2160
|
key: "rollingDays",
|
|
2216
2161
|
label: "7 дней"
|
|
2217
2162
|
}
|
|
2218
|
-
],
|
|
2163
|
+
], Pn = class extends pn {}, Fn = class {
|
|
2219
2164
|
salesDirections;
|
|
2220
2165
|
partnerGroups;
|
|
2221
2166
|
managers;
|
|
@@ -2226,10 +2171,10 @@ var Nn = class {
|
|
|
2226
2171
|
lastLoginDate;
|
|
2227
2172
|
lastOrderDate;
|
|
2228
2173
|
constructor(e) {
|
|
2229
|
-
this.salesDirections =
|
|
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 Pn(e)), this.fixedClients = j(e?.fixedClients ?? [], (e) => new Pn(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);
|
|
2230
2175
|
}
|
|
2231
2176
|
hasClientConditions() {
|
|
2232
|
-
return
|
|
2177
|
+
return nt([
|
|
2233
2178
|
this.salesDirections,
|
|
2234
2179
|
this.partnerGroups,
|
|
2235
2180
|
this.managers,
|
|
@@ -2237,33 +2182,33 @@ var Nn = class {
|
|
|
2237
2182
|
this.fixedClients,
|
|
2238
2183
|
this.regions,
|
|
2239
2184
|
this.cities
|
|
2240
|
-
], (e) => !
|
|
2185
|
+
], (e) => !Ye(e)) || nt([this.lastLoginDate, this.lastOrderDate], (e) => !!e.from || !!e.to);
|
|
2241
2186
|
}
|
|
2242
2187
|
setPeriod(e, t) {
|
|
2243
|
-
return this[e] = new
|
|
2244
|
-
from: t?.from ?
|
|
2245
|
-
to: t?.to ?
|
|
2188
|
+
return this[e] = new P({
|
|
2189
|
+
from: t?.from ? T(t.from) : null,
|
|
2190
|
+
to: t?.to ? x(t.to) : null
|
|
2246
2191
|
}), this;
|
|
2247
2192
|
}
|
|
2248
2193
|
toSaveData() {
|
|
2249
2194
|
return {
|
|
2250
|
-
salesDirections:
|
|
2251
|
-
partnerGroups:
|
|
2252
|
-
managers:
|
|
2253
|
-
additionalClients:
|
|
2254
|
-
regions:
|
|
2255
|
-
cities:
|
|
2256
|
-
lastLoginDate: new
|
|
2257
|
-
lastOrderDate: new
|
|
2195
|
+
salesDirections: j(this.salesDirections, "id"),
|
|
2196
|
+
partnerGroups: j(this.partnerGroups, "id"),
|
|
2197
|
+
managers: j(this.managers, "id"),
|
|
2198
|
+
additionalClients: j(this.additionalClients, "id"),
|
|
2199
|
+
regions: j(this.regions, "id"),
|
|
2200
|
+
cities: j(this.cities, "id"),
|
|
2201
|
+
lastLoginDate: new P(this.lastLoginDate),
|
|
2202
|
+
lastOrderDate: new P(this.lastOrderDate)
|
|
2258
2203
|
};
|
|
2259
2204
|
}
|
|
2260
|
-
},
|
|
2205
|
+
}, In = /* @__PURE__ */ function(e) {
|
|
2261
2206
|
return e.Active = "active", e.Scheduled = "scheduled", e.Completed = "completed", e;
|
|
2262
|
-
}({}),
|
|
2207
|
+
}({}), Ln = class {
|
|
2263
2208
|
static resolve(e, t = /* @__PURE__ */ new Date()) {
|
|
2264
|
-
return e.deletedAt && e.deletedAt.getTime() <= t.getTime() ?
|
|
2209
|
+
return e.deletedAt && e.deletedAt.getTime() <= t.getTime() ? In.Completed : e.publishedAt && e.publishedAt.getTime() > t.getTime() ? In.Scheduled : In.Active;
|
|
2265
2210
|
}
|
|
2266
|
-
},
|
|
2211
|
+
}, Rn = class extends pt {
|
|
2267
2212
|
conditions;
|
|
2268
2213
|
products;
|
|
2269
2214
|
productCategories;
|
|
@@ -2272,10 +2217,10 @@ var Nn = class {
|
|
|
2272
2217
|
countDiscountedProducts;
|
|
2273
2218
|
countDiscountedClients;
|
|
2274
2219
|
constructor(e) {
|
|
2275
|
-
super(e), this.conditions = new
|
|
2220
|
+
super(e), this.conditions = new Fn(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;
|
|
2276
2221
|
}
|
|
2277
2222
|
getState(e = /* @__PURE__ */ new Date()) {
|
|
2278
|
-
return
|
|
2223
|
+
return Ln.resolve(this, e);
|
|
2279
2224
|
}
|
|
2280
2225
|
assignCounters(e) {
|
|
2281
2226
|
this.countDiscountedPrices = e.countDiscountedPrices, this.expectedCountDiscountedPrices = e.expectedCountDiscountedPrices, this.countDiscountedProducts = e.countDiscountedProducts, this.countDiscountedClients = e.countDiscountedClients;
|
|
@@ -2291,12 +2236,12 @@ var Nn = class {
|
|
|
2291
2236
|
publishedAt: this.publishedAt ?? null,
|
|
2292
2237
|
deletedAt: this.deletedAt ?? null,
|
|
2293
2238
|
description: this.description ?? "",
|
|
2294
|
-
products:
|
|
2295
|
-
productCategories:
|
|
2239
|
+
products: j(this.products, "id"),
|
|
2240
|
+
productCategories: j(this.productCategories, "id"),
|
|
2296
2241
|
conditions: this.conditions.toSaveData()
|
|
2297
2242
|
};
|
|
2298
2243
|
}
|
|
2299
|
-
},
|
|
2244
|
+
}, zn = class {
|
|
2300
2245
|
client;
|
|
2301
2246
|
additionalClientsCondition;
|
|
2302
2247
|
fixedClientsCondition;
|
|
@@ -2306,12 +2251,12 @@ var Nn = class {
|
|
|
2306
2251
|
regionsCondition;
|
|
2307
2252
|
salesDirectionsCondition;
|
|
2308
2253
|
constructor(e) {
|
|
2309
|
-
this.client = new
|
|
2254
|
+
this.client = new Pn(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;
|
|
2310
2255
|
}
|
|
2311
2256
|
isEligible() {
|
|
2312
2257
|
return this.additionalClientsCondition || this.fixedClientsCondition || this.partnerGroupsCondition || this.managersCondition || this.citiesCondition || this.regionsCondition || this.salesDirectionsCondition;
|
|
2313
2258
|
}
|
|
2314
|
-
},
|
|
2259
|
+
}, Bn = class extends N {
|
|
2315
2260
|
id;
|
|
2316
2261
|
name;
|
|
2317
2262
|
states;
|
|
@@ -2326,83 +2271,83 @@ var Nn = class {
|
|
|
2326
2271
|
}
|
|
2327
2272
|
return this;
|
|
2328
2273
|
}
|
|
2329
|
-
},
|
|
2274
|
+
}, Vn = class t extends e {
|
|
2330
2275
|
static prepareSaveData(e, t) {
|
|
2331
2276
|
return {
|
|
2332
2277
|
...e,
|
|
2333
|
-
publishedAt:
|
|
2334
|
-
deletedAt:
|
|
2278
|
+
publishedAt: s.toApiFormat(e.publishedAt),
|
|
2279
|
+
deletedAt: s.toApiFormat(e.deletedAt),
|
|
2335
2280
|
conditions: {
|
|
2336
2281
|
...e.conditions,
|
|
2337
|
-
lastLoginDate:
|
|
2338
|
-
lastOrderDate:
|
|
2282
|
+
lastLoginDate: s.periodToApiFormat(e.conditions.lastLoginDate),
|
|
2283
|
+
lastOrderDate: s.periodToApiFormat(e.conditions.lastOrderDate),
|
|
2339
2284
|
updateFixedClients: t
|
|
2340
2285
|
}
|
|
2341
2286
|
};
|
|
2342
2287
|
}
|
|
2343
2288
|
getDiscountsList(e, t, n, r) {
|
|
2344
|
-
return this.getTypedPaginated(
|
|
2289
|
+
return this.getTypedPaginated(pt, "/internal/price/discounts", e, t, n, {}, void 0, r);
|
|
2345
2290
|
}
|
|
2346
2291
|
getDiscount(e) {
|
|
2347
|
-
return this.get(`/internal/price/discounts/${e}`, {}, (e) => new
|
|
2292
|
+
return this.get(`/internal/price/discounts/${e}`, {}, (e) => new Rn(e.data));
|
|
2348
2293
|
}
|
|
2349
|
-
createDiscount(
|
|
2350
|
-
return this.post("/internal/price/discounts",
|
|
2294
|
+
createDiscount(e, n, r = {}) {
|
|
2295
|
+
return this.post("/internal/price/discounts", t.prepareSaveData(e, n), (e) => new Rn(e.data), r);
|
|
2351
2296
|
}
|
|
2352
|
-
updateDiscount(
|
|
2353
|
-
return this.patch(`/internal/price/discounts/${
|
|
2297
|
+
updateDiscount(e, n, r, i = {}) {
|
|
2298
|
+
return this.patch(`/internal/price/discounts/${e}`, t.prepareSaveData(n, r), (e) => new Rn(e.data), i);
|
|
2354
2299
|
}
|
|
2355
2300
|
removeDiscount(e) {
|
|
2356
2301
|
return this.delete(`/internal/price/discounts/${e}`);
|
|
2357
2302
|
}
|
|
2358
2303
|
getEligibleClients(e) {
|
|
2359
|
-
return this.getTypedList(
|
|
2304
|
+
return this.getTypedList(zn, `/internal/price/discounts/${e}/clients`);
|
|
2360
2305
|
}
|
|
2361
2306
|
checkClient(e, t) {
|
|
2362
|
-
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 zn(e.data));
|
|
2363
2308
|
}
|
|
2364
|
-
},
|
|
2309
|
+
}, Hn = class extends p {
|
|
2365
2310
|
constructor(e) {
|
|
2366
2311
|
super(e);
|
|
2367
2312
|
}
|
|
2368
|
-
},
|
|
2313
|
+
}, Un = class extends d {
|
|
2369
2314
|
question;
|
|
2370
2315
|
answer;
|
|
2371
2316
|
groups;
|
|
2372
2317
|
constructor(e) {
|
|
2373
|
-
super(e, -1), this.question = e?.question ?? "", this.answer = e?.answer ?? "", this.groups =
|
|
2318
|
+
super(e, -1), this.question = e?.question ?? "", this.answer = e?.answer ?? "", this.groups = j(e?.groups ?? [], (e) => new Hn(e));
|
|
2374
2319
|
}
|
|
2375
2320
|
toSaveData() {
|
|
2376
2321
|
return {
|
|
2377
2322
|
question: this.question,
|
|
2378
2323
|
answer: this.answer,
|
|
2379
|
-
groups:
|
|
2324
|
+
groups: j(this.groups, "id")
|
|
2380
2325
|
};
|
|
2381
2326
|
}
|
|
2382
|
-
},
|
|
2327
|
+
}, Wn = class extends e {
|
|
2383
2328
|
getFaqList(e, t) {
|
|
2384
|
-
return this.getTypedPaginated(
|
|
2329
|
+
return this.getTypedPaginated(Un, "/internal/faq", void 0, void 0, t, k(e) ? {} : { group: e });
|
|
2385
2330
|
}
|
|
2386
2331
|
getFaq(e) {
|
|
2387
|
-
return this.get(`/internal/faq/${e}`, {}, (e) => new
|
|
2332
|
+
return this.get(`/internal/faq/${e}`, {}, (e) => new Un(e.data));
|
|
2388
2333
|
}
|
|
2389
2334
|
createFaq(e, t = {}) {
|
|
2390
|
-
return this.post("/internal/faq", e, (e) => new
|
|
2335
|
+
return this.post("/internal/faq", e, (e) => new Un(e.data), t);
|
|
2391
2336
|
}
|
|
2392
2337
|
updateFaq(e, t, n = {}) {
|
|
2393
|
-
return this.patch(`/internal/faq/${e}`, t, (e) => new
|
|
2338
|
+
return this.patch(`/internal/faq/${e}`, t, (e) => new Un(e.data), n);
|
|
2394
2339
|
}
|
|
2395
2340
|
removeFaq(e) {
|
|
2396
2341
|
return this.delete(`/internal/faq/${e}`);
|
|
2397
2342
|
}
|
|
2398
2343
|
getGroupsList() {
|
|
2399
|
-
return this.getTypedList(
|
|
2344
|
+
return this.getTypedList(Hn, "/internal/faq/groups");
|
|
2400
2345
|
}
|
|
2401
2346
|
createGroup(e, t = {}) {
|
|
2402
|
-
return this.post("/internal/faq/groups", e, (e) => new
|
|
2347
|
+
return this.post("/internal/faq/groups", e, (e) => new Hn(e.data), t);
|
|
2403
2348
|
}
|
|
2404
2349
|
updateGroup(e, t, n = {}) {
|
|
2405
|
-
return this.patch(`/internal/faq/groups/${e}`, t, (e) => new
|
|
2350
|
+
return this.patch(`/internal/faq/groups/${e}`, t, (e) => new Hn(e.data), n);
|
|
2406
2351
|
}
|
|
2407
2352
|
removeGroup(e) {
|
|
2408
2353
|
return this.delete(`/internal/faq/groups/${e}`);
|
|
@@ -2410,13 +2355,13 @@ var Nn = class {
|
|
|
2410
2355
|
};
|
|
2411
2356
|
//#endregion
|
|
2412
2357
|
//#region src/helpers/format-percent-change.ts
|
|
2413
|
-
function
|
|
2414
|
-
let t =
|
|
2358
|
+
function Gn(e) {
|
|
2359
|
+
let t = tt(e * 100);
|
|
2415
2360
|
return `${t >= 0 ? "+" : ""}${t}%`;
|
|
2416
2361
|
}
|
|
2417
2362
|
//#endregion
|
|
2418
2363
|
//#region src/helpers/units-helper.ts
|
|
2419
|
-
var
|
|
2364
|
+
var Kn = class e {
|
|
2420
2365
|
static productIsMeasurable(e) {
|
|
2421
2366
|
return e.unit.isLinear || e.unit.isSquare;
|
|
2422
2367
|
}
|
|
@@ -2426,9 +2371,9 @@ var qn = class e {
|
|
|
2426
2371
|
static getProductLengthMultiplicity(e) {
|
|
2427
2372
|
return e.properties?.lengthStep == null ? !e.properties?.ignoreMinCountCheck && e.properties?.minCount != null ? e.properties.minCount : .01 : e.properties.lengthStep;
|
|
2428
2373
|
}
|
|
2429
|
-
},
|
|
2374
|
+
}, qn = class {
|
|
2430
2375
|
static generateUndefinedManagerInstance() {
|
|
2431
|
-
return new
|
|
2376
|
+
return new f({
|
|
2432
2377
|
id: 0,
|
|
2433
2378
|
name: "- Не назначен -",
|
|
2434
2379
|
isActive: !0,
|
|
@@ -2438,18 +2383,74 @@ var qn = class e {
|
|
|
2438
2383
|
static isUndefinedManagerInstance(e) {
|
|
2439
2384
|
return e.id === 0 && e.guid === "-undefined-";
|
|
2440
2385
|
}
|
|
2441
|
-
},
|
|
2386
|
+
}, Jn = class extends N {
|
|
2387
|
+
name;
|
|
2388
|
+
phone;
|
|
2389
|
+
email;
|
|
2390
|
+
salesDirections;
|
|
2391
|
+
isActive;
|
|
2392
|
+
isSupervisor;
|
|
2393
|
+
canDoReclamations;
|
|
2394
|
+
constructor(e) {
|
|
2395
|
+
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.isSupervisor = e?.isSupervisor, this.canDoReclamations = e?.canDoReclamations;
|
|
2396
|
+
}
|
|
2397
|
+
resetFilterValue(e) {
|
|
2398
|
+
switch (e) {
|
|
2399
|
+
case "name":
|
|
2400
|
+
case "phone":
|
|
2401
|
+
case "email":
|
|
2402
|
+
case "salesDirections":
|
|
2403
|
+
case "isActive":
|
|
2404
|
+
case "isSupervisor":
|
|
2405
|
+
case "canDoReclamations": this[e] = void 0;
|
|
2406
|
+
}
|
|
2407
|
+
return this;
|
|
2408
|
+
}
|
|
2409
|
+
}, Yn = class e extends ie {
|
|
2410
|
+
static transformManagerDataToRequest(e) {
|
|
2411
|
+
return {
|
|
2412
|
+
name: e.name,
|
|
2413
|
+
phone: e.contacts?.phone ?? "",
|
|
2414
|
+
email: e.contacts?.email ?? "",
|
|
2415
|
+
password: e.password,
|
|
2416
|
+
isActive: e.isActive,
|
|
2417
|
+
isSupervisor: e.isSupervisor,
|
|
2418
|
+
canDoReclamations: e.canDoReclamations,
|
|
2419
|
+
authAsOperator: e.authAsOperator ?? !1,
|
|
2420
|
+
salesDirectionId: e.salesDirection.id,
|
|
2421
|
+
pricingRoleId: e.pricingRole?.id,
|
|
2422
|
+
showAllCosts: e.showAllCosts ?? !1,
|
|
2423
|
+
storeIds: j(e.stores, "id"),
|
|
2424
|
+
curatedDirectionIds: j(e.curatedDirections, "id"),
|
|
2425
|
+
managerRegionIds: j(e.managerRegions, "id"),
|
|
2426
|
+
managerIds: j(e.managers, "id"),
|
|
2427
|
+
photo: e.photoFile
|
|
2428
|
+
};
|
|
2429
|
+
}
|
|
2430
|
+
getManagersList(e, t, n, r) {
|
|
2431
|
+
return this.getTypedPaginated(f, "/internal/managers", e, t, n, {}, void 0, r);
|
|
2432
|
+
}
|
|
2433
|
+
createManager(t, n = {}) {
|
|
2434
|
+
return this.post("/internal/managers", e.transformManagerDataToRequest(t), (e) => new f(e.data), n);
|
|
2435
|
+
}
|
|
2436
|
+
updateManager(t, n = {}) {
|
|
2437
|
+
return this.patch(`/internal/managers/${t.id}`, e.transformManagerDataToRequest(t), (e) => new f(e.data), n);
|
|
2438
|
+
}
|
|
2439
|
+
getManagerRegionsList(e, t, n) {
|
|
2440
|
+
return this.getTypedPaginated(_e, "/internal/managers/regions", e, t, n);
|
|
2441
|
+
}
|
|
2442
|
+
}, Xn = /* @__PURE__ */ function(e) {
|
|
2442
2443
|
return e.Processing = "processing", e.Completed = "completed", e.Error = "error", e.NeedsActualization = "needs_actualization", e;
|
|
2443
|
-
}({}),
|
|
2444
|
+
}({}), Zn = class {
|
|
2444
2445
|
status;
|
|
2445
2446
|
actualizedAt;
|
|
2446
2447
|
expiresAt;
|
|
2447
2448
|
error;
|
|
2448
2449
|
constructor(e) {
|
|
2449
|
-
this.status = e?.status ??
|
|
2450
|
+
this.status = e?.status ?? Xn.Processing, this.actualizedAt = s.parse(e?.actualizedAt), this.expiresAt = s.parse(e?.expiresAt), this.error = e?.error;
|
|
2450
2451
|
}
|
|
2451
2452
|
get isProcessing() {
|
|
2452
|
-
return this.status ===
|
|
2453
|
+
return this.status === Xn.Processing;
|
|
2453
2454
|
}
|
|
2454
2455
|
get isOutdated() {
|
|
2455
2456
|
return this.isOutdatedAt(/* @__PURE__ */ new Date());
|
|
@@ -2458,12 +2459,12 @@ var qn = class e {
|
|
|
2458
2459
|
return this.isOrderAllowedAt(/* @__PURE__ */ new Date());
|
|
2459
2460
|
}
|
|
2460
2461
|
isOutdatedAt(e) {
|
|
2461
|
-
return this.status !==
|
|
2462
|
+
return this.status !== Xn.Completed || k(this.actualizedAt) ? !0 : !k(this.expiresAt) && this.expiresAt.getTime() < e.getTime();
|
|
2462
2463
|
}
|
|
2463
2464
|
isOrderAllowedAt(e) {
|
|
2464
|
-
return this.status ===
|
|
2465
|
+
return this.status === Xn.Completed && !this.isOutdatedAt(e);
|
|
2465
2466
|
}
|
|
2466
|
-
},
|
|
2467
|
+
}, Qn = class extends M {
|
|
2467
2468
|
name;
|
|
2468
2469
|
client;
|
|
2469
2470
|
sum;
|
|
@@ -2471,9 +2472,9 @@ var qn = class e {
|
|
|
2471
2472
|
actualization;
|
|
2472
2473
|
file;
|
|
2473
2474
|
constructor(e) {
|
|
2474
|
-
super(e), this.name = e?.name, this.client = new
|
|
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 Zn(e.actualization), this.file = e?.file;
|
|
2475
2476
|
}
|
|
2476
|
-
},
|
|
2477
|
+
}, $n = class extends Ct {
|
|
2477
2478
|
groupName;
|
|
2478
2479
|
supplierSku;
|
|
2479
2480
|
isIgnored;
|
|
@@ -2482,24 +2483,24 @@ var qn = class e {
|
|
|
2482
2483
|
super(e), this.groupName = e.groupName, this.supplierSku = e.supplierSku ?? e.product.supplierSku, this.isIgnored = e.isIgnored, this.lineError = e.lineError;
|
|
2483
2484
|
}
|
|
2484
2485
|
get isProductStub() {
|
|
2485
|
-
return
|
|
2486
|
+
return k(this.product.id);
|
|
2486
2487
|
}
|
|
2487
2488
|
get isOrderable() {
|
|
2488
|
-
return !this.isProductStub && !this.isIgnored &&
|
|
2489
|
+
return !this.isProductStub && !this.isIgnored && Ye(this.lineError);
|
|
2489
2490
|
}
|
|
2490
|
-
}, Z = class extends
|
|
2491
|
+
}, Z = class extends Qn {
|
|
2491
2492
|
sum;
|
|
2492
2493
|
products;
|
|
2493
2494
|
constructor(e) {
|
|
2494
|
-
super(e), this.sum = e.sum ?? 0, this.products = (e.products ?? []).map((t) => e.isProfstroy ? new
|
|
2495
|
+
super(e), this.sum = e.sum ?? 0, this.products = (e.products ?? []).map((t) => e.isProfstroy ? new $n(t) : new Ct(t));
|
|
2495
2496
|
}
|
|
2496
|
-
},
|
|
2497
|
+
}, er = class extends N {
|
|
2497
2498
|
id;
|
|
2498
2499
|
clientSearchTerm;
|
|
2499
2500
|
name;
|
|
2500
|
-
createdAt = new
|
|
2501
|
+
createdAt = new P();
|
|
2501
2502
|
constructor(e) {
|
|
2502
|
-
super(), this.id = e?.id, this.clientSearchTerm = e?.clientSearchTerm, this.name = e?.name, this.createdAt = new
|
|
2503
|
+
super(), this.id = e?.id, this.clientSearchTerm = e?.clientSearchTerm, this.name = e?.name, this.createdAt = new P(e?.createdAt);
|
|
2503
2504
|
}
|
|
2504
2505
|
resetFilterValue(e) {
|
|
2505
2506
|
return e === "createdAt" ? (this.createdAt.from = null, this.createdAt.to = null) : this[e] = void 0, this;
|
|
@@ -2508,7 +2509,7 @@ var qn = class e {
|
|
|
2508
2509
|
let e = super.asClearRaw();
|
|
2509
2510
|
return !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, e;
|
|
2510
2511
|
}
|
|
2511
|
-
},
|
|
2512
|
+
}, tr = class extends gn {
|
|
2512
2513
|
client;
|
|
2513
2514
|
payment;
|
|
2514
2515
|
delivery;
|
|
@@ -2523,20 +2524,20 @@ var qn = class e {
|
|
|
2523
2524
|
sum;
|
|
2524
2525
|
isLargeOrder;
|
|
2525
2526
|
constructor(e) {
|
|
2526
|
-
super(e), this.client = new
|
|
2527
|
+
super(e), this.client = new U(e?.client), this.payment = {
|
|
2527
2528
|
type: e?.payment?.type ?? -1,
|
|
2528
2529
|
status: e?.payment?.status ?? -1,
|
|
2529
2530
|
onlinePaymentLink: e?.payment?.onlinePaymentLink
|
|
2530
2531
|
}, this.delivery = {
|
|
2531
2532
|
type: e?.delivery?.type ?? -1,
|
|
2532
|
-
date:
|
|
2533
|
-
address: e?.delivery?.address ? new
|
|
2534
|
-
warehouse: e?.delivery?.warehouse ? new
|
|
2535
|
-
}, this.attachedUser = e?.attachedUser ? new
|
|
2533
|
+
date: A(e?.delivery?.date) ? w(e.delivery.date) : e?.delivery?.date ?? /* @__PURE__ */ new Date(),
|
|
2534
|
+
address: e?.delivery?.address ? new Y(e.delivery.address) : void 0,
|
|
2535
|
+
warehouse: e?.delivery?.warehouse ? new ve(e.delivery.warehouse) : void 0
|
|
2536
|
+
}, 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);
|
|
2536
2537
|
let t = e?.attachedAt;
|
|
2537
|
-
this.attachedAt =
|
|
2538
|
+
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;
|
|
2538
2539
|
}
|
|
2539
|
-
},
|
|
2540
|
+
}, nr = class extends St {
|
|
2540
2541
|
product;
|
|
2541
2542
|
cost;
|
|
2542
2543
|
costOne;
|
|
@@ -2550,9 +2551,9 @@ var qn = class e {
|
|
|
2550
2551
|
changedFields = [];
|
|
2551
2552
|
replacement;
|
|
2552
2553
|
constructor(e, t) {
|
|
2553
|
-
super(e), this.product = new
|
|
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 = qe(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"));
|
|
2554
2555
|
}
|
|
2555
|
-
}, Q = class extends
|
|
2556
|
+
}, Q = class extends tr {
|
|
2556
2557
|
products;
|
|
2557
2558
|
invoices;
|
|
2558
2559
|
comment;
|
|
@@ -2568,11 +2569,11 @@ var qn = class e {
|
|
|
2568
2569
|
erpOrderUrl;
|
|
2569
2570
|
numberDoc;
|
|
2570
2571
|
constructor(e) {
|
|
2571
|
-
super(e), this.products = (e.products ?? []).map((t) => new
|
|
2572
|
+
super(e), this.products = (e.products ?? []).map((t) => new nr(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 ? fn.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;
|
|
2572
2573
|
}
|
|
2573
|
-
},
|
|
2574
|
+
}, rr = class extends e {
|
|
2574
2575
|
getOffers(e, t, n, r) {
|
|
2575
|
-
return this.getTypedPaginated(
|
|
2576
|
+
return this.getTypedPaginated(Qn, "/internal/orders/offers", e, t, n, {}, void 0, r);
|
|
2576
2577
|
}
|
|
2577
2578
|
createOfferFromCart(e, t, n) {
|
|
2578
2579
|
return this.post(`/internal/orders/offers/${e}`, {
|
|
@@ -2602,12 +2603,12 @@ var qn = class e {
|
|
|
2602
2603
|
return this.delete(`/internal/orders/offers/${e}`);
|
|
2603
2604
|
}
|
|
2604
2605
|
createOrderFromDraft(e, t, n, r = {}) {
|
|
2605
|
-
let i =
|
|
2606
|
+
let i = v().config.dateFormats.api;
|
|
2606
2607
|
return this.post(`/internal/orders/offers/${e}/create-order`, {
|
|
2607
2608
|
...t,
|
|
2608
|
-
deliveryDate: t.deliveryDate ?
|
|
2609
|
+
deliveryDate: t.deliveryDate ? C(t.deliveryDate, i) : void 0,
|
|
2609
2610
|
items: n?.length ? n : void 0
|
|
2610
|
-
}, (e) =>
|
|
2611
|
+
}, (e) => _.instanceListInitializer(Q, e.data), r);
|
|
2611
2612
|
}
|
|
2612
2613
|
addOfferProduct(e, t, n = {}) {
|
|
2613
2614
|
return this.post(`/internal/orders/offers/${e}/products`, {
|
|
@@ -2649,16 +2650,16 @@ var qn = class e {
|
|
|
2649
2650
|
sendOffer(e, t) {
|
|
2650
2651
|
return this.post(`/internal/orders/offers/${e}/send`, t);
|
|
2651
2652
|
}
|
|
2652
|
-
},
|
|
2653
|
+
}, ir = class {
|
|
2653
2654
|
static isProfstroy(e) {
|
|
2654
2655
|
return !!e?.isProfstroy;
|
|
2655
2656
|
}
|
|
2656
2657
|
static isProfstroyOffer(e) {
|
|
2657
|
-
return !
|
|
2658
|
+
return !k(e) && e.isProfstroy === !0 && !k(e.actualization);
|
|
2658
2659
|
}
|
|
2659
|
-
},
|
|
2660
|
+
}, ar = /* @__PURE__ */ function(e) {
|
|
2660
2661
|
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;
|
|
2661
|
-
}({}),
|
|
2662
|
+
}({}), or = class {
|
|
2662
2663
|
paymentType;
|
|
2663
2664
|
deliveryType;
|
|
2664
2665
|
contragentId;
|
|
@@ -2676,21 +2677,21 @@ var qn = class e {
|
|
|
2676
2677
|
constructor(e) {
|
|
2677
2678
|
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;
|
|
2678
2679
|
}
|
|
2679
|
-
},
|
|
2680
|
+
}, sr = class extends N {
|
|
2680
2681
|
attachedUsers;
|
|
2681
2682
|
clientSearchTerm;
|
|
2682
2683
|
client;
|
|
2683
2684
|
contragent;
|
|
2684
|
-
createdAt = new
|
|
2685
|
+
createdAt = new P();
|
|
2685
2686
|
creator;
|
|
2686
|
-
deliveryDate = new
|
|
2687
|
+
deliveryDate = new P();
|
|
2687
2688
|
deliveryAddressSearch;
|
|
2688
2689
|
clientCities;
|
|
2689
2690
|
id;
|
|
2690
2691
|
isApproved;
|
|
2691
2692
|
isNotInStock;
|
|
2692
2693
|
isOnOrder;
|
|
2693
|
-
attachedAt = new
|
|
2694
|
+
attachedAt = new P();
|
|
2694
2695
|
salesDirections;
|
|
2695
2696
|
status;
|
|
2696
2697
|
statusDetail;
|
|
@@ -2701,7 +2702,7 @@ var qn = class e {
|
|
|
2701
2702
|
isToProcess;
|
|
2702
2703
|
onlyMyRegions;
|
|
2703
2704
|
constructor(e) {
|
|
2704
|
-
super(), this.attachedUsers = e?.attachedUsers?.map((e) => "isActive" in e ? new
|
|
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 ve(e)), this.isToProcess = e?.isToProcess;
|
|
2705
2706
|
}
|
|
2706
2707
|
resetFilterValue(e) {
|
|
2707
2708
|
switch (e) {
|
|
@@ -2715,7 +2716,7 @@ var qn = class e {
|
|
|
2715
2716
|
this.deliveryDate.from = null, this.deliveryDate.to = null;
|
|
2716
2717
|
break;
|
|
2717
2718
|
case "deliveryType":
|
|
2718
|
-
this.deliveryType = new
|
|
2719
|
+
this.deliveryType = new c();
|
|
2719
2720
|
break;
|
|
2720
2721
|
case "clientCities":
|
|
2721
2722
|
this.clientCities = [];
|
|
@@ -2742,22 +2743,22 @@ var qn = class e {
|
|
|
2742
2743
|
let e = super.asClearRaw();
|
|
2743
2744
|
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;
|
|
2744
2745
|
}
|
|
2745
|
-
},
|
|
2746
|
+
}, cr = class {
|
|
2746
2747
|
user;
|
|
2747
2748
|
status;
|
|
2748
2749
|
statusDetail;
|
|
2749
2750
|
createdAt;
|
|
2750
2751
|
constructor(e) {
|
|
2751
|
-
this.user = new
|
|
2752
|
+
this.user = new F(e?.user), this.status = new se(e?.status), this.statusDetail = e?.statusDetail ? new de(e.statusDetail) : void 0;
|
|
2752
2753
|
let t = e?.createdAt;
|
|
2753
|
-
this.createdAt =
|
|
2754
|
+
this.createdAt = A(t) ? w(t) : e?.createdAt ?? /* @__PURE__ */ new Date();
|
|
2754
2755
|
}
|
|
2755
|
-
},
|
|
2756
|
+
}, lr = class extends e {
|
|
2756
2757
|
getOrders(e, t, n, r) {
|
|
2757
|
-
return this.getTypedPaginated(
|
|
2758
|
+
return this.getTypedPaginated(tr, "/internal/orders", e, t, n, {}, void 0, r);
|
|
2758
2759
|
}
|
|
2759
2760
|
getOrdersCount(e, t) {
|
|
2760
|
-
return this.get("/internal/orders/count", e ? { filters: JSON.stringify((e instanceof
|
|
2761
|
+
return this.get("/internal/orders/count", e ? { filters: JSON.stringify((e instanceof l ? e : new l(e)).toPrimitive()) } : {}, void 0, void 0, t).then((e) => e.count);
|
|
2761
2762
|
}
|
|
2762
2763
|
getClientOrderStatistics(e, t) {
|
|
2763
2764
|
return this.get(`/internal/clients/${e}/orders/statistics`, t ? { period: t } : {});
|
|
@@ -2766,12 +2767,12 @@ var qn = class e {
|
|
|
2766
2767
|
return this.get(`/internal/orders/${e}`, {}, (e) => new Q(e.data));
|
|
2767
2768
|
}
|
|
2768
2769
|
createClientOrder(e, t, n, r = {}) {
|
|
2769
|
-
let i =
|
|
2770
|
+
let i = v().config.dateFormats.api;
|
|
2770
2771
|
return this.post(`/internal/clients/${e}/orders`, {
|
|
2771
2772
|
...t,
|
|
2772
|
-
deliveryDate:
|
|
2773
|
+
deliveryDate: C(t.deliveryDate, i),
|
|
2773
2774
|
items: n?.length ? n : void 0
|
|
2774
|
-
}, (e) =>
|
|
2775
|
+
}, (e) => _.instanceListInitializer(Q, e.data), r);
|
|
2775
2776
|
}
|
|
2776
2777
|
attachOrder(e) {
|
|
2777
2778
|
return this.patch(`/internal/orders/${e}/attach`, {}, (e) => new Q(e.data));
|
|
@@ -2789,10 +2790,10 @@ var qn = class e {
|
|
|
2789
2790
|
return this.get(`/internal/orders/${e}/clone`, {});
|
|
2790
2791
|
}
|
|
2791
2792
|
updateOrder(e, t, n = {}) {
|
|
2792
|
-
let r =
|
|
2793
|
+
let r = v().config.dateFormats.api;
|
|
2793
2794
|
return this.patch(`/internal/orders/${e}`, {
|
|
2794
2795
|
...t,
|
|
2795
|
-
deliveryDate: t.deliveryDate ?
|
|
2796
|
+
deliveryDate: t.deliveryDate ? C(t.deliveryDate, r) : void 0
|
|
2796
2797
|
}, (e) => new Q(e.data), n);
|
|
2797
2798
|
}
|
|
2798
2799
|
addOrderProduct(e, t, n = {}) {
|
|
@@ -2819,7 +2820,7 @@ var qn = class e {
|
|
|
2819
2820
|
return this.patch(`/internal/orders/${e}/status`, { statusDetail: t }, (e) => new Q(e.data));
|
|
2820
2821
|
}
|
|
2821
2822
|
getOrderStatusHistory(e) {
|
|
2822
|
-
return this.getTypedList(
|
|
2823
|
+
return this.getTypedList(cr, `/internal/orders/${e}/history`);
|
|
2823
2824
|
}
|
|
2824
2825
|
getOrderPrintHtml(e, t) {
|
|
2825
2826
|
return this.get(`/internal/orders/${e}/print/view`, { ...t }, (e) => new Blob([e.data], { type: "text/html" }));
|
|
@@ -2860,51 +2861,51 @@ var qn = class e {
|
|
|
2860
2861
|
return this.get(`/internal/orders/self-delivery/${e}/nearest-dates`, {}, (e) => e.data, void 0, t);
|
|
2861
2862
|
}
|
|
2862
2863
|
getDeliveryCost(e, t, n, r) {
|
|
2863
|
-
let i =
|
|
2864
|
+
let i = v().config.dateFormats.api;
|
|
2864
2865
|
return this.get(`/internal/orders/delivery/${e}/cost`, {
|
|
2865
|
-
date:
|
|
2866
|
+
date: C(t, i),
|
|
2866
2867
|
warehouse_id: n
|
|
2867
2868
|
}, (e) => e.data, void 0, r);
|
|
2868
2869
|
}
|
|
2869
|
-
},
|
|
2870
|
+
}, ur = Symbol("currentOrder"), dr = class {
|
|
2870
2871
|
client;
|
|
2871
2872
|
product;
|
|
2872
2873
|
cost;
|
|
2873
2874
|
costCoefficient;
|
|
2874
2875
|
source;
|
|
2875
2876
|
constructor(e) {
|
|
2876
|
-
this.client = new
|
|
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 ?? xt.Product;
|
|
2877
2878
|
}
|
|
2878
|
-
},
|
|
2879
|
+
}, fr = (e) => e ? et({
|
|
2879
2880
|
cities: e.cities?.map((e) => e.id),
|
|
2880
2881
|
clients: e.clients?.map((e) => e.id),
|
|
2881
2882
|
managers: e.managers?.map((e) => e.id),
|
|
2882
2883
|
partnerGroups: e.partnerGroups?.map((e) => e.id),
|
|
2883
2884
|
salesDirections: e.salesDirections?.map((e) => e.id),
|
|
2884
2885
|
hideNotActive: e.hideNotActive
|
|
2885
|
-
}, (e) =>
|
|
2886
|
+
}, (e) => k(e) || (qe(e) || Ze(e)) && Ye(e)) : {}, pr = (e) => {
|
|
2886
2887
|
let t = {};
|
|
2887
2888
|
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;
|
|
2888
|
-
},
|
|
2889
|
+
}, mr = class extends u {
|
|
2889
2890
|
analyzeProductPrices(e, t, n) {
|
|
2890
2891
|
return this.get(`/internal/price/products/${e}/analyze`, {
|
|
2891
|
-
...
|
|
2892
|
-
filters:
|
|
2893
|
-
}, (e) =>
|
|
2892
|
+
...pr(t),
|
|
2893
|
+
filters: fr(n)
|
|
2894
|
+
}, (e) => _.instanceListInitializer(dr, e.data));
|
|
2894
2895
|
}
|
|
2895
2896
|
analyzeCategoryPrices(e, t, n) {
|
|
2896
2897
|
return this.get(`/internal/price/categories/${e}/analyze`, {
|
|
2897
|
-
...
|
|
2898
|
-
filters:
|
|
2899
|
-
}, (e) =>
|
|
2898
|
+
...pr(t),
|
|
2899
|
+
filters: fr(n)
|
|
2900
|
+
}, (e) => _.instanceListInitializer(dr, e.data));
|
|
2900
2901
|
}
|
|
2901
2902
|
analyzeCategoryPricesBySquare(e, t, n) {
|
|
2902
2903
|
return this.get(`/internal/price/categories/${e}/analyze/square`, {
|
|
2903
2904
|
...t,
|
|
2904
|
-
filters:
|
|
2905
|
-
}, (e) =>
|
|
2905
|
+
filters: fr(n)
|
|
2906
|
+
}, (e) => _.instanceListInitializer(dr, e.data));
|
|
2906
2907
|
}
|
|
2907
|
-
},
|
|
2908
|
+
}, hr = class {
|
|
2908
2909
|
cost;
|
|
2909
2910
|
isLowCost;
|
|
2910
2911
|
isRetail;
|
|
@@ -2916,43 +2917,43 @@ var qn = class e {
|
|
|
2916
2917
|
executor;
|
|
2917
2918
|
currency;
|
|
2918
2919
|
constructor(e) {
|
|
2919
|
-
this.cost = e.cost ?? 0, this.isLowCost = e.isLowCost ?? !1, this.isRetail = e.isRetail ?? !1, this.costDate =
|
|
2920
|
+
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;
|
|
2920
2921
|
}
|
|
2921
|
-
},
|
|
2922
|
+
}, gr = class extends L {
|
|
2922
2923
|
history;
|
|
2923
2924
|
constructor(e) {
|
|
2924
|
-
super(e), this.history =
|
|
2925
|
+
super(e), this.history = j(e.history, (e) => new hr(e));
|
|
2925
2926
|
}
|
|
2926
|
-
},
|
|
2927
|
+
}, _r = class extends u {
|
|
2927
2928
|
getProductPriceHistory(e) {
|
|
2928
|
-
let t =
|
|
2929
|
-
from:
|
|
2930
|
-
to:
|
|
2931
|
-
} }), (e) =>
|
|
2932
|
-
return delete n.product, this.get(`/internal/price/products/${r}/history`, n).then((e) => [new
|
|
2929
|
+
let t = v().config.dateFormats.api, n = et($e(e, { costDate: {
|
|
2930
|
+
from: Je(e.costDate?.from) ? C(e.costDate.from, t) : e.costDate?.from,
|
|
2931
|
+
to: Je(e.costDate?.to) ? C(e.costDate.to, t) : e.costDate?.to
|
|
2932
|
+
} }), (e) => k(e) || (qe(e) || Ze(e)) && Ye(e)), r = e.product?.[0] ?? 0;
|
|
2933
|
+
return delete n.product, this.get(`/internal/price/products/${r}/history`, n).then((e) => [new gr($e(e[0], { history: e }))]);
|
|
2933
2934
|
}
|
|
2934
|
-
},
|
|
2935
|
+
}, vr = class {
|
|
2935
2936
|
createdAt;
|
|
2936
2937
|
creator;
|
|
2937
2938
|
files;
|
|
2938
2939
|
text;
|
|
2939
2940
|
status;
|
|
2940
2941
|
constructor(e) {
|
|
2941
|
-
this.createdAt =
|
|
2942
|
+
this.createdAt = s.parse(e?.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = k(e?.creator) ? void 0 : new F(e.creator), this.files = e?.files ?? [], this.text = e?.text ?? void 0, this.status = e?.status ?? void 0;
|
|
2942
2943
|
}
|
|
2943
2944
|
isStatusChanged() {
|
|
2944
|
-
return !
|
|
2945
|
+
return !k(this.status);
|
|
2945
2946
|
}
|
|
2946
2947
|
}, $ = /* @__PURE__ */ function(e) {
|
|
2947
2948
|
return e[e.Initiated = 1] = "Initiated", e[e.InfoRequired = 2] = "InfoRequired", e[e.Pending = 3] = "Pending", e[e.Completed = 4] = "Completed", e;
|
|
2948
|
-
}({}),
|
|
2949
|
+
}({}), yr = class extends M {
|
|
2949
2950
|
status;
|
|
2950
2951
|
closedAt;
|
|
2951
2952
|
isRead;
|
|
2952
2953
|
isDeleted;
|
|
2953
2954
|
client;
|
|
2954
2955
|
constructor(e) {
|
|
2955
|
-
super(e), this.status = e?.status ?? $.Initiated, this.closedAt =
|
|
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 pn(e?.client);
|
|
2956
2957
|
}
|
|
2957
2958
|
isClosed() {
|
|
2958
2959
|
return this.status === $.Completed;
|
|
@@ -2964,17 +2965,17 @@ var qn = class e {
|
|
|
2964
2965
|
return !this.isClosed();
|
|
2965
2966
|
}
|
|
2966
2967
|
getConsiderationDays(e = /* @__PURE__ */ new Date()) {
|
|
2967
|
-
return Math.max(
|
|
2968
|
+
return Math.max(Ce(this.closedAt ?? e, this.createdAt), 0);
|
|
2968
2969
|
}
|
|
2969
|
-
},
|
|
2970
|
+
}, br = class extends yr {
|
|
2970
2971
|
items;
|
|
2971
2972
|
constructor(e) {
|
|
2972
|
-
super(e), this.items =
|
|
2973
|
+
super(e), this.items = j(e?.items ?? [], (e) => new vr(e));
|
|
2973
2974
|
}
|
|
2974
2975
|
isClientMessage(e) {
|
|
2975
2976
|
return e.creator?.id === this.client.id;
|
|
2976
2977
|
}
|
|
2977
|
-
},
|
|
2978
|
+
}, xr = class extends N {
|
|
2978
2979
|
id;
|
|
2979
2980
|
statuses;
|
|
2980
2981
|
createdAt;
|
|
@@ -2987,7 +2988,7 @@ var qn = class e {
|
|
|
2987
2988
|
super(), this.id = {
|
|
2988
2989
|
from: e?.id?.from ?? null,
|
|
2989
2990
|
to: e?.id?.to ?? null
|
|
2990
|
-
}, this.statuses = e?.statuses, this.createdAt = new
|
|
2991
|
+
}, this.statuses = e?.statuses, this.createdAt = new P(e?.createdAt), this.closedAt = new P(e?.closedAt), this.isRead = e?.isRead, this.isDeleted = e?.isDeleted, this.clientName = e?.clientName, this.cityName = e?.cityName;
|
|
2991
2992
|
}
|
|
2992
2993
|
resetFilterValue(e) {
|
|
2993
2994
|
switch (e) {
|
|
@@ -3010,7 +3011,7 @@ var qn = class e {
|
|
|
3010
3011
|
}
|
|
3011
3012
|
return this;
|
|
3012
3013
|
}
|
|
3013
|
-
},
|
|
3014
|
+
}, Sr = class e {
|
|
3014
3015
|
static apiCodes = {
|
|
3015
3016
|
[$.Initiated]: "initiated",
|
|
3016
3017
|
[$.InfoRequired]: "info_required",
|
|
@@ -3021,23 +3022,23 @@ var qn = class e {
|
|
|
3021
3022
|
return e.apiCodes[t];
|
|
3022
3023
|
}
|
|
3023
3024
|
static toApiCodes(t) {
|
|
3024
|
-
return
|
|
3025
|
+
return j(t, (t) => e.toApiCode(t));
|
|
3025
3026
|
}
|
|
3026
|
-
},
|
|
3027
|
+
}, Cr = class extends e {
|
|
3027
3028
|
getReclamationsList(e, t, n, r, i = !1) {
|
|
3028
|
-
return this.getTypedPaginated(
|
|
3029
|
+
return this.getTypedPaginated(yr, "/internal/reclamations", e, t, n, {}, i, r);
|
|
3029
3030
|
}
|
|
3030
3031
|
getReclamation(e, t, n = !1) {
|
|
3031
|
-
return this.get(`/internal/reclamations/${e}`, {}, (e) => new
|
|
3032
|
+
return this.get(`/internal/reclamations/${e}`, {}, (e) => new br(e.data), n, t);
|
|
3032
3033
|
}
|
|
3033
3034
|
createMessage(e, t, n = {}) {
|
|
3034
|
-
return this.post(`/internal/reclamations/${e}/messages`, t, (e) => new
|
|
3035
|
+
return this.post(`/internal/reclamations/${e}/messages`, t, (e) => new br(e.data), n);
|
|
3035
3036
|
}
|
|
3036
3037
|
deleteReclamation(e) {
|
|
3037
3038
|
return this.delete(`/internal/reclamations/${e}`);
|
|
3038
3039
|
}
|
|
3039
3040
|
restoreReclamation(e) {
|
|
3040
|
-
return this.post(`/internal/reclamations/${e}/restore`, {}, (e) => new
|
|
3041
|
+
return this.post(`/internal/reclamations/${e}/restore`, {}, (e) => new br(e.data));
|
|
3041
3042
|
}
|
|
3042
3043
|
downloadReclamation(e, t = !1) {
|
|
3043
3044
|
return this.getBlob(`/internal/reclamations/${e}/download`, {}, (e) => new Blob([e.request.response], { type: "application/pdf" }), t);
|
|
@@ -3045,18 +3046,18 @@ var qn = class e {
|
|
|
3045
3046
|
getUpdates(e, t = !1) {
|
|
3046
3047
|
return this.get("/internal/reclamations/updates", {}, void 0, t, e);
|
|
3047
3048
|
}
|
|
3048
|
-
},
|
|
3049
|
+
}, wr = class {
|
|
3049
3050
|
products = [];
|
|
3050
3051
|
productCategories = [];
|
|
3051
3052
|
constructor(e) {
|
|
3052
|
-
e?.products && (this.products = e.products.map((e) => new
|
|
3053
|
+
e?.products && (this.products = e.products.map((e) => new L(e))), e?.productCategories && (this.productCategories = e.productCategories.map((e) => new L(e)));
|
|
3053
3054
|
}
|
|
3054
|
-
},
|
|
3055
|
+
}, Tr = class extends u {
|
|
3055
3056
|
getProductCategoryRecommendations(e) {
|
|
3056
|
-
return this.get(`/internal/catalog/recommendations/categories/${e.id}`, {}, (e) => new
|
|
3057
|
+
return this.get(`/internal/catalog/recommendations/categories/${e.id}`, {}, (e) => new wr(e.data));
|
|
3057
3058
|
}
|
|
3058
3059
|
getProductRecommendations(e) {
|
|
3059
|
-
return this.get(`/internal/catalog/recommendations/products/${e.id}`, {}, (e) => new
|
|
3060
|
+
return this.get(`/internal/catalog/recommendations/products/${e.id}`, {}, (e) => new wr(e.data));
|
|
3060
3061
|
}
|
|
3061
3062
|
saveProductCategoryRecommendations(e, t) {
|
|
3062
3063
|
return this.post(`/internal/catalog/recommendations/categories/${e.id}`, {
|
|
@@ -3070,7 +3071,7 @@ var qn = class e {
|
|
|
3070
3071
|
products: t.products.map((e) => e.id)
|
|
3071
3072
|
});
|
|
3072
3073
|
}
|
|
3073
|
-
},
|
|
3074
|
+
}, Er = class {
|
|
3074
3075
|
static generateUndefinedInstance(e, t = "- Не определён -") {
|
|
3075
3076
|
return new e({
|
|
3076
3077
|
id: 0,
|
|
@@ -3081,13 +3082,13 @@ var qn = class e {
|
|
|
3081
3082
|
static isUndefinedInstance(e) {
|
|
3082
3083
|
return e.id === 0 && e.slug === "-undefined-";
|
|
3083
3084
|
}
|
|
3084
|
-
},
|
|
3085
|
+
}, Dr = class {
|
|
3085
3086
|
name;
|
|
3086
3087
|
content;
|
|
3087
3088
|
constructor(e) {
|
|
3088
3089
|
this.name = e.name, this.content = e.content;
|
|
3089
3090
|
}
|
|
3090
|
-
},
|
|
3091
|
+
}, Or = class {
|
|
3091
3092
|
resourceType;
|
|
3092
3093
|
resourceId;
|
|
3093
3094
|
h1;
|
|
@@ -3097,42 +3098,42 @@ var qn = class e {
|
|
|
3097
3098
|
meta;
|
|
3098
3099
|
tags;
|
|
3099
3100
|
constructor(e) {
|
|
3100
|
-
this.resourceType = new
|
|
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 Dr(e)) ?? [], this.tags = e?.tags;
|
|
3101
3102
|
}
|
|
3102
|
-
},
|
|
3103
|
+
}, kr = class extends u {
|
|
3103
3104
|
getResourceSeoData(e, t) {
|
|
3104
|
-
return this.get(`/internal/seo/${e.slug}/${t}`, {}, (e) => new
|
|
3105
|
+
return this.get(`/internal/seo/${e.slug}/${t}`, {}, (e) => new Or(e.data));
|
|
3105
3106
|
}
|
|
3106
3107
|
saveResourceSeoData(e, t = {}) {
|
|
3107
|
-
return this.post(`/internal/seo/${e.resourceType.slug}/${e.resourceId}`, e, (e) => new
|
|
3108
|
+
return this.post(`/internal/seo/${e.resourceType.slug}/${e.resourceId}`, e, (e) => new Or(e.data), t);
|
|
3108
3109
|
}
|
|
3109
3110
|
deleteResourceSeoData(e, t) {
|
|
3110
3111
|
return this.delete(`/internal/seo/${e.slug}/${t}`);
|
|
3111
3112
|
}
|
|
3112
|
-
},
|
|
3113
|
+
}, Ar = class extends d {
|
|
3113
3114
|
text;
|
|
3114
3115
|
searchCount;
|
|
3115
3116
|
lastSearchedAt;
|
|
3116
3117
|
constructor(e) {
|
|
3117
|
-
super(e), this.text = e?.text ?? "", this.searchCount = e?.searchCount ?? 0, this.lastSearchedAt =
|
|
3118
|
+
super(e), this.text = e?.text ?? "", this.searchCount = e?.searchCount ?? 0, this.lastSearchedAt = s.parse(e?.lastSearchedAt);
|
|
3118
3119
|
}
|
|
3119
|
-
},
|
|
3120
|
+
}, jr = class extends u {
|
|
3120
3121
|
getSearchProductsStatistics(e, t) {
|
|
3121
|
-
return this.getTypedList(
|
|
3122
|
+
return this.getTypedList(Ar, "/internal/statistics/search/products", { date: s.periodToApiFormat(e) }, !1, t);
|
|
3122
3123
|
}
|
|
3123
3124
|
removeSearchProductStatistic(e) {
|
|
3124
3125
|
return this.delete(`/internal/statistics/search/products/${e}`);
|
|
3125
3126
|
}
|
|
3126
|
-
},
|
|
3127
|
+
}, Mr = /* @__PURE__ */ function(e) {
|
|
3127
3128
|
return e[e.Undetermined = 0] = "Undetermined", e[e.Complete = 1] = "Complete", e[e.Incomplete = 2] = "Incomplete", e;
|
|
3128
|
-
}({}),
|
|
3129
|
+
}({}), Nr = class e {
|
|
3129
3130
|
static isBlocked(e, t) {
|
|
3130
|
-
return t && e ===
|
|
3131
|
+
return t && e === Mr.Incomplete;
|
|
3131
3132
|
}
|
|
3132
3133
|
static getValidationResult(t, n) {
|
|
3133
|
-
return e.isBlocked(t, n) ? new
|
|
3134
|
+
return e.isBlocked(t, n) ? new ee("Проверьте адрес и выберите более точный вариант из подсказок", "error") : t === Mr.Incomplete || t === Mr.Undetermined ? new ee("Проверьте правильность адреса", "warning") : void 0;
|
|
3134
3135
|
}
|
|
3135
|
-
},
|
|
3136
|
+
}, Pr = class extends u {
|
|
3136
3137
|
searchAddresses(e) {
|
|
3137
3138
|
return this.execSuggestionQuery("/public/suggestions/address", e);
|
|
3138
3139
|
}
|
|
@@ -3150,26 +3151,26 @@ var qn = class e {
|
|
|
3150
3151
|
}), t;
|
|
3151
3152
|
});
|
|
3152
3153
|
}
|
|
3153
|
-
},
|
|
3154
|
+
}, Fr = class extends u {
|
|
3154
3155
|
constructor() {
|
|
3155
|
-
super(), this.baseUrl = `${
|
|
3156
|
+
super(), this.baseUrl = `${v().config.http.portalApiUrl}/api`, this.interceptorIds.request.authRequestInterceptor && this.httpClient.interceptors.request.eject(this.interceptorIds.request.authRequestInterceptor);
|
|
3156
3157
|
}
|
|
3157
3158
|
getAccessToken() {
|
|
3158
3159
|
return this.get("internal/users/current-tokens").then((e) => e.accessToken);
|
|
3159
3160
|
}
|
|
3160
|
-
},
|
|
3161
|
+
}, Ir = class {
|
|
3161
3162
|
user;
|
|
3162
3163
|
salesDirection;
|
|
3163
3164
|
constructor(e) {
|
|
3164
|
-
this.user = new
|
|
3165
|
+
this.user = new F(e?.user), this.salesDirection = new g(e?.salesDirection);
|
|
3165
3166
|
}
|
|
3166
|
-
},
|
|
3167
|
+
}, Lr = class extends _e {
|
|
3167
3168
|
cities;
|
|
3168
3169
|
users;
|
|
3169
3170
|
constructor(e) {
|
|
3170
|
-
super(e), this.cities = e?.cities?.map((e) => new
|
|
3171
|
+
super(e), this.cities = e?.cities?.map((e) => new n(e)) ?? [], this.users = e?.users?.map((e) => new Ir(e)) ?? [];
|
|
3171
3172
|
}
|
|
3172
|
-
},
|
|
3173
|
+
}, Rr = class extends N {
|
|
3173
3174
|
id;
|
|
3174
3175
|
name;
|
|
3175
3176
|
abbr;
|
|
@@ -3184,27 +3185,27 @@ var qn = class e {
|
|
|
3184
3185
|
}
|
|
3185
3186
|
return this;
|
|
3186
3187
|
}
|
|
3187
|
-
},
|
|
3188
|
+
}, zr = class extends e {
|
|
3188
3189
|
getRegionsList(e, t, n) {
|
|
3189
|
-
return this.getTypedPaginated(
|
|
3190
|
+
return this.getTypedPaginated(_e, "/internal/users/regions", e, t, n);
|
|
3190
3191
|
}
|
|
3191
3192
|
getRegion(e) {
|
|
3192
|
-
return this.get(`/internal/users/regions/${e}`, {}, (e) => new
|
|
3193
|
+
return this.get(`/internal/users/regions/${e}`, {}, (e) => new Lr(e.data));
|
|
3193
3194
|
}
|
|
3194
3195
|
createRegion(e, t = {}) {
|
|
3195
|
-
return this.post("/internal/users/regions", e, (e) => new
|
|
3196
|
+
return this.post("/internal/users/regions", e, (e) => new Lr(e.data), t);
|
|
3196
3197
|
}
|
|
3197
3198
|
updateRegion(e, t, n = {}) {
|
|
3198
|
-
return this.patch(`/internal/users/regions/${e}`, t, (e) => new
|
|
3199
|
+
return this.patch(`/internal/users/regions/${e}`, t, (e) => new Lr(e.data), n);
|
|
3199
3200
|
}
|
|
3200
3201
|
removeRegion(e) {
|
|
3201
3202
|
return this.delete(`/internal/users/regions/${e}`);
|
|
3202
3203
|
}
|
|
3203
3204
|
getRegionEmployees(e) {
|
|
3204
|
-
return this.getTypedList(
|
|
3205
|
+
return this.getTypedList(Ir, `/internal/users/regions/${e}/users`);
|
|
3205
3206
|
}
|
|
3206
3207
|
attachRegionEmployee(e, t, n) {
|
|
3207
|
-
return this.post(`/internal/users/regions/${e}/users/${t}`, { salesDirectionId: n }, (e) => new
|
|
3208
|
+
return this.post(`/internal/users/regions/${e}/users/${t}`, { salesDirectionId: n }, (e) => new Ir(e.data));
|
|
3208
3209
|
}
|
|
3209
3210
|
detachRegionEmployee(e, t, n) {
|
|
3210
3211
|
return this.request({
|
|
@@ -3215,4 +3216,4 @@ var qn = class e {
|
|
|
3215
3216
|
}
|
|
3216
3217
|
};
|
|
3217
3218
|
//#endregion
|
|
3218
|
-
export {
|
|
3219
|
+
export { Mr as AddressQualityEnum, Nr as AddressQualityHelper, an as BankAccount, lt as BlogPost, ot as BlogPostMediaFile, at as BlogPostMediaTypeEnum, st as BlogPostPublicationStatusEnum, ct as BlogPostShortInfo, ut as BlogPostsListFilters, dt as BlogProvider, Tt as CalculationTypeEnum, X as CalendarHelper, V as Cart, wt as CartProvider, Wt as CatalogProvider, _t as CatalogableItem, H as Category, Ut as CategoryFilter, Vt as CategoryFilterSetting, Ht as CategoryFilterValue, zt as CategoryPricingRule, mn as Client, _n as ClientAdditionalData, pn as ClientBaseInfo, Ot as ClientCategory, bn as ClientDataProvider, It as ClientPriceCatalogableItem, Rt as ClientPriceCategory, Lt as ClientPriceProduct, Gt as ClientPriceProvider, Kt as ClientPriceTemplateProvider, z as ClientProduct, Yt as ClientProductCategoryDataProvider, Xt as ClientProductDataProvider, U as ClientShortInfo, rn as ClientsAdditionalDataRequestTypeEnum, hn as ClientsListFilters, L as CodedIdentity, wn as ConfiguratorProvider, Cn as ConfiguratorsEnum, on as Contact, J as ContactPerson, yn as ContactPersonRelated, vn as ContactRelation, sn as ContragentBase, fn as ContragentFactory, ln as ContragentIc, cn as ContragentPerson, dn as ContragentUlNr, un as ContragentUlR, xt as CostSourceEnum, M as CreatableIdentity, Mt as Curator, Pr as DataSuggestionProvider, jn as DateTimeProvider, Nt as DeletableIdentity, ft as DeletableNamedIdentity, Y as DeliveryAddress, Rn as Discount, Pn as DiscountClient, zn as DiscountClientEligibility, Fn as DiscountConditions, Vn as DiscountProvider, pt as DiscountShortInfo, In as DiscountStateEnum, Ln as DiscountStateHelper, Bn as DiscountsListFilters, Un as Faq, Hn as FaqGroup, Wn as FaqProvider, Bt as FilterSettings, vt as HiddenCatalogableItem, yt as Image, qn as ManagerDataFactory, Yn as ManagerProvider, Jn as ManagersListFilters, Dr as MetaTagItem, Z as Offer, Zn as OfferActualization, Xn as OfferActualizationStatus, ir as OfferHelper, Qn as OfferShortInfo, rr as OffersDataProvider, er as OffersListFilters, Q as Order, ar as OrderAction, or as OrderEditorData, tr as OrderInfo, nr as OrderItem, St as OrderItemBase, gn as OrderShortInfo, cr as OrderStatusHistoryInfo, lr as OrdersDataProvider, sr as OrdersListFilters, N as PaginationFiltersBase, dr as PriceAnalyze, mr as PriceAnalyzeProvider, kt as PriceCatalogableItem, _r as PriceHistoryDataProvider, hr as PriceHistoryItem, I as PriceTemplate, jt as PriceTemplateCategory, W as PriceTemplateClient, At as PriceTemplateICatalogableItem, Pt as PriceTemplateProduct, Zt as PriceTemplateProvider, q as PricingRole, Qt as PricingRoleProvider, bt as PrimaryCatalogableItem, R as Product, qt as ProductCategoryDataProvider, Jt as ProductDataProvider, Et as ProductFilterTypeEnum, mt as ProductPriceCoefficient, gr as ProductPriceHistory, gt as ProductUnit, $n as ProfstroyOfferItem, $t as PropertiesProvider, G as Property, K as PropertyValue, br as Reclamation, vr as ReclamationItem, Cr as ReclamationProvider, yr as ReclamationShortInfo, $ as ReclamationStatusEnum, Sr as ReclamationStatusHelper, xr as ReclamationsListFilters, Tr as RecommendationsDataProvider, wr as RecommendationsList, Er as ReferenceDataFactory, Mn as STANDARD_PERIOD_GROUPS, Nn as STANDARD_PERIOD_SECTIONS, Ar as SearchProductStatistic, Or as Seo, kr as SeoDataProvider, jr as StatisticsProvider, ht as StockCount, En as TableDataPagination, Tn as TableDataPaginationRequestParams, Dn as TableDataSortRequestParams, en as TemplateProductCategoryDataProvider, Ft as TemplatesListFilters, Kn as UnitsHelper, xn as UnknownClientDataProvider, Fr as UserAuthDataProvider, Lr as UserRegion, Ir as UserRegionEmployee, zr as UserRegionProvider, Rr as UserRegionsListFilters, F as UserShortInfo, Sn as VersionConfig, ur as currentOrderInjectionKey, On as daysAgoIso, tn as findCatalogItemByIdRecursive, nn as flattenCatalogItems, Gn as formatPercentChange, An as formatRelativeDate, kn as pluralize };
|