autosync_backend2 1.1.33 → 1.1.34
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/index.d.ts +31 -12
- package/dist/index.js +12 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,13 @@ export declare const app: Elysia<"", {
|
|
|
13
13
|
}, {
|
|
14
14
|
typebox: {
|
|
15
15
|
readonly "WarehouseProductModel.create": import("@sinclair/typebox").TObject<{
|
|
16
|
-
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").
|
|
16
|
+
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
|
17
|
+
Сэлбэг: "Сэлбэг";
|
|
18
|
+
Тос: "Тос";
|
|
19
|
+
Дугуй: "Дугуй";
|
|
20
|
+
Будаг: "Будаг";
|
|
21
|
+
Аккумлятор: "Аккумлятор";
|
|
22
|
+
}>>;
|
|
17
23
|
name: import("@sinclair/typebox").TString;
|
|
18
24
|
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
|
|
19
25
|
supplierId: import("@sinclair/typebox").TString;
|
|
@@ -26,7 +32,13 @@ export declare const app: Elysia<"", {
|
|
|
26
32
|
alias: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
|
|
27
33
|
}>;
|
|
28
34
|
readonly "WarehouseProductModel.update": import("@sinclair/typebox").TObject<{
|
|
29
|
-
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").
|
|
35
|
+
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
|
36
|
+
Сэлбэг: "Сэлбэг";
|
|
37
|
+
Тос: "Тос";
|
|
38
|
+
Дугуй: "Дугуй";
|
|
39
|
+
Будаг: "Будаг";
|
|
40
|
+
Аккумлятор: "Аккумлятор";
|
|
41
|
+
}>>;
|
|
30
42
|
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
31
43
|
companyId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
32
44
|
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
|
|
@@ -43,6 +55,7 @@ export declare const app: Elysia<"", {
|
|
|
43
55
|
id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
44
56
|
branchId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
45
57
|
ids: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
58
|
+
type: import("@sinclair/typebox").TOptional<import("elysia/dist/type-system/types").TUnionEnum<["Сэлбэг", "Тос", "Дугуй", "Будаг", "Аккумлятор"]>>;
|
|
46
59
|
search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
47
60
|
supplierId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
48
61
|
productId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -98,6 +111,7 @@ export declare const app: Elysia<"", {
|
|
|
98
111
|
id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
99
112
|
branchId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
100
113
|
ids: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
114
|
+
type: import("@sinclair/typebox").TOptional<import("elysia/dist/type-system/types").TUnionEnum<["Сэлбэг", "Тос", "Дугуй", "Будаг", "Аккумлятор"]>>;
|
|
101
115
|
search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
102
116
|
supplierId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
103
117
|
productId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -131,6 +145,7 @@ export declare const app: Elysia<"", {
|
|
|
131
145
|
SALES: "SALES";
|
|
132
146
|
}>>;
|
|
133
147
|
product: import("@sinclair/typebox").TObject<{
|
|
148
|
+
type: import("@sinclair/typebox").TOptional<import("elysia/dist/type-system/types").TUnionEnum<["Сэлбэг", "Тос", "Дугуй", "Будаг", "Аккумлятор"]>>;
|
|
134
149
|
id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
135
150
|
search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
136
151
|
branchId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -1414,6 +1429,7 @@ export declare const app: Elysia<"", {
|
|
|
1414
1429
|
body: unknown;
|
|
1415
1430
|
params: {};
|
|
1416
1431
|
query: {
|
|
1432
|
+
type?: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор" | undefined;
|
|
1417
1433
|
id?: string | undefined;
|
|
1418
1434
|
search?: string | undefined;
|
|
1419
1435
|
branchId?: string | undefined;
|
|
@@ -1445,7 +1461,7 @@ export declare const app: Elysia<"", {
|
|
|
1445
1461
|
partNumber: string;
|
|
1446
1462
|
alias: string | null;
|
|
1447
1463
|
companyId: string;
|
|
1448
|
-
type:
|
|
1464
|
+
type: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор";
|
|
1449
1465
|
id: string;
|
|
1450
1466
|
createdAt: string;
|
|
1451
1467
|
updatedAt: string;
|
|
@@ -1479,7 +1495,7 @@ export declare const app: Elysia<"", {
|
|
|
1479
1495
|
product: {
|
|
1480
1496
|
post: {
|
|
1481
1497
|
body: {
|
|
1482
|
-
type?:
|
|
1498
|
+
type?: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор" | undefined;
|
|
1483
1499
|
description?: string | null | undefined;
|
|
1484
1500
|
productId?: string | null | undefined;
|
|
1485
1501
|
barCode?: string | null | undefined;
|
|
@@ -1496,7 +1512,7 @@ export declare const app: Elysia<"", {
|
|
|
1496
1512
|
headers: unknown;
|
|
1497
1513
|
response: {
|
|
1498
1514
|
200: {
|
|
1499
|
-
type:
|
|
1515
|
+
type: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор";
|
|
1500
1516
|
name: string;
|
|
1501
1517
|
id: string;
|
|
1502
1518
|
createdAt: string;
|
|
@@ -1530,7 +1546,7 @@ export declare const app: Elysia<"", {
|
|
|
1530
1546
|
many: {
|
|
1531
1547
|
post: {
|
|
1532
1548
|
body: {
|
|
1533
|
-
type?:
|
|
1549
|
+
type?: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор" | undefined;
|
|
1534
1550
|
description?: string | null | undefined;
|
|
1535
1551
|
productId?: string | null | undefined;
|
|
1536
1552
|
barCode?: string | null | undefined;
|
|
@@ -1571,6 +1587,7 @@ export declare const app: Elysia<"", {
|
|
|
1571
1587
|
body: unknown;
|
|
1572
1588
|
params: {};
|
|
1573
1589
|
query: {
|
|
1590
|
+
type?: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор" | undefined;
|
|
1574
1591
|
id?: string | undefined;
|
|
1575
1592
|
search?: string | undefined;
|
|
1576
1593
|
branchId?: string | undefined;
|
|
@@ -1606,7 +1623,7 @@ export declare const app: Elysia<"", {
|
|
|
1606
1623
|
":id": {
|
|
1607
1624
|
put: {
|
|
1608
1625
|
body: {
|
|
1609
|
-
type?:
|
|
1626
|
+
type?: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор" | undefined;
|
|
1610
1627
|
name?: string | undefined;
|
|
1611
1628
|
companyId?: string | undefined;
|
|
1612
1629
|
description?: string | null | undefined;
|
|
@@ -1637,7 +1654,7 @@ export declare const app: Elysia<"", {
|
|
|
1637
1654
|
partNumber: string;
|
|
1638
1655
|
alias: string | null;
|
|
1639
1656
|
companyId: string;
|
|
1640
|
-
type:
|
|
1657
|
+
type: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор";
|
|
1641
1658
|
id: string;
|
|
1642
1659
|
createdAt: string;
|
|
1643
1660
|
updatedAt: string;
|
|
@@ -1809,6 +1826,7 @@ export declare const app: Elysia<"", {
|
|
|
1809
1826
|
params: {};
|
|
1810
1827
|
query: {
|
|
1811
1828
|
product?: {
|
|
1829
|
+
type?: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор" | undefined;
|
|
1812
1830
|
id?: string | undefined;
|
|
1813
1831
|
search?: string | undefined;
|
|
1814
1832
|
branchId?: string | undefined;
|
|
@@ -1868,7 +1886,7 @@ export declare const app: Elysia<"", {
|
|
|
1868
1886
|
partNumber: string;
|
|
1869
1887
|
alias: string | null;
|
|
1870
1888
|
companyId: string;
|
|
1871
|
-
type:
|
|
1889
|
+
type: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор";
|
|
1872
1890
|
id: string;
|
|
1873
1891
|
createdAt: string;
|
|
1874
1892
|
updatedAt: string;
|
|
@@ -1970,6 +1988,7 @@ export declare const app: Elysia<"", {
|
|
|
1970
1988
|
transactionType?: "IN" | "OUT" | undefined;
|
|
1971
1989
|
transactionKind?: "ORDER" | "TRANSFER" | "RETURN" | "ADJUSTMENT" | "REJECTION" | "SALES" | undefined;
|
|
1972
1990
|
product: {
|
|
1991
|
+
type?: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор" | undefined;
|
|
1973
1992
|
id?: string | undefined;
|
|
1974
1993
|
search?: string | undefined;
|
|
1975
1994
|
branchId?: string | undefined;
|
|
@@ -2002,7 +2021,7 @@ export declare const app: Elysia<"", {
|
|
|
2002
2021
|
partNumber: string;
|
|
2003
2022
|
alias: string | null;
|
|
2004
2023
|
companyId: string;
|
|
2005
|
-
type:
|
|
2024
|
+
type: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор";
|
|
2006
2025
|
id: string;
|
|
2007
2026
|
createdAt: string;
|
|
2008
2027
|
updatedAt: string;
|
|
@@ -3253,7 +3272,7 @@ export declare const app: Elysia<"", {
|
|
|
3253
3272
|
partNumber: string;
|
|
3254
3273
|
alias: string | null;
|
|
3255
3274
|
companyId: string;
|
|
3256
|
-
type:
|
|
3275
|
+
type: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор";
|
|
3257
3276
|
id: string;
|
|
3258
3277
|
createdAt: string;
|
|
3259
3278
|
updatedAt: string;
|
|
@@ -4420,7 +4439,7 @@ export declare const app: Elysia<"", {
|
|
|
4420
4439
|
partNumber: string;
|
|
4421
4440
|
alias: string | null;
|
|
4422
4441
|
companyId: string;
|
|
4423
|
-
type:
|
|
4442
|
+
type: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор";
|
|
4424
4443
|
id: string;
|
|
4425
4444
|
createdAt: string;
|
|
4426
4445
|
updatedAt: string;
|
package/dist/index.js
CHANGED
|
@@ -137649,6 +137649,7 @@ __export(exports_schema, {
|
|
|
137649
137649
|
warehouseTransactionTypeEnum: () => warehouseTransactionTypeEnum,
|
|
137650
137650
|
warehouseTransactionKindEnum: () => warehouseTransactionKindEnum,
|
|
137651
137651
|
warehouseSchema: () => warehouseSchema,
|
|
137652
|
+
warehouseProductTypeEnum: () => warehouseProductTypeEnum,
|
|
137652
137653
|
warehouseProductTable: () => warehouseProductTable,
|
|
137653
137654
|
warehouseItemTransactionTable: () => warehouseItemTransactionTable,
|
|
137654
137655
|
warehouseItemTable: () => warehouseItemTable,
|
|
@@ -138085,6 +138086,13 @@ var techdocSupplierTable = techdocSchema.table("supplier", {
|
|
|
138085
138086
|
});
|
|
138086
138087
|
// src/lib/db/schema/warehouse.schema.ts
|
|
138087
138088
|
var warehouseSchema = pgSchema("warehouse");
|
|
138089
|
+
var warehouseProductTypeEnum = warehouseSchema.enum("product_type", [
|
|
138090
|
+
"\u0421\u044D\u043B\u0431\u044D\u0433",
|
|
138091
|
+
"\u0422\u043E\u0441",
|
|
138092
|
+
"\u0414\u0443\u0433\u0443\u0439",
|
|
138093
|
+
"\u0411\u0443\u0434\u0430\u0433",
|
|
138094
|
+
"\u0410\u043A\u043A\u0443\u043C\u043B\u044F\u0442\u043E\u0440"
|
|
138095
|
+
]);
|
|
138088
138096
|
var warehouseProductTable = warehouseSchema.table("product", {
|
|
138089
138097
|
...base_schema_helper_default,
|
|
138090
138098
|
supplierId: uuid().notNull(),
|
|
@@ -138098,7 +138106,7 @@ var warehouseProductTable = warehouseSchema.table("product", {
|
|
|
138098
138106
|
partNumber: varchar().notNull(),
|
|
138099
138107
|
alias: varchar(),
|
|
138100
138108
|
companyId: uuid().notNull(),
|
|
138101
|
-
type:
|
|
138109
|
+
type: warehouseProductTypeEnum().notNull().default("\u0421\u044D\u043B\u0431\u044D\u0433")
|
|
138102
138110
|
});
|
|
138103
138111
|
var warehouseWarehouseTable = warehouseSchema.table("warehouse", {
|
|
138104
138112
|
...base_schema_helper_default,
|
|
@@ -144220,7 +144228,7 @@ var WarehouseProductLogic;
|
|
|
144220
144228
|
((WarehouseProductLogic) => {
|
|
144221
144229
|
WarehouseProductLogic.getFilter = (query, user2) => {
|
|
144222
144230
|
const ilikeSearch = `%${query.search}%`;
|
|
144223
|
-
return and(softDeletedFilter(warehouseProductTable), eq(warehouseProductTable.companyId, user2.companyId), or(ilike(warehouseProductTable.name, ilikeSearch), ilike(warehouseProductTable.barCode, ilikeSearch), ilike(warehouseProductTable.oen, ilikeSearch), ilike(warehouseProductTable.partNumber, ilikeSearch))?.if(!!query.search), eq(warehouseProductTable.priceSell, query.priceSell ?? 0).if(query.priceSell), eq(warehouseProductTable.productId, query.productId ?? "").if(query.productId), eq(warehouseProductTable.supplierId, query.supplierId ?? "").if(query.supplierId), eq(warehouseProductTable.id, query.id ?? "").if(query.id), inArray(warehouseProductTable.id, query.ids ?? []).if(query.ids?.length));
|
|
144231
|
+
return and(softDeletedFilter(warehouseProductTable), eq(warehouseProductTable.companyId, user2.companyId), or(ilike(warehouseProductTable.name, ilikeSearch), ilike(warehouseProductTable.barCode, ilikeSearch), ilike(warehouseProductTable.oen, ilikeSearch), ilike(warehouseProductTable.partNumber, ilikeSearch))?.if(!!query.search), eq(warehouseProductTable.priceSell, query.priceSell ?? 0).if(query.priceSell), eq(warehouseProductTable.productId, query.productId ?? "").if(query.productId), eq(warehouseProductTable.supplierId, query.supplierId ?? "").if(query.supplierId), eq(warehouseProductTable.id, query.id ?? "").if(query.id), inArray(warehouseProductTable.id, query.ids ?? []).if(query.ids?.length), eq(warehouseProductTable.type, query.type ?? "\u0421\u044D\u043B\u0431\u044D\u0433").if(query.type));
|
|
144224
144232
|
};
|
|
144225
144233
|
WarehouseProductLogic.select = async (query, user2) => {
|
|
144226
144234
|
const baseQuery = db_default.select({
|
|
@@ -144892,9 +144900,6 @@ var CrmSpPackageProductLogic;
|
|
|
144892
144900
|
if (body.length === 0) {
|
|
144893
144901
|
return status("Bad Request", "\u0411\u04AF\u0442\u044D\u044D\u0433\u0434\u044D\u0445\u04AF\u04AF\u043D \u043E\u0440\u0443\u0443\u043B\u0430\u0445 \u043C\u044D\u0434\u044D\u044D\u043B\u044D\u043B \u0431\u0430\u0439\u0445\u0433\u04AF\u0439 \u0431\u0430\u0439\u043D\u0430.");
|
|
144894
144902
|
}
|
|
144895
|
-
console.dir(body, {
|
|
144896
|
-
depth: Infinity
|
|
144897
|
-
});
|
|
144898
144903
|
await db_default.transaction(async (db2) => {
|
|
144899
144904
|
await db2.delete(crmSpPackageProductTable).where(eq(crmSpPackageProductTable.spPackageId, body[0].spPackageId));
|
|
144900
144905
|
await db2.insert(crmSpPackageProductTable).values(body.map((i2) => ({
|
|
@@ -145778,7 +145783,8 @@ var WarehouseProductModel;
|
|
|
145778
145783
|
branchId: t.String({ format: "uuid" }),
|
|
145779
145784
|
productId: t.String({ format: "uuid" }),
|
|
145780
145785
|
id: t.String({ format: "uuid" }),
|
|
145781
|
-
ids: t.Array(t.String({ format: "uuid" }))
|
|
145786
|
+
ids: t.Array(t.String({ format: "uuid" })),
|
|
145787
|
+
type: t.UnionEnum(warehouseProductTypeEnum.enumValues)
|
|
145782
145788
|
})),
|
|
145783
145789
|
PaginationSchema
|
|
145784
145790
|
]);
|