@esb-market-contracts/backend 1.0.25 → 1.0.27

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
@@ -583,6 +583,7 @@ declare const exchangeRatesRouter: import("hono/hono-base").HonoBase<{
583
583
  id: number;
584
584
  code: string;
585
585
  name: string;
586
+ sortOrder: number;
586
587
  }[];
587
588
  }>;
588
589
  outputFormat: "json";
@@ -665,11 +666,11 @@ declare const auditLogSchema: import("drizzle-orm/zod").BuildSchema<"select", {
665
666
  identity: undefined;
666
667
  generated: undefined;
667
668
  }>;
668
- event: import("drizzle-orm/pg-core").PgBuildColumn<"audit_logs", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, "brand.created" | "brand.updated" | "category.activated" | "category.archived" | "category.created" | "category.updated" | "country.created" | "country.updated" | "customer.created" | "customer.updated" | "product.created" | "product.deleted" | "product.updated" | "productVariant.created" | "productVariant.deleted" | "productVariant.updated">, {
669
+ event: import("drizzle-orm/pg-core").PgBuildColumn<"audit_logs", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, "brand.created" | "brand.updated" | "category.activated" | "category.archived" | "category.created" | "category.updated" | "country.created" | "country.updated" | "customer.created" | "customer.updated" | "product.created" | "product.deleted" | "product.updated" | "productVariant.created" | "productVariant.deleted" | "productVariant.updated" | "warehouse.activated" | "warehouse.archived" | "warehouse.created" | "warehouse.updated">, {
669
670
  name: string;
670
671
  tableName: "audit_logs";
671
672
  dataType: "string";
672
- data: "brand.created" | "brand.updated" | "category.activated" | "category.archived" | "category.created" | "category.updated" | "country.created" | "country.updated" | "customer.created" | "customer.updated" | "product.created" | "product.deleted" | "product.updated" | "productVariant.created" | "productVariant.deleted" | "productVariant.updated";
673
+ data: "brand.created" | "brand.updated" | "category.activated" | "category.archived" | "category.created" | "category.updated" | "country.created" | "country.updated" | "customer.created" | "customer.updated" | "product.created" | "product.deleted" | "product.updated" | "productVariant.created" | "productVariant.deleted" | "productVariant.updated" | "warehouse.activated" | "warehouse.archived" | "warehouse.created" | "warehouse.updated";
673
674
  driverParam: string;
674
675
  notNull: true;
675
676
  hasDefault: false;
@@ -889,4 +890,97 @@ declare const customersRouter: import("hono/hono-base").HonoBase<{
889
890
  }, "/operations/customers", "/operations/customers/update">;
890
891
  type CustomersRouter = typeof customersRouter;
891
892
  //#endregion
892
- export type { AuditLogsRouter, BrandsRouter, CategoriesRouter, CountriesRouter, CustomersRouter, ExchangeRatesRouter, ProductVariantsRouter, ProductsRouter };
893
+ //#region src/app/routes/(operations)/warehouses.routes.d.ts
894
+ declare const warehousesRouter: import("hono/hono-base").HonoBase<{
895
+ Variables: VariablesWithActor;
896
+ }, {
897
+ "/operations/warehouses/one": {
898
+ $get: {
899
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
900
+ warehouse: {
901
+ id: number;
902
+ code: string;
903
+ name: Partial<Record<"en" | "ka" | "ru", string>>;
904
+ status: "active" | "archived";
905
+ salesEnabled: boolean;
906
+ updatedAt: Date | null;
907
+ createdAt: Date;
908
+ };
909
+ }>;
910
+ outputFormat: "json";
911
+ status: 200;
912
+ input: {
913
+ query: {
914
+ id: string | string[];
915
+ };
916
+ };
917
+ };
918
+ };
919
+ } & {
920
+ "/operations/warehouses/create": {
921
+ $post: {
922
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
923
+ outputFormat: "json";
924
+ status: 201;
925
+ input: {
926
+ json: {
927
+ code: string;
928
+ name: Partial<Record<"en" | "ka" | "ru", string>>;
929
+ salesEnabled: boolean;
930
+ };
931
+ };
932
+ };
933
+ };
934
+ } & {
935
+ "/operations/warehouses/search": {
936
+ $post: {
937
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
938
+ warehouses: {
939
+ id: number;
940
+ code: string;
941
+ name: Partial<Record<"en" | "ka" | "ru", string>>;
942
+ status: "active" | "archived";
943
+ salesEnabled: boolean;
944
+ updatedAt: Date | null;
945
+ createdAt: Date;
946
+ }[];
947
+ total: number;
948
+ }>;
949
+ outputFormat: "json";
950
+ status: 200;
951
+ input: {
952
+ json: {
953
+ where?: {
954
+ status?: "active" | "archived" | undefined;
955
+ salesEnabled?: boolean | undefined;
956
+ } | undefined;
957
+ query?: string | undefined;
958
+ pagination: {
959
+ offset?: unknown;
960
+ limit?: unknown;
961
+ };
962
+ };
963
+ };
964
+ };
965
+ };
966
+ } & {
967
+ "/operations/warehouses/update": {
968
+ $post: {
969
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
970
+ outputFormat: "json";
971
+ status: 200;
972
+ input: {
973
+ json: {
974
+ code?: string | undefined;
975
+ name?: Partial<Record<"en" | "ka" | "ru", string>> | undefined;
976
+ status?: "active" | "archived" | undefined;
977
+ salesEnabled?: boolean | undefined;
978
+ warehouseId: number;
979
+ };
980
+ };
981
+ };
982
+ };
983
+ }, "/operations/warehouses", "/operations/warehouses/update">;
984
+ type WarehousesRouter = typeof warehousesRouter;
985
+ //#endregion
986
+ export type { AuditLogsRouter, BrandsRouter, CategoriesRouter, CountriesRouter, CustomersRouter, ExchangeRatesRouter, ProductVariantsRouter, ProductsRouter, WarehousesRouter };
package/enums.js CHANGED
@@ -6,7 +6,7 @@ var locale = localesRecord;
6
6
 
