FSMS manages field marketer teams, leads, and commission payouts for multiple companies from one deployment. Multi-tenancy sounds like a solved problem until you're the one deciding where the tenant boundary actually lives in the codebase - and how expensive it is to get that decision wrong after launch.
Where we draw the tenant line
Every tenant-scoped model carries its company identifier at the database layer, enforced through query scoping rather than relying on every controller remembering to filter correctly. A missed "where company_id =" in one controller is exactly the kind of bug that leaks one company's leads into another company's dashboard, and it is far cheaper to make that mistake structurally impossible than to catch it in review.
Commissions are the part that has to be exactly right
Field marketing platforms live or die on whether commission payouts are trusted. A lead that converts has to be traceable back to the specific marketer and assignment that generated it, even when a company reorganizes its teams or reassigns territories mid-month. We built the commission calculation to reference the state of the assignment at the time the lead converted, not the current team structure, so a later reorg can't retroactively change what someone is owed for work already done.
GPS-tracked assignments, kept honest
Assigning marketers to physical places and tracking GPS location only has value if the data is trustworthy enough for a sales manager to actually act on. That meant deciding early how to handle gaps - a marketer's phone dying mid-shift, patchy GPS indoors - without either flooding the dashboard with false "off task" alerts or silently hiding real ones.
Dashboards that compare periods, not just totals
A raw sales number means little without something to compare it to. Owners and team leads needed period-over-period comparisons built in from day one - this month against last month, this quarter against the same quarter last year - rather than exporting data to a spreadsheet to get the comparison everyone actually wanted to see first.