@esb-market-contracts/backend 1.0.48 → 1.0.49

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.
Files changed (3) hide show
  1. package/api.d.ts +62 -1
  2. package/package.json +1 -1
  3. package/types.d.ts +82 -1
package/api.d.ts CHANGED
@@ -1443,6 +1443,67 @@ declare const suppliersRouter: import("hono/hono-base").HonoBase<{
1443
1443
  }, "/operations/suppliers", "/operations/suppliers/switch-status">;
1444
1444
  type SuppliersRouter = typeof suppliersRouter;
1445
1445
  //#endregion
1446
+ //#region src/app/routes/(warehouse)/stock-balances.routes.d.ts
1447
+ declare const stockBalancesRouter: import("hono/hono-base").HonoBase<{
1448
+ Variables: VariablesWithActor;
1449
+ }, {
1450
+ "/operations/stock-balances/search": {
1451
+ $post: {
1452
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
1453
+ stockBalances: {
1454
+ id: number;
1455
+ warehouseId: number;
1456
+ productVariantId: number;
1457
+ onHand: number;
1458
+ reserved: number;
1459
+ averageUnitCostBase: string | null;
1460
+ updatedAt: Date | null;
1461
+ createdAt: Date;
1462
+ available: number;
1463
+ product: {
1464
+ id: number;
1465
+ model: string | null;
1466
+ name: Partial<Record<"en" | "ka" | "ru", string>> | null;
1467
+ image: {
1468
+ src: string;
1469
+ isBanner: boolean;
1470
+ } | null;
1471
+ };
1472
+ productVariant: {
1473
+ id: number;
1474
+ sku: string | null;
1475
+ barcode: string | null;
1476
+ name: Partial<Record<"en" | "ka" | "ru", string>> | null;
1477
+ };
1478
+ measurementUnit: {
1479
+ id: number;
1480
+ code: string;
1481
+ name: string;
1482
+ decimalPlaces: number;
1483
+ };
1484
+ }[];
1485
+ total: number;
1486
+ }>;
1487
+ outputFormat: "json";
1488
+ status: 200;
1489
+ input: {
1490
+ json: {
1491
+ where?: {
1492
+ warehouseId?: number | undefined;
1493
+ productVariantId?: number | undefined;
1494
+ } | undefined;
1495
+ query?: string | undefined;
1496
+ pagination: {
1497
+ offset?: unknown;
1498
+ limit?: unknown;
1499
+ };
1500
+ };
1501
+ };
1502
+ };
1503
+ };
1504
+ }, "/operations/stock-balances", "/operations/stock-balances/search">;
1505
+ type StockBalancesRouter = typeof stockBalancesRouter;
1506
+ //#endregion
1446
1507
  //#region src/app/routes/(warehouse)/warehouses.routes.d.ts
