@final-commerce/common 2.0.9 → 2.0.11-beta.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../pos-types/index.ts","../../pos-types/active/PaymentStatus.ts","../../pos-types/active/ProcessorType.ts","../../pos-types/active/pos-runtime.ts"],"sourcesContent":["// @final-commerce/common/pos-types\n//\n// Public POS contract types for Final Commerce terminals — consumed by render\n// and command-frame. These mirror the public (wire) subset of data-layer's\n// Mongoose schemas (option D: manually mirrored, no data-layer dependency),\n// public-scrubbed: `_id`→`id`, `__v`/`_class`/`isDeleted` omitted, ObjectId\n// refs stringified, dates as ISO 8601 strings, secrets dropped.\n//\n// Shared primitives (CurrencyCode and the other enums, the order-state-machine\n// engine types) live elsewhere in this package — import them from\n// `@final-commerce/common` directly.\n\n// Type-level helpers (e.g. `Enrich` — builds Active* types from wire bases).\nexport type { Enrich } from './util';\n\n// Public bases for entities (BaseDocument = no companyId; BaseEntity adds it).\nexport type { BaseDocument, BaseEntity } from './base';\n\n// Embedded sub-document shapes.\nexport * from './embedded';\n\n// Entity shapes (wire).\nexport * from './entities';\n\n// Enriched (Render in-memory) `Active*` layer.\nexport * from './active';\n\n// Seam contract — the frozen station-home (HOST) ↔ pos-brain (runtime)\n// interface: selection-context snapshot + ServiceChannel message union.\nexport * from './seam';\n","export enum PaymentStatus {\n FAILED = 'failed',\n SUCCESS = 'success',\n CANCELED = 'canceled',\n IN_PROGRESS = 'inProgress',\n}\n","// Payment processor / tender type for a POS payment. Shared by Render and\n// command-frame; the string values are the wire contract used by orders.\nexport enum ProcessorType {\n FINAL_PAY = 'Terminal',\n TAP_TO_PAY = 'TapToPay',\n MOTO = 'Moto',\n CLOUD = 'Cloud',\n BLUETOOTH = 'Bluetooth',\n CASH = 'Cash',\n CUSTOM_PAY = 'CustomPay',\n VENDARA = 'Vendara',\n /** Extension-controlled payment (e.g. gift card redeem); order uses paymentType `redeem`. */\n REDEEM = 'Redeem',\n /** Extension-controlled integration (e.g. Stripe-like); order uses paymentType `integration`. */\n INTEGRATION = 'Integration',\n}\n","// Render in-memory POS runtime support types (tax engine, tips, cash, active-entity discriminator, environment data, flow) — the PaymentStatus-dependent active types (ActiveSplitPayment/RefundProcessingStatus/ActiveRefundOrder) remain in Render until PaymentStatus moves.\n\nimport type { CartFeeTaxEntry } from './CartFee';\n\ninterface TaxesDetails {\n [id: string]: {\n amount: number;\n percentage: number;\n name: string;\n taxTableName: string;\n taxTableId: string;\n compounding?: boolean;\n priority?: number;\n };\n}\n\nexport interface ProdDiscountBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n}\n\nexport interface ProdFeeBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n tax: number;\n taxTableId?: string;\n taxRateId?: string;\n applyTaxes: boolean;\n}\n\nexport interface ProductTaxDetails {\n tax: number;\n prodDiscount: number;\n /** Line-level item discount in minor units (originalLineTotal − lineDisplayBase); drift-free, matches the value written to orders/refunds. */\n prodDiscountTotal: number;\n cartDiscount: number;\n prodDiscountPercentage: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n fee?: number;\n feeTax?: number;\n feePercentage?: number;\n feeLabel?: string;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n feeTaxTableId?: string;\n cartFeeTaxTableId?: string;\n prodDiscountLabel?: string;\n /** Staging: line total including fee for discount allocation */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n feeDisplay?: number;\n prodDiscounts?: ProdDiscountBreakdown[];\n fees?: ProdFeeBreakdown[];\n /** Staging: (price × qty) − sum(itemDiscounts) + sum(itemFees) */\n lineNetWithFees?: number;\n}\n\nexport interface CustomSaleDetails {\n tax: number;\n cartDiscount: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n cartFeeTaxTableId?: string;\n applyTaxes?: boolean;\n /** Staging: for discount allocation and order total */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n}\n\nexport interface CartFeesDetails {\n name: string;\n amount: number;\n percentage: number;\n feeTax: number;\n taxTableId: string;\n taxName: string;\n /** Per-rate breakdown (gst, hst, etc.) so order/refund summary can show correct amounts per rate. */\n taxes?: CartFeeTaxEntry[];\n}\n\nexport interface CalculatedTaxDetails {\n tax: number;\n total: number;\n subtotal: number;\n orderSubtotal: number;\n totalDiscount: number;\n /** Staging: cart discount amount and subtotal after discount */\n discountAmount?: number;\n subtotalAfterDiscount?: number;\n products: { [id: string]: ProductTaxDetails };\n customSales: { [id: string]: CustomSaleDetails };\n totalTaxes: TaxesDetails;\n cartFees: CartFeesDetails[];\n}\n\nexport interface TipData {\n value: number;\n label?: string;\n isPercent: boolean;\n}\n\nexport interface TipsDetails {\n total: number;\n tips: TipData[];\n currency?: string;\n noTipLabel?: string;\n customTipLabel?: string;\n selectedTip?: TipData;\n cashChange?: number;\n enabled?: boolean;\n}\n\nexport type CashRoundingIncrement = '' | '0.05' | '0.10' | '0.25' | '0.50' | '1.00';\n\nexport interface CashPaymentSettings {\n cashRounding: CashRoundingIncrement;\n}\n\nexport enum ActiveEntityType {\n TAX = 'tax',\n CART = 'cart',\n USER = 'user',\n ORDER = 'order',\n PRODUCT = 'product',\n FULL_PRODUCT = 'fullProduct',\n CUSTOMER = 'customer',\n OUTLET = 'outlet',\n CHANGES = 'changes',\n SPLIT_PAYMENT = 'splitPayment',\n CALCULATED_TAX = 'calculatedTaxDetails',\n TIPS_DETAILS = 'tipsDetails',\n CASH_PAYMENT_SETTINGS = 'cashPaymentSettings',\n REFUND_DETAILS = 'refundDetails',\n COMPANY = 'company',\n IS_AUTHENTICATED = 'isAuthenticated',\n TIMER = 'timer',\n UPDATED_ORDER_ACTIONS = 'updatedOrderActions', //FOR ORDER UPDATE VIA ACTION\n BUILD = 'activeBuild',\n BUILD_UPDATE_INFO = 'buildUpdateInfo',\n GLOBAL_BLOCKS = 'globalBlocks',\n ACTIVE_STATION = 'activeStation',\n SMART_GRID = 'smartGrid',\n CUSTOM_SALE = 'customSale',\n ACTIVE_FLOW = 'activeFlow',\n ACTIVE_FLOW_VERSION_URL = 'activeFlowVersionUrl',\n}\n\nexport enum EnvironmentDataKeys {\n NETWORK_INFO = 'Network Info',\n DISPLAY = 'Display',\n APP_INFO = 'App Info',\n LOCATION = 'Location',\n DEVICE_INFO = 'Device Info',\n SYSTEM_HEALTH = 'System Health',\n DEVELOPER = 'Developer',\n PERIPHERAL_DEVICES = 'Peripheral Devices',\n}\n\nexport enum EnvironmentDataSubKeys {\n DEVICE_STATUS = 'Device Status',\n LAST_ONLINE_TIME = 'Last Online Time',\n NETWORK_TYPE = 'Network Type',\n SIGNAL_STRENGTH = 'Signal Strength',\n NETWORK_NAME = 'Network name',\n IP_ADDRESS = 'IP Address',\n\n SCREEN_RESOLUTION = 'Screen Resolution',\n PIXEL_RATIO = 'Pixel Ratio',\n ORIENTATION = 'Orientation',\n\n APP_VERSION = 'App Version',\n BUILD_NUMBER = 'Build Number',\n BUNDLE_ID = 'Bundle ID',\n INSTALLED = 'Installed',\n LAST_UPDATED = 'Last Updated',\n\n LOCATION_ACCESS = 'Location Access',\n CURRENT_LOCATION = 'Current Location',\n\n MODEL = 'Model',\n SYSTEM_VERSION = 'System Version',\n FIRMWARE_VERSION = 'Firmware Version',\n SERIAL_NUMBER = 'Serial Number',\n IMEI_NUMBER = 'IMEI Number',\n MAC_ADDRESS = 'MAC Address',\n ACTIVATION_TIME = 'Activation Time',\n TIME_ZONE = 'Time Zone',\n DEVICE_LANGUAGE = 'Device Language',\n\n TOTAL_RAM = 'Total RAM',\n BATTERY_LEVEL = 'Battery Level',\n BATTERY_STATUS = 'Battery Status',\n LOW_POWER_MODE = 'Low Power Mode',\n AVERAGE_CPU_USAGE = 'Average CPU Usage',\n CPU_SPEED = 'CPU Speed',\n AVAILABLE_STORAGE = 'Available Storage',\n TOTAL_STORAGE = 'Total Storage',\n UPTIME = 'Uptime',\n\n FLUTTER_VERSION = 'Flutter Version',\n DART_VERSION = 'Dart Version',\n ENVIRONMENT = 'Environment',\n\n CONNECTED_PRINTER = 'Connected Printer',\n}\n\nexport interface ActiveTimer {\n initialTimer: string;\n currentTimer: string;\n}\n\nexport interface ActiveUpdatedOrder {\n customerNote?: string;\n status?: string;\n}\n\nexport interface TaxTableActive {\n name: string;\n country: string;\n postcode: string;\n rate: number;\n priority: number;\n compounding: boolean;\n id: string;\n taxTableName: string;\n taxTableId: string;\n}\n\nexport interface ActiveTaxDetails {\n taxIncl?: boolean;\n tables: { [name: string]: TaxTableActive[] };\n}\n\nexport interface ActiveEntityChanges {\n productInCart: string[] | null; //array of ids of product in cart\n numberOfProductsInCart: number;\n cartValue: number;\n user: string | null;\n customer: string | null;\n order: string | null;\n role: string | null;\n product: string | null;\n}\n\nexport interface Flow {\n _id: string;\n companyId: string;\n title: string;\n description: string;\n template: string;\n createdBy: string;\n flowData: Record<string, any>;\n isDeleted: boolean;\n createdAt: string;\n updatedAt: string;\n previewImage: string;\n currentVersion: string;\n webAppId: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAK,gBAAL,kBAAKA,mBAAL;AACL,EAAAA,eAAA,YAAS;AACT,EAAAA,eAAA,aAAU;AACV,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,iBAAc;AAJJ,SAAAA;AAAA,GAAA;;;ACEL,IAAK,gBAAL,kBAAKC,mBAAL;AACL,EAAAA,eAAA,eAAY;AACZ,EAAAA,eAAA,gBAAa;AACb,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,WAAQ;AACR,EAAAA,eAAA,eAAY;A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AAA,wBAAA,mBAAgB;AAChB,EAAAA,wBAAA,sBAAmB;AACnB,EAAAA,wBAAA,kBAAe;AACf,EAAAA,wBAAA,qBAAkB;AAClB,EAAAA,wBAAA,kBAAe;AACf,EAAAA,wBAAA,gBAAa;AAEb,EAAAA,wBAAA,uBAAoB;AACpB,EAAAA,wBAAA,iBAAc;AACd,EAAAA,wBAAA,iBAAc;AAEd,EAAAA,wBAAA,iBAAc;AACd,EAAAA,wBAAA,kBAAe;AACf,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,kBAAe;AAEf,EAAAA,wBAAA,qBAAkB;AAClB,EAAAA,wBAAA,sBAAmB;AAEnB,EAAAA,wBAAA,WAAQ;AACR,EAAAA,wBAAA,oBAAiB;AACjB,EAAAA,wBAAA,sBAAmB;AACnB,EAAAA,wBAAA,mBAAgB;AAChB,EAAAA,wBAAA,iBAAc;AACd,EAAAA,wBAAA,iBAAc;AACd,EAAAA,wBAAA,qBAAkB;AAClB,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,qBAAkB;AAElB,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,mBAAgB;AAChB,EAAAA,wBAAA,oBAAiB;AACjB,EAAAA,wBAAA,oBAAiB;AACjB,EAAAA,wBAAA,uBAAoB;AACpB,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,uBAAoB;AACpB,EAAAA,wBAAA,mBAAgB;AAChB,EAAAA,wBAAA,YAAS;AAET,EAAAA,wBAAA,qBAAkB;AAClB,EAAAA,wBAAA,kBAAe;AACf,EAAAA,wBAAA,iBAAc;AAEd,EAAAA,wBAAA,uBAAoB;AA7CV,SAAAA;AAAA,GAAA;","names":["PaymentStatus","ProcessorType","ActiveEntityType","EnvironmentDataKeys","EnvironmentDataSubKeys"]}
|
|
1
|
+
{"version":3,"sources":["../../pos-types/index.ts","../../pos-types/active/PaymentStatus.ts","../../pos-types/active/ProcessorType.ts","../../pos-types/active/pos-runtime.ts"],"sourcesContent":["// @final-commerce/common/pos-types\n//\n// Public POS contract types for Final Commerce terminals — consumed by render\n// and command-frame. These mirror the public (wire) subset of data-layer's\n// Mongoose schemas (option D: manually mirrored, no data-layer dependency),\n// public-scrubbed: `_id`→`id`, `__v`/`_class`/`isDeleted` omitted, ObjectId\n// refs stringified, dates as ISO 8601 strings, secrets dropped.\n//\n// Shared primitives (CurrencyCode and the other enums, the order-state-machine\n// engine types) live elsewhere in this package — import them from\n// `@final-commerce/common` directly.\n\n// Type-level helpers (e.g. `Enrich` — builds Active* types from wire bases).\nexport type { Enrich } from './util';\n\n// Public bases for entities (BaseDocument = no companyId; BaseEntity adds it).\nexport type { BaseDocument, BaseEntity } from './base';\n\n// Embedded sub-document shapes.\nexport * from './embedded';\n\n// Entity shapes (wire).\nexport * from './entities';\n\n// Enriched (Render in-memory) `Active*` layer.\nexport * from './active';\n\n// Seam contract — the frozen station-home (HOST) ↔ pos-brain (runtime)\n// interface: selection-context snapshot + ServiceChannel message union.\nexport * from './seam';\n","export enum PaymentStatus {\n FAILED = 'failed',\n SUCCESS = 'success',\n CANCELED = 'canceled',\n IN_PROGRESS = 'inProgress',\n}\n","// Payment processor / tender type for a POS payment. Shared by Render and\n// command-frame; the string values are the wire contract used by orders.\nexport enum ProcessorType {\n FINAL_PAY = 'Terminal',\n TAP_TO_PAY = 'TapToPay',\n MOTO = 'Moto',\n CLOUD = 'Cloud',\n BLUETOOTH = 'Bluetooth',\n CASH = 'Cash',\n CUSTOM_PAY = 'CustomPay',\n VENDARA = 'Vendara',\n /** Extension-controlled payment (e.g. gift card redeem); order uses paymentType `redeem`. */\n REDEEM = 'Redeem',\n /** Extension-controlled integration (e.g. Stripe-like); order uses paymentType `integration`. */\n INTEGRATION = 'Integration',\n}\n","// Render in-memory POS runtime support types (tax engine, tips, cash, active-entity discriminator, environment data, flow) — the PaymentStatus-dependent active types (ActiveSplitPayment/RefundProcessingStatus/ActiveRefundOrder) remain in Render until PaymentStatus moves.\n\nimport type { CartFeeTaxEntry } from './CartFee';\n\ninterface TaxesDetails {\n [id: string]: {\n amount: number;\n percentage: number;\n name: string;\n taxTableName: string;\n taxTableId: string;\n compounding?: boolean;\n priority?: number;\n };\n}\n\nexport interface ProdDiscountBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n}\n\nexport interface ProdFeeBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n tax: number;\n taxTableId?: string;\n taxRateId?: string;\n applyTaxes: boolean;\n}\n\nexport interface ProductTaxDetails {\n tax: number;\n prodDiscount: number;\n /** Line-level item discount in minor units (originalLineTotal − lineDisplayBase); drift-free, matches the value written to orders/refunds. */\n prodDiscountTotal: number;\n cartDiscount: number;\n prodDiscountPercentage: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n fee?: number;\n feeTax?: number;\n feePercentage?: number;\n feeLabel?: string;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n feeTaxTableId?: string;\n cartFeeTaxTableId?: string;\n prodDiscountLabel?: string;\n /** Staging: line total including fee for discount allocation */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n feeDisplay?: number;\n prodDiscounts?: ProdDiscountBreakdown[];\n fees?: ProdFeeBreakdown[];\n /** Staging: (price × qty) − sum(itemDiscounts) + sum(itemFees) */\n lineNetWithFees?: number;\n}\n\nexport interface CustomSaleDetails {\n tax: number;\n cartDiscount: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n cartFeeTaxTableId?: string;\n applyTaxes?: boolean;\n /** Staging: for discount allocation and order total */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n}\n\nexport interface CartFeesDetails {\n name: string;\n amount: number;\n percentage: number;\n feeTax: number;\n taxTableId: string;\n taxName: string;\n /** Per-rate breakdown (gst, hst, etc.) so order/refund summary can show correct amounts per rate. */\n taxes?: CartFeeTaxEntry[];\n}\n\nexport interface CalculatedTaxDetails {\n tax: number;\n total: number;\n subtotal: number;\n orderSubtotal: number;\n totalDiscount: number;\n /** Staging: cart discount amount and subtotal after discount */\n discountAmount?: number;\n subtotalAfterDiscount?: number;\n products: { [id: string]: ProductTaxDetails };\n customSales: { [id: string]: CustomSaleDetails };\n totalTaxes: TaxesDetails;\n cartFees: CartFeesDetails[];\n}\n\nexport interface TipData {\n value: number;\n label?: string;\n isPercent: boolean;\n}\n\nexport interface TipsDetails {\n total: number;\n tips: TipData[];\n currency?: string;\n noTipLabel?: string;\n customTipLabel?: string;\n selectedTip?: TipData;\n cashChange?: number;\n enabled?: boolean;\n}\n\nexport type CashRoundingIncrement = '' | '0.05' | '0.10' | '0.25' | '0.50' | '1.00';\n\nexport interface CashPaymentSettings {\n cashRounding: CashRoundingIncrement;\n}\n\nexport enum ActiveEntityType {\n TAX = 'tax',\n CART = 'cart',\n USER = 'user',\n ORDER = 'order',\n PRODUCT = 'product',\n FULL_PRODUCT = 'fullProduct',\n CUSTOMER = 'customer',\n OUTLET = 'outlet',\n CHANGES = 'changes',\n SPLIT_PAYMENT = 'splitPayment',\n CALCULATED_TAX = 'calculatedTaxDetails',\n TIPS_DETAILS = 'tipsDetails',\n CASH_PAYMENT_SETTINGS = 'cashPaymentSettings',\n REFUND_DETAILS = 'refundDetails',\n COMPANY = 'company',\n IS_AUTHENTICATED = 'isAuthenticated',\n TIMER = 'timer',\n UPDATED_ORDER_ACTIONS = 'updatedOrderActions', //FOR ORDER UPDATE VIA ACTION\n BUILD = 'activeBuild',\n BUILD_UPDATE_INFO = 'buildUpdateInfo',\n GLOBAL_BLOCKS = 'globalBlocks',\n ACTIVE_STATION = 'activeStation',\n SMART_GRID = 'smartGrid',\n CUSTOM_SALE = 'customSale',\n ACTIVE_FLOW = 'activeFlow',\n ACTIVE_FLOW_VERSION_URL = 'activeFlowVersionUrl',\n}\n\nexport enum EnvironmentDataKeys {\n NETWORK_INFO = 'Network Info',\n DISPLAY = 'Display',\n APP_INFO = 'App Info',\n LOCATION = 'Location',\n DEVICE_INFO = 'Device Info',\n SYSTEM_HEALTH = 'System Health',\n DEVELOPER = 'Developer',\n PERIPHERAL_DEVICES = 'Peripheral Devices',\n}\n\nexport enum EnvironmentDataSubKeys {\n DEVICE_STATUS = 'Device Status',\n LAST_ONLINE_TIME = 'Last Online Time',\n NETWORK_TYPE = 'Network Type',\n SIGNAL_STRENGTH = 'Signal Strength',\n NETWORK_NAME = 'Network name',\n IP_ADDRESS = 'IP Address',\n\n SCREEN_RESOLUTION = 'Screen Resolution',\n PIXEL_RATIO = 'Pixel Ratio',\n ORIENTATION = 'Orientation',\n\n APP_VERSION = 'App Version',\n BUILD_NUMBER = 'Build Number',\n BUNDLE_ID = 'Bundle ID',\n INSTALLED = 'Installed',\n LAST_UPDATED = 'Last Updated',\n\n LOCATION_ACCESS = 'Location Access',\n CURRENT_LOCATION = 'Current Location',\n\n MODEL = 'Model',\n SYSTEM_VERSION = 'System Version',\n FIRMWARE_VERSION = 'Firmware Version',\n SERIAL_NUMBER = 'Serial Number',\n IMEI_NUMBER = 'IMEI Number',\n MAC_ADDRESS = 'MAC Address',\n ACTIVATION_TIME = 'Activation Time',\n TIME_ZONE = 'Time Zone',\n DEVICE_LANGUAGE = 'Device Language',\n\n TOTAL_RAM = 'Total RAM',\n BATTERY_LEVEL = 'Battery Level',\n BATTERY_STATUS = 'Battery Status',\n LOW_POWER_MODE = 'Low Power Mode',\n AVERAGE_CPU_USAGE = 'Average CPU Usage',\n CPU_SPEED = 'CPU Speed',\n AVAILABLE_STORAGE = 'Available Storage',\n TOTAL_STORAGE = 'Total Storage',\n UPTIME = 'Uptime',\n\n FLUTTER_VERSION = 'Flutter Version',\n DART_VERSION = 'Dart Version',\n ENVIRONMENT = 'Environment',\n\n CONNECTED_PRINTER = 'Connected Printer',\n}\n\nexport interface ActiveTimer {\n initialTimer: string;\n currentTimer: string;\n}\n\nexport interface ActiveUpdatedOrder {\n customerNote?: string;\n status?: string;\n}\n\nexport interface TaxTableActive {\n name: string;\n country: string;\n postcode: string;\n rate: number;\n priority: number;\n compounding: boolean;\n id: string;\n taxTableName: string;\n taxTableId: string;\n}\n\nexport interface ActiveTaxDetails {\n taxIncl?: boolean;\n tables: { [name: string]: TaxTableActive[] };\n}\n\nexport interface ActiveEntityChanges {\n productInCart: string[] | null; //array of ids of product in cart\n numberOfProductsInCart: number;\n cartValue: number;\n user: string | null;\n customer: string | null;\n order: string | null;\n role: string | null;\n product: string | null;\n}\n\nexport interface Flow {\n _id: string;\n /**\n * Stable ObjectId hub-api keys FlowSettings / PaymentSettings under.\n * Set for AI flows resolved Miami-direct (station-home adapts the service\n * projection onto this shape); absent on regular flows, where `_id` is the\n * settings key. Settings lookups should key by `hubId ?? _id`.\n */\n hubId?: string;\n companyId: string;\n title: string;\n description: string;\n template: string;\n createdBy: string;\n flowData: Record<string, any>;\n isDeleted: boolean;\n createdAt: string;\n updatedAt: string;\n previewImage: string;\n currentVersion: string;\n webAppId: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAK,gBAAL,kBAAKA,mBAAL;AACL,EAAAA,eAAA,YAAS;AACT,EAAAA,eAAA,aAAU;AACV,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,iBAAc;AAJJ,SAAAA;AAAA,GAAA;;;ACEL,IAAK,gBAAL,kBAAKC,mBAAL;AACL,EAAAA,eAAA,eAAY;AACZ,EAAAA,eAAA,gBAAa;AACb,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,WAAQ;AACR,EAAAA,eAAA,eAAY;AACZ,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,gBAAa;AACb,EAAAA,eAAA,a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,kBAAe;AACf,EAAAA,wBAAA,qBAAkB;AAClB,EAAAA,wBAAA,kBAAe;AACf,EAAAA,wBAAA,gBAAa;AAEb,EAAAA,wBAAA,uBAAoB;AACpB,EAAAA,wBAAA,iBAAc;AACd,EAAAA,wBAAA,iBAAc;AAEd,EAAAA,wBAAA,iBAAc;AACd,EAAAA,wBAAA,kBAAe;AACf,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,kBAAe;AAEf,EAAAA,wBAAA,qBAAkB;AAClB,EAAAA,wBAAA,sBAAmB;AAEnB,EAAAA,wBAAA,WAAQ;AACR,EAAAA,wBAAA,oBAAiB;AACjB,EAAAA,wBAAA,sBAAmB;AACnB,EAAAA,wBAAA,mBAAgB;AAChB,EAAAA,wBAAA,iBAAc;AACd,EAAAA,wBAAA,iBAAc;AACd,EAAAA,wBAAA,qBAAkB;AAClB,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,qBAAkB;AAElB,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,mBAAgB;AAChB,EAAAA,wBAAA,oBAAiB;AACjB,EAAAA,wBAAA,oBAAiB;AACjB,EAAAA,wBAAA,uBAAoB;AACpB,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,uBAAoB;AACpB,EAAAA,wBAAA,mBAAgB;AAChB,EAAAA,wBAAA,YAAS;AAET,EAAAA,wBAAA,qBAAkB;AAClB,EAAAA,wBAAA,kBAAe;AACf,EAAAA,wBAAA,iBAAc;AAEd,EAAAA,wBAAA,uBAAoB;AA7CV,SAAAA;AAAA,GAAA;","names":["PaymentStatus","ProcessorType","ActiveEntityType","EnvironmentDataKeys","EnvironmentDataSubKeys"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../pos-types/active/PaymentStatus.ts","../../pos-types/active/ProcessorType.ts","../../pos-types/active/pos-runtime.ts"],"sourcesContent":["export enum PaymentStatus {\n FAILED = 'failed',\n SUCCESS = 'success',\n CANCELED = 'canceled',\n IN_PROGRESS = 'inProgress',\n}\n","// Payment processor / tender type for a POS payment. Shared by Render and\n// command-frame; the string values are the wire contract used by orders.\nexport enum ProcessorType {\n FINAL_PAY = 'Terminal',\n TAP_TO_PAY = 'TapToPay',\n MOTO = 'Moto',\n CLOUD = 'Cloud',\n BLUETOOTH = 'Bluetooth',\n CASH = 'Cash',\n CUSTOM_PAY = 'CustomPay',\n VENDARA = 'Vendara',\n /** Extension-controlled payment (e.g. gift card redeem); order uses paymentType `redeem`. */\n REDEEM = 'Redeem',\n /** Extension-controlled integration (e.g. Stripe-like); order uses paymentType `integration`. */\n INTEGRATION = 'Integration',\n}\n","// Render in-memory POS runtime support types (tax engine, tips, cash, active-entity discriminator, environment data, flow) — the PaymentStatus-dependent active types (ActiveSplitPayment/RefundProcessingStatus/ActiveRefundOrder) remain in Render until PaymentStatus moves.\n\nimport type { CartFeeTaxEntry } from './CartFee';\n\ninterface TaxesDetails {\n [id: string]: {\n amount: number;\n percentage: number;\n name: string;\n taxTableName: string;\n taxTableId: string;\n compounding?: boolean;\n priority?: number;\n };\n}\n\nexport interface ProdDiscountBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n}\n\nexport interface ProdFeeBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n tax: number;\n taxTableId?: string;\n taxRateId?: string;\n applyTaxes: boolean;\n}\n\nexport interface ProductTaxDetails {\n tax: number;\n prodDiscount: number;\n /** Line-level item discount in minor units (originalLineTotal − lineDisplayBase); drift-free, matches the value written to orders/refunds. */\n prodDiscountTotal: number;\n cartDiscount: number;\n prodDiscountPercentage: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n fee?: number;\n feeTax?: number;\n feePercentage?: number;\n feeLabel?: string;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n feeTaxTableId?: string;\n cartFeeTaxTableId?: string;\n prodDiscountLabel?: string;\n /** Staging: line total including fee for discount allocation */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n feeDisplay?: number;\n prodDiscounts?: ProdDiscountBreakdown[];\n fees?: ProdFeeBreakdown[];\n /** Staging: (price × qty) − sum(itemDiscounts) + sum(itemFees) */\n lineNetWithFees?: number;\n}\n\nexport interface CustomSaleDetails {\n tax: number;\n cartDiscount: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n cartFeeTaxTableId?: string;\n applyTaxes?: boolean;\n /** Staging: for discount allocation and order total */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n}\n\nexport interface CartFeesDetails {\n name: string;\n amount: number;\n percentage: number;\n feeTax: number;\n taxTableId: string;\n taxName: string;\n /** Per-rate breakdown (gst, hst, etc.) so order/refund summary can show correct amounts per rate. */\n taxes?: CartFeeTaxEntry[];\n}\n\nexport interface CalculatedTaxDetails {\n tax: number;\n total: number;\n subtotal: number;\n orderSubtotal: number;\n totalDiscount: number;\n /** Staging: cart discount amount and subtotal after discount */\n discountAmount?: number;\n subtotalAfterDiscount?: number;\n products: { [id: string]: ProductTaxDetails };\n customSales: { [id: string]: CustomSaleDetails };\n totalTaxes: TaxesDetails;\n cartFees: CartFeesDetails[];\n}\n\nexport interface TipData {\n value: number;\n label?: string;\n isPercent: boolean;\n}\n\nexport interface TipsDetails {\n total: number;\n tips: TipData[];\n currency?: string;\n noTipLabel?: string;\n customTipLabel?: string;\n selectedTip?: TipData;\n cashChange?: number;\n enabled?: boolean;\n}\n\nexport type CashRoundingIncrement = '' | '0.05' | '0.10' | '0.25' | '0.50' | '1.00';\n\nexport interface CashPaymentSettings {\n cashRounding: CashRoundingIncrement;\n}\n\nexport enum ActiveEntityType {\n TAX = 'tax',\n CART = 'cart',\n USER = 'user',\n ORDER = 'order',\n PRODUCT = 'product',\n FULL_PRODUCT = 'fullProduct',\n CUSTOMER = 'customer',\n OUTLET = 'outlet',\n CHANGES = 'changes',\n SPLIT_PAYMENT = 'splitPayment',\n CALCULATED_TAX = 'calculatedTaxDetails',\n TIPS_DETAILS = 'tipsDetails',\n CASH_PAYMENT_SETTINGS = 'cashPaymentSettings',\n REFUND_DETAILS = 'refundDetails',\n COMPANY = 'company',\n IS_AUTHENTICATED = 'isAuthenticated',\n TIMER = 'timer',\n UPDATED_ORDER_ACTIONS = 'updatedOrderActions', //FOR ORDER UPDATE VIA ACTION\n BUILD = 'activeBuild',\n BUILD_UPDATE_INFO = 'buildUpdateInfo',\n GLOBAL_BLOCKS = 'globalBlocks',\n ACTIVE_STATION = 'activeStation',\n SMART_GRID = 'smartGrid',\n CUSTOM_SALE = 'customSale',\n ACTIVE_FLOW = 'activeFlow',\n ACTIVE_FLOW_VERSION_URL = 'activeFlowVersionUrl',\n}\n\nexport enum EnvironmentDataKeys {\n NETWORK_INFO = 'Network Info',\n DISPLAY = 'Display',\n APP_INFO = 'App Info',\n LOCATION = 'Location',\n DEVICE_INFO = 'Device Info',\n SYSTEM_HEALTH = 'System Health',\n DEVELOPER = 'Developer',\n PERIPHERAL_DEVICES = 'Peripheral Devices',\n}\n\nexport enum EnvironmentDataSubKeys {\n DEVICE_STATUS = 'Device Status',\n LAST_ONLINE_TIME = 'Last Online Time',\n NETWORK_TYPE = 'Network Type',\n SIGNAL_STRENGTH = 'Signal Strength',\n NETWORK_NAME = 'Network name',\n IP_ADDRESS = 'IP Address',\n\n SCREEN_RESOLUTION = 'Screen Resolution',\n PIXEL_RATIO = 'Pixel Ratio',\n ORIENTATION = 'Orientation',\n\n APP_VERSION = 'App Version',\n BUILD_NUMBER = 'Build Number',\n BUNDLE_ID = 'Bundle ID',\n INSTALLED = 'Installed',\n LAST_UPDATED = 'Last Updated',\n\n LOCATION_ACCESS = 'Location Access',\n CURRENT_LOCATION = 'Current Location',\n\n MODEL = 'Model',\n SYSTEM_VERSION = 'System Version',\n FIRMWARE_VERSION = 'Firmware Version',\n SERIAL_NUMBER = 'Serial Number',\n IMEI_NUMBER = 'IMEI Number',\n MAC_ADDRESS = 'MAC Address',\n ACTIVATION_TIME = 'Activation Time',\n TIME_ZONE = 'Time Zone',\n DEVICE_LANGUAGE = 'Device Language',\n\n TOTAL_RAM = 'Total RAM',\n BATTERY_LEVEL = 'Battery Level',\n BATTERY_STATUS = 'Battery Status',\n LOW_POWER_MODE = 'Low Power Mode',\n AVERAGE_CPU_USAGE = 'Average CPU Usage',\n CPU_SPEED = 'CPU Speed',\n AVAILABLE_STORAGE = 'Available Storage',\n TOTAL_STORAGE = 'Total Storage',\n UPTIME = 'Uptime',\n\n FLUTTER_VERSION = 'Flutter Version',\n DART_VERSION = 'Dart Version',\n ENVIRONMENT = 'Environment',\n\n CONNECTED_PRINTER = 'Connected Printer',\n}\n\nexport interface ActiveTimer {\n initialTimer: string;\n currentTimer: string;\n}\n\nexport interface ActiveUpdatedOrder {\n customerNote?: string;\n status?: string;\n}\n\nexport interface TaxTableActive {\n name: string;\n country: string;\n postcode: string;\n rate: number;\n priority: number;\n compounding: boolean;\n id: string;\n taxTableName: string;\n taxTableId: string;\n}\n\nexport interface ActiveTaxDetails {\n taxIncl?: boolean;\n tables: { [name: string]: TaxTableActive[] };\n}\n\nexport interface ActiveEntityChanges {\n productInCart: string[] | null; //array of ids of product in cart\n numberOfProductsInCart: number;\n cartValue: number;\n user: string | null;\n customer: string | null;\n order: string | null;\n role: string | null;\n product: string | null;\n}\n\nexport interface Flow {\n _id: string;\n companyId: string;\n title: string;\n description: string;\n template: string;\n createdBy: string;\n flowData: Record<string, any>;\n isDeleted: boolean;\n createdAt: string;\n updatedAt: string;\n previewImage: string;\n currentVersion: string;\n webAppId: string;\n}\n"],"mappings":";AAAO,IAAK,gBAAL,kBAAKA,mBAAL;AACL,EAAAA,eAAA,YAAS;AACT,EAAAA,eAAA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BAAe;AACf,EAAAA,wBAAA,iBAAc;AAEd,EAAAA,wBAAA,uBAAoB;AA7CV,SAAAA;AAAA,GAAA;","names":["PaymentStatus","ProcessorType","ActiveEntityType","EnvironmentDataKeys","EnvironmentDataSubKeys"]}
|
|
1
|
+
{"version":3,"sources":["../../pos-types/active/PaymentStatus.ts","../../pos-types/active/ProcessorType.ts","../../pos-types/active/pos-runtime.ts"],"sourcesContent":["export enum PaymentStatus {\n FAILED = 'failed',\n SUCCESS = 'success',\n CANCELED = 'canceled',\n IN_PROGRESS = 'inProgress',\n}\n","// Payment processor / tender type for a POS payment. Shared by Render and\n// command-frame; the string values are the wire contract used by orders.\nexport enum ProcessorType {\n FINAL_PAY = 'Terminal',\n TAP_TO_PAY = 'TapToPay',\n MOTO = 'Moto',\n CLOUD = 'Cloud',\n BLUETOOTH = 'Bluetooth',\n CASH = 'Cash',\n CUSTOM_PAY = 'CustomPay',\n VENDARA = 'Vendara',\n /** Extension-controlled payment (e.g. gift card redeem); order uses paymentType `redeem`. */\n REDEEM = 'Redeem',\n /** Extension-controlled integration (e.g. Stripe-like); order uses paymentType `integration`. */\n INTEGRATION = 'Integration',\n}\n","// Render in-memory POS runtime support types (tax engine, tips, cash, active-entity discriminator, environment data, flow) — the PaymentStatus-dependent active types (ActiveSplitPayment/RefundProcessingStatus/ActiveRefundOrder) remain in Render until PaymentStatus moves.\n\nimport type { CartFeeTaxEntry } from './CartFee';\n\ninterface TaxesDetails {\n [id: string]: {\n amount: number;\n percentage: number;\n name: string;\n taxTableName: string;\n taxTableId: string;\n compounding?: boolean;\n priority?: number;\n };\n}\n\nexport interface ProdDiscountBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n}\n\nexport interface ProdFeeBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n tax: number;\n taxTableId?: string;\n taxRateId?: string;\n applyTaxes: boolean;\n}\n\nexport interface ProductTaxDetails {\n tax: number;\n prodDiscount: number;\n /** Line-level item discount in minor units (originalLineTotal − lineDisplayBase); drift-free, matches the value written to orders/refunds. */\n prodDiscountTotal: number;\n cartDiscount: number;\n prodDiscountPercentage: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n fee?: number;\n feeTax?: number;\n feePercentage?: number;\n feeLabel?: string;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n feeTaxTableId?: string;\n cartFeeTaxTableId?: string;\n prodDiscountLabel?: string;\n /** Staging: line total including fee for discount allocation */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n feeDisplay?: number;\n prodDiscounts?: ProdDiscountBreakdown[];\n fees?: ProdFeeBreakdown[];\n /** Staging: (price × qty) − sum(itemDiscounts) + sum(itemFees) */\n lineNetWithFees?: number;\n}\n\nexport interface CustomSaleDetails {\n tax: number;\n cartDiscount: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n cartFeeTaxTableId?: string;\n applyTaxes?: boolean;\n /** Staging: for discount allocation and order total */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n}\n\nexport interface CartFeesDetails {\n name: string;\n amount: number;\n percentage: number;\n feeTax: number;\n taxTableId: string;\n taxName: string;\n /** Per-rate breakdown (gst, hst, etc.) so order/refund summary can show correct amounts per rate. */\n taxes?: CartFeeTaxEntry[];\n}\n\nexport interface CalculatedTaxDetails {\n tax: number;\n total: number;\n subtotal: number;\n orderSubtotal: number;\n totalDiscount: number;\n /** Staging: cart discount amount and subtotal after discount */\n discountAmount?: number;\n subtotalAfterDiscount?: number;\n products: { [id: string]: ProductTaxDetails };\n customSales: { [id: string]: CustomSaleDetails };\n totalTaxes: TaxesDetails;\n cartFees: CartFeesDetails[];\n}\n\nexport interface TipData {\n value: number;\n label?: string;\n isPercent: boolean;\n}\n\nexport interface TipsDetails {\n total: number;\n tips: TipData[];\n currency?: string;\n noTipLabel?: string;\n customTipLabel?: string;\n selectedTip?: TipData;\n cashChange?: number;\n enabled?: boolean;\n}\n\nexport type CashRoundingIncrement = '' | '0.05' | '0.10' | '0.25' | '0.50' | '1.00';\n\nexport interface CashPaymentSettings {\n cashRounding: CashRoundingIncrement;\n}\n\nexport enum ActiveEntityType {\n TAX = 'tax',\n CART = 'cart',\n USER = 'user',\n ORDER = 'order',\n PRODUCT = 'product',\n FULL_PRODUCT = 'fullProduct',\n CUSTOMER = 'customer',\n OUTLET = 'outlet',\n CHANGES = 'changes',\n SPLIT_PAYMENT = 'splitPayment',\n CALCULATED_TAX = 'calculatedTaxDetails',\n TIPS_DETAILS = 'tipsDetails',\n CASH_PAYMENT_SETTINGS = 'cashPaymentSettings',\n REFUND_DETAILS = 'refundDetails',\n COMPANY = 'company',\n IS_AUTHENTICATED = 'isAuthenticated',\n TIMER = 'timer',\n UPDATED_ORDER_ACTIONS = 'updatedOrderActions', //FOR ORDER UPDATE VIA ACTION\n BUILD = 'activeBuild',\n BUILD_UPDATE_INFO = 'buildUpdateInfo',\n GLOBAL_BLOCKS = 'globalBlocks',\n ACTIVE_STATION = 'activeStation',\n SMART_GRID = 'smartGrid',\n CUSTOM_SALE = 'customSale',\n ACTIVE_FLOW = 'activeFlow',\n ACTIVE_FLOW_VERSION_URL = 'activeFlowVersionUrl',\n}\n\nexport enum EnvironmentDataKeys {\n NETWORK_INFO = 'Network Info',\n DISPLAY = 'Display',\n APP_INFO = 'App Info',\n LOCATION = 'Location',\n DEVICE_INFO = 'Device Info',\n SYSTEM_HEALTH = 'System Health',\n DEVELOPER = 'Developer',\n PERIPHERAL_DEVICES = 'Peripheral Devices',\n}\n\nexport enum EnvironmentDataSubKeys {\n DEVICE_STATUS = 'Device Status',\n LAST_ONLINE_TIME = 'Last Online Time',\n NETWORK_TYPE = 'Network Type',\n SIGNAL_STRENGTH = 'Signal Strength',\n NETWORK_NAME = 'Network name',\n IP_ADDRESS = 'IP Address',\n\n SCREEN_RESOLUTION = 'Screen Resolution',\n PIXEL_RATIO = 'Pixel Ratio',\n ORIENTATION = 'Orientation',\n\n APP_VERSION = 'App Version',\n BUILD_NUMBER = 'Build Number',\n BUNDLE_ID = 'Bundle ID',\n INSTALLED = 'Installed',\n LAST_UPDATED = 'Last Updated',\n\n LOCATION_ACCESS = 'Location Access',\n CURRENT_LOCATION = 'Current Location',\n\n MODEL = 'Model',\n SYSTEM_VERSION = 'System Version',\n FIRMWARE_VERSION = 'Firmware Version',\n SERIAL_NUMBER = 'Serial Number',\n IMEI_NUMBER = 'IMEI Number',\n MAC_ADDRESS = 'MAC Address',\n ACTIVATION_TIME = 'Activation Time',\n TIME_ZONE = 'Time Zone',\n DEVICE_LANGUAGE = 'Device Language',\n\n TOTAL_RAM = 'Total RAM',\n BATTERY_LEVEL = 'Battery Level',\n BATTERY_STATUS = 'Battery Status',\n LOW_POWER_MODE = 'Low Power Mode',\n AVERAGE_CPU_USAGE = 'Average CPU Usage',\n CPU_SPEED = 'CPU Speed',\n AVAILABLE_STORAGE = 'Available Storage',\n TOTAL_STORAGE = 'Total Storage',\n UPTIME = 'Uptime',\n\n FLUTTER_VERSION = 'Flutter Version',\n DART_VERSION = 'Dart Version',\n ENVIRONMENT = 'Environment',\n\n CONNECTED_PRINTER = 'Connected Printer',\n}\n\nexport interface ActiveTimer {\n initialTimer: string;\n currentTimer: string;\n}\n\nexport interface ActiveUpdatedOrder {\n customerNote?: string;\n status?: string;\n}\n\nexport interface TaxTableActive {\n name: string;\n country: string;\n postcode: string;\n rate: number;\n priority: number;\n compounding: boolean;\n id: string;\n taxTableName: string;\n taxTableId: string;\n}\n\nexport interface ActiveTaxDetails {\n taxIncl?: boolean;\n tables: { [name: string]: TaxTableActive[] };\n}\n\nexport interface ActiveEntityChanges {\n productInCart: string[] | null; //array of ids of product in cart\n numberOfProductsInCart: number;\n cartValue: number;\n user: string | null;\n customer: string | null;\n order: string | null;\n role: string | null;\n product: string | null;\n}\n\nexport interface Flow {\n _id: string;\n /**\n * Stable ObjectId hub-api keys FlowSettings / PaymentSettings under.\n * Set for AI flows resolved Miami-direct (station-home adapts the service\n * projection onto this shape); absent on regular flows, where `_id` is the\n * settings key. Settings lookups should key by `hubId ?? _id`.\n */\n hubId?: string;\n companyId: string;\n title: string;\n description: string;\n template: string;\n createdBy: string;\n flowData: Record<string, any>;\n isDeleted: boolean;\n createdAt: string;\n updatedAt: string;\n previewImage: string;\n currentVersion: string;\n webAppId: string;\n}\n"],"mappings":";AAAO,IAAK,gBAAL,kBAAKA,mBAAL;AACL,EAAAA,eAAA,YAAS;AACT,EAAAA,eAAA,aAAU;AACV,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,iBAAc;AAJJ,SAAAA;AAAA,GAAA;;;ACEL,IAAK,gBAAL,kBAAKC,mBAAL;AACL,EAAAA,eAAA,eAAY;AACZ,EAAAA,eAAA,gBAAa;AACb,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,WAAQ;AACR,EAAAA,eAAA,eAAY;AACZ,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,gBAAa;AACb,EAAAA,eAAA,aAAU;AAEV,EAAAA,eAAA,YAAS;AAET,EAAAA,eAAA,iBAAc;AAZJ,SAAAA;AAAA,GAAA;;;ACmIL,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,kBAAA,SAAM;AACN,EAAAA,kBAAA,UAAO;AACP,EAAAA,kBAAA,UAAO;AACP,EAAAA,kBAAA,WAAQ;AACR,EAAAA,kBAAA,aAAU;AACV,EAAAA,kBAAA,kBAAe;AACf,EAAAA,kBAAA,cAAW;AACX,EAAAA,kBAAA,YAAS;AACT,EAAAA,kBAAA,aAAU;AACV,EAAAA,kBAAA,mBAAgB;AAChB,EAAAA,kBAAA,oBAAiB;AACjB,EAAAA,kBAAA,kBAAe;AACf,EAAAA,kBAAA,2BAAwB;AACxB,E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,mBAAgB;AAChB,EAAAA,wBAAA,iBAAc;AACd,EAAAA,wBAAA,iBAAc;AACd,EAAAA,wBAAA,qBAAkB;AAClB,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,qBAAkB;AAElB,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,mBAAgB;AAChB,EAAAA,wBAAA,oBAAiB;AACjB,EAAAA,wBAAA,oBAAiB;AACjB,EAAAA,wBAAA,uBAAoB;AACpB,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,uBAAoB;AACpB,EAAAA,wBAAA,mBAAgB;AAChB,EAAAA,wBAAA,YAAS;AAET,EAAAA,wBAAA,qBAAkB;AAClB,EAAAA,wBAAA,kBAAe;AACf,EAAAA,wBAAA,iBAAc;AAEd,EAAAA,wBAAA,uBAAoB;AA7CV,SAAAA;AAAA,GAAA;","names":["PaymentStatus","ProcessorType","ActiveEntityType","EnvironmentDataKeys","EnvironmentDataSubKeys"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@final-commerce/common",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11-beta.1",
|
|
4
4
|
"description": "Shared utilities, types, constants, and engineering governance configs for the Final Commerce platform.",
|
|
5
5
|
"homepage": "https://github.com/Final-Commerce/common#readme",
|
|
6
6
|
"bugs": {
|