UNPKG

amberflo-metering-typescript

Version:
77 lines 2.44 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CustomerProductInvoice = exports.InvoiceQuery = exports.LatestInvoiceQuery = exports.AllInvoicesQuery = void 0; const validation_1 = require("./validation"); const constants_1 = require("./constants"); class AllInvoicesQuery { constructor(customerId) { this.customerId = customerId; } validate() { validation_1.validators.nonEmptyStr('customerId', this.customerId, false); this.productId || (this.productId = constants_1.defaultProductId); } } exports.AllInvoicesQuery = AllInvoicesQuery; class LatestInvoiceQuery extends AllInvoicesQuery { constructor() { super(...arguments); this.latest = true; } } exports.LatestInvoiceQuery = LatestInvoiceQuery; class InvoiceQuery extends AllInvoicesQuery { constructor(customerId, productPlanId, year, month, day) { super(customerId); this.productPlanId = productPlanId; this.year = year; this.month = month; this.day = day; } validate() { super.validate(); validation_1.validators.nonEmptyStr('productItemId', this.productPlanId, false); validation_1.validators.positiveInteger('year', this.year, false); validation_1.validators.positiveInteger('month', this.month, false); validation_1.validators.positiveInteger('day', this.day, false); } } exports.InvoiceQuery = InvoiceQuery; // Response Type var PromotionType; (function (PromotionType) { PromotionType["planFreeTier"] = "plan_free_tier"; PromotionType["automaticPromotion"] = "automatic_promotion"; PromotionType["discount"] = "discount"; PromotionType["coupon"] = "coupon"; })(PromotionType || (PromotionType = {})); var InvoiceStatus; (function (InvoiceStatus) { InvoiceStatus["open"] = "open"; InvoiceStatus["gracePeriod"] = "grace_period"; InvoiceStatus["priceLocked"] = "price_locked"; })(InvoiceStatus || (InvoiceStatus = {})); class InvoiceKey { } class BillingPeriod { } class ProductItemInvoiceKey extends InvoiceKey { } class ItemVariantBill { } class ProductItemVariantInvoice { } class ProductItemInvoice { } class AppliedPromotion { } class ProductPlanFee { } class ProductPlanBill { } class CreditUnit { } class CustomerProductInvoice { } exports.CustomerProductInvoice = CustomerProductInvoice; //# sourceMappingURL=customerProductInvoiceApiPayload.js.map