import { Complete } from "./Complete" export type Agent = Omit export namespace Agent { export const header = [ "Settlement Id", "Merchant", "Operation", "Tx Date", "Clearing Date", "Tx Amount", "Tx Currency", "Gross Currency", "Authorization Id", "Authorization Number", "Card Iin", "Card Type", "Card Scheme", "Scheme Reference", "Issuer Country", "Gross Amount", "Interchange", "Scheme Fee", "Intergiro Fee", "Total Fee", "Net Amount", "Fx Rate", "Fxd Net Amount", "Payout Currency", "Transfer Date", ] export const exclude = ["Settlement Service", "Fee", "Arn", "Processor"] 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 } } } }