{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.digitalcalculator.info/templates/household-template.schema.json",
  "title": "Household template row (dc-household-template/1)",
  "description": "One row of the Money Flow household template CSV (templates/household-template.csv). The CSV header row is exactly: Date,Description,Amount,Direction,Category. Each data row, read with the header names as keys and Amount as a number, validates against this schema. The file is imported on the Money Flow Visualizer page, where it is read in the browser.",
  "x-dc-schema": "dc-household-template/1",
  "x-dc-csv-headers": [
    "Date",
    "Description",
    "Amount",
    "Direction",
    "Category"
  ],
  "type": "object",
  "additionalProperties": false,
  "required": [
    "Date",
    "Description",
    "Amount"
  ],
  "properties": {
    "Date": {
      "description": "The day of the transaction, written YYYY-MM-DD (for example 2026-08-03).",
      "type": "string",
      "format": "date",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "Description": {
      "description": "Who was paid or who paid you, in your own words.",
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "Amount": {
      "description": "The amount in US dollars as a plain number (1400.00). Write it positive and say which way it went in Direction; with Direction blank, a negative number is money out.",
      "type": "number",
      "not": {
        "const": 0
      }
    },
    "Direction": {
      "description": "\"in\" for money received, \"out\" for money spent. Leave blank to let the sign of Amount decide.",
      "enum": [
        "in",
        "out",
        ""
      ]
    },
    "Category": {
      "description": "Optional, for money-out rows. One of the line items listed in the schema (for example Groceries or Rent). Left blank, the page suggests a category from the description.",
      "enum": [
        "Rent",
        "Mortgage",
        "Utilities",
        "Internet & phone",
        "Groceries",
        "Dining out",
        "Gas",
        "Car payment",
        "Insurance",
        "Transit & rideshare",
        "Streaming & subscriptions",
        "Gym & fitness",
        "Shopping",
        "Travel",
        "Pharmacy",
        "Medical",
        "Student loan",
        "Credit card payment",
        "Loan payment",
        "Other",
        ""
      ]
    }
  }
}
