@esb-market-contracts/backend 1.0.23 → 1.0.24

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 +30 -4
  2. package/package.json +1 -1
  3. package/types.d.ts +33 -24
package/api.d.ts CHANGED
@@ -404,7 +404,20 @@ declare const productVariantsRouter: import("hono/hono-base").HonoBase<{
404
404
  };
405
405
  };
406
406
  };
407
- }, "/catalog/product-variants", "/catalog/product-variants/update">;
407
+ } & {
408
+ "/catalog/product-variants/delete": {
409
+ $post: {
410
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
411
+ outputFormat: "json";
412
+ status: 200;
413
+ input: {
414
+ json: {
415
+ productVariantId: number;
416
+ };
417
+ };
418
+ };
419
+ };
420
+ }, "/catalog/product-variants", "/catalog/product-variants/delete">;
408
421
  type ProductVariantsRouter = typeof productVariantsRouter;
409
422
  //#endregion
410
423
  //#region src/app/routes/(catalog)/products.routes.d.ts
@@ -538,7 +551,20 @@ declare const productsRouter: import("hono/hono-base").HonoBase<{
538
551
  };
539
552
  };
540
553
  };
541
- }, "/catalog/products", "/catalog/products/update">;
554
+ } & {
555
+ "/catalog/products/delete": {
556
+ $post: {
557
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
558
+ outputFormat: "json";
559
+ status: 200;
560
+ input: {
561
+ json: {
562
+ productId: number;
563
+ };
564
+ };
565
+ };
566
+ };
567
+ }, "/catalog/products", "/catalog/products/delete">;
542
568
  type ProductsRouter = typeof productsRouter;
543
569
  //#endregion
544
570
  //#region src/app/routes/(finance)/exchange-rates.routes.d.ts
@@ -634,11 +660,11 @@ declare const auditLogSchema: import("drizzle-orm/zod").BuildSchema<"select", {
634
660
  identity: undefined;
635
661
  generated: undefined;
636
662
  }>;
637
- 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.updated" | "productVariant.created" | "productVariant.updated">, {
663
+ 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">, {
638
664
  name: string;
639
665
  tableName: "audit_logs";
640
666
  dataType: "string";
641
- data: "brand.created" | "brand.updated" | "category.activated" | "category.archived" | "category.created" | "category.updated" | "country.created" | "country.updated" | "customer.created" | "customer.updated" | "product.created" | "product.updated" | "productVariant.created" | "productVariant.updated";
667
+ 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";
642
668
  driverParam: string;
643
669
  notNull: true;
644
670
  hasDefault: false;
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.23",
4
+ "version": "1.0.24",
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 "postgres";
3
4
  import "drizzle-orm";
4
5
  //#region src/app/domain/(catalog)/brands/brands.schemas.d.ts
