Conversation
…xt/number - patient: date_of_birth→date, email→email, phone→phone - appointment: scheduled_date→datetime, telehealth_link→url - hipaa_audit: timestamp→datetime - prescription: start_date/end_date→date - insurance: coverage_start/end→date, copay/deductible→currency - care_plan: start_date/review_date→date - referral: referral_date→date Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
… education packages - transaction_record: amount → Field.currency(), transaction_date → Field.date() - kyc: verified_date, expiry_date → Field.date() - student: graduation_date → Field.date() - enrollment: enrollment_date → Field.date() - alumni: email → Field.email() - application_form: email → Field.email(), application_date/decision_date → Field.date() - scholarship: application_deadline → Field.date() - campus_event: event_date → Field.date() Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…e casing - marketing/email_template: fix non-snake_case option values (openrate → open_rate, clickrate → click_rate, conversionrate → conversion_rate) - crm/lead: fix defaultValue 'New' → 'new' to match option value - marketing/campaign: fix defaultValue 'Planned' → 'planned' to match option value - finance/payment: fix defaultValue 'Planned' → 'planned' to match option value - products/pricebook: fix defaultValue 'CNY' → 'cny' and 'USD' → 'usd' to match lowercase option values Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Fix label capitalization issues across all 20 object files in packages/support/src/. Field labels now use proper Title Case (e.g., 'Description' not 'description', 'Status' not 'status'). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…packages Fix inconsistent label capitalization across 7 object files: - price_rule.object.ts: Industry, Competitor Name, Approval Status - product_bundle.object.ts: Bundle Name, Description, Status - quote_line_item.object.ts: Description, Quantity, Subtotal, Margin, Margin %, AI Optimal Quantity - approval_request.object.ts: Request Name, Description, Status, Competitor Name - quote.object.ts: Quote Name, Status, Subtotal, Approval Status, Description - discount_schedule.object.ts: Schedule Name, Description, Status, Industry, Priority - campaign_member.object.ts: Notes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Align test assertions with schema changes where generic text/number fields were replaced with semantic ObjectStack field types: - date_of_birth, coverage_start/end, referral_date, etc. → 'date' - scheduled_date, timestamp → 'datetime' - email fields → 'email' - phone → 'phone' - telehealth_link → 'url' - copay, deductible, amount → 'currency' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Agent-Logs-Url: https://github.com/objectstack-ai/hotcrm/sessions/d6245b39-884c-4561-9590-88bfa01ceb07 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Repository-wide ObjectStack schema compliance audit that aligns object metadata across business packages with spec requirements (semantic field types, snake_case tokens, consistent select defaults, and standardized labeling).
Changes:
- Corrected field types to semantic equivalents (e.g.,
text→date/datetime/email/phone/url,number→currency) and updated spec-compliance tests accordingly. - Standardized select
defaultValuecasing to match lowercase option values where required. - Normalized naming/casing in metadata (Title Case labels; select option token snake_case updates in marketing email templates) and documented the audit in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/support/src/web_to_case.object.ts | Title Case label standardization for support object fields. |
| packages/support/src/social_media_case.object.ts | Title Case labels for configuration and platform fields. |
| packages/support/src/sla_template.object.ts | Title Case label normalization. |
| packages/support/src/sla_policy.object.ts | Title Case label normalization across multiple SLA policy fields. |
| packages/support/src/sla_milestone.object.ts | Title Case label normalization for milestone name/description/status. |
| packages/support/src/skill.object.ts | Title Case label normalization (including certification fields). |
| packages/support/src/routing_rule.object.ts | Title Case label normalization for rule fields. |
| packages/support/src/queue_member.object.ts | Title Case label normalization for status/notes/schedule fields. |
| packages/support/src/queue.object.ts | Title Case label normalization for queue fields. |
| packages/support/src/portal_user.object.ts | Title Case label normalization for user profile/notification fields. |
| packages/support/src/knowledge_article.object.ts | Title Case label normalization across article and AI-assisted fields. |
| packages/support/src/holiday_calendar.object.ts | Title Case label normalization for calendar/country/year/region fields. |
| packages/support/src/holiday.object.ts | Title Case label normalization for holiday fields. |
| packages/support/src/forum_topic.object.ts | Title Case label normalization for forum topic fields. |
| packages/support/src/forum_post.object.ts | Title Case label normalization for post content field. |
| packages/support/src/escalation_rule.object.ts | Title Case label normalization for escalation rule fields. |
| packages/support/src/email_to_case.object.ts | Title Case label normalization for configuration and username fields. |
| packages/support/src/case.object.ts | Title Case label normalization for core case fields. |
| packages/support/src/business_hours.object.ts | Title Case label normalization for business hours fields. |
| packages/support/src/agent_skill.object.ts | Title Case label normalization for notes field. |
| packages/products/src/quote_line_item.object.ts | Title Case label normalization for quote line item fields. |
| packages/products/src/quote.object.ts | Title Case label normalization for quote fields including approval status. |
| packages/products/src/product_bundle.object.ts | Title Case label normalization for bundle fields. |
| packages/products/src/pricebook.object.ts | Lowercased currency defaults to match lowercase currency tokens. |
| packages/products/src/price_rule.object.ts | Title Case label normalization in pricing rule metadata. |
| packages/products/src/discount_schedule.object.ts | Title Case label normalization for schedule fields and criteria labels. |
| packages/products/src/approval_request.object.ts | Title Case label normalization for approval request fields. |
| packages/marketing/src/email_template.object.ts | Snake_case option token updates for A/B test “winning metric” selector. |
| packages/marketing/src/campaign_member.object.ts | Title Case label normalization for notes field. |
| packages/marketing/src/campaign.object.ts | Lowercased campaign status default to match option values. |
| packages/healthcare/src/referral.object.ts | Corrected referral date field type (text → date). |
| packages/healthcare/src/prescription.object.ts | Corrected prescription start/end dates (text → date). |
| packages/healthcare/src/patient.object.ts | Corrected DOB/email/phone field types to semantic types. |
| packages/healthcare/src/insurance.object.ts | Corrected coverage dates and monetary amounts to date/currency. |
| packages/healthcare/src/hipaa_audit.object.ts | Corrected timestamp type (text → datetime). |
| packages/healthcare/src/care_plan.object.ts | Corrected care plan dates (text → date). |
| packages/healthcare/src/appointment.object.ts | Corrected scheduled datetime and telehealth link (text → datetime/url). |
| packages/healthcare/tests/unit/objects/spec-compliance.test.ts | Updated assertions for corrected healthcare field types. |
| packages/financial-services/src/transaction_record.object.ts | Corrected transaction amount/date to currency/date. |
| packages/financial-services/src/kyc.object.ts | Corrected verified/expiry dates (text → date). |
| packages/financial-services/tests/unit/objects/spec-compliance.test.ts | Updated assertions for corrected financial-services field types. |
| packages/finance/src/payment.object.ts | Lowercased payment status default to match option values. |
| packages/education/src/student.object.ts | Corrected graduation date (text → date). |
| packages/education/src/scholarship.object.ts | Corrected application deadline (text → date). |
| packages/education/src/enrollment.object.ts | Corrected enrollment date (text → date). |
| packages/education/src/campus_event.object.ts | Corrected event date (text → date). |
| packages/education/src/application_form.object.ts | Corrected email/date fields to semantic types. |
| packages/education/src/alumni.object.ts | Corrected alumni email (text → email). |
| packages/education/tests/unit/objects/spec-compliance.test.ts | Updated assertions for corrected education field types. |
| packages/crm/src/lead.object.ts | Lowercased lead status default to match option values. |
| CHANGELOG.md | Documented the audit scope and summarized the compliance fixes. |
| a_b_test_winner_metric: Field.select({ | ||
| label: 'A/B Test Winning Metric', | ||
| options: [ | ||
| { | ||
| "label": "Open Rate", | ||
| "value": "openrate" | ||
| "value": "open_rate" | ||
| }, | ||
| { | ||
| "label": "Click Rate", | ||
| "value": "clickrate" | ||
| "value": "click_rate" | ||
| }, | ||
| { | ||
| "label": "Conversion Rate", | ||
| "value": "conversionrate" | ||
| "value": "conversion_rate" | ||
| } |
There was a problem hiding this comment.
Changing the stored select option values for a_b_test_winner_metric (e.g., openrate → open_rate) can break existing records that already have the old values saved, causing invalid/unknown select values at runtime. Consider keeping the old values as deprecated aliases in options (same labels) for backward compatibility, or provide a data migration to rewrite existing records to the new snake_case values before removing the old ones.
| description: Field.textarea({ label: 'Description' }), | ||
| supported_currencies: Field.text({ label: 'Supported Currencies', maxLength: 500, description: 'Comma-separated currency codes (e.g., USD,EUR,GBP)' }), | ||
| default_currency: Field.text({ label: 'Default Currency', maxLength: 3, defaultValue: 'USD' }), | ||
| default_currency: Field.text({ label: 'Default Currency', maxLength: 3, defaultValue: 'usd' }), |
There was a problem hiding this comment.
In Pricebook, currency option values and default_currency are now lowercase (e.g. usd), but the supported_currencies field description still suggests uppercase codes (e.g., USD,EUR,GBP). To avoid confusion and inconsistent data entry, update the description/example (and/or add validation/normalization) to match the expected casing.
Description
Audited all 142
*.object.tsfiles across 14 packages against the ObjectStack schema specification. Fixed 120+ violations: wrong field types, non-snake_case names, uppercase option values, and inconsistent label capitalization.Type of Change
Related Issues
Related to ObjectStack schema spec compliance
Changes Made
Field type corrections (27 fixes) — healthcare, education, financial-services
Field.text()replaced with semantic types where data semantics require it:text→date/datetimetext→emailtext→phone/urlnumber→currencyDefault value casing (5 fixes) — crm, marketing, finance, products
Option
valueanddefaultValuemust be lowercase per spec:lead.object.ts:defaultValue: 'New'→'new'campaign.object.ts:defaultValue: 'Planned'→'planned'payment.object.ts:defaultValue: 'Planned'→'planned'pricebook.object.ts:defaultValue: 'CNY'/'USD'→'cny'/'usd'Field naming (3 fixes) — marketing
email_template.object.ts:openrate→open_rate,clickrate→click_rate,conversionrate→conversion_rateLabel capitalization (80+ fixes) — support (20 files), products (7 files)
Standardized to Title Case:
'description'→'Description','origin Channel'→'Origin Channel', etc.Packages with zero violations (no changes)
analytics, community, real-estate, integration, HR, core
Testing
npm test)npm run lint)npm run build)Updated spec-compliance tests in healthcare, education, and financial-services to assert corrected field types. All 210 test files / 4104 tests pass.
Screenshots
N/A
Checklist
Additional Notes
CHANGELOG.md updated with full audit summary. The audit identified label capitalization as the most widespread category — a lint rule for Title Case labels would prevent recurrence.