@esb-market-contracts/backend 1.0.19 → 1.0.20

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 +75 -3
  2. package/package.json +1 -1
  3. package/types.d.ts +53 -3
package/api.d.ts CHANGED
@@ -299,6 +299,78 @@ 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/(finance)/exchange-rates.routes.d.ts
303
+ declare const exchangeRatesRouter: import("hono/hono-base").HonoBase<{
304
+ Variables: VariablesWithActor;
305
+ }, {
306
+ "/finance/exchange-rates/currencies": {
307
+ $get: {
308
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
309
+ currencies: {
310
+ id: number;
311
+ code: string;
312
+ name: string;
313
+ }[];
314
+ }>;
315
+ outputFormat: "json";
316
+ status: 200;
317
+ input: {};
318
+ };
319
+ };
320
+ } & {
321
+ "/finance/exchange-rates/dates/search": {
322
+ $post: {
323
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
324
+ dates: Date[];
325
+ total: number;
326
+ }>;
327
+ outputFormat: "json";
328
+ status: 200;
329
+ input: {
330
+ json: {
331
+ where?: {
332
+ currencyId?: number | undefined;
333
+ validFromDate?: unknown;
334
+ } | undefined;
335
+ pagination: {
336
+ offset?: unknown;
337
+ limit?: unknown;
338
+ };
339
+ };
340
+ };
341
+ };
342
+ };
343
+ } & {
344
+ "/finance/exchange-rates/search": {
345
+ $post: {
346
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
347
+ exchangeRates: {
348
+ id: number;
349
+ currencyId: number;
350
+ rate: number;
351
+ validFromDate: Date;
352
+ }[];
353
+ total: number;
354
+ }>;
355
+ outputFormat: "json";
356
+ status: 200;
357
+ input: {
358
+ json: {
359
+ where?: {
360
+ currencyId?: number | undefined;
361
+ validFromDate?: unknown;
362
+ } | undefined;
363
+ pagination: {
364
+ offset?: unknown;
365
+ limit?: unknown;
366
+ };
367
+ };
368
+ };
369
+ };
370
+ };
371
+ }, "/finance/exchange-rates", "/finance/exchange-rates/search">;
372
+ type ExchangeRatesRouter = typeof exchangeRatesRouter;
373
+ //#endregion
302
374
  //#region src/app/flows/audit/audit.enums.d.ts
303
375
  declare const auditLogSourcesArray: readonly ['admin', 'backend'];
304
376
  type AuditLogSource = (typeof auditLogSourcesArray)[number];
@@ -320,11 +392,11 @@ declare const auditLogSchema: import("drizzle-orm/zod").BuildSchema<"select", {
320
392
  identity: undefined;
321
393
  generated: undefined;
322
394
  }>;
323
- 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">, {
395
+ 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">, {
324
396
  name: string;
325
397
  tableName: "audit_logs";
326
398
  dataType: "string";
327
- data: "brand.created" | "brand.updated" | "category.activated" | "category.archived" | "category.created" | "category.updated" | "country.created" | "country.updated" | "customer.created" | "customer.updated";
399
+ 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";
328
400
  driverParam: string;
329
401
  notNull: true;
330
402
  hasDefault: false;
@@ -544,4 +616,4 @@ declare const customersRouter: import("hono/hono-base").HonoBase<{
544
616
  }, "/operations/customers", "/operations/customers/update">;
545
617
  type CustomersRouter = typeof customersRouter;
546
618
  //#endregion
547
- export type { AuditLogsRouter, BrandsRouter, CategoriesRouter, CountriesRouter, CustomersRouter };
619
+ export type { AuditLogsRouter, BrandsRouter, CategoriesRouter, CountriesRouter, CustomersRouter, ExchangeRatesRouter };
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.19",
4
+ "version": "1.0.20",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "sideEffects": false,
package/types.d.ts CHANGED
@@ -246,11 +246,11 @@ declare const auditLogSchema: import("drizzle-orm/zod").BuildSchema<"select", {
246
246
  identity: undefined;
247
247
  generated: undefined;
248
248
  }>;
