Live & in use
Partial / needs decision
Empty / abandoned
Xero integration custom
Core Sales & Contract Model
erDiagram
Account ||--o{ Opportunity : "has"
Account ||--o{ Contract : "has"
Account ||--o{ Asset : "owns"
Opportunity ||--o{ OpportunityLineItem : "contains"
Opportunity ||--o| Contract : "may produce"
Contract ||--o{ Asset : "delivers via"
OpportunityLineItem }o--|| Product2 : "is a"
OpportunityLineItem }o--o| Asset : "previous_asset_lookup"
Asset }o--|| Product2 : "is a"
Asset }o--o| Contract : "linked to"
Account {
string Name
string ParentId
string Primary_RM__c "picklist of names"
picklist Invoicing_platforms__c "Ariba/Coupa/Tungsten/etc"
string What_regions_are_you_based_in__c "string not picklist"
currency ARR_Sum__c
string Xero_Contact_Id__c "Xero sync"
picklist Billing_Schedule__c "exists but unused?"
}
Opportunity {
string Name
picklist StageName "Closed Won target"
picklist Type "5 values today"
currency ACV__c
currency ARR__c
currency ARR_delta__c
date CloseDate
date Service_Commencement_Date_Contract__c
date Service_End_Date_Contract__c
picklist Renewal_Confidence__c
}
OpportunityLineItem {
string Service__c
string Sub_Service__c
currency ACV__c
currency ARR__c
currency One_Off__c
currency ARR_delta__c
date Service_Commencement_Date__c
date Service_End_Date__c
picklist Type_of_Billing_Schedule__c
string Type__c "1300 char string!"
reference Previous_Asset__c "lookup to Asset"
string PO_Number__c
string SOW_Number__c
}
Contract {
date StartDate
date EndDate
picklist Status
picklist Business_Line__c "Kaizen/SDS/SRB/etc - BILLING ENTITY"
picklist Renewal_Clause__c "None/Auto/Rolling"
picklist Trackers__c "CPI/RPI"
percent Price_increase__c
date Service_Commencement_Date__c
date Service_Commencement_End_Date__c
string PO_Number__c
picklist Type_of_Billing_Schedule__c
reference Previous_Contract__c
reference Next_Contract__c
}
Asset {
date Service_Commencement_Date__c
date Service_End_Date__c
date Revenue_Start_Date__c
currency ACV__c
currency ARR__c
currency One_Off__c
picklist Billing_Schedule__c "Annual/Quarterly/etc"
picklist Type_of_Billing_Schedule__c "only 'test'"
double Asset_Term__c
string Previous_Asset_ID__c "string not lookup"
reference Contract__c
}
Product2 {
string Name
picklist Family "23 product families"
picklist Service__c
picklist Subservice__c
picklist Regulation__c
picklist Jursidiction__c
}
Xero Integration Model (custom)
erDiagram
Account ||--o{ Xero_Invoice : "has"
Account ||--o{ Xero_Credit_Note : "has"
Account ||--o{ Xero_Journal : "has"
Xero_Invoice ||--o{ Xero_Invoice_Line : "lines"
Xero_Invoice ||--o{ Xero_Payment : "payments"
Xero_Invoice ||--o{ Xero_Credit_Note : "credited by"
Xero_Credit_Note ||--o{ Xero_Credit_Note_Line : "lines"
Xero_Journal ||--o{ Xero_Journal_Line : "lines"
Xero_Invoice {
reference Account__c
date Invoice_Date__c
date Due_Date__c
currency Total__c
currency Sub_Total__c
currency Total_Tax__c
currency Amount_Paid__c
currency Amount_Credited__c
currency Amount_Due__c
picklist Status__c "Draft/Authorised/Paid"
string Xero_Invoice_Id__c
string Xero_Invoice_Number__c
datetime Xero_Last_Synced__c
}
Xero_Invoice_Line {
reference Invoice__c
string Description__c
decimal Quantity__c
decimal Unit_Price__c
string Account_Code__c "Xero nominal"
string Tax_Type__c
}
Xero_Credit_Note {
reference Account__c
reference Invoice__c
currency Total__c
currency Remaining_Credit__c
picklist Status__c
string Xero_Credit_Note_Id__c
}
Xero_Journal {
reference Account__c
date Journal_Date__c
string Narration__c
picklist Status__c
string Xero_Journal_Id__c
}
Bridging the Sales Model and the Xero Model
The integration project needs to wire the Sales Model into the Xero Model. The question is which
objects/fields drive the sync triggers and what data flows where.
flowchart LR
A[Account] --> B[Opportunity]
B --> C[OpportunityLineItem]
C -.may produce.-> D[Asset]
B -.may produce.-> E[Contract]
E -.governs.-> D
C --> |"Closed Won + line
= billable event?"| F[Xero_Invoice]
D --> |"or is Asset
the trigger?"| F
F --> G[Xero_Invoice_Line]
F -.credited by.-> H[Xero_Credit_Note]
A --> |"Xero_Contact_Id__c
links to Xero"| I[(Xero API)]
F --> I
H --> I
style A fill:#d4edda
style B fill:#d4edda
style C fill:#d4edda
style D fill:#d4edda
style E fill:#d4edda
style F fill:#cce5ff
style G fill:#cce5ff
style H fill:#cce5ff
style I fill:#fff3cd
Key observations & open questions
- Q
Billing__c exists as a standalone object but has 0 records and no custom fields. Likely abandoned. Confirm with team.
- Q Same date concepts (
Service_Commencement_Date__c, Service_End_Date__c) live on Contract, OpportunityLineItem, AND Asset. Which is source of truth? Are they synced? BR-008/009 says these are currently misused for testing dates.
- Q
OLI.Type__c is a string field, length 1300 — not a restricted picklist. BR-050 wants 6 controlled values. Convert to picklist?
- Q
OLI.Type_of_Billing_Schedule__c picklist on OLI has same values as Asset.Billing_Schedule__c picklist on Asset. Asset.Type_of_Billing_Schedule__c only has value "test" (abandoned).
- ✓
OpportunityLineItem.Previous_Asset__c already exists as a lookup → Asset. BR-053 (renewal linkage) is half-built.
- ✓
Contract.Business_Line__c picklist (Kaizen, SDS, SRB, Kaizen BV, etc.) is exactly the "Billing Entity" concept BR-029/030 needs.
- ✓
Contract.Renewal_Clause__c picklist (None / Auto renew / Rolling / Other) is what BR-012 needs to retire Year 3000.
- ✓
Contract.Trackers__c (CPI/RPI) + Price_increase__c covers BR-052's CPI escalator.
- !
Account.What_regions_are_you_based_in__c is a string — BR-040 wants a controlled picklist for region reporting.
- !
Opportunity.Type picklist has 5 values (Renewal, Up-sell, New Business, Renewal w/ Up-sell, Whitespace). BR-050 wants 6 (New Logo, Upsell, Renewal, Downsell, Churn, Reactivation). Decision: extend Opp.Type, or use OLI.Type__c only as line-level classifier?
- !
OLI.SOW_OVERIDE__c typo (should be OVERRIDE). Worth fixing on the same pass that adds new fields.