1447
1508
  declare const warehousesRouter: import("hono/hono-base").HonoBase<{
1448
1509
  Variables: VariablesWithActor;
@@ -1553,4 +1614,4 @@ declare const warehousesRouter: import("hono/hono-base").HonoBase<{
1553
1614
  }, "/operations/warehouses", "/operations/warehouses/switch-status">;
1554
1615
  type WarehousesRouter = typeof warehousesRouter;
1555
1616
  //#endregion
1556
- export type { AuditLogsRouter, BrandsRouter, CategoriesRouter, CountriesRouter, CustomersRouter, DeliveriesRouter, ExchangeRatesRouter, MeasurementUnitsRouter, ProductVariantsRouter, ProductsRouter, SuppliersRouter, WarehousesRouter };
1617
+ export type { AuditLogsRouter, BrandsRouter, CategoriesRouter, CountriesRouter, CustomersRouter, DeliveriesRouter, ExchangeRatesRouter, MeasurementUnitsRouter, ProductVariantsRouter, ProductsRouter, StockBalancesRouter, SuppliersRouter, WarehousesRouter };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@esb-market-contracts/backend",
3
3
  "description": "Shared TypeScript contract definitions for backend.",
4
- "version": "1.0.48",
4
+ "version": "1.0.49",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "sideEffects": false,
package/types.d.ts CHANGED
@@ -873,6 +873,74 @@ type SupplierCreatePayload = z.infer<typeof supplierCreatePayloadSchema>;
873
873
  type SupplierUpdatePayload = z.infer<typeof supplierUpdatePayloadSchema>;
874
874
  type SupplierSwitchStatusPayload = z.infer<typeof supplierSwitchStatusPayloadSchema>;
875
875
  //#endregion
876
+ //#region src/app/flows/(warehouse)/stock-balance/stock-balance.schemas.d.ts
877
+ declare const stockBalanceSearchOptionsSchema: z.ZodObject<{
878
+ where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
879
+ warehouseId: z.ZodOptional<z.ZodInt>;
880
+ productVariantId: z.ZodOptional<z.ZodInt>;
881
+ }, z.core.$strip>, z.ZodTransform<{
882
+ warehouseId?: number | undefined;
883
+ productVariantId: number;
884
+ } | {
885
+ warehouseId: number;
886
+ productVariantId?: number | undefined;
887
+ }, {
888
+ warehouseId?: number | undefined;
889
+ productVariantId?: number | undefined;
890
+ }>>>;
891
+ query: z.ZodOptional<z.ZodString>;
892
+ pagination: z.ZodObject<{
893
+ offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
894
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
895
+ }, z.core.$strip>;
896
+ }, z.core.$strict>;
897
+ declare const stockBalanceSearchItemSchema: z.ZodObject<{
898
+ id: z.ZodInt;
899
+ warehouseId: z.ZodInt;
900
+ productVariantId: z.ZodInt;
901
+ onHand: z.ZodNumber;
902
+ reserved: z.ZodNumber;
903
+ averageUnitCostBase: z.ZodNullable<z.ZodString>;
904
+ updatedAt: z.ZodNullable<z.ZodDate>;
905
+ createdAt: z.ZodDate;
906
+ available: z.ZodNumber;
907
+ product: z.ZodObject<{
908
+ id: z.ZodInt;
909
+ model: z.ZodNullable<z.ZodString>;
910
+ name: z.ZodNullable<z.ZodRecord<z.ZodEnum<{
911
+ en: "en";
912
+ ka: "ka";
913
+ ru: "ru";
914
+ }> & z.core.$partial, z.ZodString>>;
915
+ image: z.ZodNullable<z.ZodObject<{
916
+ src: z.ZodURL;
917
+ isBanner: z.ZodBoolean;
918
+ }, z.core.$strip>>;
919
+ }, z.core.$strip>;
920
+ productVariant: z.ZodObject<{
921
+ id: z.ZodInt;
922
+ sku: z.ZodNullable<z.ZodString>;
923
+ barcode: z.ZodNullable<z.ZodString>;
924
+ name: z.ZodNullable<z.ZodRecord<z.ZodEnum<{
925
+ en: "en";
926
+ ka: "ka";
927
+ ru: "ru";
928
+ }> & z.core.$partial, z.ZodString>>;
929
+ }, z.core.$strip>;
930
+ measurementUnit: z.ZodObject<{
931
+ id: z.ZodInt;
932
+ code: z.ZodString;
933
+ name: z.ZodString;
934
+ decimalPlaces: z.ZodInt;
935
+ }, z.core.$strip>;
936
+ }, z.core.$strip>;
937
+ type StockBalanceSearchOptions = z.infer<typeof stockBalanceSearchOptionsSchema>;
938
+ type StockBalanceSearchItem = z.infer<typeof stockBalanceSearchItemSchema>;
939
+ type StockBalanceSearchResult = {
940
+ stockBalances: StockBalanceSearchItem[];
941
+ total: number;
942
+ };
943
+ //#endregion
876
944
  //#region src/app/domain/(warehouse)/warehouses/warehouses.schemas.d.ts
