diff --git a/clients/pricing-client/package-lock.json b/clients/pricing-client/package-lock.json index c807950..7cea8de 100644 --- a/clients/pricing-client/package-lock.json +++ b/clients/pricing-client/package-lock.json @@ -1,12 +1,12 @@ { "name": "@epilot/pricing-client", - "version": "3.35.13", + "version": "3.35.16", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@epilot/pricing-client", - "version": "3.35.13", + "version": "3.35.16", "license": "MIT", "dependencies": { "@dazn/lambda-powertools-correlation-ids": "^1.28.1", diff --git a/clients/pricing-client/package.json b/clients/pricing-client/package.json index 24bba7f..db9f1ff 100644 --- a/clients/pricing-client/package.json +++ b/clients/pricing-client/package.json @@ -1,6 +1,6 @@ { "name": "@epilot/pricing-client", - "version": "3.35.15", + "version": "3.35.16", "description": "Client for epilot Pricing APIs", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/clients/pricing-client/src/openapi.d.ts b/clients/pricing-client/src/openapi.d.ts index b8691fc..852c16a 100644 --- a/clients/pricing-client/src/openapi.d.ts +++ b/clients/pricing-client/src/openapi.d.ts @@ -2140,69 +2140,12 @@ declare namespace Components { */ cause?: string; } - export interface ExternalCompositePrice { - /** - * Fees structure with static and variable amounts - */ - fees?: { - billing_period: BillingPeriod; - /** - * example: - * 1.00 - */ - amount_total_decimal: string; - /** - * example: - * 1.00 - */ - amount_static_decimal: string; - /** - * example: - * 1.00 - */ - amount_variable_decimal: string; - /** - * Breakdown of the fee values - */ - breakdown: { - /** - * Static breakdown of fees - */ - static?: { - [name: string]: { - /** - * The amount of the fee, as a string with all the decimal places. - * example: - * 1.00 - */ - amount_decimal?: string; - }; - }; - /** - * Variable breakdown of fees - */ - variable?: { - [name: string]: { - /** - * example: - * 1.00 - */ - amount_decimal: string; - /** - * The unit of the fee (e.g. kWh) if applicable. - */ - unit?: string; - }; - }; - }; - }; - /** - * The name of the composite price. - */ - name?: string; - is_composite_price: true; - price_components: ExternalSimplePrice[]; - total_details: /* Details of the total price including shipping and tax amounts. */ ExternalPriceTotalDetails; + /** + * An external product & price information (already computed) from an external catalog. + */ + export interface ExternalCatalogItem { + pricing_details: /* The result from the calculation of a set of price items. */ PricingDetails; + _meta: /* Signature meta data payload */ SignatureMeta; } /** * example: @@ -2294,346 +2237,6 @@ declare namespace Components { [name: string]: any; }; } - export interface ExternalPriceFees { - /** - * Fees structure with static and variable amounts - */ - fees?: { - /** - * The billing period of the fee values (e.g. monthly). - */ - billing_period: BillingPeriod; - /** - * example: - * 1.00 - */ - amount_total_decimal: string; - /** - * example: - * 1.00 - */ - amount_static_decimal: string; - /** - * example: - * 1.00 - */ - amount_variable_decimal: string; - /** - * Breakdown of the fee values - */ - breakdown: { - /** - * Static breakdown of fees - */ - static?: { - [name: string]: { - /** - * The amount of the fee, as a string with all the decimal places. - * example: - * 1.00 - */ - amount_decimal?: string; - }; - }; - /** - * Variable breakdown of fees - */ - variable?: { - [name: string]: { - /** - * example: - * 1.00 - */ - amount_decimal: string; - /** - * The unit of the fee (e.g. kWh) if applicable. - */ - unit?: string; - }; - }; - }; - }; - } - /** - * Details of the total price including shipping and tax amounts. - */ - export interface ExternalPriceTotalDetails { - /** - * A breakdown of the recurrences of amounts. - */ - breakdown: { - recurrences?: { - /** - * Total of all items before discounts or taxes, as a string with all the decimal places. - * example: - * 1.00 - */ - amount_subtotal_decimal: string; - /** - * Total of all items after discounts and taxes, as a string with all the decimal places. - * example: - * 1.19 - */ - amount_total_decimal: string; - /** - * The price type. - * example: - * one_time - */ - type: "one_time" | "recurring"; - /** - * The billing period of the price. - */ - billing_period?: BillingPeriod; - }[]; - }; - } - /** - * An external product & price information (already computed) from an external catalog. - */ - export interface ExternalProduct { - /** - * The ID of the product in the external catalog. - */ - id: string; - /** - * The name of the product. - */ - name: string; - /** - * A description of the product. - */ - description?: string; - /** - * A list of features of the product. - */ - features?: string[]; - /** - * A list of image URLs of the product. RECOMMENDED: Store files in Epilot for advantages such as resizing, versioning, easy access, and maintenance. - * - */ - product_image_urls?: string[]; - /** - * A list of file/attachment URLs of the product RECOMMENDED: Store files in Epilot for advantages such as resizing, versioning, easy access, and maintenance. - * - */ - product_downloads_urls?: string[]; - /** - * Legal footnotes for the product. - */ - legal_footnotes?: string; - /** - * Additional notes for the product. - */ - additional_notes?: string[]; - /** - * Recommendation settings for the product. - * example: - * { - * "is_recommended": true, - * "recommended_label": "Best Value", - * "recommended_color": "#00FF00", - * "recommended_label_color": "#FFFFFF" - * } - */ - recommendation_settings?: { - /** - * Flag to enable or disable the recommendation for this product. - */ - is_recommended?: boolean; - /** - * Label to display when the product is recommended. - */ - recommended_label?: string; - /** - * Color to display when the product is recommended. - */ - recommended_color?: string; - /** - * Color of the recommended label. - */ - recommended_label_color?: string; - }; - price: ExternalSimplePrice | ExternalCompositePrice; - } - export interface ExternalSimplePrice { - /** - * Fees structure with static and variable amounts - */ - fees?: { - billing_period: BillingPeriod; - /** - * example: - * 1.00 - */ - amount_total_decimal: string; - /** - * example: - * 1.00 - */ - amount_static_decimal: string; - /** - * example: - * 1.00 - */ - amount_variable_decimal: string; - /** - * Breakdown of the fee values - */ - breakdown: { - /** - * Static breakdown of fees - */ - static?: { - [name: string]: { - /** - * The amount of the fee, as a string with all the decimal places. - * example: - * 1.00 - */ - amount_decimal?: string; - }; - }; - /** - * Variable breakdown of fees - */ - variable?: { - [name: string]: { - /** - * example: - * 1.00 - */ - amount_decimal: string; - /** - * The unit of the fee (e.g. kWh) if applicable. - */ - unit?: string; - }; - }; - }; - }; - is_composite_price: false; - /** - * A flag to indicate if the price is variable. - * - */ - variable_price?: boolean; - /** - * The name of the price. - */ - name?: string; - /** - * The unit of measurement used for display purposes and possibly for calculations when the price is variable. - * example: - * kWh - */ - unit?: string; - /** - * The currency of the price. ISO 4217 currency code. E.g. EUR. - * example: - * EUR - */ - currency?: string; - /** - * The price type. - */ - type: "one_time" | "recurring"; - billing_period?: BillingPeriod; - /** - * The billing period duration - */ - billing_duration_amount?: number; - /** - * The billing period duration unit - */ - billing_duration_unit?: "weeks" | "months" | "years"; - /** - * The notice period duration - */ - notice_time_amount?: number; - /** - * The notice period duration unit - */ - notice_time_unit?: "weeks" | "months" | "years"; - /** - * The termination period duration - */ - termination_time_amount?: number; - /** - * The termination period duration unit - */ - termination_time_unit?: "weeks" | "months" | "years"; - /** - * The renewal period duration - */ - renewal_duration_amount?: number; - /** - * The renewal period duration unit - */ - renewal_duration_unit?: "weeks" | "months" | "years"; - /** - * The unit gross amount value, as a string with all the decimal places. - * example: - * 1.19 - */ - unit_amount_gross_decimal: string; - /** - * The unit net amount value, as a string with all the decimal places. - * example: - * 1.00 - */ - unit_amount_net_decimal: string; - /** - * Total of all items before discounts or taxes, as a string with all the decimal places. - * example: - * 1.00 - */ - amount_subtotal_decimal: string; - /** - * Total of all items after discounts and taxes, as a string with all the decimal places. - * example: - * 1.19 - */ - amount_total_decimal: string; - tax?: { - /** - * The tax name. - * example: - * VAT - */ - name?: string; - /** - * The tax description. - * example: - * Value Added Tax - */ - description?: string; - /** - * The type of the tax. - * example: - * VAT - */ - type?: "VAT" | "GST" | "Custom"; - /** - * The tax rate applied. - * example: - * 19 - */ - rate: number; - /** - * The region code of the tax. - * example: - * DE - */ - region?: string; - /** - * The region label of the tax. - * example: - * Germany - */ - region_label?: string; - }; - } export interface File { [name: string]: any; _id: string; @@ -4659,7 +4262,7 @@ declare namespace Components { * The number os results returned. */ hits: number; - results: /* An external product & price information (already computed) from an external catalog. */ ExternalProduct[]; + results: /* An external product & price information (already computed) from an external catalog. */ ExternalCatalogItem[]; } /** * A search providers payload @@ -5662,14 +5265,10 @@ export type EntityId = Components.Schemas.EntityId; export type EntityItem = Components.Schemas.EntityItem; export type EntityRelation = Components.Schemas.EntityRelation; export type Error = Components.Schemas.Error; -export type ExternalCompositePrice = Components.Schemas.ExternalCompositePrice; +export type ExternalCatalogItem = Components.Schemas.ExternalCatalogItem; export type ExternalFeeMapping = Components.Schemas.ExternalFeeMapping; export type ExternalFeeMappings = Components.Schemas.ExternalFeeMappings; export type ExternalFeeMetadata = Components.Schemas.ExternalFeeMetadata; -export type ExternalPriceFees = Components.Schemas.ExternalPriceFees; -export type ExternalPriceTotalDetails = Components.Schemas.ExternalPriceTotalDetails; -export type ExternalProduct = Components.Schemas.ExternalProduct; -export type ExternalSimplePrice = Components.Schemas.ExternalSimplePrice; export type File = Components.Schemas.File; export type GasConcessionType = Components.Schemas.GasConcessionType; export type IntegrationCredentialsResult = Components.Schemas.IntegrationCredentialsResult; diff --git a/clients/pricing-client/src/openapi.json b/clients/pricing-client/src/openapi.json index 8184a94..b01eb13 100644 --- a/clients/pricing-client/src/openapi.json +++ b/clients/pricing-client/src/openapi.json @@ -5404,7 +5404,7 @@ "results": { "type": "array", "items": { - "$ref": "#/components/schemas/ExternalProduct" + "$ref": "#/components/schemas/ExternalCatalogItem" } } }, @@ -5413,435 +5413,20 @@ "hits" ] }, - "ExternalProduct": { + "ExternalCatalogItem": { "type": "object", "description": "An external product & price information (already computed) from an external catalog.", "properties": { - "id": { - "type": "string", - "description": "The ID of the product in the external catalog." - }, - "name": { - "type": "string", - "description": "The name of the product." - }, - "description": { - "type": "string", - "description": "A description of the product." - }, - "features": { - "type": "array", - "description": "A list of features of the product.", - "items": { - "type": "string" - } - }, - "product_image_urls": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of image URLs of the product. RECOMMENDED: Store files in Epilot for advantages such as resizing, versioning, easy access, and maintenance.\n" - }, - "product_downloads_urls": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of file/attachment URLs of the product RECOMMENDED: Store files in Epilot for advantages such as resizing, versioning, easy access, and maintenance.\n" - }, - "legal_footnotes": { - "type": "string", - "description": "Legal footnotes for the product." - }, - "additional_notes": { - "type": "array", - "description": "Additional notes for the product.", - "items": { - "type": "string" - } - }, - "recommendation_settings": { - "type": "object", - "description": "Recommendation settings for the product.", - "properties": { - "is_recommended": { - "type": "boolean", - "description": "Flag to enable or disable the recommendation for this product." - }, - "recommended_label": { - "type": "string", - "description": "Label to display when the product is recommended." - }, - "recommended_color": { - "type": "string", - "description": "Color to display when the product is recommended." - }, - "recommended_label_color": { - "type": "string", - "description": "Color of the recommended label." - } - }, - "example": { - "is_recommended": true, - "recommended_label": "Best Value", - "recommended_color": "#00FF00", - "recommended_label_color": "#FFFFFF" - } - }, - "price": { - "oneOf": [ - { - "$ref": "#/components/schemas/ExternalSimplePrice" - }, - { - "$ref": "#/components/schemas/ExternalCompositePrice" - } - ] - } - }, - "required": [ - "price", - "name", - "id" - ] - }, - "ExternalPriceFees": { - "type": "object", - "properties": { - "fees": { - "type": "object", - "description": "Fees structure with static and variable amounts", - "properties": { - "billing_period": { - "$ref": "#/components/schemas/BillingPeriod", - "description": "The billing period of the fee values (e.g. monthly)." - }, - "amount_total_decimal": { - "type": "string", - "example": "1.00" - }, - "amount_static_decimal": { - "type": "string", - "example": "1.00" - }, - "amount_variable_decimal": { - "type": "string", - "example": "1.00" - }, - "breakdown": { - "type": "object", - "description": "Breakdown of the fee values", - "properties": { - "static": { - "type": "object", - "description": "Static breakdown of fees", - "additionalProperties": { - "type": "object", - "properties": { - "amount_decimal": { - "type": "string", - "description": "The amount of the fee, as a string with all the decimal places.", - "example": "1.00" - } - } - }, - "required": [ - "amount_decimal" - ] - }, - "variable": { - "type": "object", - "description": "Variable breakdown of fees", - "additionalProperties": { - "type": "object", - "properties": { - "amount_decimal": { - "type": "string", - "example": "1.00" - }, - "unit": { - "type": "string", - "description": "The unit of the fee (e.g. kWh) if applicable." - } - }, - "required": [ - "amount_decimal" - ] - } - } - } - } - }, - "required": [ - "billing_period", - "amount_total_decimal", - "amount_static_decimal", - "amount_variable_decimal", - "breakdown" - ] - } - } - }, - "ExternalSimplePrice": { - "allOf": [ - { - "$ref": "#/components/schemas/ExternalPriceFees" - }, - { - "type": "object", - "properties": { - "is_composite_price": { - "type": "boolean", - "enum": [ - false - ] - }, - "variable_price": { - "type": "boolean", - "description": "A flag to indicate if the price is variable.\n" - }, - "name": { - "type": "string", - "description": "The name of the price." - }, - "unit": { - "description": "The unit of measurement used for display purposes and possibly for calculations when the price is variable.", - "type": "string", - "example": "kWh" - }, - "currency": { - "type": "string", - "description": "The currency of the price. ISO 4217 currency code. E.g. EUR.", - "default": "EUR", - "example": "EUR" - }, - "type": { - "type": "string", - "description": "The price type.", - "enum": [ - "one_time", - "recurring" - ] - }, - "billing_period": { - "$ref": "#/components/schemas/BillingPeriod", - "description": "The billing period of the price." - }, - "billing_duration_amount": { - "description": "The billing period duration", - "type": "number" - }, - "billing_duration_unit": { - "description": "The billing period duration unit", - "type": "string", - "enum": [ - "weeks", - "months", - "years" - ] - }, - "notice_time_amount": { - "description": "The notice period duration", - "type": "number" - }, - "notice_time_unit": { - "description": "The notice period duration unit", - "type": "string", - "enum": [ - "weeks", - "months", - "years" - ] - }, - "termination_time_amount": { - "description": "The termination period duration", - "type": "number" - }, - "termination_time_unit": { - "description": "The termination period duration unit", - "type": "string", - "enum": [ - "weeks", - "months", - "years" - ] - }, - "renewal_duration_amount": { - "description": "The renewal period duration", - "type": "number" - }, - "renewal_duration_unit": { - "description": "The renewal period duration unit", - "type": "string", - "enum": [ - "weeks", - "months", - "years" - ] - }, - "unit_amount_gross_decimal": { - "type": "string", - "example": "1.19", - "description": "The unit gross amount value, as a string with all the decimal places." - }, - "unit_amount_net_decimal": { - "type": "string", - "description": "The unit net amount value, as a string with all the decimal places.", - "example": "1.00" - }, - "amount_subtotal_decimal": { - "type": "string", - "description": "Total of all items before discounts or taxes, as a string with all the decimal places.", - "example": "1.00" - }, - "amount_total_decimal": { - "type": "string", - "description": "Total of all items after discounts and taxes, as a string with all the decimal places.", - "example": "1.19" - }, - "tax": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The tax name.", - "example": "VAT" - }, - "description": { - "type": "string", - "description": "The tax description.", - "example": "Value Added Tax" - }, - "type": { - "type": "string", - "enum": [ - "VAT", - "GST", - "Custom" - ], - "description": "The type of the tax.", - "example": "VAT" - }, - "rate": { - "type": "number", - "description": "The tax rate applied.", - "example": 19 - }, - "region": { - "type": "string", - "description": "The region code of the tax.", - "example": "DE" - }, - "region_label": { - "type": "string", - "description": "The region label of the tax.", - "example": "Germany" - } - }, - "required": [ - "rate" - ] - } - }, - "required": [ - "is_composite_price", - "type", - "unit_amount_decimal", - "unit_amount_gross_decimal", - "unit_amount_net_decimal", - "amount_subtotal_decimal", - "amount_total_decimal" - ] - } - ] - }, - "ExternalCompositePrice": { - "allOf": [ - { - "$ref": "#/components/schemas/ExternalPriceFees" + "pricing_details": { + "$ref": "#/components/schemas/PricingDetails" }, - { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the composite price." - }, - "is_composite_price": { - "type": "boolean", - "enum": [ - true - ] - }, - "price_components": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ExternalSimplePrice" - } - }, - "total_details": { - "$ref": "#/components/schemas/ExternalPriceTotalDetails" - } - }, - "required": [ - "is_composite_price", - "price_components", - "total_details" - ] - } - ] - }, - "ExternalPriceTotalDetails": { - "type": "object", - "description": "Details of the total price including shipping and tax amounts.", - "properties": { - "breakdown": { - "type": "object", - "description": "A breakdown of the recurrences of amounts.", - "properties": { - "recurrences": { - "type": "array", - "items": { - "type": "object", - "description": "Recurrence details including subtotal, total, and tax amounts.", - "properties": { - "amount_subtotal_decimal": { - "type": "string", - "description": "Total of all items before discounts or taxes, as a string with all the decimal places.", - "example": "1.00" - }, - "amount_total_decimal": { - "type": "string", - "description": "Total of all items after discounts and taxes, as a string with all the decimal places.", - "example": "1.19" - }, - "type": { - "type": "string", - "enum": [ - "one_time", - "recurring" - ], - "description": "The price type.", - "example": "one_time" - }, - "billing_period": { - "$ref": "#/components/schemas/BillingPeriod", - "description": "The billing period of the price." - } - }, - "required": [ - "amount_subtotal_decimal", - "amount_total_decimal", - "type" - ] - } - } - } + "_meta": { + "$ref": "#/components/schemas/SignatureMeta" } }, "required": [ - "breakdown" + "pricing_details", + "_meta" ] } }, @@ -6954,7 +6539,7 @@ "_schema": "tax", "_title": "Tax Without Behaviour", "description": "Without Behaviour", - "rate": 6, + "rate": "6", "_org": "739224", "_created_at": "2022-02-07T14:49:08.831Z", "_updated_at": "2022-02-07T14:49:08.831Z" @@ -7353,108 +6938,92 @@ } }, "external-catalog-sample-1": { - "value": [ - { - "id": "12312414", - "name": "Home Energy Package", - "description": "Composite home energy solution with solar panels and battery", - "features": [ - "4kW solar system", - "10kWh battery storage", - "Smart energy management" - ], - "product_image_urls": [ - "https://example.com/images/home-energy-package.jpg" - ], - "legal_footnotes": "Installation and permitting fees may vary by location.", - "price": { - "name": "Home Energy Package", - "is_composite_price": true, - "price_components": [ - { - "name": "Working Price", - "type": "recurring", - "billing_period": "monthly", - "variable_price": true, - "unit": "kWh", - "amount_subtotal_decimal": "11.244355742297", - "amount_total_decimal": "13.380783333333", - "unit_amount_net_decimal": "11.24", - "unit_amount_gross_decimal": "13.38", - "currency": "EUR", - "tax": { - "name": "tax", - "type": "VAT", - "rate": 19, - "region": "DE" + "value": { + "hits": 1, + "results": [ + { + "pricing_details": { + "items": [ + { + "_id": "price-12312414", + "price_id": "price-12312414", + "is_composite_price": true, + "description": "Home Energy Package Composite", + "item_components": [ + { + "_id": "price-12312414-component-0", + "price_id": "price-12312414-component-0", + "description": "Working Price", + "is_tax_inclusive": true, + "amount_total_decimal": "100", + "amount_total": 10000, + "amount_subtotal_decimal": "100", + "amount_subtotal": 10000, + "unit_amount": 10, + "unit_amount_gross": 10, + "unit_amount_gross_decimal": "0.10", + "unit_amount_net": 10, + "unit_amount_net_decimal": "0.10", + "billing_period": "monthly", + "type": "recurring", + "taxes": [], + "pricing_model": "per_unit", + "quantity": 1, + "_price": { + "_id": "price-12312414-component-0", + "unit_amount_currency": "EUR", + "description": "Working Price", + "is_tax_inclusive": true, + "unit_amount": 10, + "unit_amount_decimal": "0.10", + "unit": "kWh", + "billing_period": "monthly", + "type": "recurring", + "billing_duration_amount": 24, + "billing_duration_unit": "months", + "notice_time_amount": 3, + "notice_time_unit": "months", + "termination_time_amount": 3, + "termination_time_unit": "months", + "renewal_duration_amount": 12, + "renewal_duration_unit": "months", + "active": true, + "is_composite_price": false, + "variable_price": true, + "pricing_model": "per_unit", + "price_display_in_journeys": "show_price" + } + } + ] } - }, - { - "name": "Base Price", - "type": "one_time", - "unit_amount_net_decimal": "99", - "unit_amount_gross_decimal": "99", - "amount_subtotal_decimal": "99", - "amount_total_decimal": "99", - "currency": "EUR" - } - ], - "fees": { - "amount_total_decimal": "410.84", - "amount_variable_decimal": "356.58", - "billing_period": "yearly", - "breakdown": { - "static": { - "basic_fee": { - "amount_decimal": "19.21" - }, - "maintenance_fee": { - "amount_decimal": "35.05" - } - }, - "variable": { - "offshore_liability_fee": { - "amount_decimal": "2.4", - "unit": "kWh" - }, - "interruptible_load": { - "amount_decimal": "0" - }, - "extra_charge": { - "amount_decimal": "22.68" - }, - "chp": { - "amount_decimal": "26.7" - }, - "power_kwh": { - "amount_decimal": "161.4" - }, - "concession": { - "amount_decimal": "143.4" - } + ], + "currency": "EUR", + "amount_subtotal": 10000, + "amount_total": 10000, + "amount_tax": 0, + "total_details": { + "amount_tax": 0, + "breakdown": { + "taxes": [], + "recurrences": [ + { + "type": "recurring", + "billing_period": "monthly", + "amount_subtotal": 10000, + "amount_total": 10000, + "amount_tax": 0 + } + ] } } }, - "total_details": { - "breakdown": { - "recurrences": [ - { - "type": "recurring", - "billing_period": "monthly", - "amount_subtotal_decimal": "419.110616246297", - "amount_total_decimal": "498.741633333333" - }, - { - "type": "one_time", - "amount_subtotal_decimal": "99", - "amount_total_decimal": "99" - } - ] - } + "_meta": { + "signature": "abc123", + "timestamp": "2024-01-15T10:00:00Z" } } - } - ] + ] + } } } }