@esb-market-contracts/backend 1.0.21 → 1.0.22

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 +119 -2
  2. package/package.json +1 -1
  3. package/types.d.ts +88 -6
package/api.d.ts CHANGED
@@ -299,6 +299,114 @@ declare const countriesRouter: import("hono/hono-base").HonoBase<{
299
299
  }, "/catalog/countries", "/catalog/countries/update">;
300
300
  type CountriesRouter = typeof countriesRouter;
301
301
  //#endregion
302
+ //#region src/app/routes/(catalog)/product-variants.routes.d.ts
303
+ declare const productVariantsRouter: import("hono/hono-base").HonoBase<{
304
+ Variables: VariablesWithActor;
305
+ }, {
306
+ "/catalog/product-variants/one": {
307
+ $get: {
308
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
309
+ productVariant: {
310
+ id: number;
311
+ productId: number;
312
+ status: "active" | "archived" | "draft";
313
+ sku: string | null;
314
+ barcode: string | null;
315
+ name: Partial<Record<"en" | "ka" | "ru", string>> | null;
316
+ updatedAt: Date | null;
317
+ createdAt: Date;
318
+ };
319
+ }>;
320
+ outputFormat: "json";
321
+ status: 200;
322
+ input: {
323
+ query: {
324
+ id: string | string[];
325
+ };
326
+ };
327
+ };
328
+ };
329
+ } & {
330
+ "/catalog/product-variants/create": {
331
+ $post: {
332
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
333
+ productVariant: {
334
+ id: number;
335
+ productId: number;
336
+ status: "active" | "archived" | "draft";
337
+ sku: string | null;
338
+ barcode: string | null;
339
+ name: Partial<Record<"en" | "ka" | "ru", string>> | null;
340
+ updatedAt: Date | null;
341
+ createdAt: Date;
342
+ };
343
+ }>;
344
+ outputFormat: "json";
345
+ status: 201;
346
+ input: {
347
+ json: {
348
+ productId: number;
349
+ status?: "active" | "archived" | "draft" | undefined;
350
+ sku?: string | null | undefined;
351
+ barcode?: string | null | undefined;
352
+ name?: Partial<Record<"en" | "ka" | "ru", string>> | null | undefined;
353
+ };
354
+ };
355
+ };
356
+ };
357
+ } & {
358
+ "/catalog/product-variants/search": {
359
+ $post: {
360
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
361
+ productVariants: {
362
+ id: number;
363
+ productId: number;
364
+ status: "active" | "archived" | "draft";
365
+ sku: string | null;
366
+ barcode: string | null;
367
+ name: Partial<Record<"en" | "ka" | "ru", string>> | null;
368
+ updatedAt: Date | null;
369
+ createdAt: Date;
370
+ }[];
371
+ total: number;
372
+ }>;
373
+ outputFormat: "json";
374
+ status: 200;
375
+ input: {
376
+ json: {
377
+ where: {
378
+ productId: number;
379
+ status?: "active" | "archived" | "draft" | undefined;
380
+ };
381
+ query?: string | undefined;
382
+ pagination: {
383
+ offset?: unknown;
384
+ limit?: unknown;
385
+ };
386
+ };
387
+ };
388
+ };
389
+ };
390
+ } & {
391
+ "/catalog/product-variants/update": {
392
+ $post: {
393
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
394
+ outputFormat: "json";
395
+ status: 200;
396
+ input: {
397
+ json: {
398
+ status?: "active" | "archived" | "draft" | undefined;
399
+ sku?: string | null | undefined;
400
+ barcode?: string | null | undefined;
401
+ name?: Partial<Record<"en" | "ka" | "ru", string>> | null | undefined;
402
+ productVariantId: number;
403
+ };
404
+ };
405
+ };
406
+ };
407
+ }, "/catalog/product-variants", "/catalog/product-variants/update">;
408
+ type ProductVariantsRouter = typeof productVariantsRouter;
409
+ //#endregion
302
410
  //#region src/app/routes/(catalog)/products.routes.d.ts
