Chapter 1 - Master Software Requirements Specification
1. Document Control
| Field | Value |
|---|---|
| Document title | Software Requirements Specification — TKAMOL |
| System name | TKAMOL Legal Operations SaaS |
| Document identifier | Part I - Software Requirements Specification, Chapter 1 (Master Software Requirements Specification) |
| Version | 1.0 (draft derived from source code) |
| Preparation date | Oct 2026 |
| Status | Draft — Pending Stakeholder Validation |
| Intended audience | Product owner, technical manager, senior developers, QA engineers, external vendor companies |
| Primary source | Repository C:\laragon\www\ts-app inspected Oct 2026 (routes, controllers, models, migrations, services, frontend pages) |
| Supporting files | Part I - Software Requirements Specification, Chapter 2 (Functional Requirements Register), Part I, Chapter 3 - Non-Functional Requirements Register, Part I, Chapter 4 - Use Cases and Acceptance Criteria, Part I, Chapter 5 - Requirements Traceability |
Revision history
| Rev | Date | Description |
|---|---|---|
| 0.1 | Oct 2026 | Initial structuring from inspected code |
| 1.0 | Oct 2026 | Consolidated SRS pending stakeholder validation |
No sign-off records, author names, or approvals have been invented. Stakeholder approval is explicitly not granted by this document.
2. Executive Summary
TKAMOL is an enterprise-grade, multi-workspace (multi-tenant) legal-operations platform for law firms and professional services teams. It is built on Laravel 12 with a React 19 SPA delivered via Inertia.js. The platform unifies project/case management, task tracking (Kanban boards), time tracking and timesheet approvals, expense management and budgeting, invoice generation and collection via 30+ payment gateways, client/company/contact management, legal-bug tracking, IMAP-based email inbox with AI-driven triage and assignment, AI assistant (Gemini) chat, WhatsApp/Slack/Telegram notifications, Zoom meetings, and SaaS billing (plans, plan orders, coupons, referrals). Frontend is supported in 16 enabled locales (actual configuration — see §7) with full RTL.
3. Business Context and Objectives
- Business problem: law firms manage cases, deadlines, teams, clients, billing, and inbound client email on disconnected tools, losing traceability and time.
- Business objective: single unified system of record for case lifecycle, time and expense, billing, and team communication.
- Business objective: safer handling of legal-budget approval workflows (submitters → reviewers → approver) and invoice payment collection.
- Business objective: automated ingestion of inbound legal email (Gmail/IMAP) into projects/tasks and assignment to the right team member via AI.
- Business objective: allow a SaaS operator to host multiple law firms as separate companies/tenants with subscription plans, trial, plan-change requests.
- Known business constraints (from code):
- Non-SaaS mode removes plan-gating, billing, companies admin, and coupons —
config('app.is_saas')(config/app.php). - Demo mode blocks state-changing HTTP verbs via
DemoModeMiddleware—config('app.is_demo'). - All role permissions are hardcoded in
PermissionSeederandRoleSeeder; 286 permissions across 31 modules.
- Confirmed vs inferred: the core business objectives above are inferred from implementation; if the project was commissioned against signed specifications, those remain the source of truth. Stakeholder confirmation needed.
4. Scope
Confirmed in-scope (implemented & wired in routes + pages + models)
Authentication and registration, multi-workspace tenancy, users/roles/permissions, projects with milestones/notes/attachments, tasks with Kanban stages/comments/checklists/attachments/templates, bugs with statuses/comments/attachments, timesheets/entries/timer/approvals/reports, budgets/revisions/categories, expenses/approvals/dashboards/workflows/receipts/recurring, invoices/items/payments/public checkout through 33 gateways, contacts/companies/newsletters, email templates/notification templates, email inbox (IMAP + rules + AI), AI agent chat (Gemini), WhatsApp/Slack/Telegram/Zoom integrations, dashboards and reports, multi-language/RTL, media library, performance evaluations, landing page / custom pages.
Potential / proposed (only referenced but not wired)
- Referral program —
app/Http/Controllers/ReferralController.phpexists, but all referral routes are commented out inroutes/web.phplines 521–527. Implementation status: backend present, UI page exists (referral/index.tsx), routes disabled. - Social login / Google2FA —
users.google2fa_enable/secretandcreated_bycolumns; only'verified'middleware gated onemailVerificationsetting. No social-login controller observed. - VCard import/export — mentioned in README; export route not found in web.php for vCards.
- Browser push notifications / cloud backup / SSO — no evidence.
- Expense report CSV export —
ExpenseReportController::exportreturns{"message":"Export functionality coming soon"}(line 155) — placeholder, not implemented. - Slack settings GET endpoint — route
slack.settings(GET) points toSlackSettingsController::getSettings, which does not exist (onlyupdate,testWebhook). Minor documentation/feature gap.
Out of scope
No explicit signed statement of scope was found in the repository. A BUSINESS.md (31 KB) file exists and should be treated as the authoritive business proposal. (Its contents were not quoted in this draft; cross-read recommended.)
5. Stakeholders and User Classes
Source: database/seeders/RoleSeeder.php and PermissionSeeder.php (286 permissions).
| Role | Description / access boundary |
|---|---|
super admin | SaaS operator. Sees all companies/workspaces, all permissions. Only created when isSaasMode(). |
company | Tenant owner (law firm). Manages users/workspaces/projects/settings/billing. |
owner | Alternate label "Owner with read-only access" but receives same grant set as company (RoleSeeder). (Ambiguity — stakeholder confirmation needed: "owner" currently gets full company permissions.) |
manager | Firm manager: scoped subset (dashboard, projects, tasks, bugs, timesheets, budget, expenses, invoice, media, report). |
member | Staff lawyer/worker: explicit allow-list including work hours timer. |
client | External client view rights (projects, invoices, bug views). |
Access enforcement is roles-based (Spatie in SaaS mode, in non-SaaS mode uses the workspace_members.role column without Spatie — see System doc §4). End users can only access their current workspace (users.current_workspace_id).
6. Functional Requirements
Full canonical list: Part I - Software Requirements Specification, Chapter 2 (Functional Requirements Register). Summary modules:
- FR-AUTH (authentication & registration, 15 requirements)
- FR-WORKSPACE (workspaces & members, 12 reqs)
- FR-COMPANY (SaaS companies/billing, 14 reqs)
- FR-PROJECT (project lifecycle, 18 reqs)
- FR-TASK (tasks & kanban, 15 reqs)
- FR-BUG (bug tracking, 7 reqs)
- FR-TIMESHEET (timesheets/entries/timer/approvals, 11 reqs)
- FR-BUDGET (budgets & revisions, 8 reqs)
- FR-EXPENSE (expenses & workflow, 13 reqs)
- FR-INVOICE (invoices & payments, 14 reqs)
- FR-MEDIA (media library, 4 reqs)
- FR-COMM (contacts, newsletters, notifications, 7 reqs)
- FR-EMAIL (IMAP inbox & rules, 14 reqs)
- FR-AI-EMAIL (Gemini-based email assignment, 9 reqs)
- FR-AI-AGENT (in-app assistant, 10 reqs)
- FR-REPORTS (dashboards & reports, 8 reqs)
- FR-ADMIN (Plans, Coupons, Roles/Permissions, Languages, Landing CMS, templates, integrations settings, 22 reqs)
- FR-INT (WhatsApp/Slack/Telegram/Zoom/email delivery, 13 reqs)
Total: 214 functional requirements, each labelled Implemented & Verified / Partially Implemented / Present but Unverified / Not Found / Stakeholder Confirmation Required.
7. Non-Functional Requirements
Full canonical list: Part I - Software Requirements Specification, Chapter 3 (Non-Functional Requirements Register). Key points:
- Security: session-based auth, CSRF exceptions only for callbacks, owned workspace guard; notable gaps: plaintext fallback IMAP password in
config/imap.php, password hashes nullable in migration, no.envshipped, demo mode. - Performance: no stated SLA; indexes present on audit/migration;
withoutOverlapping()scheduled tasks. - Availability: no redundancy/uptime SLA defined (To Be Confirmed).
- Accessibility & locale: 16 locales enabled (ar, da, de, en, es, fr, he, hi, it, ja, nl, pl, pt, ru, tr, zh-CN) per
resources/lang/language.json, of paths claimed 22 in README (mismatch). - Maintainability: MVC+Service+Repository; conventional routes; 380 JS files. Test coverage none at app level (no
tests/directory). Major NFR gap.
8. Business Rules
| ID | Rule | Evidence | Type |
|---|---|---|---|
| BR-001 | A user may only operate on the current workspace (users.current_workspace_id). | HandleInertiaRequests; User scopes. | Verified implementation. |
| BR-002 | Demo mode blocks all non-GET requests (and some POSTs). | DemoModeMiddleware; config IS_DEMO. | Verified. |
| BR-003 | Plan limits restrict workspaces/users/clients/managers/projects/file uploads in SaaS mode; superadmin bypasses. | PlanLimitService::short-circuit for non-SaaS. | Verified. |
| BR-004 | Expired/missing plan redirects user to plans.index with plan reset. | CheckPlanAccess. | Verified. |
| BR-005 | Suspended workspace blocks state changes for member/client, allows owner/superadmin GET-only. | CheckWorkspaceSuspension. | Verified. |
| BR-006 | Task stage change emits events and drives task_events (assigned/submitted/returned/approved) based on stage name. | TaskObserver (stage name substring matching). | Verified — name-matching is fragile. |
| BR-007 | Multi-assignee is stored via task_members but Task model $fillable omits allow_multi_assign → cannot be set through mass-assignment. | app/Models/Task.php. | Inconsistency (gap). |
| BR-008 | Plan column added ai_monthly_price_limit renamed; Setting/Plan fillable lists ai_monthly_token_limit instead. | migrations 2026-03-04 + Plan.php. | Inconsistency (gap). |
| BR-009 | Currency/role invoices require manual gateway credentials from UI; only bank and manually are enabled by default. | PaymentSettingController defaults. | Verified. |
| BR-010 | New workspace gets default task stages + bug statuses automatically. | WorkspaceObserver::created. | Verified. |
| BR-011 | AI assignment uses Gemini; falls back to rule-based automation when key absent/token exceeded/AI returns false. | EmailAIAssignmentService + EmailAutomationService. | Verified. |
| BR-012 | Email account password is encrypted at rest by accessor/mutator. | EmailAccount mutators. | Verified (plaintext fallback in default config is separate). |
| BR-013 | Inbound email domain filtering follows filter_type (none/whitelist/blocklist) on account + allowed_email_senders on workspace; wildcards supported. | EmailListenerService::processSingleMessage. | Verified. |
| BR-014 | New project auto-creation only when AUTO settings enabled at account level. | EmailAutomationService::processNewMessage. | Verified. |
| BR-015 | Cost limit on AI agent = ai_monthly_price_limit precedence workspace → plan → global. | AiAgentService::getPriceLimitForWorkspace. | Verified. |
| BR-016 | Rate limit 30 AI chat messages/hr per user (cache key). | AiAgentService::chat first guard. | Verified. |
| BR-017 | Communication messages (task chat) are manager-gated (manager_approved). | Communications migration. | Verified. |
| BR-018 | User is not creatable with a default plan outside SaaS. | UserObserver only when isSaasMode; SulkanCompanySeeder sets no password. | Verified. |
9. Use Cases
Full text: Part I - Software Requirements Specification, Chapter 4 (Use Cases and Acceptance Criteria). Core ones: UC-REG (register/verify), UC-WS-SWITCH, UC-PROJECT-CREATE, UC-TASK-BOARD, UC-TIMESHEET-APPROVE, UC-EXPENSE-APPROVAL, UC-INVOICE-CHECKOUT, UC-EMAIL-INGEST-AI, UC-AI-CHAT, UC-EVAL-FIRM.
10. Data Requirements
- Business data ownership: Workspace is the tenancy root; all
workspace_idcolumns are either explicit or implied viaproject_id. Sub-entities (tasks, expenses) are scoped via parent project. - Sensitive data categories handled: IMAP passwords (encrypted), API keys in
Setting, payment gateway credentials, legal content in email bodies, invoices/clients, audit logs, performance metrics. - Validation/integrity: foreign keys declared in migrations; unique keys (email, slug, invoice number, unique email+workspace, payment settings); unique (workspace, month) on AI token usage.
- Data retention/deletion: many models use softDeletes? Only
projects(andtasks? Migration showstaskswithsoftDeletesper manual). Deletion cascades: must be audited per table. Stakeholder confirmation needed for retention period/regulatory requirements (e.g., legal records retention). - Multi-language:
TaskTemplate/EmailTemplate/NotificationTemplateimplement per-language child tables.
11. External Interfaces
| System | Mode | Where configured | Status |
|---|---|---|---|
Google Gemini (model default gemini-3-pro-preview) | Outbound AI | Setting.geminiKey/geminiModel, AiAgentService/EmailAIAssignmentService. | Implemented & verified. |
| OpenAI | Outbound (ChatGptController demo) | config/openai.php, OPENAI_API_KEY. | Implemented. |
| IMAP/Gmail | Inbound email sync + push | config/imap.php, EmailAccount. | Implemented. |
| Outbound per-number | WhatsAppController, driver ultramsg/twilio. | Implemented. | |
| Slack | Outbound webhook | SlackService, settings. | Implemented. |
| Telegram | Outbound webhook | TelegramSettingsController. | Implemented. |
| Zoom | REST + meetings | ZoomService, project/team members. | Implemented (OAuth data model strongly indicates it; full scope unverified). |
| Payment gateways (Stripe, PayPal, … 33) | Outbound + inbound callback | InvoicePaymentController + *PaymentController. | Implemented; many stubs not individually verified. |
| Storage S3/Disk | object storage | config/filesystems.php, DynamicStorageService. | Config present; usage verified for media. |
| Google Calendar sync | Zoom option | ZoomMeeting sync_google_calendar. | Claimed in model fillable, no column observed in migration (potential backlog). |
12. Constraints, Assumptions, Dependencies
- PHP ^8.2, Laravel Framework ^12, Node ESM, Vite 6.
- DB: MySQL (production assumed) or SQLite (local). Redis optional.
- Queue worker recommended
php artisan queue:work --tries=3 --timeout=600. - Scheduler requires cron.
- WebSocket is not used (no broadcast standard config beyond default).
- No
.env.exampletracked — install scripts expect it and fallback is broken; operational risk. - Demo/extension of platform expects assets via
build-ui/remote builder.
13. Acceptance Criteria
See Part I - Software Requirements Specification, Chapter 4 (Use Cases and Acceptance Criteria). Criteria follow Given/When/Then and are required to be validated by QA; no acceptance claim is made here.
14. Requirements Traceability
See Part I - Software Requirements Specification, Chapter 5 (Requirements Traceability). Includes IDs, module/delivery, source, implementation status.
15. Open Questions and Stakeholder Decisions (must be resolved before SRS becomes contractual)
- Scope authority: which is the signed spec — the
BUSINESS.md(31 KB) file, or stakeholder verbal requirements? - Roles: is
ownerread-only or full-access (seed shows fullcompanygrants)? (database/seeders/RoleSeeder.php). - Languages: README claims 22 languages; app config enables 16. Which is required?
- Tests: no test suite at all. Minimum coverage threshold to be agreed. (Phase 6 NFR-gating.)
- Data retention: retention policy & legal records requirements unspecified; required due to multi-tenant legal data.
- AI cost basis & pricing: AI charges in USD per token; max token limit configuration
ai_monthly_price_limitvsai_monthly_token_limitmismatch. - Payment/finance gateway enable flags: only web-push/channel list of 33 gateways. Which should be supported out-of-the-box in UAT?
- Vocabulary "case" vs "project": domain model calls them
projects, UI likely says projects; confirm whether a legalcaseentity separate from project is needed. - Currency accuracy in consultant's monthly reports / invoice currency.
- Production deployment baseline (managed hosting, no CF/infra declared). See Technical doc.
- AI model privacy / confidentiality: inbound email body is sent to Gemini — data-sharing acceptance needed by the law firm clients.
- Cross-user data isolation audit under SOC-equivalent policies — see Security Review.