{
  "config_version": 1,
  "name": "tidb_load_business_phase1",
  "description": "Default business-baseline load scope. Identity/bootstrap objects User and Group are handled separately.",
  "include_objects": [
    "UserRole",
    "RecordType",
    "Account",
    "Contact",
    "Lead",
    "Opportunity",
    "Campaign",
    "CampaignMember",
    "TaskRelation",
    "Task",
    "Event",
    "Quote",
    "Contract",
    "Order",
    "Product2",
    "Pricebook2",
    "PricebookEntry",
    "org__c",
    "invoice_collection__c",
    "ContentDocument",
    "LeadHistory",
    "LeadShare",
    "AccountShare",
    "OpportunityShare",
    "ContactShare",
    "CampaignShare",
    "QuoteShare",
    "ContractShare",
    "ContentDocumentLink",
    "ContentVersion",
    "Month_End_ARR__c",
    "Global_Arr_Forecast__c"
  ],
  "skip_objects": [
    "User",
    "Group"
  ],
  "person_identity_resolution_requirement": {
    "identity_field": "Salesforce_Identity_Key__c",
    "objects": [
      "Lead",
      "Contact"
    ]
  },
  "object_load_strategies": {
    "Lead": {
      "mode": "chunked_insert",
      "write_mode": "upsert",
      "chunk_size": 250,
      "min_fallback_rows": 10,
      "notes": "provider-identity-resolved in-place upsert; canonical person authority policy preserves HubSpot-primary fields"
    },
    "Contact": {
      "mode": "chunked_insert",
      "write_mode": "upsert",
      "chunk_size": 250,
      "min_fallback_rows": 10,
      "notes": "provider-identity-resolved in-place upsert; canonical person authority policy preserves HubSpot-primary fields"
    },
    "CampaignMember": {
      "mode": "chunked_load_data",
      "chunk_size": 250,
      "min_fallback_rows": 10,
      "notes": "large activity-membership table"
    },
    "org__c": {
      "mode": "chunked_load_data",
      "chunk_size": 250,
      "min_fallback_rows": 10,
      "notes": "large custom business table"
    },
    "Task": {
      "mode": "chunked_load_data",
      "chunk_size": 250,
      "min_fallback_rows": 10
    },
    "Event": {
      "mode": "chunked_load_data",
      "chunk_size": 250,
      "min_fallback_rows": 10
    },
    "TaskRelation": {
      "mode": "chunked_load_data",
      "chunk_size": 250,
      "min_fallback_rows": 10
    },
    "LeadHistory": {
      "mode": "chunked_load_data",
      "chunk_size": 250,
      "min_fallback_rows": 10
    },
    "LeadShare": {
      "mode": "chunked_load_data",
      "chunk_size": 250,
      "min_fallback_rows": 10
    },
    "AccountShare": {
      "mode": "chunked_load_data",
      "chunk_size": 250,
      "min_fallback_rows": 10
    },
    "OpportunityShare": {
      "mode": "chunked_load_data",
      "chunk_size": 250,
      "min_fallback_rows": 10
    },
    "ContactShare": {
      "mode": "chunked_load_data",
      "chunk_size": 250,
      "min_fallback_rows": 10
    },
    "CampaignShare": {
      "mode": "chunked_load_data",
      "chunk_size": 250,
      "min_fallback_rows": 10
    },
    "QuoteShare": {
      "mode": "chunked_load_data",
      "chunk_size": 250,
      "min_fallback_rows": 10
    },
    "ContractShare": {
      "mode": "chunked_load_data",
      "chunk_size": 250,
      "min_fallback_rows": 10
    },
    "Account": {
      "mode": "chunked_load_data",
      "chunk_size": 500,
      "min_fallback_rows": 25
    },
    "Opportunity": {
      "mode": "chunked_load_data",
      "chunk_size": 500,
      "min_fallback_rows": 25
    },
    "invoice_collection__c": {
      "mode": "chunked_load_data",
      "chunk_size": 500,
      "min_fallback_rows": 25
    },
    "ContentVersion": {
      "mode": "chunked_load_data",
      "chunk_size": 100,
      "min_fallback_rows": 5,
      "notes": "content payload rows are smaller in count but more fragile in shape"
    },
    "ContentDocumentLink": {
      "mode": "chunked_insert",
      "chunk_size": 100,
      "min_fallback_rows": 5,
      "notes": "use insert mode because source SystemModstamp may contain invalid raw markers that TiDB datetime LOAD DATA rejects"
    },
    "User": {
      "mode": "chunked_load_data",
      "chunk_size": 200,
      "min_fallback_rows": 10,
      "column_value_rules": {
        "Password": {
          "literal": "Nexuscrm!ImportedPlaceholder20260520"
        }
      }
    },
    "Group": {
      "mode": "chunked_load_data",
      "chunk_size": 200,
      "min_fallback_rows": 10,
      "column_value_rules": {
        "Name": {
          "source_column": "Name",
          "trim": "both",
          "when_blank_template": "{DeveloperName}__{Type}"
        },
        "Label": {
          "source_column": "Name",
          "trim": "both",
          "when_blank_template": "{DeveloperName}"
        }
      }
    },
    "PermissionSet": {
      "mode": "chunked_load_data",
      "chunk_size": 200,
      "min_fallback_rows": 10,
      "column_value_rules": {
        "ProfileId": {
          "source_column": "ProfileId",
          "trim": "both",
          "null_if_blank": true
        }
      }
    },
    "UserRole": {
      "mode": "chunked_load_data",
      "chunk_size": 200,
      "min_fallback_rows": 25
    },
    "RecordType": {
      "mode": "chunked_load_data",
      "chunk_size": 200,
      "min_fallback_rows": 25
    },
    "Campaign": {
      "mode": "chunked_load_data",
      "chunk_size": 500,
      "min_fallback_rows": 25
    },
    "Quote": {
      "mode": "chunked_load_data",
      "chunk_size": 500,
      "min_fallback_rows": 25
    },
    "Contract": {
      "mode": "chunked_load_data",
      "chunk_size": 500,
      "min_fallback_rows": 25
    },
    "Order": {
      "mode": "chunked_load_data",
      "chunk_size": 500,
      "min_fallback_rows": 25
    },
    "Product2": {
      "mode": "chunked_load_data",
      "chunk_size": 500,
      "min_fallback_rows": 25
    },
    "Pricebook2": {
      "mode": "chunked_load_data",
      "chunk_size": 500,
      "min_fallback_rows": 25
    },
    "PricebookEntry": {
      "mode": "chunked_load_data",
      "chunk_size": 500,
      "min_fallback_rows": 25
    }
  },
  "post_load_projections": {
    "salesforce_files_to_system_file": {
      "enabled": true,
      "required_loaded_objects": [
        "ContentDocumentLink",
        "ContentVersion"
      ],
      "storage_provider": "s3",
      "storage_bucket_env": "SF_S3_BUCKET",
      "storage_key_prefix": "salesforce/content/blobs",
      "source_type": "salesforce",
      "parents": [
        {
          "parent_object_api_name": "Order",
          "target_table": "order",
          "attachment_kind": "archived_order"
        },
        {
          "parent_object_api_name": "Contract",
          "target_table": "contract",
          "attachment_kind": "archived_contract"
        }
      ]
    }
  }
}
