[
  {
    "apiName": "Grant__c",
    "label": "Grant",
    "pluralLabel": "Grants",
    "tableType": "custom_object",
    "category": "smoke",
    "sharingModel": "Private",
    "enableHierarchySharing": false,
    "description": "Parent record for rollup + active formula smoke fixture",
    "fields": [
      {
        "apiName": "Name",
        "label": "Name",
        "type": "string",
        "required": true,
        "isNameField": true
      },
      {
        "apiName": "InitialAmount__c",
        "label": "Initial Amount",
        "type": "currency"
      },
      {
        "apiName": "ApprovedChildSum__c",
        "label": "Approved Child Sum",
        "type": "rollupsummary",
        "required": false,
        "updateable": false,
        "rollupConfig": {
          "calcType": "SUM",
          "summaryObject": "ChildGrant__c",
          "summaryField": "Amount__c",
          "relationshipField": "GrantId__c",
          "filter": "Status__c = 'Approved'"
        }
      },
      {
        "apiName": "Total__c",
        "label": "Total",
        "type": "formula",
        "formulaMode": "active",
        "formula": "InitialAmount__c + BLANKVALUE(ApprovedChildSum__c, 0)",
        "returnType": "currency"
      }
    ]
  }
]
