@esb-market-contracts/backend 1.0.38 → 1.0.39

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/api.d.ts CHANGED
@@ -880,6 +880,35 @@ declare const deliveriesRouter: import("hono/hono-base").HonoBase<{
880
880
  };
881
881
  };
882
882
  };
883
+ } & {
884
+ "/operations/deliveries/item/scan": {
885
+ $post: {
886
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
887
+ outcome: "added";
888
+ deliveryItem: {
889
+ id: number;
890
+ deliveryId: number;
891
+ productVariantId: number;
892
+ quantity: number;
893
+ unitCost: string | null;
894
+ unitCostBase: string | null;
895
+ updatedAt: Date | null;
896
+ createdAt: Date;
897
+ };
898
+ } | {
899
+ outcome: "product-variant-not-found";
900
+ barcode: string;
901
+ }>;
902
+ outputFormat: "json";
903
+ status: 200;
904
+ input: {
905
+ json: {
906
+ deliveryId: number;
907
+ barcode: string;
908
+ };
909
+ };
910
+ };
911
+ };
883
912
  } & {
884
913
  "/operations/deliveries/item/update": {
885
914
  $post: {
package/enums.d.ts CHANGED
@@ -27,6 +27,14 @@ declare const deliveryStatusesRecord: Readonly<{
27
27
  }>;
28
28
  type DeliveryStatus = (typeof deliveryStatusesArray)[number];
29
29
  //#endregion
30
+ //#region src/app/flows/(procurement)/delivery/delivery.enums.d.ts
31
+ export declare const deliveryItemScanOutcomesArray: readonly ['added', 'product-variant-not-found'];
32
+ declare const deliveryItemScanOutcomesRecord: Readonly<{
33
+ ADDED: "added";
34
+ PRODUCT_VARIANT_NOT_FOUND: "product-variant-not-found";
35
+ }>;
36
+ type DeliveryItemScanOutcome = (typeof deliveryItemScanOutcomesArray)[number];
37
+ //#endregion
30
38
  //#region src/app/flows/(audit)/audit/audit.enums.d.ts
31
39
  export declare const auditLogSourcesArray: readonly ['admin', 'backend'];
32
40
  declare const auditLogSourcesRecord: Readonly<{
@@ -53,4 +61,4 @@ declare const productStatusesRecord: Readonly<{
53
61
  }>;
54
62
  type ProductStatus = (typeof productStatusesArray)[number];
55
63
  //#endregion
56
- export { type AuditLogSource, type CustomerType, type DeliveryStatus, type EntityStatus, type Locale, type ProductStatus, auditLogSourcesRecord as auditLogSource, customerTypesRecord as customerType, deliveryStatusesRecord as deliveryStatus, entityStatusesRecord as entityStatus, productStatusesRecord as productStatus };
64
+ export { type AuditLogSource, type CustomerType, type DeliveryItemScanOutcome, type DeliveryStatus, type EntityStatus, type Locale, type ProductStatus, auditLogSourcesRecord as auditLogSource, customerTypesRecord as customerType, deliveryItemScanOutcomesRecord as deliveryItemScanOutcome, deliveryStatusesRecord as deliveryStatus, entityStatusesRecord as entityStatus, productStatusesRecord as productStatus };
package/enums.js CHANGED
@@ -25,31 +25,40 @@ var deliveryStatusesArray = ["draft", "posted", "reversed"];
25
25
  var deliveryStatusPGEnum = pgEnum2("delivery_status", deliveryStatusesArray);
26
26
  var deliveryStatusesRecord = createStringEnumRecord3(deliveryStatusesArray);
27
27
 
28
- // src/app/flows/(audit)/audit/audit.enums.ts
28
+ // src/app/flows/(procurement)/delivery/delivery.enums.ts
29
29
  import { createStringEnumRecord as createStringEnumRecord4 } from "@kalutskii/foundation";
30
30
  import { z as z2 } from "zod";
31
+ var deliveryItemScanOutcomesArray = ["added", "product-variant-not-found"];
32
+ var deliveryItemScanOutcomesRecord = createStringEnumRecord4(deliveryItemScanOutcomesArray);
33
+ var deliveryItemScanOutcomeSchema = z2.enum(deliveryItemScanOutcomesArray);
34
+
35
+ // src/app/flows/(audit)/audit/audit.enums.ts
36
+ import { createStringEnumRecord as createStringEnumRecord5 } from "@kalutskii/foundation";
37
+ import { z as z3 } from "zod";
31
38
  var auditLogSourcesArray = ["admin", "backend"];
32
- var auditLogSourcesRecord = createStringEnumRecord4(auditLogSourcesArray);
33
- var auditLogSourceSchema = z2.enum(auditLogSourcesArray);
39
+ var auditLogSourcesRecord = createStringEnumRecord5(auditLogSourcesArray);
40
+ var auditLogSourceSchema = z3.enum(auditLogSourcesArray);
34
41
 
35
42
  // src/app/domain/(sales)/customers/customers.enums.ts
36
- import { createStringEnumRecord as createStringEnumRecord5 } from "@kalutskii/foundation";
43
+ import { createStringEnumRecord as createStringEnumRecord6 } from "@kalutskii/foundation";
37
44
  import { pgEnum as pgEnum3 } from "drizzle-orm/pg-core";
38
45
  var customerTypesArray = ["individual", "individual_entrepreneur", "legal_entity"];
39
46
  var customerTypePGEnum = pgEnum3("customer_type", customerTypesArray);
40
- var customerTypesRecord = createStringEnumRecord5(customerTypesArray);
47
+ var customerTypesRecord = createStringEnumRecord6(customerTypesArray);
41
48
 
42
49
  // src/app/domain/(catalog)/products/products.enums.ts
43
- import { createStringEnumRecord as createStringEnumRecord6 } from "@kalutskii/foundation";
50
+ import { createStringEnumRecord as createStringEnumRecord7 } from "@kalutskii/foundation";
44
51
  import { pgEnum as pgEnum4 } from "drizzle-orm/pg-core";
45
52
  var productStatusesArray = ["draft", "active", "archived"];
46
53
  var productStatusPGEnum = pgEnum4("product_status", productStatusesArray);
47
- var productStatusesRecord = createStringEnumRecord6(productStatusesArray);
54
+ var productStatusesRecord = createStringEnumRecord7(productStatusesArray);
48
55
  export {
49
56
  auditLogSourcesRecord as auditLogSource,
50
57
  auditLogSourcesArray,
51
58
  customerTypesRecord as customerType,
52
59
  customerTypesArray,
60
+ deliveryItemScanOutcomesRecord as deliveryItemScanOutcome,
61
+ deliveryItemScanOutcomesArray,
53
62
  deliveryStatusesRecord as deliveryStatus,
54
63
  entityStatusesRecord as entityStatus,
55
64
  locale,
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.38",
4
+ "version": "1.0.39",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "sideEffects": false,
package/types.d.ts CHANGED
@@ -550,6 +550,26 @@ declare const deliveryItemUpdatePayloadSchema: z.ZodObject<{
550
550
  declare const deliveryItemDeletePayloadSchema: z.ZodObject<{
551
551
  deliveryItemId: z.ZodInt;
552
552
  }, z.core.$strip>;
553
+ declare const deliveryItemScanPayloadSchema: z.ZodObject<{
554
+ deliveryId: z.ZodInt;
555
+ barcode: z.ZodString;
556
+ }, z.core.$strip>;
557
+ declare const deliveryItemScanResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
558
+ outcome: z.ZodLiteral<"added">;
559
+ deliveryItem: z.ZodObject<{
560
+ id: z.ZodInt;
561
+ deliveryId: z.ZodInt;
562
+ productVariantId: z.ZodInt;
563
+ quantity: z.ZodNumber;
564
+ unitCost: z.ZodNullable<z.ZodString>;
565
+ unitCostBase: z.ZodNullable<z.ZodString>;
566
+ updatedAt: z.ZodNullable<z.ZodDate>;
567
+ createdAt: z.ZodDate;
568
+ }, z.core.$strip>;
569
+ }, z.core.$strip>, z.ZodObject<{
570
+ outcome: z.ZodLiteral<"product-variant-not-found">;
571
+ barcode: z.ZodString;
572
+ }, z.core.$strip>], "outcome">;
553
573
  declare const deliveryDetailsSchema: z.ZodObject<{
554
574
  id: z.ZodInt;
555
575
  code: z.ZodString;
@@ -584,6 +604,8 @@ type DeliveryPostPayload = z.infer<typeof deliveryPostPayloadSchema>;
584
604
  type DeliveryItemAddPayload = z.infer<typeof deliveryItemAddPayloadSchema>;
585
605
  type DeliveryItemUpdatePayload = z.infer<typeof deliveryItemUpdatePayloadSchema>;
586
606
  type DeliveryItemDeletePayload = z.infer<typeof deliveryItemDeletePayloadSchema>;
607
+ type DeliveryItemScanPayload = z.infer<typeof deliveryItemScanPayloadSchema>;
608
+ type DeliveryItemScanResult = z.infer<typeof deliveryItemScanResultSchema>;
587
609
  type DeliveryItemResult = {
588
610
  deliveryItem: DeliveryItem;
589
611
  };
@@ -1085,4 +1107,4 @@ declare const deliverySchema: z.ZodObject<{
1085
1107
  }, z.core.$strip>;
1086
1108
  type Delivery = z.infer<typeof deliverySchema>;
1087
1109
  //#endregion
1088
- 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, DeliveryItemDeletePayload, DeliveryItemResult, 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 };
1110
+ 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, DeliveryItemDeletePayload, 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 };