5
6
  declare const brandSchema: z.ZodObject<{
@@ -247,11 +248,11 @@ declare const auditLogSchema: import("drizzle-orm/zod").BuildSchema<"select", {
247
248
  identity: undefined;
248
249
  generated: undefined;
249
250
  }>;
250
- 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.updated" | "productVariant.created" | "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">, {
251
252
  name: string;
252
253
  tableName: "audit_logs";
253
254
  dataType: "string";
254
- data: "brand.created" | "brand.updated" | "category.activated" | "category.archived" | "category.created" | "category.updated" | "country.created" | "country.updated" | "customer.created" | "customer.updated" | "product.created" | "product.updated" | "productVariant.created" | "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";
255
256
  driverParam: string;
256
257
  notNull: true;
257
258
  hasDefault: false;
@@ -485,6 +486,27 @@ declare const productImagesSchema: z.ZodArray<z.ZodObject<{
485
486
  type ProductImage = z.infer<typeof productImageSchema>;
486
487
  type ProductImages = z.infer<typeof productImagesSchema>;
487
488
  //#endregion
489
+ //#region src/app/domain/(catalog)/product-variants/product-variants.schemas.d.ts
490
+ declare const productVariantSchema: z.ZodObject<{
491
+ id: z.ZodInt;
492
+ productId: z.ZodInt;
493
+ status: z.ZodEnum<{
494
+ active: "active";
495
+ archived: "archived";
496
+ draft: "draft";
497
+ }>;
498
+ sku: z.ZodNullable<z.ZodString>;
499
+ barcode: z.ZodNullable<z.ZodString>;
500
+ name: z.ZodNullable<z.ZodRecord<z.ZodEnum<{
501
+ en: "en";
502
+ ka: "ka";
503
+ ru: "ru";
504
+ }> & z.core.$partial, z.ZodString>>;
505
+ updatedAt: z.ZodNullable<z.ZodDate>;
506
+ createdAt: z.ZodDate;
507
+ }, z.core.$strip>;
508
+ type ProductVariant = z.infer<typeof productVariantSchema>;
509
+ //#endregion
488
510
  //#region src/app/domain/(catalog)/products/products.schemas.d.ts
489
511
  declare const productSchema: z.ZodObject<{
490
512
  id: z.ZodInt;
@@ -561,6 +583,9 @@ declare const productSelectOneQuerySchema: z.ZodPipe<z.ZodObject<{
561
583
  id?: number | undefined;
562
584
  slug?: string | undefined;
563
585
  }>>;
586
+ declare const productDeletePayloadSchema: z.ZodObject<{
587
+ productId: z.ZodInt;
588
+ }, z.core.$strip>;
564
589
  declare const productCreatePayloadSchema: z.ZodObject<{
565
590
  slug: z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
566
591
  name: z.ZodOptional<z.ZodPreprocess<z.ZodNullable<z.ZodRecord<z.ZodEnum<{
@@ -607,33 +632,13 @@ type ProductSearchResult = {
607
632
  total: number;
608
633
  };
609
634
  type ProductSelectOneQuery = z.infer<typeof productSelectOneQuerySchema>;
635
+ type ProductDeletePayload = z.infer<typeof productDeletePayloadSchema>;
610
636
  type ProductCreatePayload = z.infer<typeof productCreatePayloadSchema>;
611
637
  type ProductCreateResult = {
612
638
  product: Product;
613
639
  };
614
640
  type ProductUpdatePayload = z.infer<typeof productUpdatePayloadSchema>;
615
641
  //#endregion
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
642
  //#region src/app/flows/product-variant/product-variant.schemas.d.ts
638
643
  declare const productVariantSearchOptionsSchema: z.ZodObject<{
639
644
  where: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
@@ -653,6 +658,9 @@ declare const productVariantSearchOptionsSchema: z.ZodObject<{
653
658
  declare const productVariantSelectOneQuerySchema: z.ZodObject<{
654
659
  id: z.ZodInt;
655
660
  }, z.core.$strip>;
661
+ declare const productVariantDeletePayloadSchema: z.ZodObject<{
662
+ productVariantId: z.ZodInt;
663
+ }, z.core.$strip>;
656
664
  declare const productVariantCreatePayloadSchema: z.ZodObject<{
657
665
  productId: z.ZodInt;
658
666
  status: z.ZodOptional<z.ZodEnum<{
@@ -689,10 +697,11 @@ type ProductVariantSearchResult = {
689
697
  total: number;
690
698
  };
691
699
  type ProductVariantSelectOneQuery = z.infer<typeof productVariantSelectOneQuerySchema>;
700
+ type ProductVariantDeletePayload = z.infer<typeof productVariantDeletePayloadSchema>;
692
701
  type ProductVariantCreatePayload = z.infer<typeof productVariantCreatePayloadSchema>;
693
702
  type ProductVariantCreateResult = {
694
703
  productVariant: ProductVariant;
695
704
  };
696
705
  type ProductVariantUpdatePayload = z.infer<typeof productVariantUpdatePayloadSchema>;
697
706
  //#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 };
707
+ 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 };