@voyantjs/pricing 0.26.6 → 0.26.8

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.
@@ -22,7 +22,7 @@ export declare const publicPricingRoutes: import("hono/hono-base").HonoBase<Env,
22
22
  data: {
23
23
  productId: string;
24
24
  catalog: {
25
- currencyCode: string | null;
25
+ currencyCode: string;
26
26
  id: string;
27
27
  code: string;
28
28
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"schema-catalogs.d.ts","sourceRoot":"","sources":["../src/schema-catalogs.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBzB,CAAA;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B1B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,aAAa,CAAC,YAAY,CAAA;AAC5D,MAAM,MAAM,eAAe,GAAG,OAAO,aAAa,CAAC,YAAY,CAAA;AAC/D,MAAM,MAAM,aAAa,GAAG,OAAO,cAAc,CAAC,YAAY,CAAA;AAC9D,MAAM,MAAM,gBAAgB,GAAG,OAAO,cAAc,CAAC,YAAY,CAAA"}
1
+ {"version":3,"file":"schema-catalogs.d.ts","sourceRoot":"","sources":["../src/schema-catalogs.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBzB,CAAA;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B1B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,aAAa,CAAC,YAAY,CAAA;AAC5D,MAAM,MAAM,eAAe,GAAG,OAAO,aAAa,CAAC,YAAY,CAAA;AAC/D,MAAM,MAAM,aAAa,GAAG,OAAO,cAAc,CAAC,YAAY,CAAA;AAC9D,MAAM,MAAM,gBAAgB,GAAG,OAAO,cAAc,CAAC,YAAY,CAAA"}
@@ -5,6 +5,7 @@ export const priceCatalogs = pgTable("price_catalogs", {
5
5
  id: typeId("price_catalogs"),
6
6
  code: text("code").notNull(),
7
7
  name: text("name").notNull(),
8
+ // NULL = follow product.sellCurrency at snapshot time (multi-currency catalog)
8
9
  currencyCode: text("currency_code"),
9
10
  catalogType: priceCatalogTypeEnum("catalog_type").notNull().default("public"),
10
11
  isDefault: boolean("is_default").notNull().default(false),
@@ -4,7 +4,7 @@ export declare const publicPricingService: {
4
4
  getProductPricingSnapshot(db: PostgresJsDatabase, productId: string, query: PublicProductPricingQuery): Promise<{
5
5
  productId: string;
6
6
  catalog: {
7
- currencyCode: string | null;
7
+ currencyCode: string;
8
8
  id: string;
9
9
  code: string;
10
10
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"service-public.d.ts","sourceRoot":"","sources":["../src/service-public.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AASjE,OAAO,KAAK,EACV,+BAA+B,EAC/B,yBAAyB,EAC1B,MAAM,wBAAwB,CAAA;AAuE/B,eAAO,MAAM,oBAAoB;kCAEzB,kBAAkB,aACX,MAAM,SACV,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA0R5B,kBAAkB,aACX,MAAM,SACV,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;CAgGzC,CAAA"}
1
+ {"version":3,"file":"service-public.d.ts","sourceRoot":"","sources":["../src/service-public.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AASjE,OAAO,KAAK,EACV,+BAA+B,EAC/B,yBAAyB,EAC1B,MAAM,wBAAwB,CAAA;AAwE/B,eAAO,MAAM,oBAAoB;kCAEzB,kBAAkB,aACX,MAAM,SACV,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA0R5B,kBAAkB,aACX,MAAM,SACV,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;CAgGzC,CAAA"}
@@ -14,6 +14,7 @@ async function ensurePublicProduct(db, productId) {
14
14
  id: products.id,
15
15
  bookingMode: products.bookingMode,
16
16
  capacityMode: products.capacityMode,
17
+ sellCurrency: products.sellCurrency,
17
18
  })
18
19
  .from(products)
19
20
  .where(and(eq(products.id, productId), eq(products.status, "active"), eq(products.activated, true), eq(products.visibility, "public")))
@@ -80,7 +81,7 @@ export const publicPricingService = {
80
81
  productId,
81
82
  catalog: {
82
83
  ...catalog,
83
- currencyCode: catalog.currencyCode ?? null,
84
+ currencyCode: catalog.currencyCode ?? product.sellCurrency,
84
85
  },
85
86
  options: [],
86
87
  };
@@ -208,7 +209,7 @@ export const publicPricingService = {
208
209
  productId,
209
210
  catalog: {
210
211
  ...catalog,
211
- currencyCode: catalog.currencyCode ?? null,
212
+ currencyCode: catalog.currencyCode ?? product.sellCurrency,
212
213
  },
213
214
  options: options.map((option) => ({
214
215
  id: option.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyantjs/pricing",
3
- "version": "0.26.6",
3
+ "version": "0.26.8",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -39,16 +39,16 @@
39
39
  "drizzle-orm": "^0.45.2",
40
40
  "hono": "^4.12.10",
41
41
  "zod": "^4.3.6",
42
- "@voyantjs/availability": "0.26.6",
43
- "@voyantjs/core": "0.26.6",
44
- "@voyantjs/db": "0.26.6",
45
- "@voyantjs/hono": "0.26.6",
46
- "@voyantjs/products": "0.26.6"
42
+ "@voyantjs/availability": "0.26.8",
43
+ "@voyantjs/core": "0.26.8",
44
+ "@voyantjs/db": "0.26.8",
45
+ "@voyantjs/hono": "0.26.8",
46
+ "@voyantjs/products": "0.26.8"
47
47
  },
48
48
  "devDependencies": {
49
49
  "typescript": "^6.0.2",
50
- "@voyantjs/extras": "0.26.6",
51
- "@voyantjs/facilities": "0.26.6",
50
+ "@voyantjs/extras": "0.26.8",
51
+ "@voyantjs/facilities": "0.26.8",
52
52
  "@voyantjs/voyant-typescript-config": "0.1.0"
53
53
  },
54
54
  "files": [