UNPKG

@aptly-as/types

Version:
33 lines (32 loc) 1.26 kB
import { AptlyCurrency, AptlyQuantityUnitCode } from '../enums/index.js'; import { AptlyAddress } from './address.js'; import { AptlyAllowanceChargeSchema, AptlyLegalMonetaryTotal, AptlyPrice } from './algorithm.js'; import { AptlyCustomerSchema } from './customer.js'; import { AptlyItemSchema } from './item.js'; import { AptlyOrganizationSchema } from './organization.js'; export type AptlyPlanPayment = AptlyPlanPaymentSchema<string, string>; export interface AptlyPlanPaymentSchema<ID, DATE> { _id: ID; organization: ID | AptlyOrganizationSchema<ID, DATE>; offers: ID[]; users: ID[]; from: DATE; to: DATE; total: AptlyLegalMonetaryTotal; allowanceCharges: AptlyAllowanceChargeSchema<ID, boolean>[]; customer: AptlyCustomerSchema<ID, DATE>; billing: AptlyAddress; lines: AptlyPlanPaymentLineSchema<ID, DATE>[]; createdAt: DATE; } export type AptlyPlanPaymentItem = AptlyPlanPaymentLineSchema<string, string>; export interface AptlyPlanPaymentLineSchema<ID, DATE> { _id: ID; item: AptlyItemSchema<ID, DATE>; invoicedQuantity: number; quantityUnitCode: AptlyQuantityUnitCode; price: AptlyPrice; extensionAmount: number; extensionVatAmount: number; currency: AptlyCurrency; }