[
  {
    "apiName": "Contract",
    "keyPrefix": "800",
    "label": "Contract",
    "tableType": "standard_object",
    "category": "crm",
    "sharingModel": "ControlledByParent",
    "enableHierarchySharing": true,
    "description": "Standard Salesforce Contract object \u2014 legal agreements linked to Accounts",
    "fields": [
      {
        "apiName": "Name",
        "label": "Contract Name",
        "type": "string",
        "isNameField": true,
        "required": true,
        "isCompound": true,
        "composedFrom": [
          "ContractNumber"
        ]
      },
      {
        "apiName": "AccountId",
        "label": "Account Name",
        "type": "reference",
        "required": true,
        "referenceTo": [
          "Account"
        ],
        "relationshipName": "Account",
        "childRelationshipName": "Contracts"
      },
      {
        "apiName": "Status",
        "label": "Status",
        "type": "picklist",
        "required": true,
        "default": "Draft",
        "options": [
          {
            "label": "Draft",
            "value": "Draft",
            "isDefault": true
          },
          {
            "label": "In Review",
            "value": "In Review"
          },
          {
            "label": "Approved",
            "value": "Approved"
          },
          {
            "label": "Effective",
            "value": "Effective"
          },
          {
            "label": "Expired",
            "value": "Expired"
          },
          {
            "label": "Cancelled",
            "value": "Cancelled"
          }
        ]
      },
      {
        "apiName": "StartDate",
        "label": "Contract Start Date",
        "type": "date",
        "required": true
      },
      {
        "apiName": "ContractTerm",
        "label": "Contract Term (months)",
        "type": "double",
        "required": true
      },
      {
        "apiName": "ContractNumber",
        "label": "Contract Number",
        "type": "autonumber"
      },
      {
        "apiName": "EndDate",
        "label": "Contract End Date",
        "type": "formula",
        "formula": "IF(AND(NOT(ISBLANK(StartDate)), NOT(ISBLANK(ContractTerm))), ADDMONTHS(StartDate, ROUND(ContractTerm, 0)) - 1, null)",
        "returnType": "date",
        "formulaMode": "active",
        "createable": false,
        "updateable": false
      },
      {
        "apiName": "Description",
        "label": "Description",
        "type": "textarea"
      },
      {
        "apiName": "BillingStreet",
        "label": "Billing Street",
        "type": "textarea"
      },
      {
        "apiName": "BillingCity",
        "label": "Billing City",
        "type": "string"
      },
      {
        "apiName": "BillingState",
        "label": "Billing State",
        "type": "string"
      },
      {
        "apiName": "BillingPostalCode",
        "label": "Billing Zip/Postal Code",
        "type": "string"
      },
      {
        "apiName": "BillingCountry",
        "label": "Billing Country",
        "type": "string"
      },
      {
        "apiName": "ShippingStreet",
        "label": "Shipping Street",
        "type": "textarea"
      },
      {
        "apiName": "ShippingCity",
        "label": "Shipping City",
        "type": "string"
      },
      {
        "apiName": "ShippingState",
        "label": "Shipping State",
        "type": "string"
      },
      {
        "apiName": "ShippingPostalCode",
        "label": "Shipping Zip/Postal Code",
        "type": "string"
      },
      {
        "apiName": "ShippingCountry",
        "label": "Shipping Country",
        "type": "string"
      },
      {
        "apiName": "CompanySignedId",
        "label": "Company Signed By",
        "type": "reference",
        "referenceTo": [
          "User"
        ],
        "relationshipName": "CompanySigned",
        "childRelationshipName": "ContractsSigned"
      },
      {
        "apiName": "CompanySignedDate",
        "label": "Company Signed Date",
        "type": "date"
      },
      {
        "apiName": "CustomerSignedId",
        "label": "Customer Signed By",
        "type": "reference",
        "referenceTo": [
          "Contact"
        ],
        "relationshipName": "CustomerSigned",
        "childRelationshipName": "ContractsSigned"
      },
      {
        "apiName": "CustomerSignedDate",
        "label": "Customer Signed Date",
        "type": "date"
      },
      {
        "apiName": "CustomerSignedTitle",
        "label": "Customer Signed Title",
        "type": "string"
      },
      {
        "apiName": "SpecialTerms",
        "label": "Special Terms",
        "type": "textarea"
      },
      {
        "apiName": "Pricebook2Id",
        "label": "Price Book",
        "type": "reference",
        "referenceTo": [
          "Pricebook2"
        ],
        "relationshipName": "Pricebook2",
        "childRelationshipName": "Contracts"
      },
      {
        "apiName": "RecordTypeId",
        "label": "Record Type",
        "type": "reference",
        "referenceTo": [
          "RecordType"
        ],
        "relationshipName": "RecordType"
      },
      {
        "apiName": "Account_Country_Code__c",
        "type": "formula",
        "label": "*Account Country Code",
        "formula": "Text(Account.BillingCountryCode)",
        "returnType": "string",
        "formulaMode": "active",
        "createable": false,
        "updateable": false
      },
      {
        "apiName": "ActivatedById",
        "type": "reference",
        "label": "Activated By ID",
        "referenceTo": [
          "User"
        ],
        "relationshipName": "ActivatedBy"
      },
      {
        "apiName": "Applicable_Law__c",
        "type": "picklist",
        "label": "Applicable Law",
        "options": [
          {
            "value": "Singapore",
            "label": "Singapore"
          },
          {
            "value": "Japan",
            "label": "Japan"
          },
          {
            "value": "the United States",
            "label": "the United States"
          },
          {
            "value": "China",
            "label": "China"
          }
        ]
      },
      {
        "apiName": "Approve_Status__c",
        "type": "picklist",
        "label": "Approval Status",
        "default": "Pending",
        "options": [
          {
            "value": "Pending",
            "label": "Pending"
          },
          {
            "value": "In Process",
            "label": "In Process"
          },
          {
            "value": "Approved",
            "label": "Approved"
          },
          {
            "value": "Rejected",
            "label": "Rejected"
          }
        ]
      },
      {
        "apiName": "Archived_Contract__c",
        "type": "formula",
        "label": "Archived Contract",
        "formula": "if(   ISBLANK(StandardUploadUrl__c),\"\" ,HYPERLINK(StandardUploadUrl__c,  Name ))",
        "returnType": "string",
        "formulaMode": "active",
        "createable": false,
        "updateable": false
      },
      {
        "apiName": "Archived__c",
        "type": "boolean",
        "label": "Archived",
        "default": "0"
      },
      {
        "apiName": "AutoNumberText__c",
        "type": "string",
        "label": "AutoNumberText"
      },
      {
        "apiName": "AutoNumber__c",
        "type": "double",
        "label": "AutoNumber"
      },
      {
        "apiName": "Contract_Number__c",
        "type": "string",
        "label": "Contract Number",
        "unique": true
      },
      {
        "apiName": "Effective_Date__c",
        "type": "date",
        "label": "Effective Date(\u5f85\u5220\u9664\uff09",
        "default": "today()"
      },
      {
        "apiName": "Email__c",
        "type": "email",
        "label": "Email"
      },
      {
        "apiName": "IPAddress__c",
        "type": "string",
        "label": "IP Address"
      },
      {
        "apiName": "Master_Contract__c",
        "type": "reference",
        "label": "Master Contract",
        "referenceTo": [
          "Contract"
        ],
        "relationshipName": "Amendment"
      },
      {
        "apiName": "Non_standard_Uploader__c",
        "type": "reference",
        "label": "Non-Std. Contr. Uploader",
        "referenceTo": [
          "User"
        ],
        "relationshipName": "Non_standard_uploader"
      },
      {
        "apiName": "Non_standard_type__c",
        "type": "picklist",
        "label": "Non-Std. Contr. Type",
        "options": [
          {
            "value": "PingCAP Amendment",
            "label": "PingCAP Amendment"
          },
          {
            "value": "Customer Template",
            "label": "Customer Template"
          }
        ]
      },
      {
        "apiName": "NonstandardUploadUrl__c",
        "type": "url",
        "label": "Non-Standard Contract"
      },
      {
        "apiName": "Opportunity__c",
        "type": "reference",
        "label": "Opportunity",
        "referenceTo": [
          "Opportunity"
        ],
        "relationshipName": "Contracts"
      },
      {
        "apiName": "Owned_DM__c",
        "type": "reference",
        "label": "DM Owner",
        "referenceTo": [
          "User"
        ],
        "relationshipName": "Contract_DM"
      },
      {
        "apiName": "PingCAP_Contracting_Entity__c",
        "type": "picklist",
        "label": "PingCAP Contracting Entity",
        "options": [
          {
            "value": "PingCAP Kabushiki-Kaisha",
            "label": "PingCAP Kabushiki-Kaisha"
          },
          {
            "value": "PingCAP Pte. Ltd.",
            "label": "PingCAP Pte. Ltd."
          },
          {
            "value": "PingCAP (US), Inc.",
            "label": "PingCAP (US), Inc."
          },
          {
            "value": "\u5317\u4eac\u5e73\u51ef\u661f\u8fb0\u79d1\u6280\u53d1\u5c55\u6709\u9650\u516c\u53f8",
            "label": "\u5317\u4eac\u5e73\u51ef\u661f\u8fb0\u79d1\u6280\u53d1\u5c55\u6709\u9650\u516c\u53f8"
          }
        ]
      },
      {
        "apiName": "Region__c",
        "type": "formula",
        "label": "Region",
        "formula": "TEXT (Account.Region__c)",
        "returnType": "string",
        "formulaMode": "active",
        "createable": false,
        "updateable": false
      },
      {
        "apiName": "Schedule_Type__c",
        "type": "picklist",
        "label": "Schedule Type",
        "options": [
          {
            "value": "Schedule A-TiDB Enterprise Subscription",
            "label": "Schedule A-TiDB Enterprise Subscription"
          },
          {
            "value": "Schedule B-TiDB Professional Services",
            "label": "Schedule B-TiDB Professional Services"
          },
          {
            "value": "Schedule A+Schedule B",
            "label": "Schedule A+Schedule B"
          },
          {
            "value": "Schedule C - Consulting Services",
            "label": "Schedule C - Consulting Services"
          },
          {
            "value": "Schedule D - Training & Exam Services",
            "label": "Schedule D - Training & Exam Services"
          }
        ]
      },
      {
        "apiName": "StandardUploadUrl__c",
        "type": "url",
        "label": "Archived Contract"
      },
      {
        "apiName": "OwnerId",
        "type": "reference",
        "label": "Owner ID",
        "required": true,
        "referenceTo": [
          "User"
        ],
        "relationshipName": "Owner"
      }
    ],
    "managedRelationships": [
      {
        "fieldApiName": "AccountId",
        "parentObject": "Account",
        "isSharingParent": true
      }
    ]
  }
]