amberflo-metering-typescript
Version:
Amberflo metering client for TypeScript
137 lines (136 loc) • 3.78 kB
TypeScript
import { IValidatable } from './validation';
import { BillingPeriodInterval, PaymentStatus } from './payments';
export declare class AllInvoicesQuery implements IValidatable {
customerId: string;
productId?: string;
fromCache?: boolean;
withPaymentStatus?: boolean;
constructor(customerId: string);
validate(): void;
}
export declare class LatestInvoiceQuery extends AllInvoicesQuery {
latest: boolean;
}
export declare class InvoiceQuery extends AllInvoicesQuery {
productPlanId: string;
year: number;
month: number;
day: number;
constructor(customerId: string, productPlanId: string, year: number, month: number, day: number);
validate(): void;
}
declare enum PromotionType {
planFreeTier = "plan_free_tier",
automaticPromotion = "automatic_promotion",
discount = "discount",
coupon = "coupon"
}
declare enum InvoiceStatus {
open = "open",
gracePeriod = "grace_period",
priceLocked = "price_locked"
}
declare class InvoiceKey {
accountId: string;
customerId: string;
productId: string;
productPlanId: string;
year: number;
month: number;
day: number;
}
declare class BillingPeriod {
interval: BillingPeriodInterval;
intervalsCount: number;
}
declare class ProductItemInvoiceKey extends InvoiceKey {
productItemKey: string;
}
declare class ItemVariantBill {
priceInCredits?: number;
priceInBaseCurrency?: number;
startTimeInSeconds: number;
endTimeInSeconds: number;
meterUnits: number;
price: number;
meteredUnitsPerTier?: {
[key: string]: number;
};
}
declare class ProductItemVariantInvoice {
key: string;
itemDimensions: {
[key: string]: string;
};
hourlyBillInfos?: ItemVariantBill[];
totalBill: ItemVariantBill;
lateArrivalMeters: number;
}
declare class ProductItemInvoice {
key: ProductItemInvoiceKey;
productItemId: string;
productItemName: string;
meterApiName: string;
productPlanName: string;
productItemVariants: ProductItemVariantInvoice[];
totalBill: ItemVariantBill;
}
declare class AppliedPromotion {
promotionId: string;
promotionName: string;
promotionType: PromotionType;
discount: number;
promotionAppliedTimeInSeconds: number;
maxDiscountPossible: number;
canBeUsedForPayAsYouGo: boolean;
discountInCredits: number;
}
declare class ProductPlanFee {
id: string;
name: string;
description: string;
cost: number;
isOneTimeFee: boolean;
}
declare class ProductPlanBill {
startTimeInSeconds: number;
endTimeInSeconds: number;
itemPrice: number;
fixPrice: number;
prepaid: number;
totalDiscount: number;
totalPriceBeforeDiscount: number;
totalPriceBeforePrepaid: number;
totalPrice: number;
}
declare class CreditUnit {
id: string;
shortName: string;
name: string;
description: string;
ratioToCurrency: number;
}
export declare class CustomerProductInvoice {
invoiceUri: string;
invoiceKey: InvoiceKey;
planBillingPeriod: BillingPeriod;
planName: string;
invoiceStartTimeInSeconds: number;
invoiceEndTimeInSeconds: number;
gracePeriodInHours: number;
productItemInvoices: ProductItemInvoice[];
appliedPromotions: AppliedPromotion[];
productPlanFees: ProductPlanFee[];
totalBill: ProductPlanBill;
invoicePriceStatus: InvoiceStatus;
creditUnit?: CreditUnit;
paymentStatus: PaymentStatus;
paymentCreatedInSeconds?: number;
externalSystemStatus?: string;
invoiceBillInCredits?: ProductPlanBill;
availablePrepaidLeft?: number;
availablePrepaidLeftInCredits?: number;
availablePayAsYouGoMoney?: number;
availablePayAsYouGoMoneyInCredits?: number;
}
export {};