feat(registratura): 3.02 bidirectional integration, simplified status, threads

- Dynamic document types: string-based DocumentType synced with Tag Manager
  (new types auto-create tags under 'document-type' category)
- Added default types: 'Apel telefonic', 'Videoconferinta'
- Bidirectional Address Book: quick-create contacts from sender/recipient/
  assignee fields via QuickContactDialog popup
- Simplified status: Switch toggle replaces dropdown (default open)
- Responsabil (Assignee) field with contact autocomplete (ERP-ready)
- Entry threads: threadParentId links entries as replies, ThreadView shows
  parent/current/children tree with branching support
- Info tooltips on deadline, status, and assignee fields
- New Resp. column and thread icon in registry table
- All changes backward-compatible with existing data
This commit is contained in:
AI Assistant
2026-02-27 15:33:29 +02:00
parent b2618c041d
commit 2be0462e0d
10 changed files with 1199 additions and 273 deletions
+20 -11
View File
@@ -252,7 +252,7 @@
**Status:** ✅ Done. Sidebar redesigned: logos in centered row (flex-1, theme-aware, dual-render light+dark), "ArchiTools" text below, animated theme toggle (Sun/Moon lucide icons, gradient background, stars/clouds).
### 3.02 `[BUSINESS]` Registratura — Integrare și UX
### 3.02 `[BUSINESS]` Registratura — Integrare și UX (2026-02-27)
**Cerințe noi:**
@@ -263,6 +263,14 @@
- **Pregătire Integrare ERP (Responsabil):** Adăugarea unui câmp "Responsabil" (Assignee) pentru a aloca sarcini interne, gândit arhitectural pentru a putea fi expus/sincronizat ușor printr-un API/Webhook viitor către un sistem ERP extern.
- **Legături între intrări/ieșiri (Thread-uri & Branches):** Posibilitatea de a lega o ieșire de o intrare specifică (ex: "Răspuns la adresa nr. X"), creând un "fir" (thread) vizual al conversației instituționale. Trebuie să suporte și "branching" (ex: o intrare generează mai multe ieșiri conexe către instituții diferite). UI-ul trebuie să rămână extrem de simplu și intuitiv (ex: vizualizare tip arbore simplificat sau listă indentată în detaliile documentului).
**Status:** ✅ Done. All 6 sub-features implemented:
1. **Dynamic doc types** — Select + inline "Tip nou" input. New types auto-created as Tag Manager tags (category: document-type). Added "Apel telefonic" and "Videoconferință" as defaults.
2. **Bidirectional Address Book** — Autocomplete shows "Creează contact" button when no match. QuickContactDialog popup creates contact in Address Book with minimal data (Name required, Phone/Email optional).
3. **Simplified status** — Replaced Status dropdown with Switch toggle "Închis/Deschis". Default is open.
4. **Internal deadline tooltip** — Added Info tooltip explaining "Termen limită intern" vs legal deadlines. Also added tooltips on "Închis" and "Responsabil" fields.
5. **Responsabil (Assignee)** — New field with contact autocomplete + quick-create. ERP-ready with separate assigneeContactId. Shown in registry table as "Resp." column.
6. **Threads & Branching**`threadParentId` field links entries as reply-to. Thread search with direction badges. ThreadView component shows parent, current entry, siblings (branches), and child replies as indented tree. Thread icon in table. Click to navigate between threaded entries.
### 3.03 `[BUSINESS]` Registratura — Termene Legale (Flux Nou)
**Cerințe noi:**
@@ -519,6 +527,7 @@ AI_DEFAULT_MODEL=claude-sonnet-4-6-20261001
**Status:** ✅ Done. NextAuth v4 + Authentik OIDC provider configured. Group→role mapping (authentik groups → admin/manager/user). Group→company mapping (beletage/urban-switch/studii-de-teren). Cookie-based session. `useAuth()` returns real user. Header shows user name/email + logout. Sign in with Authentik page works.
Env vars (hardcoded in docker-compose.yml for Portainer CE):
- `NEXTAUTH_URL=https://tools.beletage.ro`
- `NEXTAUTH_SECRET`, `AUTHENTIK_CLIENT_ID`, `AUTHENTIK_CLIENT_SECRET`, `AUTHENTIK_ISSUER`
@@ -661,16 +670,16 @@ Env vars (hardcoded in docker-compose.yml for Portainer CE):
## Infrastructure Credentials Needed
| Service | What | When Needed | Status |
| ------------------------ | --------------------------------------- | ------------------- | ------ |
| **US/SDT Logos** | SVG/PNG logo files | Phase 1 (task 1.01) | ✅ Done |
| **US/SDT Addresses** | Office addresses for email signature | Phase 1 (task 1.02) | ✅ Done (placeholder) |
| **Anthropic API Key** | `sk-ant-...` from console.anthropic.com | Phase 5 (task 5.01) | Pending |
| **OpenAI API Key** | `sk-...` from platform.openai.com | Phase 5 (task 5.01) | Pending |
| **Authentik Admin** | Login to create OAuth app at :9100 | Phase 6 (task 6.01) | ✅ Done |
| **MinIO Credentials** | Access key + secret key for :9003 | Phase 7 (task 7.04) | ✅ Done |
| **PostgreSQL** | Database + password | Phase 7 (task 7.01) | ✅ Done |
| **Gitea Actions Runner** | Registration token from Gitea admin | Phase 10 (task 10.01) | Pending |
| Service | What | When Needed | Status |
| ------------------------ | --------------------------------------- | --------------------- | --------------------- |
| **US/SDT Logos** | SVG/PNG logo files | Phase 1 (task 1.01) | ✅ Done |
| **US/SDT Addresses** | Office addresses for email signature | Phase 1 (task 1.02) | ✅ Done (placeholder) |
| **Anthropic API Key** | `sk-ant-...` from console.anthropic.com | Phase 5 (task 5.01) | Pending |
| **OpenAI API Key** | `sk-...` from platform.openai.com | Phase 5 (task 5.01) | Pending |
| **Authentik Admin** | Login to create OAuth app at :9100 | Phase 6 (task 6.01) | ✅ Done |
| **MinIO Credentials** | Access key + secret key for :9003 | Phase 7 (task 7.04) | ✅ Done |
| **PostgreSQL** | Database + password | Phase 7 (task 7.01) | ✅ Done |
| **Gitea Actions Runner** | Registration token from Gitea admin | Phase 10 (task 10.01) | Pending |
---