@esb-market-contracts/backend 1.0.22 → 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 -14
  2. package/package.json +1 -1
  3. package/types.d.ts +24 -19
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
@@ -429,16 +442,6 @@ declare const productsRouter: import("hono/hono-base").HonoBase<{
429
442
  updatedAt: Date | null;
430
443
  createdAt: Date;
431
444
  };
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
- }[];
442
445
  }>;
443
446
  outputFormat: "json";
444
447
  status: 200;
@@ -548,7 +551,20 @@ declare const productsRouter: import("hono/hono-base").HonoBase<{
548
551
  };
549
552
  };
550
553
  };
551
- }, "/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">;
552
568
  type ProductsRouter = typeof productsRouter;
553
569
  //#endregion
554
570
  //#region src/app/routes/(finance)/exchange-rates.routes.d.ts
@@ -644,11 +660,11 @@ declare const auditLogSchema: import("drizzle-orm/zod").BuildSchema<"select", {
644
660
  identity: undefined;
645
661
  generated: undefined;
646
662
  }>;
647
- 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">, {
648
664
  name: string;
649
665
  tableName: "audit_logs";
650
666
  dataType: "string";
651
- 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";
652
668
  driverParam: string;
653
669
  notNull: true;
654
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.22",
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;
@@ -473,6 +474,18 @@ type CurrencyListResult = {
473
474
  currencies: Currency[];
474
475
  };
475
476
  //#endregion
477
+ //#region src/app/domain/(catalog)/products/products.fields.d.ts
478
+ declare const productImageSchema: z.ZodObject<{
479
+ src: z.ZodURL;
480
+ isBanner: z.ZodBoolean;
481
+ }, z.core.$strip>;
482
+ declare const productImagesSchema: z.ZodArray<z.ZodObject<{
483
+ src: z.ZodURL;
484
+ isBanner: z.ZodBoolean;
485
+ }, z.core.$strip>>;
486
+ type ProductImage = z.infer<typeof productImageSchema>;
487
+ type ProductImages = z.infer<typeof productImagesSchema>;
488
+ //#endregion
476
489
  //#region src/app/domain/(catalog)/product-variants/product-variants.schemas.d.ts
477
490
  declare const productVariantSchema: z.ZodObject<{
478
491
  id: z.ZodInt;
@@ -494,18 +507,6 @@ declare const productVariantSchema: z.ZodObject<{
494
507
  }, z.core.$strip>;
495
508
  type ProductVariant = z.infer<typeof productVariantSchema>;
496
509
  //#endregion
497
- //#region src/app/domain/(catalog)/products/products.fields.d.ts
498
- declare const productImageSchema: z.ZodObject<{
499
- src: z.ZodURL;
500
- isBanner: z.ZodBoolean;
501
- }, z.core.$strip>;
502
- declare const productImagesSchema: z.ZodArray<z.ZodObject<{
503
- src: z.ZodURL;
504
- isBanner: z.ZodBoolean;
505
- }, z.core.$strip>>;
506
- type ProductImage = z.infer<typeof productImageSchema>;
507
- type ProductImages = z.infer<typeof productImagesSchema>;
508
- //#endregion
509
510
  //#region src/app/domain/(catalog)/products/products.schemas.d.ts
510
511
  declare const productSchema: z.ZodObject<{
511
512
  id: z.ZodInt;
@@ -582,6 +583,9 @@ declare const productSelectOneQuerySchema: z.ZodPipe<z.ZodObject<{
582
583
  id?: number | undefined;
583
584
  slug?: string | undefined;
584
585
  }>>;
586
+ declare const productDeletePayloadSchema: z.ZodObject<{
587
+ productId: z.ZodInt;
588
+ }, z.core.$strip>;
585
589
  declare const productCreatePayloadSchema: z.ZodObject<{
586
590
  slug: z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
587
591
  name: z.ZodOptional<z.ZodPreprocess<z.ZodNullable<z.ZodRecord<z.ZodEnum<{
@@ -628,10 +632,7 @@ type ProductSearchResult = {
628
632
  total: number;
629
633
  };
630
634
  type ProductSelectOneQuery = z.infer<typeof productSelectOneQuerySchema>;
631
- type ProductSelectOneResult = {
632
- product: Product;
633
- productVariants: ProductVariant[];
634
- };
635
+ type ProductDeletePayload = z.infer<typeof productDeletePayloadSchema>;
635
636
  type ProductCreatePayload = z.infer<typeof productCreatePayloadSchema>;
636
637
  type ProductCreateResult = {
637
638
  product: Product;
@@ -657,6 +658,9 @@ declare const productVariantSearchOptionsSchema: z.ZodObject<{
657
658
  declare const productVariantSelectOneQuerySchema: z.ZodObject<{
658
659
  id: z.ZodInt;
659
660
  }, z.core.$strip>;
661
+ declare const productVariantDeletePayloadSchema: z.ZodObject<{
662
+ productVariantId: z.ZodInt;
663
+ }, z.core.$strip>;
660
664
  declare const productVariantCreatePayloadSchema: z.ZodObject<{
661
665
  productId: z.ZodInt;
662
666
  status: z.ZodOptional<z.ZodEnum<{
@@ -693,10 +697,11 @@ type ProductVariantSearchResult = {
693
697
  total: number;
694
698
  };
695
699
  type ProductVariantSelectOneQuery = z.infer<typeof productVariantSelectOneQuerySchema>;
700
+ type ProductVariantDeletePayload = z.infer<typeof productVariantDeletePayloadSchema>;
696
701
  type ProductVariantCreatePayload = z.infer<typeof productVariantCreatePayloadSchema>;
697
702
  type ProductVariantCreateResult = {
698
703
  productVariant: ProductVariant;
699
704
  };
700
705
  type ProductVariantUpdatePayload = z.infer<typeof productVariantUpdatePayloadSchema>;
701
706
  //#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 };
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 };