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