7
7
  // src/internal/localization/localization.schemas.ts
8
8
  import { z } from "zod";
9
- var AT_LEAST_ONE_LOCALIZED_VALUE_ERROR = "At least one localized value is required";
9
+ var AT_LEAST_ONE_LOCALIZED_VALUE_ERROR = "\u10E8\u10D4\u10D0\u10D5\u10E1\u10D4\u10D7 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 \u10DB\u10D8\u10DC\u10D8\u10DB\u10E3\u10DB \u10D4\u10E0\u10D7 \u10D4\u10DC\u10D0\u10D6\u10D4.";
10
10
  var localizedStringSchema = z.partialRecord(z.enum(localesArray), z.string()).refine((value) => Object.values(value).some((localizedValue) => localizedValue.trim().length > 0), {
11
11
  message: AT_LEAST_ONE_LOCALIZED_VALUE_ERROR
12
12
  });
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.25",
4
+ "version": "1.0.27",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "sideEffects": false,
package/types.d.ts CHANGED
@@ -248,11 +248,11 @@ declare const auditLogSchema: import("drizzle-orm/zod").BuildSchema<"select", {
248
248
  identity: undefined;
249
249
  generated: undefined;
250
250
  }>;
251
- event: import("drizzle-orm/pg-core").PgBuildColumn<"audit_logs", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, "brand.created" | "brand.updated" | "category.activated" | "category.archived" | "category.created" | "category.updated" | "country.created" | "country.updated" | "customer.created" | "customer.updated" | "product.created" | "product.deleted" | "product.updated" | "productVariant.created" | "productVariant.deleted" | "productVariant.updated">, {
251
+ event: import("drizzle-orm/pg-core").PgBuildColumn<"audit_logs", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, "brand.created" | "brand.updated" | "category.activated" | "category.archived" | "category.created" | "category.updated" | "country.created" | "country.updated" | "customer.created" | "customer.updated" | "product.created" | "product.deleted" | "product.updated" | "productVariant.created" | "productVariant.deleted" | "productVariant.updated" | "warehouse.activated" | "warehouse.archived" | "warehouse.created" | "warehouse.updated">, {
252
252
  name: string;
253
253
  tableName: "audit_logs";
254
254
  dataType: "string";
255
- data: "brand.created" | "brand.updated" | "category.activated" | "category.archived" | "category.created" | "category.updated" | "country.created" | "country.updated" | "customer.created" | "customer.updated" | "product.created" | "product.deleted" | "product.updated" | "productVariant.created" | "productVariant.deleted" | "productVariant.updated";
255
+ data: "brand.created" | "brand.updated" | "category.activated" | "category.archived" | "category.created" | "category.updated" | "country.created" | "country.updated" | "customer.created" | "customer.updated" | "product.created" | "product.deleted" | "product.updated" | "productVariant.created" | "productVariant.deleted" | "productVariant.updated" | "warehouse.activated" | "warehouse.archived" | "warehouse.created" | "warehouse.updated";
256
256
  driverParam: string;
257
257
  notNull: true;
258
258
  hasDefault: false;
@@ -424,11 +424,90 @@ type CustomerSelectOneQuery = z.infer<typeof customerSelectOneQuerySchema>;
424
424
  type CustomerCreatePayload = z.infer<typeof customerCreatePayloadSchema>;
425
425
  type CustomerUpdatePayload = z.infer<typeof customerUpdatePayloadSchema>;
426
426
  //#endregion
427
+ //#region src/app/domain/(operations)/warehouses/warehouses.schemas.d.ts
428
+ declare const warehouseSchema: z.ZodObject<{
429
+ id: z.ZodInt;
430
+ code: z.ZodString;
431
+ name: z.ZodRecord<z.ZodEnum<{
432
+ en: "en";
433
+ ka: "ka";
434
+ ru: "ru";
435
+ }> & z.core.$partial, z.ZodString>;
436
+ status: z.ZodEnum<{
437
+ active: "active";
438
+ archived: "archived";
439
+ }>;
440
+ salesEnabled: z.ZodBoolean;
441
+ updatedAt: z.ZodNullable<z.ZodDate>;
442
+ createdAt: z.ZodDate;
443
+ }, z.core.$strip>;
444
+ type Warehouse = z.infer<typeof warehouseSchema>;
445
+ //#endregion
446
+ //#region src/app/flows/warehouse/warehouse.schemas.d.ts
447
+ declare const warehouseSearchOptionsSchema: z.ZodObject<{
448
+ where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
449
+ status: z.ZodOptional<z.ZodEnum<{
450
+ active: "active";
451
+ archived: "archived";
452
+ }>>;
453
+ salesEnabled: z.ZodOptional<z.ZodBoolean>;
454
+ }, z.core.$strip>, z.ZodTransform<{
455
+ status?: "active" | "archived" | undefined;
456
+ salesEnabled: boolean;
457
+ } | {
458
+ status: "active" | "archived";
459
+ salesEnabled?: boolean | undefined;
460
+ }, {
461
+ status?: "active" | "archived" | undefined;
462
+ salesEnabled?: boolean | undefined;
463
+ }>>>;
464
+ query: z.ZodOptional<z.ZodString>;
465
+ pagination: z.ZodObject<{
466
+ offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
467
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
468
+ }, z.core.$strip>;
469
+ }, z.core.$strict>;
470
+ declare const warehouseSelectOneQuerySchema: z.ZodObject<{
471
+ id: z.ZodInt;
472
+ }, z.core.$strip>;
473
+ declare const warehouseCreatePayloadSchema: z.ZodObject<{
474
+ code: z.ZodString;
475
+ name: z.ZodRecord<z.ZodEnum<{
476
+ en: "en";
477
+ ka: "ka";
478
+ ru: "ru";
479
+ }> & z.core.$partial, z.ZodString>;
480
+ salesEnabled: z.ZodBoolean;
481
+ }, z.core.$strip>;
482
+ declare const warehouseUpdatePayloadSchema: z.ZodObject<{
483
+ code: z.ZodOptional<z.ZodString>;
484
+ name: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
485
+ en: "en";
486
+ ka: "ka";
487
+ ru: "ru";
488
+ }> & z.core.$partial, z.ZodString>>;
489
+ status: z.ZodOptional<z.ZodEnum<{
490
+ active: "active";
491
+ archived: "archived";
492
+ }>>;
493
+ salesEnabled: z.ZodOptional<z.ZodBoolean>;
494
+ warehouseId: z.ZodInt;
495
+ }, z.core.$strip>;
496
+ type WarehouseSearchOptions = z.infer<typeof warehouseSearchOptionsSchema>;
497
+ type WarehouseSearchResult = {
498
+ warehouses: Warehouse[];
499
+ total: number;
500
+ };
501
+ type WarehouseSelectOneQuery = z.infer<typeof warehouseSelectOneQuerySchema>;
502
+ type WarehouseCreatePayload = z.infer<typeof warehouseCreatePayloadSchema>;
503
+ type WarehouseUpdatePayload = z.infer<typeof warehouseUpdatePayloadSchema>;
504
+ //#endregion
427
505
  //#region src/app/domain/(finance)/currencies/currencies.schemas.d.ts