303
411
  declare const productsRouter: import("hono/hono-base").HonoBase<{
304
412
  Variables: VariablesWithActor;
@@ -321,6 +429,16 @@ declare const productsRouter: import("hono/hono-base").HonoBase<{
321
429
  updatedAt: Date | null;
322
430
  createdAt: Date;
323
431
  };
432
+ productVariants: {
433
+ id: number;
434
+ productId: number;
435
+ status: "active" | "archived" | "draft";
436
+ sku: string | null;
437
+ barcode: string | null;
438
+ name: Partial<Record<"en" | "ka" | "ru", string>> | null;
439
+ updatedAt: Date | null;
440
+ createdAt: Date;
441
+ }[];
324
442
  }>;
325
443
  outputFormat: "json";
326
444
  status: 200;
@@ -359,7 +477,6 @@ declare const productsRouter: import("hono/hono-base").HonoBase<{
359
477
  status: 201;
360
478
  input: {
361
479
  form: {
362
- status?: "active" | "archived" | "draft" | undefined;
363
480
  slug?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
364
481
  name?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
365
482
  description?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
@@ -751,4 +868,4 @@ declare const customersRouter: import("hono/hono-base").HonoBase<{
751
868
  }, "/operations/customers", "/operations/customers/update">;
752
869
  type CustomersRouter = typeof customersRouter;
753
870
  //#endregion
754
- export type { AuditLogsRouter, BrandsRouter, CategoriesRouter, CountriesRouter, CustomersRouter, ExchangeRatesRouter, ProductsRouter };
871
+ export type { AuditLogsRouter, BrandsRouter, CategoriesRouter, CountriesRouter, CustomersRouter, ExchangeRatesRouter, ProductVariantsRouter, ProductsRouter };
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.21",
4
+ "version": "1.0.22",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "sideEffects": false,
package/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import "hono/http-exception";
3
+ import "drizzle-orm";
3
4
  //#region src/app/domain/(catalog)/brands/brands.schemas.d.ts
4
5
  declare const brandSchema: z.ZodObject<{
5
6
  id: z.ZodInt;
@@ -472,6 +473,27 @@ type CurrencyListResult = {
472
473
  currencies: Currency[];
473
474
  };
474
475
  //#endregion
476
+ //#region src/app/domain/(catalog)/product-variants/product-variants.schemas.d.ts
477
+ declare const productVariantSchema: z.ZodObject<{
478
+ id: z.ZodInt;
479
+ productId: z.ZodInt;
480
+ status: z.ZodEnum<{
481
+ active: "active";
482
+ archived: "archived";
483
+ draft: "draft";
484
+ }>;
485
+ sku: z.ZodNullable<z.ZodString>;
486
+ barcode: z.ZodNullable<z.ZodString>;
487
+ name: z.ZodNullable<z.ZodRecord<z.ZodEnum<{
488
+ en: "en";
489
+ ka: "ka";
490
+ ru: "ru";
491
+ }> & z.core.$partial, z.ZodString>>;
492
+ updatedAt: z.ZodNullable<z.ZodDate>;
493
+ createdAt: z.ZodDate;
494
+ }, z.core.$strip>;
495
+ type ProductVariant = z.infer<typeof productVariantSchema>;
496
+ //#endregion
475
497
  //#region src/app/domain/(catalog)/products/products.fields.d.ts
476
498
  declare const productImageSchema: z.ZodObject<{
477
499
  src: z.ZodURL;
@@ -561,11 +583,6 @@ declare const productSelectOneQuerySchema: z.ZodPipe<z.ZodObject<{
561
583
  slug?: string | undefined;
562
584
  }>>;
563
585
  declare const productCreatePayloadSchema: z.ZodObject<{
564
- status: z.ZodOptional<z.ZodEnum<{
565
- active: "active";
566
- archived: "archived";
567
- draft: "draft";
568
- }>>;
569
586
  slug: z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
570
587
  name: z.ZodOptional<z.ZodPreprocess<z.ZodNullable<z.ZodRecord<z.ZodEnum<{
571
588
  en: "en";
@@ -611,10 +628,75 @@ type ProductSearchResult = {
611
628
  total: number;
612
629
  };
613
630
  type ProductSelectOneQuery = z.infer<typeof productSelectOneQuerySchema>;
631
+ type ProductSelectOneResult = {
632
+ product: Product;
633
+ productVariants: ProductVariant[];
634
+ };
614
635
  type ProductCreatePayload = z.infer<typeof productCreatePayloadSchema>;
615
636
  type ProductCreateResult = {
616
637
  product: Product;
617
638
  };
618
639
  type ProductUpdatePayload = z.infer<typeof productUpdatePayloadSchema>;
619
640
  //#endregion
620
- 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, ProductImage, ProductImages, ProductSearchOptions, ProductSearchResult, ProductSelectOneQuery, ProductUpdatePayload };
641
+ //#region src/app/flows/product-variant/product-variant.schemas.d.ts
642
+ declare const productVariantSearchOptionsSchema: z.ZodObject<{
643
+ where: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
644
+ productId: z.ZodInt;
645
+ status: z.ZodOptional<z.ZodEnum<{
646
+ active: "active";
647
+ archived: "archived";
648
+ draft: "draft";
649
+ }>>;
650
+ }, z.core.$strip>>>;
651
+ query: z.ZodOptional<z.ZodString>;
652
+ pagination: z.ZodObject<{
653
+ offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
654
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
655
+ }, z.core.$strip>;
656
+ }, z.core.$strict>;
657
+ declare const productVariantSelectOneQuerySchema: z.ZodObject<{
658
+ id: z.ZodInt;
659
+ }, z.core.$strip>;
660
+ declare const productVariantCreatePayloadSchema: z.ZodObject<{
661
+ productId: z.ZodInt;
662
+ status: z.ZodOptional<z.ZodEnum<{
663
+ active: "active";
664
+ archived: "archived";
665
+ draft: "draft";
666
+ }>>;
667
+ sku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
668
+ barcode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
669
+ name: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodEnum<{
670
+ en: "en";
671
+ ka: "ka";
672
+ ru: "ru";
673
+ }> & z.core.$partial, z.ZodString>>>;
674
+ }, z.core.$strip>;
675
+ declare const productVariantUpdatePayloadSchema: z.ZodObject<{
676
+ status: z.ZodOptional<z.ZodEnum<{
677
+ active: "active";
678
+ archived: "archived";
679
+ draft: "draft";
680
+ }>>;
681
+ sku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
682
+ barcode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
683
+ name: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodEnum<{
684
+ en: "en";
685
+ ka: "ka";
686
+ ru: "ru";
687
+ }> & z.core.$partial, z.ZodString>>>;
688
+ productVariantId: z.ZodInt;
689
+ }, z.core.$strip>;
690
+ type ProductVariantSearchOptions = z.infer<typeof productVariantSearchOptionsSchema>;
691
+ type ProductVariantSearchResult = {
692
+ productVariants: ProductVariant[];
693
+ total: number;
694
+ };
695
+ type ProductVariantSelectOneQuery = z.infer<typeof productVariantSelectOneQuerySchema>;
696
+ type ProductVariantCreatePayload = z.infer<typeof productVariantCreatePayloadSchema>;
697
+ type ProductVariantCreateResult = {
698
+ productVariant: ProductVariant;
699
+ };
700
+ type ProductVariantUpdatePayload = z.infer<typeof productVariantUpdatePayloadSchema>;
701
+ //#endregion
702
+ 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, ProductImage, ProductImages, ProductSearchOptions, ProductSearchResult, ProductSelectOneQuery, ProductSelectOneResult, ProductUpdatePayload, ProductVariant, ProductVariantCreatePayload, ProductVariantCreateResult, ProductVariantSearchOptions, ProductVariantSearchResult, ProductVariantSelectOneQuery, ProductVariantUpdatePayload };