import { Complete } from "./Complete" export type Agent = Omit export namespace Agent { export const header = [ "Settlement Id", "Merchant", "Period From", "Period To", "Currency", "Gross Amount", "Interchange", "Scheme Fee", "Intergiro Fee", "Total Fee", "Net Amount", "Reserve Amount", "Payout Amount", "Payout Date", "Reserve Release Date", "Created", "Transactions", ] export const exclude = ["Processor", "Fee"] export function from(complete: Complete): Agent { const result: Agent & Partial = complete for (const excluded of Agent.exclude) delete result[excluded] return result } export type Csv = { header: typeof header data: Agent[] } export namespace Csv { export function from(data: Agent[]): Csv { return { header, data } } } }