{
  "name": "bank_upi_settlement",
  "display_name": "Bank UPI Settlement Statement",
  "source_role": "settlement_bank",
  "file_format": "xlsx",
  "header": {
    "row": "auto",
    "skip_rows_containing": ["Total", "Grand Total"]
  },
  "fields": [
    {
      "canonical": "payer_vpa",
      "aliases": ["Payer_VPA", "Payer VPA", "PAYER VPA", "VPA"],
      "normalize": [{ "step": "trim" }, { "step": "lower" }]
    },
    {
      "canonical": "terminal_id",
      "aliases": ["EXTERNAL_TID", "External TID", "TERMINAL_ID", "TID"],
      "normalize": [{ "step": "trim" }, { "step": "strip_chars", "chars": ["'"] }, { "step": "upper" }]
    },
    {
      "canonical": "amount",
      "aliases": ["Transaction_Amount", "Transaction Amount", "AMOUNT", "Txn Amt"],
      "dtype": "number",
      "normalize": [{ "step": "strip_chars", "chars": [",", "'", "₹"] }, { "step": "to_number" }]
    },
    {
      "canonical": "rrn",
      "aliases": ["RRN_NO", "RRN No", "RRN", "UPI RRN"],
      "normalize": [{ "step": "trim" }, { "step": "strip_chars", "chars": ["'"] }, { "step": "lpad", "length": 12, "fill": "0" }]
    },
    {
      "canonical": "txn_date",
      "aliases": ["Transaction Date", "TXN_DATE", "Date"],
      "required": false,
      "dtype": "date",
      "normalize": [{ "step": "date_parse", "formats": ["%d/%m/%Y", "%d-%m-%Y", "%Y-%m-%d"] }]
    },
    {
      "canonical": "location",
      "aliases": ["unit", "UNIT", "Merchant Name", "Store"],
      "required": false,
      "normalize": [{ "step": "trim" }, { "step": "value_map", "map_ref": "location_map" }]
    }
  ]
}
