@accounter/server
Version:
Accounter GraphQL server
14 lines (13 loc) • 567 B
TypeScript
export interface DocumentBusinessInfo {
businessId: string | null;
isBusinessCreditor: boolean;
}
/**
* Extract business information from a document
* @param creditorId - Document's creditor_id
* @param debtorId - Document's debtor_id
* @param adminBusinessId - Current user's ID
* @returns Business ID and whether business is the creditor
* @throws Error if both or neither IDs match adminBusinessId
*/
export declare function extractDocumentBusiness(creditorId: string | null, debtorId: string | null, adminBusinessId: string): DocumentBusinessInfo;