{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://shapes.penny.coop/spending-submission/1.0.0/schema.json",
  "title": "Spending submission",
  "description": "A household spending submission with reporting dates, currency, total and breakdown.",
  "type": "object",
  "properties": {
    "title": {
      "title": "Reporting period",
      "type": "string",
      "x-penny": {
        "field": "text"
      }
    },
    "householdId": {
      "title": "Household",
      "type": "string",
      "description": "A project-local record reference, normally typeName/recordId. The referenced record is not embedded.",
      "x-penny": {
        "field": "reference",
        "to": [
          "household"
        ]
      }
    },
    "periodStart": {
      "title": "Period start",
      "type": "string",
      "format": "date",
      "x-penny": {
        "field": "date",
        "input": "date"
      }
    },
    "periodEnd": {
      "title": "Period end",
      "type": "string",
      "format": "date",
      "x-penny": {
        "field": "date",
        "input": "date"
      }
    },
    "currency": {
      "title": "Currency",
      "type": "string",
      "enum": [
        "GBP",
        "EUR",
        "USD"
      ],
      "x-penny": {
        "field": "text",
        "input": "select",
        "options": [
          "GBP",
          "EUR",
          "USD"
        ]
      }
    },
    "amount": {
      "title": "Total spending",
      "type": "number",
      "x-penny": {
        "field": "number"
      }
    },
    "breakdown": {
      "title": "Spending breakdown",
      "type": "string",
      "x-penny": {
        "field": "textarea",
        "input": "textarea"
      }
    }
  },
  "x-penny": {
    "shape": "spending-submission",
    "version": "1.0.0",
    "source": "app/src/lib/design/project-model.js",
    "sourceName": "spendingSubmission",
    "kind": "record",
    "plural": "Spending submissions",
    "icon": "ListChecks",
    "defaultVisibility": "private",
    "publishable": false,
    "fieldOrder": [
      "title",
      "householdId",
      "periodStart",
      "periodEnd",
      "currency",
      "amount",
      "breakdown"
    ],
    "sensitive": true
  }
}
