[
  {
    "apiName": "Order_Product__c",
    "label": "Order Product",
    "pluralLabel": "Order Products",
    "tableType": "custom_object",
    "category": "crm",
    "sharingModel": "ControlledByParent",
    "enableHierarchySharing": false,
    "lifecycleStatus": "retired",
    "supersededBy": "OrderItem",
    "retiredOn": "2026-07-23",
    "description": "Frozen archive: retired after the billing owner confirmed the OrderItem backfill is complete, and the monthly billing cron writes OrderItem as of the 2026-07-04 cycle. Historical rows (5,523 billing rows through 2026-07-04) are deliberately KEPT for audit/reference and must not be deleted — 'retired' does not license deletion, and nothing enforces retention (validation rules do not cover deletes, and DeleteMode has no block setting). New creates/updates are blocked by Legacy_Table_Retired_Guard (inspection-prefix exemption only; direct-SQL writes bypass it too — the retirement watchdog asserts zero post-epoch non-inspection rows). Order header rollups re-source to OrderItem in PR-B3.",
    "fields": [
      {
        "apiName": "Name",
        "label": "Name",
        "type": "string",
        "isNameField": true
      },
      {
        "apiName": "Description__c",
        "label": "Description",
        "type": "textarea"
      },
      {
        "apiName": "Discount__c",
        "label": "Discount",
        "type": "percent"
      },
      {
        "apiName": "List_Price_Subtotal__c",
        "label": "List Price Subtotal",
        "type": "formula",
        "formula": "IF( LEFT( Product_Code__c , 2)=\"ES\" , List_Price__c * Quantity__c * Term_Months__c, List_Price__c * Quantity__c)",
        "returnType": "currency",
        "formulaMode": "active",
        "createable": false,
        "updateable": false
      },
      {
        "apiName": "List_Price__c",
        "label": "Unit List Price",
        "type": "currency"
      },
      {
        "apiName": "Manday__c",
        "label": "Man-day",
        "type": "rollupsummary",
        "rollupConfig": {
          "summaryObject": "Service_Man_day__c",
          "summaryField": "Man_Day__c",
          "relationshipField": "Order_Product__c",
          "calcType": "SUM"
        },
        "createable": false,
        "updateable": false
      },
      {
        "apiName": "Net_fees__c",
        "label": "Net fees",
        "type": "currency"
      },
      {
        "apiName": "Opportunity_Product__c",
        "label": "Opportunity Product",
        "type": "reference",
        "referenceTo": [
          "Opportunity_Product__c"
        ],
        "relationshipName": "Opportunity_Product__r",
        "childRelationshipName": "Order_Products",
        "deleteConstraint": "SetNull"
      },
      {
        "apiName": "Order__c",
        "label": "Order",
        "type": "masterdetail",
        "referenceTo": [
          "Order"
        ],
        "relationshipName": "Order__r",
        "childRelationshipName": "Order_Products"
      },
      {
        "apiName": "Product_Code__c",
        "label": "Product Code",
        "type": "string"
      },
      {
        "apiName": "Product_Family__c",
        "label": "*Product Family",
        "type": "formula",
        "formula": "Text( Product__r.Family )",
        "returnType": "string",
        "formulaMode": "active",
        "createable": false,
        "updateable": false
      },
      {
        "apiName": "Product_Name__c",
        "label": "Product Name",
        "type": "formula",
        "formula": "Product__r.Name",
        "returnType": "string",
        "formulaMode": "active",
        "createable": false,
        "updateable": false
      },
      {
        "apiName": "Product__c",
        "label": "Product",
        "type": "reference",
        "referenceTo": [
          "Product2"
        ],
        "relationshipName": "Product__r",
        "childRelationshipName": "Order_Products",
        "deleteConstraint": "SetNull"
      },
      {
        "apiName": "Quantity__c",
        "label": "Quantity",
        "type": "double"
      },
      {
        "apiName": "Quote_Product__c",
        "label": "Quote Product",
        "type": "reference",
        "referenceTo": [
          "Quote_Product__c"
        ],
        "relationshipName": "Quote_Product__r",
        "childRelationshipName": "Order_Products",
        "deleteConstraint": "SetNull"
      },
      {
        "apiName": "Recalculate__c",
        "label": "Recalculate",
        "type": "boolean",
        "default": "0"
      },
      {
        "apiName": "Service_End_Date__c",
        "label": "Service End Date",
        "type": "date"
      },
      {
        "apiName": "Service_Start_Date__c",
        "label": "Service Start Date",
        "type": "date"
      },
      {
        "apiName": "Stripe_Bill_ID__c",
        "label": "Stripe Bill ID",
        "type": "string",
        "unique": true
      },
      {
        "apiName": "Surplus__c",
        "label": "*Surplus",
        "type": "formula",
        "formula": "Quantity__c -  Manday__c",
        "returnType": "double",
        "formulaMode": "active",
        "createable": false,
        "updateable": false
      },
      {
        "apiName": "Term_Months__c",
        "label": "Term(Months)",
        "type": "double"
      },
      {
        "apiName": "Unit_Net_Price__c",
        "label": "Unit Net Price",
        "type": "currency",
        "default": "0"
      }
    ],
    "keyPrefix": "a0I"
  }
]
