@accounter/server
Version:
Accounter GraphQL server
17 lines (16 loc) • 1.04 kB
TypeScript
import type { BillingCycle, Product, SubscriptionPlan } from '../../../__generated__/types.js';
import type { TimelessDateString } from '../../../shared/types/index.js';
import type { IGetContractsByIdsResult } from '../types.js';
export declare function normalizeSubscriptionPlan(raw?: string | null): SubscriptionPlan | null;
export declare function getSubscriptionPlanName(plan: SubscriptionPlan): string;
export declare function normalizeProduct(raw?: string | null): Product | null;
export declare function getProductName(product: Product): string;
export declare function normalizeBillingCycle(raw: string): BillingCycle;
/**
* Builds the document description for a contract-generated document.
*
* - Monthly contracts keep the billed month description (e.g. "… - May 2026").
* - Annual contracts use the contract's start & end dates (e.g.
* "… January 15th, 2025 → January 14th, 2026").
*/
export declare function buildContractDocumentDescription(contract: IGetContractsByIdsResult, issueMonth: TimelessDateString): string;