@voyant-travel/commerce 0.1.0
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/LICENSE +201 -0
- package/README.md +145 -0
- package/dist/accepted-quote-version-reservation-golden-flow.test.d.ts +2 -0
- package/dist/accepted-quote-version-reservation-golden-flow.test.d.ts.map +1 -0
- package/dist/accepted-quote-version-reservation-golden-flow.test.js +398 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/interface.d.ts +18 -0
- package/dist/interface.d.ts.map +1 -0
- package/dist/interface.js +246 -0
- package/dist/interface.test.d.ts +2 -0
- package/dist/interface.test.d.ts.map +1 -0
- package/dist/interface.test.js +357 -0
- package/dist/markets/index.d.ts +11 -0
- package/dist/markets/index.d.ts.map +1 -0
- package/dist/markets/index.js +12 -0
- package/dist/markets/routes.d.ts +1182 -0
- package/dist/markets/routes.d.ts.map +1 -0
- package/dist/markets/routes.js +209 -0
- package/dist/markets/schema.d.ts +1527 -0
- package/dist/markets/schema.d.ts.map +1 -0
- package/dist/markets/schema.js +240 -0
- package/dist/markets/service-core.d.ts +253 -0
- package/dist/markets/service-core.d.ts.map +1 -0
- package/dist/markets/service-core.js +242 -0
- package/dist/markets/service-rules.d.ts +191 -0
- package/dist/markets/service-rules.d.ts.map +1 -0
- package/dist/markets/service-rules.js +155 -0
- package/dist/markets/service-shared.d.ts +36 -0
- package/dist/markets/service-shared.d.ts.map +1 -0
- package/dist/markets/service-shared.js +7 -0
- package/dist/markets/service.d.ts +43 -0
- package/dist/markets/service.d.ts.map +1 -0
- package/dist/markets/service.js +42 -0
- package/dist/markets/validation.d.ts +451 -0
- package/dist/markets/validation.d.ts.map +1 -0
- package/dist/markets/validation.js +160 -0
- package/dist/pricing/events.d.ts +53 -0
- package/dist/pricing/events.d.ts.map +1 -0
- package/dist/pricing/events.js +28 -0
- package/dist/pricing/index.d.ts +15 -0
- package/dist/pricing/index.d.ts.map +1 -0
- package/dist/pricing/index.js +18 -0
- package/dist/pricing/routes-core.d.ts +981 -0
- package/dist/pricing/routes-core.d.ts.map +1 -0
- package/dist/pricing/routes-core.js +102 -0
- package/dist/pricing/routes-public.d.ts +136 -0
- package/dist/pricing/routes-public.d.ts.map +1 -0
- package/dist/pricing/routes-public.js +14 -0
- package/dist/pricing/routes-rules.d.ts +1339 -0
- package/dist/pricing/routes-rules.d.ts.map +1 -0
- package/dist/pricing/routes-rules.js +138 -0
- package/dist/pricing/routes-shared.d.ts +14 -0
- package/dist/pricing/routes-shared.d.ts.map +1 -0
- package/dist/pricing/routes-shared.js +3 -0
- package/dist/pricing/routes.d.ts +7 -0
- package/dist/pricing/routes.d.ts.map +1 -0
- package/dist/pricing/routes.js +6 -0
- package/dist/pricing/schema-catalogs.d.ts +467 -0
- package/dist/pricing/schema-catalogs.d.ts.map +1 -0
- package/dist/pricing/schema-catalogs.js +47 -0
- package/dist/pricing/schema-categories.d.ts +497 -0
- package/dist/pricing/schema-categories.d.ts.map +1 -0
- package/dist/pricing/schema-categories.js +54 -0
- package/dist/pricing/schema-departure-overrides.d.ts +228 -0
- package/dist/pricing/schema-departure-overrides.d.ts.map +1 -0
- package/dist/pricing/schema-departure-overrides.js +36 -0
- package/dist/pricing/schema-option-rules.d.ts +1770 -0
- package/dist/pricing/schema-option-rules.d.ts.map +1 -0
- package/dist/pricing/schema-option-rules.js +181 -0
- package/dist/pricing/schema-policies.d.ts +395 -0
- package/dist/pricing/schema-policies.d.ts.map +1 -0
- package/dist/pricing/schema-policies.js +41 -0
- package/dist/pricing/schema-relations.d.ts +59 -0
- package/dist/pricing/schema-relations.d.ts.map +1 -0
- package/dist/pricing/schema-relations.js +111 -0
- package/dist/pricing/schema-shared.d.ts +11 -0
- package/dist/pricing/schema-shared.d.ts.map +1 -0
- package/dist/pricing/schema-shared.js +67 -0
- package/dist/pricing/schema.d.ts +8 -0
- package/dist/pricing/schema.d.ts.map +1 -0
- package/dist/pricing/schema.js +7 -0
- package/dist/pricing/service-catalog-plane-pricing.d.ts +95 -0
- package/dist/pricing/service-catalog-plane-pricing.d.ts.map +1 -0
- package/dist/pricing/service-catalog-plane-pricing.js +382 -0
- package/dist/pricing/service-catalogs.d.ts +139 -0
- package/dist/pricing/service-catalogs.d.ts.map +1 -0
- package/dist/pricing/service-catalogs.js +89 -0
- package/dist/pricing/service-categories.d.ts +147 -0
- package/dist/pricing/service-categories.d.ts.map +1 -0
- package/dist/pricing/service-categories.js +105 -0
- package/dist/pricing/service-departure-overrides.d.ts +67 -0
- package/dist/pricing/service-departure-overrides.d.ts.map +1 -0
- package/dist/pricing/service-departure-overrides.js +54 -0
- package/dist/pricing/service-option-rules.d.ts +321 -0
- package/dist/pricing/service-option-rules.d.ts.map +1 -0
- package/dist/pricing/service-option-rules.js +340 -0
- package/dist/pricing/service-policies.d.ts +123 -0
- package/dist/pricing/service-policies.d.ts.map +1 -0
- package/dist/pricing/service-policies.js +95 -0
- package/dist/pricing/service-public.d.ts +89 -0
- package/dist/pricing/service-public.d.ts.map +1 -0
- package/dist/pricing/service-public.js +473 -0
- package/dist/pricing/service-rule-resolver.d.ts +67 -0
- package/dist/pricing/service-rule-resolver.d.ts.map +1 -0
- package/dist/pricing/service-rule-resolver.js +204 -0
- package/dist/pricing/service-shared.d.ts +53 -0
- package/dist/pricing/service-shared.d.ts.map +1 -0
- package/dist/pricing/service-shared.js +4 -0
- package/dist/pricing/service-transfer-rules.d.ts +211 -0
- package/dist/pricing/service-transfer-rules.d.ts.map +1 -0
- package/dist/pricing/service-transfer-rules.js +139 -0
- package/dist/pricing/service.d.ts +79 -0
- package/dist/pricing/service.d.ts.map +1 -0
- package/dist/pricing/service.js +78 -0
- package/dist/pricing/validation-public.d.ts +412 -0
- package/dist/pricing/validation-public.d.ts.map +1 -0
- package/dist/pricing/validation-public.js +111 -0
- package/dist/pricing/validation-shared.d.ts +71 -0
- package/dist/pricing/validation-shared.d.ts.map +1 -0
- package/dist/pricing/validation-shared.js +63 -0
- package/dist/pricing/validation.d.ts +987 -0
- package/dist/pricing/validation.d.ts.map +1 -0
- package/dist/pricing/validation.js +307 -0
- package/dist/promotions/events.d.ts +38 -0
- package/dist/promotions/events.d.ts.map +1 -0
- package/dist/promotions/events.js +25 -0
- package/dist/promotions/index.d.ts +12 -0
- package/dist/promotions/index.d.ts.map +1 -0
- package/dist/promotions/index.js +17 -0
- package/dist/promotions/routes-shared.d.ts +14 -0
- package/dist/promotions/routes-shared.d.ts.map +1 -0
- package/dist/promotions/routes-shared.js +3 -0
- package/dist/promotions/routes.d.ts +395 -0
- package/dist/promotions/routes.d.ts.map +1 -0
- package/dist/promotions/routes.js +55 -0
- package/dist/promotions/schema.d.ts +675 -0
- package/dist/promotions/schema.d.ts.map +1 -0
- package/dist/promotions/schema.js +126 -0
- package/dist/promotions/service-booking-confirmed.d.ts +77 -0
- package/dist/promotions/service-booking-confirmed.d.ts.map +1 -0
- package/dist/promotions/service-booking-confirmed.js +134 -0
- package/dist/promotions/service-boundary-scheduler.d.ts +85 -0
- package/dist/promotions/service-boundary-scheduler.d.ts.map +1 -0
- package/dist/promotions/service-boundary-scheduler.js +141 -0
- package/dist/promotions/service-catalog-evaluator.d.ts +22 -0
- package/dist/promotions/service-catalog-evaluator.d.ts.map +1 -0
- package/dist/promotions/service-catalog-evaluator.js +33 -0
- package/dist/promotions/service-catalog-plane-promotions.d.ts +73 -0
- package/dist/promotions/service-catalog-plane-promotions.d.ts.map +1 -0
- package/dist/promotions/service-catalog-plane-promotions.js +118 -0
- package/dist/promotions/service-evaluator.d.ts +134 -0
- package/dist/promotions/service-evaluator.d.ts.map +1 -0
- package/dist/promotions/service-evaluator.js +302 -0
- package/dist/promotions/service-storefront.d.ts +147 -0
- package/dist/promotions/service-storefront.d.ts.map +1 -0
- package/dist/promotions/service-storefront.js +326 -0
- package/dist/promotions/service.d.ts +143 -0
- package/dist/promotions/service.d.ts.map +1 -0
- package/dist/promotions/service.js +359 -0
- package/dist/promotions/validation.d.ts +195 -0
- package/dist/promotions/validation.d.ts.map +1 -0
- package/dist/promotions/validation.js +167 -0
- package/dist/promotions/workflow-bulk-reindex.d.ts +36 -0
- package/dist/promotions/workflow-bulk-reindex.d.ts.map +1 -0
- package/dist/promotions/workflow-bulk-reindex.js +53 -0
- package/dist/promotions/workflow-runtime.d.ts +17 -0
- package/dist/promotions/workflow-runtime.d.ts.map +1 -0
- package/dist/promotions/workflow-runtime.js +9 -0
- package/dist/runtime.d.ts +18 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +27 -0
- package/dist/runtime.test.d.ts +2 -0
- package/dist/runtime.test.d.ts.map +1 -0
- package/dist/runtime.test.js +25 -0
- package/dist/schema.d.ts +5 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +4 -0
- package/dist/sellability/index.d.ts +13 -0
- package/dist/sellability/index.d.ts.map +1 -0
- package/dist/sellability/index.js +17 -0
- package/dist/sellability/routes.d.ts +2332 -0
- package/dist/sellability/routes.d.ts.map +1 -0
- package/dist/sellability/routes.js +166 -0
- package/dist/sellability/schema.d.ts +1716 -0
- package/dist/sellability/schema.d.ts.map +1 -0
- package/dist/sellability/schema.js +278 -0
- package/dist/sellability/service-records.d.ts +316 -0
- package/dist/sellability/service-records.d.ts.map +1 -0
- package/dist/sellability/service-records.js +253 -0
- package/dist/sellability/service-resolve.d.ts +72 -0
- package/dist/sellability/service-resolve.d.ts.map +1 -0
- package/dist/sellability/service-resolve.js +580 -0
- package/dist/sellability/service-shared.d.ts +124 -0
- package/dist/sellability/service-shared.d.ts.map +1 -0
- package/dist/sellability/service-shared.js +96 -0
- package/dist/sellability/service-snapshots.d.ts +191 -0
- package/dist/sellability/service-snapshots.d.ts.map +1 -0
- package/dist/sellability/service-snapshots.js +153 -0
- package/dist/sellability/service.d.ts +1038 -0
- package/dist/sellability/service.d.ts.map +1 -0
- package/dist/sellability/service.js +17 -0
- package/dist/sellability/validation.d.ts +477 -0
- package/dist/sellability/validation.d.ts.map +1 -0
- package/dist/sellability/validation.js +192 -0
- package/dist/types.d.ts +239 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/markets/schema.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,gBAAgB,0EAA8D,CAAA;AAC3F,eAAO,MAAM,oBAAoB,uEAA+D,CAAA;AAChG,eAAO,MAAM,qBAAqB,iFAIhC,CAAA;AACF,eAAO,MAAM,sBAAsB,yEAKjC,CAAA;AACF,eAAO,MAAM,gBAAgB,mGAO3B,CAAA;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBnB,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCzB,CAAA;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmC5B,CAAA;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;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A;AAEH,eAAO,MAAM,4BAA4B;;;;EAOtC,CAAA;AAEH,eAAO,MAAM,2BAA2B;;;EASrC,CAAA;AAEH,eAAO,MAAM,2BAA2B;;;EASrC,CAAA"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { typeId, typeIdRef } from "@voyant-travel/db/lib/typeid-column";
|
|
2
|
+
import { relations } from "drizzle-orm";
|
|
3
|
+
import { boolean, date, index, integer, jsonb, numeric, pgEnum, pgTable, text, timestamp, uniqueIndex, } from "drizzle-orm/pg-core";
|
|
4
|
+
export const marketStatusEnum = pgEnum("market_status", ["active", "inactive", "archived"]);
|
|
5
|
+
export const marketVisibilityEnum = pgEnum("market_visibility", ["public", "private", "hidden"]);
|
|
6
|
+
export const marketSellabilityEnum = pgEnum("market_sellability", [
|
|
7
|
+
"sellable",
|
|
8
|
+
"on_request",
|
|
9
|
+
"unavailable",
|
|
10
|
+
]);
|
|
11
|
+
export const marketChannelScopeEnum = pgEnum("market_channel_scope", [
|
|
12
|
+
"all",
|
|
13
|
+
"b2c",
|
|
14
|
+
"b2b",
|
|
15
|
+
"internal",
|
|
16
|
+
]);
|
|
17
|
+
export const fxRateSourceEnum = pgEnum("fx_rate_source", [
|
|
18
|
+
"manual",
|
|
19
|
+
"ecb",
|
|
20
|
+
"custom",
|
|
21
|
+
"channel",
|
|
22
|
+
"supplier",
|
|
23
|
+
"other",
|
|
24
|
+
]);
|
|
25
|
+
export const markets = pgTable("markets", {
|
|
26
|
+
id: typeId("markets"),
|
|
27
|
+
code: text("code").notNull(),
|
|
28
|
+
name: text("name").notNull(),
|
|
29
|
+
status: marketStatusEnum("status").notNull().default("active"),
|
|
30
|
+
regionCode: text("region_code"),
|
|
31
|
+
countryCode: text("country_code"),
|
|
32
|
+
defaultLanguageTag: text("default_language_tag").notNull(),
|
|
33
|
+
defaultCurrency: text("default_currency").notNull(),
|
|
34
|
+
timezone: text("timezone"),
|
|
35
|
+
taxContext: text("tax_context"),
|
|
36
|
+
metadata: jsonb("metadata").$type(),
|
|
37
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
38
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
39
|
+
}, (table) => [
|
|
40
|
+
uniqueIndex("uidx_markets_code").on(table.code),
|
|
41
|
+
index("idx_markets_updated").on(table.updatedAt),
|
|
42
|
+
index("idx_markets_status_updated").on(table.status, table.updatedAt),
|
|
43
|
+
index("idx_markets_country_updated").on(table.countryCode, table.updatedAt),
|
|
44
|
+
]);
|
|
45
|
+
export const marketLocales = pgTable("market_locales", {
|
|
46
|
+
id: typeId("market_locales"),
|
|
47
|
+
marketId: typeIdRef("market_id")
|
|
48
|
+
.notNull()
|
|
49
|
+
.references(() => markets.id, { onDelete: "cascade" }),
|
|
50
|
+
languageTag: text("language_tag").notNull(),
|
|
51
|
+
isDefault: boolean("is_default").notNull().default(false),
|
|
52
|
+
sortOrder: integer("sort_order").notNull().default(0),
|
|
53
|
+
active: boolean("active").notNull().default(true),
|
|
54
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
55
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
56
|
+
}, (table) => [
|
|
57
|
+
index("idx_market_locales_sort_created").on(table.sortOrder, table.createdAt),
|
|
58
|
+
index("idx_market_locales_market_sort_created").on(table.marketId, table.sortOrder, table.createdAt),
|
|
59
|
+
index("idx_market_locales_language_sort_created").on(table.languageTag, table.sortOrder, table.createdAt),
|
|
60
|
+
index("idx_market_locales_active_sort_created").on(table.active, table.sortOrder, table.createdAt),
|
|
61
|
+
uniqueIndex("uidx_market_locales_market_language").on(table.marketId, table.languageTag),
|
|
62
|
+
]);
|
|
63
|
+
export const marketCurrencies = pgTable("market_currencies", {
|
|
64
|
+
id: typeId("market_currencies"),
|
|
65
|
+
marketId: typeIdRef("market_id")
|
|
66
|
+
.notNull()
|
|
67
|
+
.references(() => markets.id, { onDelete: "cascade" }),
|
|
68
|
+
currencyCode: text("currency_code").notNull(),
|
|
69
|
+
isDefault: boolean("is_default").notNull().default(false),
|
|
70
|
+
isSettlement: boolean("is_settlement").notNull().default(false),
|
|
71
|
+
isReporting: boolean("is_reporting").notNull().default(false),
|
|
72
|
+
sortOrder: integer("sort_order").notNull().default(0),
|
|
73
|
+
active: boolean("active").notNull().default(true),
|
|
74
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
75
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
76
|
+
}, (table) => [
|
|
77
|
+
index("idx_market_currencies_sort_created").on(table.sortOrder, table.createdAt),
|
|
78
|
+
index("idx_market_currencies_market_sort_created").on(table.marketId, table.sortOrder, table.createdAt),
|
|
79
|
+
index("idx_market_currencies_code_sort_created").on(table.currencyCode, table.sortOrder, table.createdAt),
|
|
80
|
+
index("idx_market_currencies_active_sort_created").on(table.active, table.sortOrder, table.createdAt),
|
|
81
|
+
uniqueIndex("uidx_market_currencies_market_code").on(table.marketId, table.currencyCode),
|
|
82
|
+
]);
|
|
83
|
+
export const fxRateSets = pgTable("fx_rate_sets", {
|
|
84
|
+
id: typeId("fx_rate_sets"),
|
|
85
|
+
source: fxRateSourceEnum("source").notNull().default("manual"),
|
|
86
|
+
baseCurrency: text("base_currency").notNull(),
|
|
87
|
+
effectiveAt: timestamp("effective_at", { withTimezone: true }).notNull(),
|
|
88
|
+
observedAt: timestamp("observed_at", { withTimezone: true }),
|
|
89
|
+
sourceReference: text("source_reference"),
|
|
90
|
+
notes: text("notes"),
|
|
91
|
+
metadata: jsonb("metadata").$type(),
|
|
92
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
93
|
+
}, (table) => [
|
|
94
|
+
index("idx_fx_rate_sets_base_currency_effective").on(table.baseCurrency, table.effectiveAt),
|
|
95
|
+
index("idx_fx_rate_sets_effective_at").on(table.effectiveAt),
|
|
96
|
+
index("idx_fx_rate_sets_source_effective").on(table.source, table.effectiveAt),
|
|
97
|
+
]);
|
|
98
|
+
export const exchangeRates = pgTable("exchange_rates", {
|
|
99
|
+
id: typeId("exchange_rates"),
|
|
100
|
+
fxRateSetId: typeIdRef("fx_rate_set_id")
|
|
101
|
+
.notNull()
|
|
102
|
+
.references(() => fxRateSets.id, { onDelete: "cascade" }),
|
|
103
|
+
baseCurrency: text("base_currency").notNull(),
|
|
104
|
+
quoteCurrency: text("quote_currency").notNull(),
|
|
105
|
+
rateDecimal: numeric("rate_decimal", { precision: 18, scale: 8 }).notNull(),
|
|
106
|
+
inverseRateDecimal: numeric("inverse_rate_decimal", { precision: 18, scale: 8 }),
|
|
107
|
+
observedAt: timestamp("observed_at", { withTimezone: true }),
|
|
108
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
109
|
+
}, (table) => [
|
|
110
|
+
index("idx_exchange_rates_rate_set_created").on(table.fxRateSetId, table.createdAt),
|
|
111
|
+
index("idx_exchange_rates_base_currency_created").on(table.baseCurrency, table.createdAt),
|
|
112
|
+
index("idx_exchange_rates_quote_currency_created").on(table.quoteCurrency, table.createdAt),
|
|
113
|
+
index("idx_exchange_rates_pair").on(table.baseCurrency, table.quoteCurrency),
|
|
114
|
+
uniqueIndex("uidx_exchange_rates_set_pair").on(table.fxRateSetId, table.baseCurrency, table.quoteCurrency),
|
|
115
|
+
]);
|
|
116
|
+
export const marketPriceCatalogs = pgTable("market_price_catalogs", {
|
|
117
|
+
id: typeId("market_price_catalogs"),
|
|
118
|
+
marketId: typeIdRef("market_id")
|
|
119
|
+
.notNull()
|
|
120
|
+
.references(() => markets.id, { onDelete: "cascade" }),
|
|
121
|
+
priceCatalogId: typeIdRef("price_catalog_id").notNull(),
|
|
122
|
+
isDefault: boolean("is_default").notNull().default(false),
|
|
123
|
+
priority: integer("priority").notNull().default(0),
|
|
124
|
+
active: boolean("active").notNull().default(true),
|
|
125
|
+
notes: text("notes"),
|
|
126
|
+
metadata: jsonb("metadata").$type(),
|
|
127
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
128
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
129
|
+
}, (table) => [
|
|
130
|
+
index("idx_market_price_catalogs_market_created").on(table.marketId, table.createdAt),
|
|
131
|
+
index("idx_market_price_catalogs_catalog_created").on(table.priceCatalogId, table.createdAt),
|
|
132
|
+
index("idx_market_price_catalogs_active_created").on(table.active, table.createdAt),
|
|
133
|
+
uniqueIndex("uidx_market_price_catalogs_market_catalog").on(table.marketId, table.priceCatalogId),
|
|
134
|
+
]);
|
|
135
|
+
export const marketProductRules = pgTable("market_product_rules", {
|
|
136
|
+
id: typeId("market_product_rules"),
|
|
137
|
+
marketId: typeIdRef("market_id")
|
|
138
|
+
.notNull()
|
|
139
|
+
.references(() => markets.id, { onDelete: "cascade" }),
|
|
140
|
+
productId: text("product_id").notNull(),
|
|
141
|
+
optionId: text("option_id"),
|
|
142
|
+
priceCatalogId: typeIdRef("price_catalog_id").references(() => marketPriceCatalogs.id, {
|
|
143
|
+
onDelete: "set null",
|
|
144
|
+
}),
|
|
145
|
+
visibility: marketVisibilityEnum("visibility").notNull().default("public"),
|
|
146
|
+
sellability: marketSellabilityEnum("sellability").notNull().default("sellable"),
|
|
147
|
+
channelScope: marketChannelScopeEnum("channel_scope").notNull().default("all"),
|
|
148
|
+
active: boolean("active").notNull().default(true),
|
|
149
|
+
availableFrom: date("available_from"),
|
|
150
|
+
availableTo: date("available_to"),
|
|
151
|
+
notes: text("notes"),
|
|
152
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
153
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
154
|
+
}, (table) => [
|
|
155
|
+
index("idx_market_product_rules_market_created").on(table.marketId, table.createdAt),
|
|
156
|
+
index("idx_market_product_rules_product_created").on(table.productId, table.createdAt),
|
|
157
|
+
index("idx_market_product_rules_option_created").on(table.optionId, table.createdAt),
|
|
158
|
+
index("idx_market_product_rules_catalog").on(table.priceCatalogId),
|
|
159
|
+
index("idx_market_product_rules_sellability_created").on(table.sellability, table.createdAt),
|
|
160
|
+
index("idx_market_product_rules_active_created").on(table.active, table.createdAt),
|
|
161
|
+
]);
|
|
162
|
+
export const marketChannelRules = pgTable("market_channel_rules", {
|
|
163
|
+
id: typeId("market_channel_rules"),
|
|
164
|
+
marketId: typeIdRef("market_id")
|
|
165
|
+
.notNull()
|
|
166
|
+
.references(() => markets.id, { onDelete: "cascade" }),
|
|
167
|
+
channelId: text("channel_id").notNull(),
|
|
168
|
+
priceCatalogId: typeIdRef("price_catalog_id").references(() => marketPriceCatalogs.id, {
|
|
169
|
+
onDelete: "set null",
|
|
170
|
+
}),
|
|
171
|
+
visibility: marketVisibilityEnum("visibility").notNull().default("public"),
|
|
172
|
+
sellability: marketSellabilityEnum("sellability").notNull().default("sellable"),
|
|
173
|
+
active: boolean("active").notNull().default(true),
|
|
174
|
+
priority: integer("priority").notNull().default(0),
|
|
175
|
+
notes: text("notes"),
|
|
176
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
177
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
178
|
+
}, (table) => [
|
|
179
|
+
index("idx_market_channel_rules_market_created").on(table.marketId, table.createdAt),
|
|
180
|
+
index("idx_market_channel_rules_channel_created").on(table.channelId, table.createdAt),
|
|
181
|
+
index("idx_market_channel_rules_catalog").on(table.priceCatalogId),
|
|
182
|
+
index("idx_market_channel_rules_sellability_created").on(table.sellability, table.createdAt),
|
|
183
|
+
index("idx_market_channel_rules_active_created").on(table.active, table.createdAt),
|
|
184
|
+
]);
|
|
185
|
+
export const marketsRelations = relations(markets, ({ many }) => ({
|
|
186
|
+
locales: many(marketLocales),
|
|
187
|
+
currencies: many(marketCurrencies),
|
|
188
|
+
priceCatalogs: many(marketPriceCatalogs),
|
|
189
|
+
productRules: many(marketProductRules),
|
|
190
|
+
channelRules: many(marketChannelRules),
|
|
191
|
+
}));
|
|
192
|
+
export const marketLocalesRelations = relations(marketLocales, ({ one }) => ({
|
|
193
|
+
market: one(markets, {
|
|
194
|
+
fields: [marketLocales.marketId],
|
|
195
|
+
references: [markets.id],
|
|
196
|
+
}),
|
|
197
|
+
}));
|
|
198
|
+
export const marketCurrenciesRelations = relations(marketCurrencies, ({ one }) => ({
|
|
199
|
+
market: one(markets, {
|
|
200
|
+
fields: [marketCurrencies.marketId],
|
|
201
|
+
references: [markets.id],
|
|
202
|
+
}),
|
|
203
|
+
}));
|
|
204
|
+
export const fxRateSetsRelations = relations(fxRateSets, ({ many }) => ({
|
|
205
|
+
exchangeRates: many(exchangeRates),
|
|
206
|
+
}));
|
|
207
|
+
export const exchangeRatesRelations = relations(exchangeRates, ({ one }) => ({
|
|
208
|
+
fxRateSet: one(fxRateSets, {
|
|
209
|
+
fields: [exchangeRates.fxRateSetId],
|
|
210
|
+
references: [fxRateSets.id],
|
|
211
|
+
}),
|
|
212
|
+
}));
|
|
213
|
+
export const marketPriceCatalogsRelations = relations(marketPriceCatalogs, ({ one, many }) => ({
|
|
214
|
+
market: one(markets, {
|
|
215
|
+
fields: [marketPriceCatalogs.marketId],
|
|
216
|
+
references: [markets.id],
|
|
217
|
+
}),
|
|
218
|
+
productRules: many(marketProductRules),
|
|
219
|
+
channelRules: many(marketChannelRules),
|
|
220
|
+
}));
|
|
221
|
+
export const marketProductRulesRelations = relations(marketProductRules, ({ one }) => ({
|
|
222
|
+
market: one(markets, {
|
|
223
|
+
fields: [marketProductRules.marketId],
|
|
224
|
+
references: [markets.id],
|
|
225
|
+
}),
|
|
226
|
+
priceCatalog: one(marketPriceCatalogs, {
|
|
227
|
+
fields: [marketProductRules.priceCatalogId],
|
|
228
|
+
references: [marketPriceCatalogs.id],
|
|
229
|
+
}),
|
|
230
|
+
}));
|
|
231
|
+
export const marketChannelRulesRelations = relations(marketChannelRules, ({ one }) => ({
|
|
232
|
+
market: one(markets, {
|
|
233
|
+
fields: [marketChannelRules.marketId],
|
|
234
|
+
references: [markets.id],
|
|
235
|
+
}),
|
|
236
|
+
priceCatalog: one(marketPriceCatalogs, {
|
|
237
|
+
fields: [marketChannelRules.priceCatalogId],
|
|
238
|
+
references: [marketPriceCatalogs.id],
|
|
239
|
+
}),
|
|
240
|
+
}));
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
2
|
+
import type { CreateExchangeRateInput, CreateFxRateSetInput, CreateMarketCurrencyInput, CreateMarketInput, CreateMarketLocaleInput, ExchangeRateListQuery, FxRateSetListQuery, MarketCurrencyListQuery, MarketListQuery, MarketLocaleListQuery, UpdateExchangeRateInput, UpdateFxRateSetInput, UpdateMarketCurrencyInput, UpdateMarketInput, UpdateMarketLocaleInput } from "./service-shared.js";
|
|
3
|
+
export declare function listMarkets(db: PostgresJsDatabase, query: MarketListQuery): Promise<{
|
|
4
|
+
data: {
|
|
5
|
+
id: string;
|
|
6
|
+
code: string;
|
|
7
|
+
name: string;
|
|
8
|
+
status: "active" | "inactive" | "archived";
|
|
9
|
+
regionCode: string | null;
|
|
10
|
+
countryCode: string | null;
|
|
11
|
+
defaultLanguageTag: string;
|
|
12
|
+
defaultCurrency: string;
|
|
13
|
+
timezone: string | null;
|
|
14
|
+
taxContext: string | null;
|
|
15
|
+
metadata: Record<string, unknown> | null;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
}[];
|
|
19
|
+
total: number;
|
|
20
|
+
limit: number;
|
|
21
|
+
offset: number;
|
|
22
|
+
}>;
|
|
23
|
+
export declare function getMarketById(db: PostgresJsDatabase, id: string): Promise<{
|
|
24
|
+
id: string;
|
|
25
|
+
code: string;
|
|
26
|
+
name: string;
|
|
27
|
+
status: "active" | "inactive" | "archived";
|
|
28
|
+
regionCode: string | null;
|
|
29
|
+
countryCode: string | null;
|
|
30
|
+
defaultLanguageTag: string;
|
|
31
|
+
defaultCurrency: string;
|
|
32
|
+
timezone: string | null;
|
|
33
|
+
taxContext: string | null;
|
|
34
|
+
metadata: Record<string, unknown> | null;
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
updatedAt: Date;
|
|
37
|
+
} | null>;
|
|
38
|
+
export declare function createMarket(db: PostgresJsDatabase, data: CreateMarketInput): Promise<{
|
|
39
|
+
metadata: Record<string, unknown> | null;
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
status: "active" | "inactive" | "archived";
|
|
43
|
+
createdAt: Date;
|
|
44
|
+
code: string;
|
|
45
|
+
updatedAt: Date;
|
|
46
|
+
regionCode: string | null;
|
|
47
|
+
countryCode: string | null;
|
|
48
|
+
defaultLanguageTag: string;
|
|
49
|
+
defaultCurrency: string;
|
|
50
|
+
timezone: string | null;
|
|
51
|
+
taxContext: string | null;
|
|
52
|
+
} | null>;
|
|
53
|
+
export declare function updateMarket(db: PostgresJsDatabase, id: string, data: UpdateMarketInput): Promise<{
|
|
54
|
+
id: string;
|
|
55
|
+
code: string;
|
|
56
|
+
name: string;
|
|
57
|
+
status: "active" | "inactive" | "archived";
|
|
58
|
+
regionCode: string | null;
|
|
59
|
+
countryCode: string | null;
|
|
60
|
+
defaultLanguageTag: string;
|
|
61
|
+
defaultCurrency: string;
|
|
62
|
+
timezone: string | null;
|
|
63
|
+
taxContext: string | null;
|
|
64
|
+
metadata: Record<string, unknown> | null;
|
|
65
|
+
createdAt: Date;
|
|
66
|
+
updatedAt: Date;
|
|
67
|
+
} | null>;
|
|
68
|
+
export declare function deleteMarket(db: PostgresJsDatabase, id: string): Promise<{
|
|
69
|
+
id: string;
|
|
70
|
+
} | null>;
|
|
71
|
+
export declare function listMarketLocales(db: PostgresJsDatabase, query: MarketLocaleListQuery): Promise<{
|
|
72
|
+
data: {
|
|
73
|
+
id: string;
|
|
74
|
+
marketId: string;
|
|
75
|
+
languageTag: string;
|
|
76
|
+
isDefault: boolean;
|
|
77
|
+
sortOrder: number;
|
|
78
|
+
active: boolean;
|
|
79
|
+
createdAt: Date;
|
|
80
|
+
updatedAt: Date;
|
|
81
|
+
}[];
|
|
82
|
+
total: number;
|
|
83
|
+
limit: number;
|
|
84
|
+
offset: number;
|
|
85
|
+
}>;
|
|
86
|
+
export declare function createMarketLocale(db: PostgresJsDatabase, marketId: string, data: CreateMarketLocaleInput): Promise<{
|
|
87
|
+
id: string;
|
|
88
|
+
createdAt: Date;
|
|
89
|
+
updatedAt: Date;
|
|
90
|
+
active: boolean;
|
|
91
|
+
marketId: string;
|
|
92
|
+
languageTag: string;
|
|
93
|
+
isDefault: boolean;
|
|
94
|
+
sortOrder: number;
|
|
95
|
+
} | null>;
|
|
96
|
+
export declare function updateMarketLocale(db: PostgresJsDatabase, id: string, data: UpdateMarketLocaleInput): Promise<{
|
|
97
|
+
id: string;
|
|
98
|
+
marketId: string;
|
|
99
|
+
languageTag: string;
|
|
100
|
+
isDefault: boolean;
|
|
101
|
+
sortOrder: number;
|
|
102
|
+
active: boolean;
|
|
103
|
+
createdAt: Date;
|
|
104
|
+
updatedAt: Date;
|
|
105
|
+
} | null>;
|
|
106
|
+
export declare function deleteMarketLocale(db: PostgresJsDatabase, id: string): Promise<{
|
|
107
|
+
id: string;
|
|
108
|
+
} | null>;
|
|
109
|
+
export declare function listMarketCurrencies(db: PostgresJsDatabase, query: MarketCurrencyListQuery): Promise<{
|
|
110
|
+
data: {
|
|
111
|
+
id: string;
|
|
112
|
+
marketId: string;
|
|
113
|
+
currencyCode: string;
|
|
114
|
+
isDefault: boolean;
|
|
115
|
+
isSettlement: boolean;
|
|
116
|
+
isReporting: boolean;
|
|
117
|
+
sortOrder: number;
|
|
118
|
+
active: boolean;
|
|
119
|
+
createdAt: Date;
|
|
120
|
+
updatedAt: Date;
|
|
121
|
+
}[];
|
|
122
|
+
total: number;
|
|
123
|
+
limit: number;
|
|
124
|
+
offset: number;
|
|
125
|
+
}>;
|
|
126
|
+
export declare function createMarketCurrency(db: PostgresJsDatabase, marketId: string, data: CreateMarketCurrencyInput): Promise<{
|
|
127
|
+
id: string;
|
|
128
|
+
createdAt: Date;
|
|
129
|
+
updatedAt: Date;
|
|
130
|
+
active: boolean;
|
|
131
|
+
marketId: string;
|
|
132
|
+
isDefault: boolean;
|
|
133
|
+
sortOrder: number;
|
|
134
|
+
currencyCode: string;
|
|
135
|
+
isSettlement: boolean;
|
|
136
|
+
isReporting: boolean;
|
|
137
|
+
} | null>;
|
|
138
|
+
export declare function updateMarketCurrency(db: PostgresJsDatabase, id: string, data: UpdateMarketCurrencyInput): Promise<{
|
|
139
|
+
id: string;
|
|
140
|
+
marketId: string;
|
|
141
|
+
currencyCode: string;
|
|
142
|
+
isDefault: boolean;
|
|
143
|
+
isSettlement: boolean;
|
|
144
|
+
isReporting: boolean;
|
|
145
|
+
sortOrder: number;
|
|
146
|
+
active: boolean;
|
|
147
|
+
createdAt: Date;
|
|
148
|
+
updatedAt: Date;
|
|
149
|
+
} | null>;
|
|
150
|
+
export declare function deleteMarketCurrency(db: PostgresJsDatabase, id: string): Promise<{
|
|
151
|
+
id: string;
|
|
152
|
+
} | null>;
|
|
153
|
+
export declare function listFxRateSets(db: PostgresJsDatabase, query: FxRateSetListQuery): Promise<{
|
|
154
|
+
data: {
|
|
155
|
+
id: string;
|
|
156
|
+
source: "custom" | "other" | "supplier" | "manual" | "ecb" | "channel";
|
|
157
|
+
baseCurrency: string;
|
|
158
|
+
effectiveAt: Date;
|
|
159
|
+
observedAt: Date | null;
|
|
160
|
+
sourceReference: string | null;
|
|
161
|
+
notes: string | null;
|
|
162
|
+
metadata: Record<string, unknown> | null;
|
|
163
|
+
createdAt: Date;
|
|
164
|
+
}[];
|
|
165
|
+
total: number;
|
|
166
|
+
limit: number;
|
|
167
|
+
offset: number;
|
|
168
|
+
}>;
|
|
169
|
+
export declare function getFxRateSetById(db: PostgresJsDatabase, id: string): Promise<{
|
|
170
|
+
id: string;
|
|
171
|
+
source: "custom" | "other" | "supplier" | "manual" | "ecb" | "channel";
|
|
172
|
+
baseCurrency: string;
|
|
173
|
+
effectiveAt: Date;
|
|
174
|
+
observedAt: Date | null;
|
|
175
|
+
sourceReference: string | null;
|
|
176
|
+
notes: string | null;
|
|
177
|
+
metadata: Record<string, unknown> | null;
|
|
178
|
+
createdAt: Date;
|
|
179
|
+
} | null>;
|
|
180
|
+
export declare function createFxRateSet(db: PostgresJsDatabase, data: CreateFxRateSetInput): Promise<{
|
|
181
|
+
source: "custom" | "other" | "supplier" | "manual" | "ecb" | "channel";
|
|
182
|
+
metadata: Record<string, unknown> | null;
|
|
183
|
+
id: string;
|
|
184
|
+
createdAt: Date;
|
|
185
|
+
notes: string | null;
|
|
186
|
+
baseCurrency: string;
|
|
187
|
+
effectiveAt: Date;
|
|
188
|
+
observedAt: Date | null;
|
|
189
|
+
sourceReference: string | null;
|
|
190
|
+
} | null>;
|
|
191
|
+
export declare function updateFxRateSet(db: PostgresJsDatabase, id: string, data: UpdateFxRateSetInput): Promise<{
|
|
192
|
+
id: string;
|
|
193
|
+
source: "custom" | "other" | "supplier" | "manual" | "ecb" | "channel";
|
|
194
|
+
baseCurrency: string;
|
|
195
|
+
effectiveAt: Date;
|
|
196
|
+
observedAt: Date | null;
|
|
197
|
+
sourceReference: string | null;
|
|
198
|
+
notes: string | null;
|
|
199
|
+
metadata: Record<string, unknown> | null;
|
|
200
|
+
createdAt: Date;
|
|
201
|
+
} | null>;
|
|
202
|
+
export declare function deleteFxRateSet(db: PostgresJsDatabase, id: string): Promise<{
|
|
203
|
+
id: string;
|
|
204
|
+
} | null>;
|
|
205
|
+
export declare function listExchangeRates(db: PostgresJsDatabase, query: ExchangeRateListQuery): Promise<{
|
|
206
|
+
data: {
|
|
207
|
+
id: string;
|
|
208
|
+
fxRateSetId: string;
|
|
209
|
+
baseCurrency: string;
|
|
210
|
+
quoteCurrency: string;
|
|
211
|
+
rateDecimal: string;
|
|
212
|
+
inverseRateDecimal: string | null;
|
|
213
|
+
observedAt: Date | null;
|
|
214
|
+
createdAt: Date;
|
|
215
|
+
}[];
|
|
216
|
+
total: number;
|
|
217
|
+
limit: number;
|
|
218
|
+
offset: number;
|
|
219
|
+
}>;
|
|
220
|
+
export declare function getExchangeRateById(db: PostgresJsDatabase, id: string): Promise<{
|
|
221
|
+
id: string;
|
|
222
|
+
fxRateSetId: string;
|
|
223
|
+
baseCurrency: string;
|
|
224
|
+
quoteCurrency: string;
|
|
225
|
+
rateDecimal: string;
|
|
226
|
+
inverseRateDecimal: string | null;
|
|
227
|
+
observedAt: Date | null;
|
|
228
|
+
createdAt: Date;
|
|
229
|
+
} | null>;
|
|
230
|
+
export declare function createExchangeRate(db: PostgresJsDatabase, fxRateSetId: string, data: CreateExchangeRateInput): Promise<{
|
|
231
|
+
id: string;
|
|
232
|
+
createdAt: Date;
|
|
233
|
+
baseCurrency: string;
|
|
234
|
+
observedAt: Date | null;
|
|
235
|
+
fxRateSetId: string;
|
|
236
|
+
quoteCurrency: string;
|
|
237
|
+
rateDecimal: string;
|
|
238
|
+
inverseRateDecimal: string | null;
|
|
239
|
+
} | null>;
|
|
240
|
+
export declare function updateExchangeRate(db: PostgresJsDatabase, id: string, data: UpdateExchangeRateInput): Promise<{
|
|
241
|
+
id: string;
|
|
242
|
+
fxRateSetId: string;
|
|
243
|
+
baseCurrency: string;
|
|
244
|
+
quoteCurrency: string;
|
|
245
|
+
rateDecimal: string;
|
|
246
|
+
inverseRateDecimal: string | null;
|
|
247
|
+
observedAt: Date | null;
|
|
248
|
+
createdAt: Date;
|
|
249
|
+
} | null>;
|
|
250
|
+
export declare function deleteExchangeRate(db: PostgresJsDatabase, id: string): Promise<{
|
|
251
|
+
id: string;
|
|
252
|
+
} | null>;
|
|
253
|
+
//# sourceMappingURL=service-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-core.d.ts","sourceRoot":"","sources":["../../src/markets/service-core.ts"],"names":[],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