v3.0
EDI 277 + 999 inbound, MFA enforcement, dispute drafter, 820 generator, feature flags, full HubSpot + Salesforce one-way CRM push + OAuth web flow
- EDI 999 + 277 / 277CA inbound — pure X12 parsers (CRLF/LF tolerant, composite-element aware, partial-parse safe), reconciled back to the originating outbound transmission by group control number (999) or TRN02 (277). Per-claim STC status (accepted / pending / rejected / finalized) lands as flat validation rows on the outbound row. POST
/api/v1/edi/transmissions/ack+/api/v1/edi/transmissions/status-277. - TOTP MFA + recovery codes — RFC 6238 implementation, 4 enrollment routes, and login enforcement via stateless HMAC-signed challenge tokens. Recovery codes are bcrypt-stored, single-use, atomically burned via
$transaction. Regeneration requires a current TOTP. - Commission dispute drafter — deterministic email skeleton (variance trail, statement period, expected vs received) with optional AI refinement and drift-guard (response must reference the org name + dollar amount or we fall back to the deterministic draft).
- Feature flag service — per-agency flag CRUD with HMAC bucketing (key =
agencyId:flagKey:userId, not just userId, so the same 10% doesn’t get every feature). Used to gate roadmap surfaces in production. - X12 820 premium-payment generator — full envelope (BPR I/NON remittance-only, TRN, N1*PR carrier, N1*PE payer, per-EE ENT loops with NM1 + REF + DTM*582 + RMR). 5K-line cap.
- HubSpot one-way contact push (PAT auth) — Bearer client with 429-aware retry honoring
X-HubSpot-RateLimit-Interval-Milliseconds, error classification (auth_failed / rate_limited / not_found / validation_error), connect / disconnect / status / push routes. Atlas → HubSpot only — Atlas remains source of truth. - Salesforce one-way contact push (session / OAuth Bearer) — mirror of the HubSpot connector, instance-URL-scoped client with PATCH-by-external-id upsert (
velora_atlas_contact_id__c) so dedupe is idempotent in one round-trip. SOQL fallback for orgs without the external-id field configured. Error classification surfaces Salesforce’serrorCodein the message for triage. Same 4-route shape (connect / disconnect / status / push), same encrypt-at-rest tokens, same audit + status surface. Deal sync + full web-flow OAuth UI are roadmap. - HubSpot Company + Salesforce Account push — symmetric Organization push surface. POST
/api/v1/integrations/hubspot/organizations/[id]/push(search-by-property + create/update) and/api/v1/integrations/salesforce/organizations/[id]/push(PATCH-by-external-id). Domain auto-derived from website for HubSpot dedupe. The returned company / account id is persisted toOrganization.hubspotId/Organization.salesforceIdso subsequent contact pushes can stamp AccountId on the contact (Atlas → SFDC closes the contact-of-account loop). - HubSpot Deal + Salesforce Opportunity push — third CRM leg shipped. Operator passes
pipeline+dealstage(HubSpot) orstageName(Salesforce) on each push so we never silently land deals into the wrong stage from an auto-mapping. HubSpot deals carry an explicit company association on create when the linked Atlas Organization has a hubspotId; Salesforce Opportunities populate AccountId the same way. CloseDate is required for Salesforce — the mapper throws a clear 400 with field hint rather than letting Salesforce return a generic VALIDATION_ERROR. Both persist the returned id toDeal.hubspotDealId/Deal.salesforceDealId. - HubSpot + Salesforce OAuth 2.0 web flow— paste-in token stays as the developer-friendly path; OAuth is now the connect surface for end users. Stateless HMAC-SHA256 signed state token (10-min TTL) prevents CSRF without a session store, validates the provider on the callback so a state issued for one provider can’t be replayed against the other. Authorize-side: 302-redirect to
app.hubspot.com/oauth/authorize/login.salesforce.com/services/oauth2/authorizewith operator- configured client_id + scopes. Callback: token exchange viaapplication/x-www-form-urlencoded, capture portal id (HubSpot) / org id + instance_url (Salesforce), encrypt access + refresh tokens at rest, redirect to/settings/integrations?{hubspot,salesforce}=connected. Salesforce side respects aSALESFORCE_LOGIN_HOSTenv override for sandbox connections. Both flows fail closed: any malformed / expired / cross- provider state token becomes a redirect with a specific{provider}_errorreason — never trusts an attacker-supplied agency id from the URL. - Atlas-agent test coverage — 19 tests covering all 8 tool dispatchers, agency scoping, limit clamping, MAX_ITERATIONS termination.
- 1147 tests passing, TypeScript clean.