877
945
  declare const warehouseSchema: z.ZodObject<{
878
946
  id: z.ZodInt;
@@ -1295,4 +1363,17 @@ declare const deliverySchema: z.ZodObject<{
1295
1363
  }, z.core.$strip>;
1296
1364
  type Delivery = z.infer<typeof deliverySchema>;
1297
1365
  //#endregion
1298
- export type { AuditLogResult, AuditLogSearchPayload, AuditLogSearchResult, AuditLogSelectOneQuery, Brand, BrandCreatePayload, BrandSearchOptions, BrandSearchResult, BrandSelectOneQuery, BrandUpdatePayload, Category, CategoryCreatePayload, CategorySearchOptions, CategorySearchResult, CategorySelectOneQuery, CategoryUpdatePayload, Country, CountryCreatePayload, CountrySearchOptions, CountrySearchResult, CountrySelectOneQuery, CountryUpdatePayload, Currency, CurrencyListResult, Customer, CustomerCreatePayload, CustomerSearchOptions, CustomerSearchResult, CustomerSelectOneQuery, CustomerUpdatePayload, Delivery, DeliveryCreatePayload, DeliveryCreateResult, DeliveryDeletePayload, DeliveryDetails, DeliveryItem, DeliveryItemAddPayload, DeliveryItemCatalogDetails, DeliveryItemDeletePayload, DeliveryItemDetails, DeliveryItemResult, DeliveryItemScanPayload, DeliveryItemScanResult, DeliveryItemUpdatePayload, DeliveryPostPayload, DeliverySearchItem, DeliverySearchOptions, DeliverySearchResult, DeliverySelectOneQuery, DeliverySelectOneResult, DeliveryUpdatePayload, ExchangeRate, ExchangeRateDateSearchResult, ExchangeRateSearchOptions, ExchangeRateSearchResult, MeasurementUnit, MeasurementUnitListResult, Product, ProductCreatePayload, ProductCreateResult, ProductDeletePayload, ProductImage, ProductImages, ProductSearchOptions, ProductSearchResult, ProductSelectOneQuery, ProductUpdatePayload, ProductVariant, ProductVariantCreatePayload, ProductVariantCreateResult, ProductVariantDeletePayload, ProductVariantSearchOptions, ProductVariantSearchResult, ProductVariantSelectOneQuery, ProductVariantUpdatePayload, Supplier, SupplierCreatePayload, SupplierSearchOptions, SupplierSearchResult, SupplierSelectOneQuery, SupplierSwitchStatusPayload, SupplierUpdatePayload, Warehouse, WarehouseCreatePayload, WarehouseSearchOptions, WarehouseSearchResult, WarehouseSelectOneQuery, WarehouseSwitchStatusPayload, WarehouseUpdatePayload };
1366
+ //#region src/app/domain/(warehouse)/stock/stock-balances/stock-balances.schemas.d.ts
1367
+ declare const stockBalanceSchema: z.ZodObject<{
1368
+ id: z.ZodInt;
1369
+ warehouseId: z.ZodInt;
1370
+ productVariantId: z.ZodInt;
1371
+ onHand: z.ZodNumber;
1372
+ reserved: z.ZodNumber;
1373
+ averageUnitCostBase: z.ZodNullable<z.ZodString>;
1374
+ updatedAt: z.ZodNullable<z.ZodDate>;
1375
+ createdAt: z.ZodDate;
1376
+ }, z.core.$strip>;
1377
+ type StockBalance = z.infer<typeof stockBalanceSchema>;
1378
+ //#endregion
1379
+ export type { AuditLogResult, AuditLogSearchPayload, AuditLogSearchResult, AuditLogSelectOneQuery, Brand, BrandCreatePayload, BrandSearchOptions, BrandSearchResult, BrandSelectOneQuery, BrandUpdatePayload, Category, CategoryCreatePayload, CategorySearchOptions, CategorySearchResult, CategorySelectOneQuery, CategoryUpdatePayload, Country, CountryCreatePayload, CountrySearchOptions, CountrySearchResult, CountrySelectOneQuery, CountryUpdatePayload, Currency, CurrencyListResult, Customer, CustomerCreatePayload, CustomerSearchOptions, CustomerSearchResult, CustomerSelectOneQuery, CustomerUpdatePayload, Delivery, DeliveryCreatePayload, DeliveryCreateResult, DeliveryDeletePayload, DeliveryDetails, DeliveryItem, DeliveryItemAddPayload, DeliveryItemCatalogDetails, DeliveryItemDeletePayload, DeliveryItemDetails, DeliveryItemResult, DeliveryItemScanPayload, DeliveryItemScanResult, DeliveryItemUpdatePayload, DeliveryPostPayload, DeliverySearchItem, DeliverySearchOptions, DeliverySearchResult, DeliverySelectOneQuery, DeliverySelectOneResult, DeliveryUpdatePayload, ExchangeRate, ExchangeRateDateSearchResult, ExchangeRateSearchOptions, ExchangeRateSearchResult, MeasurementUnit, MeasurementUnitListResult, Product, ProductCreatePayload, ProductCreateResult, ProductDeletePayload, ProductImage, ProductImages, ProductSearchOptions, ProductSearchResult, ProductSelectOneQuery, ProductUpdatePayload, ProductVariant, ProductVariantCreatePayload, ProductVariantCreateResult, ProductVariantDeletePayload, ProductVariantSearchOptions, ProductVariantSearchResult, ProductVariantSelectOneQuery, ProductVariantUpdatePayload, StockBalance, StockBalanceSearchItem, StockBalanceSearchOptions, StockBalanceSearchResult, Supplier, SupplierCreatePayload, SupplierSearchOptions, SupplierSearchResult, SupplierSelectOneQuery, SupplierSwitchStatusPayload, SupplierUpdatePayload, Warehouse, WarehouseCreatePayload, WarehouseSearchOptions, WarehouseSearchResult, WarehouseSelectOneQuery, WarehouseSwitchStatusPayload, WarehouseUpdatePayload };