Short intro
A finance workspace becomes fragile when every page owns its own fake data, filtering logic, and business behavior. A service layer gives modules a shared contract.
What I was trying to do
I wanted to separate UI components from business logic so modules like AP, AR, GL, Cash, Reporting, and Admin could share patterns without becoming one giant component.
What I learned
- Service layers help avoid hardcoded UI data.
- UI components should render state and actions, not invent finance behavior.
- AP, AR, GL, Cash, Reporting, and Admin can share repository, table, filter, saved-view, and audit patterns.
- Metadata persistence matters for saved views, notifications, and preferences.
Technical notes
- A service method should own validation, permission checks, persistence, and audit side effects.
- Saved views should store filters, visible columns, sorting, grouping, and module identity.
- Audit logs should record actor, organization, action, entity, diff, and timestamp.
- Notifications should be created by domain events instead of sprinkled through UI code.
Problems / open questions
- How generic should the module repository layer become?
- Should audit logging be explicit in services or automatic through middleware?
- How should saved view schema evolve as modules diverge?
Next steps
- Define a service contract per module.
- Move remaining hardcoded datasets behind service calls.
- Add saved view persistence across modules.
- Tie important service actions to audit logs.