Phase 4 part 3: Stripe customers matched to EspoCRM Accounts
Every customer with billing is matched to an Account copied from the CRM: the user's choice, then an Account Hermes created from here, a stored ID on either side, an email (the Account's or a Contact's), or the email's domain (not free mail). Several candidates wait for a choice. Metrics → Customers and the CRM fixes matches, marks customers not in the CRM, and queues paying ones as new Accounts. Schema 20. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -537,6 +537,15 @@ CREATE INDEX stripe_invoice_lines_by_customer ON stripe_invoice_lines (customer,
|
||||
// can't read Products.
|
||||
`
|
||||
ALTER TABLE stripe_invoice_lines ADD COLUMN description TEXT NOT NULL DEFAULT '';
|
||||
`,
|
||||
// 20: Stripe customers matched to EspoCRM Accounts by hand (the
|
||||
// automatic matches are worked out each time).
|
||||
`
|
||||
CREATE TABLE crm_matches (
|
||||
customer TEXT PRIMARY KEY, -- cus_…
|
||||
espo_id TEXT NOT NULL DEFAULT '', -- the Account; '' means "not in the CRM"
|
||||
set_at TEXT NOT NULL
|
||||
);
|
||||
`,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user