-
Notifications
You must be signed in to change notification settings - Fork 0
Fix ObjectStack spec v0.6.1 protocol compliance - naming conventions #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1f684b3
a3536b0
8db71c7
44adc07
d4be247
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,240 @@ | ||||||||||||||||||||||||||||||
| # ObjectStack Spec v0.6.1 Protocol Compliance Report | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Date:** 2026-01-29 | ||||||||||||||||||||||||||||||
| **Status:** ✅ **FULLY COMPLIANT** | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## Executive Summary | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| All metadata objects in the HotCRM repository have been validated and confirmed to be **fully compliant** with the @objectstack/spec v0.6.1 protocol requirements. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| - **Total Objects:** 8 | ||||||||||||||||||||||||||||||
| - **Total Fields:** 248 | ||||||||||||||||||||||||||||||
| - **Total Relationships:** 18 | ||||||||||||||||||||||||||||||
| - **Critical Issues:** 0 | ||||||||||||||||||||||||||||||
| - **Warnings:** 0 | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## Protocol Requirements | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### 1. Object Naming Convention | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Requirement:** Object `name` property (machine name) MUST use **lowercase/snake_case** (e.g., `account`, `project_task`) | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Status:** ✅ **COMPLIANT** | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| All 8 objects use lowercase naming for the machine name property. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| #### Examples: | ||||||||||||||||||||||||||||||
| - ✅ `name: 'account'` | ||||||||||||||||||||||||||||||
| - ✅ `name: 'activity'` | ||||||||||||||||||||||||||||||
| - ✅ `name: 'contact'` | ||||||||||||||||||||||||||||||
| - ✅ `name: 'lead'` | ||||||||||||||||||||||||||||||
| - ✅ `name: 'opportunity'` | ||||||||||||||||||||||||||||||
| - ✅ `name: 'contract'` | ||||||||||||||||||||||||||||||
| - ✅ `name: 'quote'` | ||||||||||||||||||||||||||||||
| - ✅ `name: 'case'` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### 2. Field Naming Convention | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Requirement:** All field names MUST use **PascalCase** (e.g., `FirstName`, `AccountId`, `CreatedDate`) | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Status:** ✅ **COMPLIANT** | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| All 248 fields across all objects follow the PascalCase naming convention. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| #### Examples: | ||||||||||||||||||||||||||||||
| - ✅ `Name` | ||||||||||||||||||||||||||||||
| - ✅ `FirstName` | ||||||||||||||||||||||||||||||
| - ✅ `AccountId` | ||||||||||||||||||||||||||||||
| - ✅ `AnnualRevenue` | ||||||||||||||||||||||||||||||
| - ✅ `BillingStreet` | ||||||||||||||||||||||||||||||
| - ✅ `IsDecisionMaker` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### 2. Field Type Specification | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Requirement:** All field types MUST use standard @objectstack/spec type names | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Status:** ✅ **COMPLIANT** | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| #### Valid Field Types (16 types in use): | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| | Type | Usage Count | Description | | ||||||||||||||||||||||||||||||
| |------|-------------|-------------| | ||||||||||||||||||||||||||||||
| | `text` | 48 | Single-line text field | | ||||||||||||||||||||||||||||||
| | `select` | 42 | Single-select picklist | | ||||||||||||||||||||||||||||||
| | `lookup` | 37 | Reference to another object | | ||||||||||||||||||||||||||||||
| | `textarea` | 24 | Multi-line text field | | ||||||||||||||||||||||||||||||
| | `number` | 22 | Numeric value | | ||||||||||||||||||||||||||||||
| | `datetime` | 20 | Date and time | | ||||||||||||||||||||||||||||||
| | `currency` | 11 | Monetary value | | ||||||||||||||||||||||||||||||
| | `date` | 9 | Date only | | ||||||||||||||||||||||||||||||
| | `phone` | 8 | Phone number | | ||||||||||||||||||||||||||||||
| | `checkbox` | 8 | Boolean value | | ||||||||||||||||||||||||||||||
| | `percent` | 6 | Percentage value | | ||||||||||||||||||||||||||||||
| | `email` | 5 | Email address | | ||||||||||||||||||||||||||||||
| | `url` | 4 | Web URL | | ||||||||||||||||||||||||||||||
| | `autoNumber` | 2 | Auto-incrementing number | | ||||||||||||||||||||||||||||||
| | `masterDetail` | 1 | Master-detail relationship | | ||||||||||||||||||||||||||||||
| | `hasMany` | 18 | One-to-many relationship | | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| #### Common Mistakes to Avoid: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| | ❌ Incorrect | ✅ Correct | Notes | | ||||||||||||||||||||||||||||||
| |--------------|------------|-------| | ||||||||||||||||||||||||||||||
| | `autonumber` | `autoNumber` | Must use camelCase | | ||||||||||||||||||||||||||||||
| | `picklist` | `select` | Salesforce terminology | | ||||||||||||||||||||||||||||||
| | `reference` | `lookup` | Alternative naming | | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Fixed Issues:** | ||||||||||||||||||||||||||||||
| - ✅ Contract.ContractNumber: Changed `'autonumber'` → `'autoNumber'` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### 3. Object Structure | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Requirement:** All objects MUST have the standard structure | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Status:** ✅ **COMPLIANT** | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| All objects include: | ||||||||||||||||||||||||||||||
| - ✅ `name` property (object identifier) | ||||||||||||||||||||||||||||||
| - ✅ `label` property (display name) | ||||||||||||||||||||||||||||||
| - ✅ `labelPlural` property (plural display name) | ||||||||||||||||||||||||||||||
| - ✅ `icon` property (UI icon) | ||||||||||||||||||||||||||||||
| - ✅ `description` property (object description) | ||||||||||||||||||||||||||||||
| - ✅ `fields` object (field definitions) | ||||||||||||||||||||||||||||||
| - ✅ `capabilities` object (optional features) | ||||||||||||||||||||||||||||||
| - ✅ `relationships` array (optional relationships) | ||||||||||||||||||||||||||||||
| - ✅ `listViews` array (list view definitions) | ||||||||||||||||||||||||||||||
| - ✅ `validationRules` array (optional validation) | ||||||||||||||||||||||||||||||
| - ✅ `pageLayout` object (UI layout) | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### 4. Relationship Naming | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Requirement:** Relationship names MUST use PascalCase and valid relationship types | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Status:** ✅ **COMPLIANT** | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| All 18 relationships use: | ||||||||||||||||||||||||||||||
| - ✅ PascalCase names (e.g., `Contacts`, `Opportunities`, `ChildAccounts`) | ||||||||||||||||||||||||||||||
| - ✅ Valid types: `hasMany` (18 instances) | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## Object-by-Object Validation | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### 1. Account Object (`account.object.ts`) | ||||||||||||||||||||||||||||||
| - **Fields:** 29 | ||||||||||||||||||||||||||||||
| - **Relationships:** 4 | ||||||||||||||||||||||||||||||
| - **Status:** ✅ Fully compliant | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### 2. Activity Object (`activity.object.ts`) | ||||||||||||||||||||||||||||||
| - **Fields:** 40 | ||||||||||||||||||||||||||||||
| - **Relationships:** 2 | ||||||||||||||||||||||||||||||
| - **Status:** ✅ Fully compliant | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### 3. Contact Object (`contact.object.ts`) | ||||||||||||||||||||||||||||||
| - **Fields:** 17 | ||||||||||||||||||||||||||||||
| - **Relationships:** 1 | ||||||||||||||||||||||||||||||
| - **Status:** ✅ Fully compliant | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### 4. Lead Object (`lead.object.ts`) | ||||||||||||||||||||||||||||||
| - **Fields:** 36 | ||||||||||||||||||||||||||||||
| - **Relationships:** 2 | ||||||||||||||||||||||||||||||
| - **Status:** ✅ Fully compliant | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### 5. Opportunity Object (`opportunity.object.ts`) | ||||||||||||||||||||||||||||||
| - **Fields:** 14 | ||||||||||||||||||||||||||||||
| - **Relationships:** 1 | ||||||||||||||||||||||||||||||
| - **Status:** ✅ Fully compliant | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### 6. Contract Object (`contract.object.ts`) | ||||||||||||||||||||||||||||||
| - **Fields:** 8 | ||||||||||||||||||||||||||||||
| - **Relationships:** 0 | ||||||||||||||||||||||||||||||
| - **Status:** ✅ Fully compliant | ||||||||||||||||||||||||||||||
| - **Fixed:** Changed `autonumber` to `autoNumber` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### 7. Quote Object (`quote.object.ts`) | ||||||||||||||||||||||||||||||
| - **Fields:** 56 | ||||||||||||||||||||||||||||||
| - **Relationships:** 4 | ||||||||||||||||||||||||||||||
| - **Status:** ✅ Fully compliant | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### 8. Case Object (`case.object.ts`) | ||||||||||||||||||||||||||||||
| - **Fields:** 48 | ||||||||||||||||||||||||||||||
| - **Relationships:** 4 | ||||||||||||||||||||||||||||||
| - **Status:** ✅ Fully compliant | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## Validation Methodology | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| The validation was performed using automated scripts that: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| 1. Parse all `.object.ts` files in the repository | ||||||||||||||||||||||||||||||
| 2. Extract field names and types | ||||||||||||||||||||||||||||||
| 3. Validate PascalCase naming convention | ||||||||||||||||||||||||||||||
| 4. Check field types against the @objectstack/spec standard | ||||||||||||||||||||||||||||||
| 5. Verify object structure completeness | ||||||||||||||||||||||||||||||
| 6. Count and validate relationships | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## Protocol Best Practices | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### For Developers | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| When creating or modifying object metadata, ensure: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| 1. **Object Names (Machine Names):** | ||||||||||||||||||||||||||||||
| - Use lowercase/snake_case: `account`, `project_task`, not `Account` or `ProjectTask` | ||||||||||||||||||||||||||||||
| - Start with a lowercase letter | ||||||||||||||||||||||||||||||
| - Use underscores for multi-word names: `project_task` not `projectTask` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| 2. **Field Names:** | ||||||||||||||||||||||||||||||
| - Use PascalCase: `FirstName`, not `first_name` or `firstName` | ||||||||||||||||||||||||||||||
| - Start with a capital letter | ||||||||||||||||||||||||||||||
| - Use descriptive names: `BillingStreet` not `BillStreet` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| 2. **Field Types:** | ||||||||||||||||||||||||||||||
| - Use `autoNumber` not `autonumber` | ||||||||||||||||||||||||||||||
| - Use `select` not `picklist` | ||||||||||||||||||||||||||||||
| - Use `lookup` not `reference` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| 3. **Object Properties:** | ||||||||||||||||||||||||||||||
|
Comment on lines
+189
to
+194
|
||||||||||||||||||||||||||||||
| 2. **Field Types:** | |
| - Use `autoNumber` not `autonumber` | |
| - Use `select` not `picklist` | |
| - Use `lookup` not `reference` | |
| 3. **Object Properties:** | |
| 3. **Field Types:** | |
| - Use `autoNumber` not `autonumber` | |
| - Use `select` not `picklist` | |
| - Use `lookup` not `reference` | |
| 4. **Object Properties:** |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both "Object Properties" (line 194) and "Relationships" (line 200) are numbered as sections "3." and "4." respectively, but they should be "4." and "5." to maintain correct sequential numbering given the duplicate "2." earlier in the document.
| 3. **Object Properties:** | |
| - Always include `name`, `label`, `icon`, and `description` | |
| - Define `fields` object with all field metadata | |
| - Include `listViews` for common queries | |
| - Add `validationRules` for business logic | |
| 4. **Relationships:** | |
| 4. **Object Properties:** | |
| - Always include `name`, `label`, `icon`, and `description` | |
| - Define `fields` object with all field metadata | |
| - Include `listViews` for common queries | |
| - Add `validationRules` for business logic | |
| 5. **Relationships:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both "Field Naming Convention" (line 36) and "Field Type Specification" (line 52) are numbered as section "### 2.". The Field Type Specification section should be numbered "### 3." to maintain correct sequential numbering.