@esb-market-contracts/backend 1.0.21 → 1.0.23

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 +109 -2
  2. package/package.json +1 -1
  3. package/types.d.ts +84 -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;
@@ -359,7 +467,6 @@ declare const productsRouter: import("hono/hono-base").HonoBase<{
359
467
  status: 201;
360
468
  input: {
361
469
  form: {
362
- status?: "active" | "archived" | "draft" | undefined;
363
470
  slug?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
364
471
  name?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
365
472
  description?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
@@ -751,4 +858,4 @@ declare const customersRouter: import("hono/hono-base").HonoBase<{
751
858
  }, "/operations/customers", "/operations/customers/update">;
752
859
  type CustomersRouter = typeof customersRouter;
753
860
  //#endregion
754
- export type { AuditLogsRouter, BrandsRouter, CategoriesRouter, CountriesRouter, CustomersRouter, ExchangeRatesRouter, ProductsRouter };
861
+ 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.23",
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;
@@ -561,11 +562,6 @@ declare const productSelectOneQuerySchema: z.ZodPipe<z.ZodObject<{
561
562
  slug?: string | undefined;
562
563
  }>>;
563
564
  declare const productCreatePayloadSchema: z.ZodObject<{
564
- status: z.ZodOptional<z.ZodEnum<{
565
- active: "active";
566
- archived: "archived";
567
- draft: "draft";
568
- }>>;
569
565
  slug: z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
570
566
  name: z.ZodOptional<z.ZodPreprocess<z.ZodNullable<z.ZodRecord<z.ZodEnum<{
571
567
  en: "en";
@@ -617,4 +613,86 @@ type ProductCreateResult = {
617
613
  };
618
614
  type ProductUpdatePayload = z.infer<typeof productUpdatePayloadSchema>;
619
615
  //#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 };
616
+ //#region src/app/domain/(catalog)/product-variants/product-variants.schemas.d.ts
617
+ declare const productVariantSchema: z.ZodObject<{
618
+ id: z.ZodInt;
619
+ productId: z.ZodInt;
620
+ status: z.ZodEnum<{
621
+ active: "active";
622
+ archived: "archived";
623
+ draft: "draft";
624
+ }>;
625
+ sku: z.ZodNullable<z.ZodString>;
626
+ barcode: z.ZodNullable<z.ZodString>;
627
+ name: z.ZodNullable<z.ZodRecord<z.ZodEnum<{
628
+ en: "en";
629
+ ka: "ka";
630
+ ru: "ru";
631
+ }> & z.core.$partial, z.ZodString>>;
632
+ updatedAt: z.ZodNullable<z.ZodDate>;
633
+ createdAt: z.ZodDate;
634
+ }, z.core.$strip>;
635
+ type ProductVariant = z.infer<typeof productVariantSchema>;
636
+ //#endregion
637
+ //#region src/app/flows/product-variant/product-variant.schemas.d.ts
638
+ declare const productVariantSearchOptionsSchema: z.ZodObject<{
639
+ where: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
640
+ productId: z.ZodInt;
641
+ status: z.ZodOptional<z.ZodEnum<{
642
+ active: "active";
643
+ archived: "archived";
644
+ draft: "draft";
645
+ }>>;
646
+ }, z.core.$strip>>>;
647
+ query: z.ZodOptional<z.ZodString>;
648
+ pagination: z.ZodObject<{
649
+ offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
650
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
651
+ }, z.core.$strip>;
652
+ }, z.core.$strict>;
653
+ declare const productVariantSelectOneQuerySchema: z.ZodObject<{
654
+ id: z.ZodInt;
655
+ }, z.core.$strip>;
656
+ declare const productVariantCreatePayloadSchema: z.ZodObject<{
657
+ productId: z.ZodInt;
658
+ status: z.ZodOptional<z.ZodEnum<{
659
+ active: "active";
660
+ archived: "archived";
661
+ draft: "draft";
662
+ }>>;
663
+ sku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
664
+ barcode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
665
+ name: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodEnum<{
666
+ en: "en";
667
+ ka: "ka";
668
+ ru: "ru";
669
+ }> & z.core.$partial, z.ZodString>>>;
670
+ }, z.core.$strip>;
671
+ declare const productVariantUpdatePayloadSchema: z.ZodObject<{
672
+ status: z.ZodOptional<z.ZodEnum<{
673
+ active: "active";
674
+ archived: "archived";
675
+ draft: "draft";
676
+ }>>;
677
+ sku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
678
+ barcode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
679
+ name: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodEnum<{
680
+ en: "en";
681
+ ka: "ka";
682
+ ru: "ru";
683
+ }> & z.core.$partial, z.ZodString>>>;
684
+ productVariantId: z.ZodInt;
685
+ }, z.core.$strip>;
686
+ type ProductVariantSearchOptions = z.infer<typeof productVariantSearchOptionsSchema>;
687
+ type ProductVariantSearchResult = {
688
+ productVariants: ProductVariant[];
689
+ total: number;
690
+ };
691
+ type ProductVariantSelectOneQuery = z.infer<typeof productVariantSelectOneQuerySchema>;
692
+ type ProductVariantCreatePayload = z.infer<typeof productVariantCreatePayloadSchema>;
693
+ type ProductVariantCreateResult = {
694
+ productVariant: ProductVariant;
695
+ };
696
+ type ProductVariantUpdatePayload = z.infer<typeof productVariantUpdatePayloadSchema>;
697
+ //#endregion
698
+ 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, ProductVariant, ProductVariantCreatePayload, ProductVariantCreateResult, ProductVariantSearchOptions, ProductVariantSearchResult, ProductVariantSelectOneQuery, ProductVariantUpdatePayload };