428
506
  declare const currencySchema: z.ZodObject<{
429
507
  id: z.ZodInt;
430
508
  code: z.ZodString;
431
509
  name: z.ZodString;
510
+ sortOrder: z.ZodInt;
432
511
  }, z.core.$strip>;
433
512
  type Currency = z.infer<typeof currencySchema>;
434
513
  //#endregion
@@ -707,4 +786,4 @@ type ProductVariantCreateResult = {
707
786
  };
708
787
  type ProductVariantUpdatePayload = z.infer<typeof productVariantUpdatePayloadSchema>;
709
788
  //#endregion
710
- 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, ExchangeRate, ExchangeRateDateSearchResult, ExchangeRateSearchOptions, ExchangeRateSearchResult, Product, ProductCreatePayload, ProductCreateResult, ProductDeletePayload, ProductImage, ProductImages, ProductSearchOptions, ProductSearchResult, ProductSelectOneQuery, ProductUpdatePayload, ProductVariant, ProductVariantCreatePayload, ProductVariantCreateResult, ProductVariantDeletePayload, ProductVariantSearchOptions, ProductVariantSearchResult, ProductVariantSelectOneQuery, ProductVariantUpdatePayload };
789
+ 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, ExchangeRate, ExchangeRateDateSearchResult, ExchangeRateSearchOptions, ExchangeRateSearchResult, Product, ProductCreatePayload, ProductCreateResult, ProductDeletePayload, ProductImage, ProductImages, ProductSearchOptions, ProductSearchResult, ProductSelectOneQuery, ProductUpdatePayload, ProductVariant, ProductVariantCreatePayload, ProductVariantCreateResult, ProductVariantDeletePayload, ProductVariantSearchOptions, ProductVariantSearchResult, ProductVariantSelectOneQuery, ProductVariantUpdatePayload, Warehouse, WarehouseCreatePayload, WarehouseSearchOptions, WarehouseSearchResult, WarehouseSelectOneQuery, WarehouseUpdatePayload };