01Problem and context
The CRM manages documents and appeals for both chambers of Parliament. Every document follows a BPMN process — drafting, approvals, signing, registration — and its route and history must be visible. Some documents go to the President for signature. After registration a document becomes legally fixed.
02Constraints
- aWorkflow lives in a BPMN process engine; the UI starts processes, completes tasks and changes statuses.
- bLegal immutability after registration.
- cNational e-signature (NCALayer) and online document editing (OnlyOffice).
- dRussian and Kazakh UI; state directories (BIN/IIN, government bodies, sessions, convocations).
03My role
I built three modules from scratch — Deputies' inquiries, the Parliamentary Institute and "For the President's signature" — with the full BPMN lifecycle: draft, review, sign, archive. I worked on Interaction management and the Contacts core, and proposed and implemented one BPMN API used by four modules. We — a team of 13 — built the rest of the CRM.
04Decisions and why
- Decision
- One BPMN API — a single startProcess and changeProcessStatus — for all four modules.
- Why
- Each module called the engine differently, and the differences turned into bugs. One API cut duplicated code by ~40% and made new modules ~30% faster to build.
- Rejected
- Per-module process calls.
- Decision
- Lock editing in the UI once a document is registered; the server checks it too and rejects a change that does not match.
- Why
- A registered parliamentary document is legally fixed; every screen must reflect that and offer no way to edit it.
- Rejected
- Allowing edits with a warning.
- Decision
- Embed OnlyOffice for document editing.
- Why
- Users edit real office documents; the file stays the single source of truth.
- Rejected
- Downloading the file, editing it locally and uploading it again.
- Decision
- A shared form-component library — searchable reference-data selects, masked inputs, localised validation.
- Why
- Dozens of forms pick from the same state directories; one set of controls keeps them consistent and cut form-development time by ~25%.
- Rejected
- A separate select per form.
05Figures
06Tradeoffs and what went wrong
An infinite re-render loop in the inquiry card blocked production: a tabs higher-order component was created inside render, so React saw a new component type every time and remounted it. Memoising it fixed the loop. Moving create/send logic from the view to the form unified two creation flows into one, at the cost of reworking a screen that already worked.
07Quality
- Testing
- A dedicated QA team tested every release.
- Data loss
- In edit mode, the back button asks for confirmation, so unsaved work is not lost.
- Inputs
- Masked inputs moved to react-number-format.
- Validation
- Form validation messages localised. BIN/IIN validation for individuals, legal entities and government bodies.
08Result in numbers
09What I'd do differently
- Agree the shared BPMN API before the first module, not after the fourth.
- Add render-performance checks to code review.
10Credits
- Product
- Product and analysts — Parliament CRM team
- Backend
- Backend and process engine — backend team
- Frontend
- Team of 13