@esb-market-contracts/backend 1.0.20 → 1.0.21
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 +136 -1
- package/enums.d.ts +10 -1
- package/enums.js +10 -1
- package/package.json +1 -1
- package/types.d.ts +146 -1
package/api.d.ts
CHANGED
|
@@ -299,6 +299,141 @@ 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)/products.routes.d.ts
|
|
303
|
+
declare const productsRouter: import("hono/hono-base").HonoBase<{
|
|
304
|
+
Variables: VariablesWithActor;
|
|
305
|
+
}, {
|
|
306
|
+
"/catalog/products/one": {
|
|
307
|
+
$get: {
|
|
308
|
+
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
|
|
309
|
+
product: {
|
|
310
|
+
id: number;
|
|
311
|
+
slug: string | null;
|
|
312
|
+
status: "active" | "archived" | "draft";
|
|
313
|
+
name: Partial<Record<"en" | "ka" | "ru", string>> | null;
|
|
314
|
+
description: Partial<Record<"en" | "ka" | "ru", string>> | null;
|
|
315
|
+
images: {
|
|
316
|
+
src: string;
|
|
317
|
+
isBanner: boolean;
|
|
318
|
+
}[];
|
|
319
|
+
categoryId: number | null;
|
|
320
|
+
brandId: number | null;
|
|
321
|
+
updatedAt: Date | null;
|
|
322
|
+
createdAt: Date;
|
|
323
|
+
};
|
|
324
|
+
}>;
|
|
325
|
+
outputFormat: "json";
|
|
326
|
+
status: 200;
|
|
327
|
+
input: {
|
|
328
|
+
query: {
|
|
329
|
+
id: string | string[];
|
|
330
|
+
slug?: string | undefined;
|
|
331
|
+
} | {
|
|
332
|
+
id?: number | undefined;
|
|
333
|
+
slug: string | string[];
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
} & {
|
|
339
|
+
"/catalog/products/create": {
|
|
340
|
+
$post: {
|
|
341
|
+
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
|
|
342
|
+
product: {
|
|
343
|
+
id: number;
|
|
344
|
+
slug: string | null;
|
|
345
|
+
status: "active" | "archived" | "draft";
|
|
346
|
+
name: Partial<Record<"en" | "ka" | "ru", string>> | null;
|
|
347
|
+
description: Partial<Record<"en" | "ka" | "ru", string>> | null;
|
|
348
|
+
images: {
|
|
349
|
+
src: string;
|
|
350
|
+
isBanner: boolean;
|
|
351
|
+
}[];
|
|
352
|
+
categoryId: number | null;
|
|
353
|
+
brandId: number | null;
|
|
354
|
+
updatedAt: Date | null;
|
|
355
|
+
createdAt: Date;
|
|
356
|
+
};
|
|
357
|
+
}>;
|
|
358
|
+
outputFormat: "json";
|
|
359
|
+
status: 201;
|
|
360
|
+
input: {
|
|
361
|
+
form: {
|
|
362
|
+
status?: "active" | "archived" | "draft" | undefined;
|
|
363
|
+
slug?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
|
|
364
|
+
name?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
|
|
365
|
+
description?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
|
|
366
|
+
categoryId?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
|
|
367
|
+
brandId?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
|
|
368
|
+
images?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
|
|
369
|
+
bannerImageIndex?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
} & {
|
|
375
|
+
"/catalog/products/search": {
|
|
376
|
+
$post: {
|
|
377
|
+
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
|
|
378
|
+
products: {
|
|
379
|
+
id: number;
|
|
380
|
+
slug: string | null;
|
|
381
|
+
status: "active" | "archived" | "draft";
|
|
382
|
+
name: Partial<Record<"en" | "ka" | "ru", string>> | null;
|
|
383
|
+
description: Partial<Record<"en" | "ka" | "ru", string>> | null;
|
|
384
|
+
images: {
|
|
385
|
+
src: string;
|
|
386
|
+
isBanner: boolean;
|
|
387
|
+
}[];
|
|
388
|
+
categoryId: number | null;
|
|
389
|
+
brandId: number | null;
|
|
390
|
+
updatedAt: Date | null;
|
|
391
|
+
createdAt: Date;
|
|
392
|
+
}[];
|
|
393
|
+
total: number;
|
|
394
|
+
}>;
|
|
395
|
+
outputFormat: "json";
|
|
396
|
+
status: 200;
|
|
397
|
+
input: {
|
|
398
|
+
json: {
|
|
399
|
+
where?: {
|
|
400
|
+
status?: "active" | "archived" | "draft" | undefined;
|
|
401
|
+
categoryId?: number | null | undefined;
|
|
402
|
+
brandId?: number | null | undefined;
|
|
403
|
+
} | undefined;
|
|
404
|
+
query?: string | undefined;
|
|
405
|
+
pagination: {
|
|
406
|
+
offset?: unknown;
|
|
407
|
+
limit?: unknown;
|
|
408
|
+
};
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
} & {
|
|
414
|
+
"/catalog/products/update": {
|
|
415
|
+
$post: {
|
|
416
|
+
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
|
|
417
|
+
outputFormat: "json";
|
|
418
|
+
status: 200;
|
|
419
|
+
input: {
|
|
420
|
+
form: {
|
|
421
|
+
status?: "active" | "archived" | "draft" | undefined;
|
|
422
|
+
slug?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
|
|
423
|
+
name?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
|
|
424
|
+
description?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
|
|
425
|
+
categoryId?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
|
|
426
|
+
brandId?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
|
|
427
|
+
images?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
|
|
428
|
+
bannerImageIndex?: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue | undefined;
|
|
429
|
+
productId: import("hono/types").ParsedFormValue[] | import("hono/types").ParsedFormValue;
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
}, "/catalog/products", "/catalog/products/update">;
|
|
435
|
+
type ProductsRouter = typeof productsRouter;
|
|
436
|
+
//#endregion
|
|
302
437
|
//#region src/app/routes/(finance)/exchange-rates.routes.d.ts
|
|
303
438
|
declare const exchangeRatesRouter: import("hono/hono-base").HonoBase<{
|
|
304
439
|
Variables: VariablesWithActor;
|
|
@@ -616,4 +751,4 @@ declare const customersRouter: import("hono/hono-base").HonoBase<{
|
|
|
616
751
|
}, "/operations/customers", "/operations/customers/update">;
|
|
617
752
|
type CustomersRouter = typeof customersRouter;
|
|
618
753
|
//#endregion
|
|
619
|
-
export type { AuditLogsRouter, BrandsRouter, CategoriesRouter, CountriesRouter, CustomersRouter, ExchangeRatesRouter };
|
|
754
|
+
export type { AuditLogsRouter, BrandsRouter, CategoriesRouter, CountriesRouter, CustomersRouter, ExchangeRatesRouter, ProductsRouter };
|
package/enums.d.ts
CHANGED
|
@@ -35,4 +35,13 @@ declare const customerTypesRecord: Readonly<{
|
|
|
35
35
|
}>;
|
|
36
36
|
type CustomerType = (typeof customerTypesArray)[number];
|
|
37
37
|
//#endregion
|
|
38
|
-
|
|
38
|
+
//#region src/app/domain/(catalog)/products/products.enums.d.ts
|
|
39
|
+
export declare const productStatusesArray: readonly ['draft', 'active', 'archived'];
|
|
40
|
+
declare const productStatusesRecord: Readonly<{
|
|
41
|
+
ACTIVE: "active";
|
|
42
|
+
ARCHIVED: "archived";
|
|
43
|
+
DRAFT: "draft";
|
|
44
|
+
}>;
|
|
45
|
+
type ProductStatus = (typeof productStatusesArray)[number];
|
|
46
|
+
//#endregion
|
|
47
|
+
export { type AuditLogSource, type CustomerType, type EntityStatus, type Locale, type ProductStatus, auditLogSourcesRecord as auditLogSource, customerTypesRecord as customerType, entityStatusesRecord as entityStatus, productStatusesRecord as productStatus };
|
package/enums.js
CHANGED
|
@@ -31,6 +31,13 @@ import { pgEnum as pgEnum2 } from "drizzle-orm/pg-core";
|
|
|
31
31
|
var customerTypesArray = ["individual", "individual_entrepreneur", "legal_entity"];
|
|
32
32
|
var customerTypePGEnum = pgEnum2("customer_type", customerTypesArray);
|
|
33
33
|
var customerTypesRecord = createStringEnumRecord4(customerTypesArray);
|
|
34
|
+
|
|
35
|
+
// src/app/domain/(catalog)/products/products.enums.ts
|
|
36
|
+
import { createStringEnumRecord as createStringEnumRecord5 } from "@kalutskii/foundation";
|
|
37
|
+
import { pgEnum as pgEnum3 } from "drizzle-orm/pg-core";
|
|
38
|
+
var productStatusesArray = ["draft", "active", "archived"];
|
|
39
|
+
var productStatusPGEnum = pgEnum3("product_status", productStatusesArray);
|
|
40
|
+
var productStatusesRecord = createStringEnumRecord5(productStatusesArray);
|
|
34
41
|
export {
|
|
35
42
|
auditLogSourcesRecord as auditLogSource,
|
|
36
43
|
auditLogSourcesArray,
|
|
@@ -38,5 +45,7 @@ export {
|
|
|
38
45
|
customerTypesArray,
|
|
39
46
|
entityStatusesRecord as entityStatus,
|
|
40
47
|
locale,
|
|
41
|
-
localesArray
|
|
48
|
+
localesArray,
|
|
49
|
+
productStatusesRecord as productStatus,
|
|
50
|
+
productStatusesArray
|
|
42
51
|
};
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -472,4 +472,149 @@ type CurrencyListResult = {
|
|
|
472
472
|
currencies: Currency[];
|
|
473
473
|
};
|
|
474
474
|
//#endregion
|
|
475
|
-
|
|
475
|
+
//#region src/app/domain/(catalog)/products/products.fields.d.ts
|
|
476
|
+
declare const productImageSchema: z.ZodObject<{
|
|
477
|
+
src: z.ZodURL;
|
|
478
|
+
isBanner: z.ZodBoolean;
|
|
479
|
+
}, z.core.$strip>;
|
|
480
|
+
declare const productImagesSchema: z.ZodArray<z.ZodObject<{
|
|
481
|
+
src: z.ZodURL;
|
|
482
|
+
isBanner: z.ZodBoolean;
|
|
483
|
+
}, z.core.$strip>>;
|
|
484
|
+
type ProductImage = z.infer<typeof productImageSchema>;
|
|
485
|
+
type ProductImages = z.infer<typeof productImagesSchema>;
|
|
486
|
+
//#endregion
|
|
487
|
+
//#region src/app/domain/(catalog)/products/products.schemas.d.ts
|
|
488
|
+
declare const productSchema: z.ZodObject<{
|
|
489
|
+
id: z.ZodInt;
|
|
490
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
491
|
+
status: z.ZodEnum<{
|
|
492
|
+
active: "active";
|
|
493
|
+
archived: "archived";
|
|
494
|
+
draft: "draft";
|
|
495
|
+
}>;
|
|
496
|
+
name: z.ZodNullable<z.ZodRecord<z.ZodEnum<{
|
|
497
|
+
en: "en";
|
|
498
|
+
ka: "ka";
|
|
499
|
+
ru: "ru";
|
|
500
|
+
}> & z.core.$partial, z.ZodString>>;
|
|
501
|
+
description: z.ZodNullable<z.ZodRecord<z.ZodEnum<{
|
|
502
|
+
en: "en";
|
|
503
|
+
ka: "ka";
|
|
504
|
+
ru: "ru";
|
|
505
|
+
}> & z.core.$partial, z.ZodString>>;
|
|
506
|
+
images: z.ZodArray<z.ZodObject<{
|
|
507
|
+
src: z.ZodURL;
|
|
508
|
+
isBanner: z.ZodBoolean;
|
|
509
|
+
}, z.core.$strip>>;
|
|
510
|
+
categoryId: z.ZodNullable<z.ZodInt>;
|
|
511
|
+
brandId: z.ZodNullable<z.ZodInt>;
|
|
512
|
+
updatedAt: z.ZodNullable<z.ZodDate>;
|
|
513
|
+
createdAt: z.ZodDate;
|
|
514
|
+
}, z.core.$strip>;
|
|
515
|
+
type Product = z.infer<typeof productSchema>;
|
|
516
|
+
//#endregion
|
|
517
|
+
//#region src/app/flows/product/product.schemas.d.ts
|
|
518
|
+
declare const productSearchOptionsSchema: z.ZodObject<{
|
|
519
|
+
where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
520
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
521
|
+
active: "active";
|
|
522
|
+
archived: "archived";
|
|
523
|
+
draft: "draft";
|
|
524
|
+
}>>;
|
|
525
|
+
categoryId: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
526
|
+
brandId: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
527
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
528
|
+
status?: "active" | "archived" | "draft" | undefined;
|
|
529
|
+
categoryId?: number | null | undefined;
|
|
530
|
+
brandId: number | null;
|
|
531
|
+
} | {
|
|
532
|
+
status?: "active" | "archived" | "draft" | undefined;
|
|
533
|
+
categoryId: number | null;
|
|
534
|
+
brandId?: number | null | undefined;
|
|
535
|
+
} | {
|
|
536
|
+
status: "active" | "archived" | "draft";
|
|
537
|
+
categoryId?: number | null | undefined;
|
|
538
|
+
brandId?: number | null | undefined;
|
|
539
|
+
}, {
|
|
540
|
+
status?: "active" | "archived" | "draft" | undefined;
|
|
541
|
+
categoryId?: number | null | undefined;
|
|
542
|
+
brandId?: number | null | undefined;
|
|
543
|
+
}>>>;
|
|
544
|
+
query: z.ZodOptional<z.ZodString>;
|
|
545
|
+
pagination: z.ZodObject<{
|
|
546
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
547
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
548
|
+
}, z.core.$strip>;
|
|
549
|
+
}, z.core.$strict>;
|
|
550
|
+
declare const productSelectOneQuerySchema: z.ZodPipe<z.ZodObject<{
|
|
551
|
+
id: z.ZodOptional<z.ZodInt>;
|
|
552
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
553
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
554
|
+
id: number;
|
|
555
|
+
slug?: string | undefined;
|
|
556
|
+
} | {
|
|
557
|
+
id?: number | undefined;
|
|
558
|
+
slug: string;
|
|
559
|
+
}, {
|
|
560
|
+
id?: number | undefined;
|
|
561
|
+
slug?: string | undefined;
|
|
562
|
+
}>>;
|
|
563
|
+
declare const productCreatePayloadSchema: z.ZodObject<{
|
|
564
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
565
|
+
active: "active";
|
|
566
|
+
archived: "archived";
|
|
567
|
+
draft: "draft";
|
|
568
|
+
}>>;
|
|
569
|
+
slug: z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
570
|
+
name: z.ZodOptional<z.ZodPreprocess<z.ZodNullable<z.ZodRecord<z.ZodEnum<{
|
|
571
|
+
en: "en";
|
|
572
|
+
ka: "ka";
|
|
573
|
+
ru: "ru";
|
|
574
|
+
}> & z.core.$partial, z.ZodString>>>>;
|
|
575
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodNullable<z.ZodRecord<z.ZodEnum<{
|
|
576
|
+
en: "en";
|
|
577
|
+
ka: "ka";
|
|
578
|
+
ru: "ru";
|
|
579
|
+
}> & z.core.$partial, z.ZodString>>>>;
|
|
580
|
+
categoryId: z.ZodOptional<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodNull, z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>]>>>;
|
|
581
|
+
brandId: z.ZodOptional<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodNull, z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>]>>>;
|
|
582
|
+
images: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodFile>>>;
|
|
583
|
+
bannerImageIndex: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
584
|
+
}, z.core.$strip>;
|
|
585
|
+
declare const productUpdatePayloadSchema: z.ZodObject<{
|
|
586
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
587
|
+
active: "active";
|
|
588
|
+
archived: "archived";
|
|
589
|
+
draft: "draft";
|
|
590
|
+
}>>;
|
|
591
|
+
slug: z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
592
|
+
name: z.ZodOptional<z.ZodPreprocess<z.ZodNullable<z.ZodRecord<z.ZodEnum<{
|
|
593
|
+
en: "en";
|
|
594
|
+
ka: "ka";
|
|
595
|
+
ru: "ru";
|
|
596
|
+
}> & z.core.$partial, z.ZodString>>>>;
|
|
597
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodNullable<z.ZodRecord<z.ZodEnum<{
|
|
598
|
+
en: "en";
|
|
599
|
+
ka: "ka";
|
|
600
|
+
ru: "ru";
|
|
601
|
+
}> & z.core.$partial, z.ZodString>>>>;
|
|
602
|
+
categoryId: z.ZodOptional<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodNull, z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>]>>>;
|
|
603
|
+
brandId: z.ZodOptional<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodNull, z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>]>>>;
|
|
604
|
+
images: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodFile>>>;
|
|
605
|
+
bannerImageIndex: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
606
|
+
productId: z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>;
|
|
607
|
+
}, z.core.$strip>;
|
|
608
|
+
type ProductSearchOptions = z.infer<typeof productSearchOptionsSchema>;
|
|
609
|
+
type ProductSearchResult = {
|
|
610
|
+
products: Product[];
|
|
611
|
+
total: number;
|
|
612
|
+
};
|
|
613
|
+
type ProductSelectOneQuery = z.infer<typeof productSelectOneQuerySchema>;
|
|
614
|
+
type ProductCreatePayload = z.infer<typeof productCreatePayloadSchema>;
|
|
615
|
+
type ProductCreateResult = {
|
|
616
|
+
product: Product;
|
|
617
|
+
};
|
|
618
|
+
type ProductUpdatePayload = z.infer<typeof productUpdatePayloadSchema>;
|
|
619
|
+
//#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 };
|