import { Complete } from "./Complete" export type Master = Omit export namespace Master { 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", "Settlement Service", "Gross Amount", "Interchange", "Scheme Fee", "Intergiro Fee", "Total Fee", "Net Amount", "Fx Rate", "Fxd Net Amount", "Payout Currency", "Transfer Date", "Arn", "Processor", ] export const exclude = ["Fee"] export function from(complete: Complete): Master { const result: Master & Partial = complete for (const excluded of Master.exclude) delete result[excluded] return complete } export type Csv = { header: typeof header data: Master[] } export namespace Csv { export function from(data: Master[]): Csv { return { header, data } } } }