249
- 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">, {
249
+ 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">, {
250
250
  name: string;
251
251
  tableName: "audit_logs";
252
252
  dataType: "string";
253
- data: "brand.created" | "brand.updated" | "category.activated" | "category.archived" | "category.created" | "category.updated" | "country.created" | "country.updated" | "customer.created" | "customer.updated";
253
+ 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";
254
254
  driverParam: string;
255
255
  notNull: true;
256
256
  hasDefault: false;
@@ -422,4 +422,54 @@ type CustomerSelectOneQuery = z.infer<typeof customerSelectOneQuerySchema>;
422
422
  type CustomerCreatePayload = z.infer<typeof customerCreatePayloadSchema>;
423
423
  type CustomerUpdatePayload = z.infer<typeof customerUpdatePayloadSchema>;
424
424
  //#endregion
425
- export type { AuditLogResult, AuditLogSearchPayload, AuditLogSearchResult, AuditLogSelectOneQuery, Brand, BrandCreatePayload, BrandSearchOptions, BrandSearchResult, BrandSelectOneQuery, BrandUpdatePayload, Category, CategoryCreatePayload, CategorySearchOptions, CategorySearchResult, CategorySelectOneQuery, CategoryUpdatePayload, Country, CountryCreatePayload, CountrySearchOptions, CountrySearchResult, CountrySelectOneQuery, CountryUpdatePayload, Customer, CustomerCreatePayload, CustomerSearchOptions, CustomerSearchResult, CustomerSelectOneQuery, CustomerUpdatePayload };
425
+ //#region src/app/domain/(finance)/currencies/currencies.schemas.d.ts
426
+ declare const currencySchema: z.ZodObject<{
427
+ id: z.ZodInt;
428
+ code: z.ZodString;
429
+ name: z.ZodString;
430
+ }, z.core.$strip>;
431
+ type Currency = z.infer<typeof currencySchema>;
432
+ //#endregion
433
+ //#region src/app/domain/(finance)/exchange-rates/exchange-rates.schemas.d.ts
434
+ declare const exchangeRateSchema: z.ZodObject<{
435
+ id: z.ZodInt;
436
+ currencyId: z.ZodInt;
437
+ rate: z.ZodNumber;
438
+ validFromDate: z.ZodDate;
439
+ }, z.core.$strip>;
440
+ type ExchangeRate = z.infer<typeof exchangeRateSchema>;
441
+ //#endregion
442
+ //#region src/app/flows/exchange-rate/exchange-rate.schemas.d.ts
443
+ declare const exchangeRateSearchOptionsSchema: z.ZodObject<{
444
+ where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
445
+ currencyId: z.ZodOptional<z.ZodInt>;
446
+ validFromDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
447
+ }, z.core.$strip>, z.ZodTransform<{
448
+ currencyId: number;
449
+ validFromDate?: Date | undefined;
450
+ } | {
451
+ currencyId?: number | undefined;
452
+ validFromDate: Date;
453
+ }, {
454
+ currencyId?: number | undefined;
455
+ validFromDate?: Date | undefined;
456
+ }>>>;
457
+ pagination: z.ZodObject<{
458
+ offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
459
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
460
+ }, z.core.$strip>;
461
+ }, z.core.$strict>;
462
+ type ExchangeRateSearchOptions = z.infer<typeof exchangeRateSearchOptionsSchema>;
463
+ type ExchangeRateSearchResult = {
464
+ exchangeRates: ExchangeRate[];
465
+ total: number;
466
+ };
467
+ type ExchangeRateDateSearchResult = {
468
+ dates: Date[];
469
+ total: number;
470
+ };
471
+ type CurrencyListResult = {
472
+ currencies: Currency[];
473
+ };
474
+ //#endregion
475
+ 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 };