Some checks failed
✅ Check / 🔬 ESLint (push) Failing after 21s
✅ Check / 🏷️ Typecheck (push) Failing after 11s
✅ Check / 🔎 Test (push) Failing after 11s
✅ Check / e2e-test (push) Failing after 11s
✅ Check / 🔨 Build (push) Failing after 11s
🚀 Deploy / 🚀 Deploy (doc) (push) Failing after 12s
🚀 Deploy / 🚀 Deploy (demo) (push) Failing after 12s
🚀 Deploy / 🚀 Deploy (supabase) (push) Failing after 18s
3.2 KiB
3.2 KiB
Deleting deals
deals owns the deals + deal_notes tables but is woven into two shared subsystems (notes, activity log), adds an aggregated nb_deals to companies_summary, ships three config props plus a non-eponymous one, and has a custom dataProvider method — so it fans out almost as wide as a column removal.
Frontend specifics
- Shared subsystems — narrow the notes union to
"contacts"and the activity-log union to drop"deal"; prune the=== "deals"/deal_id/DealNotebranches (the=== "contacts"checks stay valid). DeleteActivityLogDealCreated.tsx+ActivityLogDealNoteCreated.tsxoutright; dropgetNewDealsAndNotesinproviders/commons/activity.tsandDEAL_CREATED/DEAL_NOTE_CREATED+ActivityDeal*inconsts.ts/types.ts. Drop the"deals"reference test inNoteInputs.test.tsx. - Config props —
dealStages/dealCategories/dealPipelineStatusespluscurrency, which is deal-scoped but NOT named after the resource (it lived in the Deals<Card>; readers areDealsChart/DealsPipeline/CompanyShow's deal iterator). Removingcurrencyis a judgement call — flag it. The Deals<Card>also carries avalidateItemsInUsehelper — exported, unit-tested inSettingsPage.test.ts(delete that test file outright), backed by acrm.settings.validationi18n block; delete all three. - Custom method —
unarchiveDeal(deal)in both providers (drops fromCrmDataProviderautomatically via the supabase provider's return type). - Wrapper components outside the folder, delete outright:
dashboard/DealsChart.tsx,dashboard/DealsPipeline.tsx.Dashboard.tsxkeeps both an import and a{totalDeal ? <DealsChart/> : null}JSX site — remove both.LatestNotes.tsxfetchesdeal_notes+ renders<Deal/>. nb_dealsreaders (invisible to\bdeals?\bgrep):CompanyShow.tsx(deals tab),CompanyCard.tsx(badge).ContactMergeButton.tsxshows adealsCountpreview.- i18n:
resources.deals,nb_deals, activity/dashboard/settings.deals/settings.validationkeys;i18nProvider.test.tsasserts aresources.deals.*key.
Backend
- Drop the
deals+deal_notestables, grants, policies, sequences. Updatecompanies_summary(dropcount(distinct d.id) as nb_deals+ theleft join public.deals). activity_logview:dealscontributed adeal+deal_notecolumn to every branch and two dedicated branches (deal.created,dealNote.created) — remove both, keep column lists aligned, and drop thedeal_note → dealNoterename in the supabase provider'sgetList("activity_log").- MCP: no dedicated MCP App — only the
DealsTableKysely interface in_shared/db.ts, the deal-reassignment step inmerge_contacts/index.ts(its removal leaves thesqlimport unused — drop it), and deal mentions in thequery/mutateprompt-text examples inmcp/index.ts(rewrite the examples, don't just delete lines).
grep — benign matches to leave
dealsmatchesideal(an English comment inRelativeDate.tsx) and the Frenchaffaires/Chiffre d'affaires(= revenue, not a deal, infrenchCrmMessages.ts) — filter them out and don't blind-delete French lines.