autosync_backend2 1.0.76 → 1.0.77
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 +4 -2
- package/dist/index.js +17 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1208,10 +1208,12 @@ declare const app: Elysia<"", {
|
|
|
1208
1208
|
headers: unknown;
|
|
1209
1209
|
response: {
|
|
1210
1210
|
200: {
|
|
1211
|
-
|
|
1212
|
-
|
|
1211
|
+
pageQuantity: number;
|
|
1212
|
+
totalQuantity: number;
|
|
1213
1213
|
pagePrice: number;
|
|
1214
1214
|
totalPrice: number;
|
|
1215
|
+
tlotalCount: number;
|
|
1216
|
+
totalPage: number;
|
|
1215
1217
|
result: {
|
|
1216
1218
|
name: string;
|
|
1217
1219
|
partNumber: string;
|
package/dist/index.js
CHANGED
|
@@ -96325,20 +96325,30 @@ var InventoryItemLogic;
|
|
|
96325
96325
|
const columns = getTableColumns(inventoryItemTable);
|
|
96326
96326
|
const base = db_default.select({
|
|
96327
96327
|
...columns,
|
|
96328
|
-
|
|
96329
|
-
|
|
96328
|
+
pageQuantity: sql`COALESCE(sum(${inventoryItemTable.quantity}), 0)`.mapWith(Number),
|
|
96329
|
+
totalQuantity: sql`COALESCE(sum(${inventoryItemTable.quantity}) over(), 0)`.mapWith(Number),
|
|
96330
96330
|
pagePrice: sql`sum(${inventoryItemTable.sellPrice} * ${inventoryItemTable.quantity})`.mapWith(Number),
|
|
96331
|
-
totalPrice: sql`sum(${inventoryItemTable.sellPrice} * ${inventoryItemTable.quantity}) over()`.mapWith(Number)
|
|
96331
|
+
totalPrice: sql`sum(${inventoryItemTable.sellPrice} * ${inventoryItemTable.quantity}) over()`.mapWith(Number),
|
|
96332
|
+
totalCount: sql`count(*) over()`.mapWith(Number)
|
|
96332
96333
|
}).from(inventoryItemTable).where(InventoryItemLogic.getInventoryItemFilter(query, user2)).groupBy(inventoryItemTable.id).$dynamic();
|
|
96333
96334
|
const inventoryItems = await pagination_helper_default(base, query.pagination);
|
|
96334
96335
|
const content = {
|
|
96335
|
-
|
|
96336
|
-
|
|
96336
|
+
pageQuantity: inventoryItems[0]?.pageQuantity ?? 0,
|
|
96337
|
+
totalQuantity: inventoryItems[0]?.totalQuantity ?? 0,
|
|
96337
96338
|
pagePrice: inventoryItems[0]?.pagePrice ?? 0,
|
|
96338
|
-
totalPrice: inventoryItems[0]?.totalPrice ?? 0
|
|
96339
|
+
totalPrice: inventoryItems[0]?.totalPrice ?? 0,
|
|
96340
|
+
tlotalCount: inventoryItems[0]?.totalCount ?? 0,
|
|
96341
|
+
totalPage: inventoryItems.length === 0 ? 0 : Math.ceil(inventoryItems[0].totalCount / query.pagination.size)
|
|
96339
96342
|
};
|
|
96340
96343
|
return {
|
|
96341
|
-
result: inventoryItems.map(({
|
|
96344
|
+
result: inventoryItems.map(({
|
|
96345
|
+
pageQuantity,
|
|
96346
|
+
totalQuantity,
|
|
96347
|
+
pagePrice,
|
|
96348
|
+
totalPrice,
|
|
96349
|
+
totalCount,
|
|
96350
|
+
...item
|
|
96351
|
+
}) => item),
|
|
96342
96352
|
...content
|
|
96343
96353
|
};
|
|
96344
96354
|
};
|
|
@@ -97287,8 +97297,6 @@ var app = new Elysia().use(index_default({
|
|
|
97287
97297
|
allowedHeaders: ["Content-Type", "Authorization"]
|
|
97288
97298
|
})).use(index_default2({
|
|
97289
97299
|
documentation: {
|
|
97290
|
-
components: await OpenAPI.components,
|
|
97291
|
-
paths: await OpenAPI.getPaths(),
|
|
97292
97300
|
tags: swagger_tags_default
|
|
97293
97301
|
}
|
|
97294
97302
|
})).use(pino_logger_default).onAfterResponse(async ({ request, response, server, status: status2, set: set2, body, headers }) => {
|