@esb-market-contracts/backend 1.0.29 → 1.0.31
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 +34 -5
- package/enums.d.ts +1 -1
- package/enums.js +1 -1
- package/package.json +1 -1
- package/types.d.ts +31 -13
package/api.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import "hono";
|
|
|
3
3
|
import "ky";
|
|
4
4
|
import "hono/http-exception";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
|
|
6
|
+
import "drizzle-orm";
|
|
7
|
+
//#region src/app/flows/global/authentication/authentication.middleware.d.ts
|
|
7
8
|
type VariablesWithActor = {
|
|
8
9
|
actorSession: SessionPayload;
|
|
9
10
|
};
|
|
@@ -299,6 +300,28 @@ declare const countriesRouter: import("hono/hono-base").HonoBase<{
|
|
|
299
300
|
}, "/catalog/countries", "/catalog/countries/update">;
|
|
300
301
|
type CountriesRouter = typeof countriesRouter;
|
|
301
302
|
//#endregion
|
|
303
|
+
//#region src/app/routes/(catalog)/measurement-units.routes.d.ts
|
|
304
|
+
declare const measurementUnitsRouter: import("hono/hono-base").HonoBase<{
|
|
305
|
+
Variables: VariablesWithActor;
|
|
306
|
+
}, {
|
|
307
|
+
"/catalog/measurement-units/list": {
|
|
308
|
+
$get: {
|
|
309
|
+
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
|
|
310
|
+
measurementUnits: {
|
|
311
|
+
id: number;
|
|
312
|
+
code: string;
|
|
313
|
+
name: string;
|
|
314
|
+
decimalPlaces: number;
|
|
315
|
+
}[];
|
|
316
|
+
}>;
|
|
317
|
+
outputFormat: "json";
|
|
318
|
+
status: 200;
|
|
319
|
+
input: {};
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
}, "/catalog/measurement-units", "/catalog/measurement-units/list">;
|
|
323
|
+
type MeasurementUnitsRouter = typeof measurementUnitsRouter;
|
|
324
|
+
//#endregion
|
|
302
325
|
//#region src/app/routes/(catalog)/product-variants.routes.d.ts
|
|
303
326
|
declare const productVariantsRouter: import("hono/hono-base").HonoBase<{
|
|
304
327
|
Variables: VariablesWithActor;
|
|
@@ -309,6 +332,7 @@ declare const productVariantsRouter: import("hono/hono-base").HonoBase<{
|
|
|
309
332
|
productVariant: {
|
|
310
333
|
id: number;
|
|
311
334
|
productId: number;
|
|
335
|
+
measurementUnitId: number | null;
|
|
312
336
|
status: "active" | "archived" | "draft";
|
|
313
337
|
sku: string | null;
|
|
314
338
|
barcode: string | null;
|
|
@@ -333,6 +357,7 @@ declare const productVariantsRouter: import("hono/hono-base").HonoBase<{
|
|
|
333
357
|
productVariant: {
|
|
334
358
|
id: number;
|
|
335
359
|
productId: number;
|
|
360
|
+
measurementUnitId: number | null;
|
|
336
361
|
status: "active" | "archived" | "draft";
|
|
337
362
|
sku: string | null;
|
|
338
363
|
barcode: string | null;
|
|
@@ -346,6 +371,7 @@ declare const productVariantsRouter: import("hono/hono-base").HonoBase<{
|
|
|
346
371
|
input: {
|
|
347
372
|
json: {
|
|
348
373
|
productId: number;
|
|
374
|
+
measurementUnitId?: number | null | undefined;
|
|
349
375
|
status?: "active" | "archived" | "draft" | undefined;
|
|
350
376
|
sku?: string | null | undefined;
|
|
351
377
|
barcode?: string | null | undefined;
|
|
@@ -361,6 +387,7 @@ declare const productVariantsRouter: import("hono/hono-base").HonoBase<{
|
|
|
361
387
|
productVariants: {
|
|
362
388
|
id: number;
|
|
363
389
|
productId: number;
|
|
390
|
+
measurementUnitId: number | null;
|
|
364
391
|
status: "active" | "archived" | "draft";
|
|
365
392
|
sku: string | null;
|
|
366
393
|
barcode: string | null;
|
|
@@ -376,6 +403,7 @@ declare const productVariantsRouter: import("hono/hono-base").HonoBase<{
|
|
|
376
403
|
json: {
|
|
377
404
|
where: {
|
|
378
405
|
productId: number;
|
|
406
|
+
measurementUnitId?: number | null | undefined;
|
|
379
407
|
status?: "active" | "archived" | "draft" | undefined;
|
|
380
408
|
};
|
|
381
409
|
query?: string | undefined;
|
|
@@ -395,6 +423,7 @@ declare const productVariantsRouter: import("hono/hono-base").HonoBase<{
|
|
|
395
423
|
status: 200;
|
|
396
424
|
input: {
|
|
397
425
|
json: {
|
|
426
|
+
measurementUnitId?: number | null | undefined;
|
|
398
427
|
status?: "active" | "archived" | "draft" | undefined;
|
|
399
428
|
sku?: string | null | undefined;
|
|
400
429
|
barcode?: string | null | undefined;
|
|
@@ -621,7 +650,7 @@ declare const exchangeRatesRouter: import("hono/hono-base").HonoBase<{
|
|
|
621
650
|
exchangeRates: {
|
|
622
651
|
id: number;
|
|
623
652
|
currencyId: number;
|
|
624
|
-
rate:
|
|
653
|
+
rate: string;
|
|
625
654
|
validFromDate: Date;
|
|
626
655
|
}[];
|
|
627
656
|
total: number;
|
|
@@ -645,7 +674,7 @@ declare const exchangeRatesRouter: import("hono/hono-base").HonoBase<{
|
|
|
645
674
|
}, "/finance/exchange-rates", "/finance/exchange-rates/search">;
|
|
646
675
|
type ExchangeRatesRouter = typeof exchangeRatesRouter;
|
|
647
676
|
//#endregion
|
|
648
|
-
//#region src/app/flows/audit/audit.enums.d.ts
|
|
677
|
+
//#region src/app/flows/(operations)/audit/audit.enums.d.ts
|
|
649
678
|
declare const auditLogSourcesArray: readonly ['admin', 'backend'];
|
|
650
679
|
type AuditLogSource = (typeof auditLogSourcesArray)[number];
|
|
651
680
|
//#endregion
|
|
@@ -728,7 +757,7 @@ declare const auditLogSchema: import("drizzle-orm/zod").BuildSchema<"select", {
|
|
|
728
757
|
}>;
|
|
729
758
|
}, undefined, undefined>;
|
|
730
759
|
//#endregion
|
|
731
|
-
//#region src/app/flows/audit/audit.schemas.d.ts
|
|
760
|
+
//#region src/app/flows/(operations)/audit/audit.schemas.d.ts
|
|
732
761
|
type AuditLogResult = z.infer<typeof auditLogSchema> & {
|
|
733
762
|
source: AuditLogSource;
|
|
734
763
|
};
|
|
@@ -1000,4 +1029,4 @@ declare const warehousesRouter: import("hono/hono-base").HonoBase<{
|
|
|
1000
1029
|
}, "/operations/warehouses", "/operations/warehouses/switch-status">;
|
|
1001
1030
|
type WarehousesRouter = typeof warehousesRouter;
|
|
1002
1031
|
//#endregion
|
|
1003
|
-
export type { AuditLogsRouter, BrandsRouter, CategoriesRouter, CountriesRouter, CustomersRouter, ExchangeRatesRouter, ProductVariantsRouter, ProductsRouter, WarehousesRouter };
|
|
1032
|
+
export type { AuditLogsRouter, BrandsRouter, CategoriesRouter, CountriesRouter, CustomersRouter, ExchangeRatesRouter, MeasurementUnitsRouter, ProductVariantsRouter, ProductsRouter, WarehousesRouter };
|
package/enums.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ declare const entityStatusesRecord: Readonly<{
|
|
|
18
18
|
}>;
|
|
19
19
|
type EntityStatus = (typeof entityStatusesArray)[number];
|
|
20
20
|
//#endregion
|
|
21
|
-
//#region src/app/flows/audit/audit.enums.d.ts
|
|
21
|
+
//#region src/app/flows/(operations)/audit/audit.enums.d.ts
|
|
22
22
|
export declare const auditLogSourcesArray: readonly ['admin', 'backend'];
|
|
23
23
|
declare const auditLogSourcesRecord: Readonly<{
|
|
24
24
|
ADMIN: "admin";
|
package/enums.js
CHANGED
|
@@ -18,7 +18,7 @@ var entityStatusesArray = ["active", "archived"];
|
|
|
18
18
|
var entityStatusPGEnum = pgEnum("entity_status", entityStatusesArray);
|
|
19
19
|
var entityStatusesRecord = createStringEnumRecord2(entityStatusesArray);
|
|
20
20
|
|
|
21
|
-
// src/app/flows/audit/audit.enums.ts
|
|
21
|
+
// src/app/flows/(operations)/audit/audit.enums.ts
|
|
22
22
|
import { createStringEnumRecord as createStringEnumRecord3 } from "@kalutskii/foundation";
|
|
23
23
|
import { z as z2 } from "zod";
|
|
24
24
|
var auditLogSourcesArray = ["admin", "backend"];
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import "hono/http-exception";
|
|
3
|
-
import "postgres";
|
|
4
3
|
import "drizzle-orm";
|
|
4
|
+
import "postgres";
|
|
5
5
|
//#region src/app/domain/(catalog)/brands/brands.schemas.d.ts
|
|
6
6
|
declare const brandSchema: z.ZodObject<{
|
|
7
7
|
id: z.ZodInt;
|
|
@@ -20,7 +20,7 @@ declare const brandSchema: z.ZodObject<{
|
|
|
20
20
|
}, z.core.$strip>;
|
|
21
21
|
type Brand = z.infer<typeof brandSchema>;
|
|
22
22
|
//#endregion
|
|
23
|
-
//#region src/app/flows/brand/brand.schemas.d.ts
|
|
23
|
+
//#region src/app/flows/(catalog)/brand/brand.schemas.d.ts
|
|
24
24
|
declare const brandSearchOptionsSchema: z.ZodObject<{
|
|
25
25
|
where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
26
26
|
countryId: z.ZodOptional<z.ZodInt>;
|
|
@@ -101,7 +101,7 @@ declare const categorySchema: z.ZodObject<{
|
|
|
101
101
|
}, z.core.$strip>;
|
|
102
102
|
type Category = z.infer<typeof categorySchema>;
|
|
103
103
|
//#endregion
|
|
104
|
-
//#region src/app/flows/category/category.schemas.d.ts
|
|
104
|
+
//#region src/app/flows/(catalog)/category/category.schemas.d.ts
|
|
105
105
|
declare const categorySearchOptionsSchema: z.ZodObject<{
|
|
106
106
|
where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
107
107
|
parentId: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -185,7 +185,7 @@ declare const countrySchema: z.ZodObject<{
|
|
|
185
185
|
}, z.core.$strip>;
|
|
186
186
|
type Country = z.infer<typeof countrySchema>;
|
|
187
187
|
//#endregion
|
|
188
|
-
//#region src/app/flows/country/country.schemas.d.ts
|
|
188
|
+
//#region src/app/flows/(catalog)/country/country.schemas.d.ts
|
|
189
189
|
declare const countrySearchOptionsSchema: z.ZodObject<{
|
|
190
190
|
where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
191
191
|
code: z.ZodOptional<z.ZodString>;
|
|
@@ -231,6 +231,20 @@ type CountrySelectOneQuery = z.infer<typeof countrySelectOneQuerySchema>;
|
|
|
231
231
|
type CountryCreatePayload = z.infer<typeof countryCreatePayloadSchema>;
|
|
232
232
|
type CountryUpdatePayload = z.infer<typeof countryUpdatePayloadSchema>;
|
|
233
233
|
//#endregion
|
|
234
|
+
//#region src/app/domain/(catalog)/measurement-units/measurement-units.schemas.d.ts
|
|
235
|
+
declare const measurementUnitSchema: z.ZodObject<{
|
|
236
|
+
id: z.ZodInt;
|
|
237
|
+
code: z.ZodString;
|
|
238
|
+
name: z.ZodString;
|
|
239
|
+
decimalPlaces: z.ZodInt;
|
|
240
|
+
}, z.core.$strip>;
|
|
241
|
+
type MeasurementUnit = z.infer<typeof measurementUnitSchema>;
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/app/flows/(catalog)/measurement-unit/measurement-unit.schemas.d.ts
|
|
244
|
+
type MeasurementUnitListResult = {
|
|
245
|
+
measurementUnits: MeasurementUnit[];
|
|
246
|
+
};
|
|
247
|
+
//#endregion
|
|
234
248
|
//#region src/app/domain/(operations)/audit-logs/audit-logs.schemas.d.ts
|
|
235
249
|
declare const auditLogSchema: import("drizzle-orm/zod").BuildSchema<"select", {
|
|
236
250
|
id: import("drizzle-orm/pg-core").PgBuildColumn<"audit_logs", import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgSerialBuilder>, {
|
|
@@ -310,11 +324,11 @@ declare const auditLogSchema: import("drizzle-orm/zod").BuildSchema<"select", {
|
|
|
310
324
|
}>;
|
|
311
325
|
}, undefined, undefined>;
|
|
312
326
|
//#endregion
|
|
313
|
-
//#region src/app/flows/audit/audit.enums.d.ts
|
|
327
|
+
//#region src/app/flows/(operations)/audit/audit.enums.d.ts
|
|
314
328
|
declare const auditLogSourcesArray: readonly ['admin', 'backend'];
|
|
315
329
|
type AuditLogSource = (typeof auditLogSourcesArray)[number];
|
|
316
330
|
//#endregion
|
|
317
|
-
//#region src/app/flows/audit/audit.schemas.d.ts
|
|
331
|
+
//#region src/app/flows/(operations)/audit/audit.schemas.d.ts
|
|
318
332
|
declare const auditLogSearchPayloadSchema: z.ZodObject<{
|
|
319
333
|
where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
320
334
|
event: z.ZodOptional<z.ZodString>;
|
|
@@ -373,7 +387,7 @@ declare const customerSchema: z.ZodObject<{
|
|
|
373
387
|
}, z.core.$strip>;
|
|
374
388
|
type Customer = z.infer<typeof customerSchema>;
|
|
375
389
|
//#endregion
|
|
376
|
-
//#region src/app/flows/customer/customer.schemas.d.ts
|
|
390
|
+
//#region src/app/flows/(operations)/customer/customer.schemas.d.ts
|
|
377
391
|
declare const customerSearchOptionsSchema: z.ZodObject<{
|
|
378
392
|
where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
379
393
|
type: z.ZodOptional<z.ZodEnum<{
|
|
@@ -440,7 +454,7 @@ declare const warehouseSchema: z.ZodObject<{
|
|
|
440
454
|
}, z.core.$strip>;
|
|
441
455
|
type Warehouse = z.infer<typeof warehouseSchema>;
|
|
442
456
|
//#endregion
|
|
443
|
-
//#region src/app/flows/warehouse/warehouse.schemas.d.ts
|
|
457
|
+
//#region src/app/flows/(operations)/warehouse/warehouse.schemas.d.ts
|
|
444
458
|
declare const warehouseSearchOptionsSchema: z.ZodObject<{
|
|
445
459
|
where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
446
460
|
status: z.ZodOptional<z.ZodEnum<{
|
|
@@ -510,12 +524,12 @@ type Currency = z.infer<typeof currencySchema>;
|
|
|
510
524
|
declare const exchangeRateSchema: z.ZodObject<{
|
|
511
525
|
id: z.ZodInt;
|
|
512
526
|
currencyId: z.ZodInt;
|
|
513
|
-
rate: z.
|
|
527
|
+
rate: z.ZodString;
|
|
514
528
|
validFromDate: z.ZodDate;
|
|
515
529
|
}, z.core.$strip>;
|
|
516
530
|
type ExchangeRate = z.infer<typeof exchangeRateSchema>;
|
|
517
531
|
//#endregion
|
|
518
|
-
//#region src/app/flows/exchange-rate/exchange-rate.schemas.d.ts
|
|
532
|
+
//#region src/app/flows/(finance)/exchange-rate/exchange-rate.schemas.d.ts
|
|
519
533
|
declare const exchangeRateSearchOptionsSchema: z.ZodObject<{
|
|
520
534
|
where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
521
535
|
currencyId: z.ZodOptional<z.ZodInt>;
|
|
@@ -564,6 +578,7 @@ type ProductImages = z.infer<typeof productImagesSchema>;
|
|
|
564
578
|
declare const productVariantSchema: z.ZodObject<{
|
|
565
579
|
id: z.ZodInt;
|
|
566
580
|
productId: z.ZodInt;
|
|
581
|
+
measurementUnitId: z.ZodNullable<z.ZodInt>;
|
|
567
582
|
status: z.ZodEnum<{
|
|
568
583
|
active: "active";
|
|
569
584
|
archived: "archived";
|
|
@@ -612,7 +627,7 @@ declare const productSchema: z.ZodObject<{
|
|
|
612
627
|
}, z.core.$strip>;
|
|
613
628
|
type Product = z.infer<typeof productSchema>;
|
|
614
629
|
//#endregion
|
|
615
|
-
//#region src/app/flows/product/product.schemas.d.ts
|
|
630
|
+
//#region src/app/flows/(catalog)/product/product.schemas.d.ts
|
|
616
631
|
declare const productSearchOptionsSchema: z.ZodObject<{
|
|
617
632
|
where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
618
633
|
status: z.ZodOptional<z.ZodEnum<{
|
|
@@ -716,10 +731,11 @@ type ProductCreateResult = {
|
|
|
716
731
|
};
|
|
717
732
|
type ProductUpdatePayload = z.infer<typeof productUpdatePayloadSchema>;
|
|
718
733
|
//#endregion
|
|
719
|
-
//#region src/app/flows/product-variant/product-variant.schemas.d.ts
|
|
734
|
+
//#region src/app/flows/(catalog)/product-variant/product-variant.schemas.d.ts
|
|
720
735
|
declare const productVariantSearchOptionsSchema: z.ZodObject<{
|
|
721
736
|
where: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
|
|
722
737
|
productId: z.ZodInt;
|
|
738
|
+
measurementUnitId: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
723
739
|
status: z.ZodOptional<z.ZodEnum<{
|
|
724
740
|
active: "active";
|
|
725
741
|
archived: "archived";
|
|
@@ -740,6 +756,7 @@ declare const productVariantDeletePayloadSchema: z.ZodObject<{
|
|
|
740
756
|
}, z.core.$strip>;
|
|
741
757
|
declare const productVariantCreatePayloadSchema: z.ZodObject<{
|
|
742
758
|
productId: z.ZodInt;
|
|
759
|
+
measurementUnitId: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
743
760
|
status: z.ZodOptional<z.ZodEnum<{
|
|
744
761
|
active: "active";
|
|
745
762
|
archived: "archived";
|
|
@@ -754,6 +771,7 @@ declare const productVariantCreatePayloadSchema: z.ZodObject<{
|
|
|
754
771
|
}> & z.core.$partial, z.ZodString>>>;
|
|
755
772
|
}, z.core.$strip>;
|
|
756
773
|
declare const productVariantUpdatePayloadSchema: z.ZodObject<{
|
|
774
|
+
measurementUnitId: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
757
775
|
status: z.ZodOptional<z.ZodEnum<{
|
|
758
776
|
active: "active";
|
|
759
777
|
archived: "archived";
|
|
@@ -781,4 +799,4 @@ type ProductVariantCreateResult = {
|
|
|
781
799
|
};
|
|
782
800
|
type ProductVariantUpdatePayload = z.infer<typeof productVariantUpdatePayloadSchema>;
|
|
783
801
|
//#endregion
|
|
784
|
-
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, WarehouseSwitchStatusPayload, WarehouseUpdatePayload };
|
|
802
|
+
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, MeasurementUnit, MeasurementUnitListResult, Product, ProductCreatePayload, ProductCreateResult, ProductDeletePayload, ProductImage, ProductImages, ProductSearchOptions, ProductSearchResult, ProductSelectOneQuery, ProductUpdatePayload, ProductVariant, ProductVariantCreatePayload, ProductVariantCreateResult, ProductVariantDeletePayload, ProductVariantSearchOptions, ProductVariantSearchResult, ProductVariantSelectOneQuery, ProductVariantUpdatePayload, Warehouse, WarehouseCreatePayload, WarehouseSearchOptions, WarehouseSearchResult, WarehouseSelectOneQuery, WarehouseSwitchStatusPayload, WarehouseUpdatePayload };
|