From b0f27053aef935adab6bd720a25953fbd3971e85 Mon Sep 17 00:00:00 2001 From: AI Assistant Date: Thu, 12 Mar 2026 19:38:15 +0200 Subject: [PATCH] feat(registratura): AC validity 12/24 months + reminder config in Ghid termene - Add ACValidityPeriod type (12 | 24) and validityMonths field to ACValidityTracking - Replace hardcoded 12-month validity with configurable dropdown (12/24 luni) - Update computed dates, reminder counter, and tooltip to use selected period - Add "Configurare remindere si alerte" section in Ghid termene with: - Threshold table (urgent 5z, depasit 0z, CU alert 30z, AC monthly, prelungire 45z lucr, anuntare 10z cal, transmitere 1z) - Pause/resume explanation for clarification requests - Update AC expiry description to mention configurable 12/24 month validity Co-Authored-By: Claude Opus 4.6 --- .../components/ac-validity-tracker.tsx | 47 +++++-- .../components/deadline-config-overview.tsx | 121 +++++++++++++++++- src/modules/registratura/types.ts | 4 + 3 files changed, 162 insertions(+), 10 deletions(-) diff --git a/src/modules/registratura/components/ac-validity-tracker.tsx b/src/modules/registratura/components/ac-validity-tracker.tsx index 68bc49a..2bfad9d 100644 --- a/src/modules/registratura/components/ac-validity-tracker.tsx +++ b/src/modules/registratura/components/ac-validity-tracker.tsx @@ -39,6 +39,7 @@ import { import { Textarea } from "@/shared/components/ui/textarea"; import type { ACValidityTracking, + ACValidityPeriod, ACExecutionDuration, ACPhase, } from "../types"; @@ -52,6 +53,11 @@ interface ACValidityTrackerProps { entryDate: string; } +const VALIDITY_LABELS: Record = { + 12: "12 luni", + 24: "24 luni", +}; + const EXECUTION_LABELS: Record = { 6: "6 luni", 12: "12 luni", @@ -158,9 +164,10 @@ export function ACValidityTracker({ now.setHours(0, 0, 0, 0); const today = now.toISOString().slice(0, 10); - // 12-month validity period + // Configurable validity period (12 or 24 months) + const validityMonths = ac.validityMonths ?? 12; const validityEnd = new Date(issuance); - validityEnd.setMonth(validityEnd.getMonth() + 12); + validityEnd.setMonth(validityEnd.getMonth() + validityMonths); const validityEndStr = validityEnd.toISOString().slice(0, 10); const daysToValidityEnd = daysBetween(today, validityEndStr); const monthsToValidityEnd = monthsBetween(today, validityEndStr); @@ -243,10 +250,10 @@ export function ACValidityTracker({

- Urmărirea completă a ciclului de viață al AC: valabilitate 12 - luni, anunțare lucrări, documente obligatorii, durată - execuție, prelungire. Conform Legii 50/1991 și normelor - aferente. + Urmărirea completă a ciclului de viață al AC: valabilitate + 12 sau 24 luni (configurabil), anunțare lucrări, documente + obligatorii, durată execuție, prelungire. Conform Legii + 50/1991 și normelor aferente.

@@ -288,8 +295,8 @@ export function ACValidityTracker({ )} - {/* Issuance date + duration */} -
+ {/* Issuance date + validity period + duration */} +
+
+ + +
@@ -633,7 +662,7 @@ export function ACValidityTracker({ {ac.reminder.dismissed ? "Remindere dezactivate" - : `Reminder lunar activ (luna ${computedData.monthsToValidityEnd > 0 ? 12 - computedData.monthsToValidityEnd : 12}/12)`} + : `Reminder lunar activ (luna ${computedData.monthsToValidityEnd > 0 ? (ac.validityMonths ?? 12) - computedData.monthsToValidityEnd : (ac.validityMonths ?? 12)}/${ac.validityMonths ?? 12})`}
diff --git a/src/modules/registratura/components/deadline-config-overview.tsx b/src/modules/registratura/components/deadline-config-overview.tsx index 6c3c762..c2f9dab 100644 --- a/src/modules/registratura/components/deadline-config-overview.tsx +++ b/src/modules/registratura/components/deadline-config-overview.tsx @@ -257,6 +257,125 @@ export function DeadlineConfigOverview() {
+ {/* ── Reminder & alert configuration ── */} +
+
+ + Configurare remindere si alerte +
+ +
+

+ Praguri si intervale folosite de sistem pentru a genera alerte si notificari. Valorile se aplica automat tuturor inregistrarilor. +

+ + {/* Thresholds table */} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParametruValoareDescriere
Prag "Urgent" + + 5 zile + + + Termenele cu 5 sau mai putine zile ramase sunt marcate ca urgente (galben) si incluse in digest-ul zilnic. +
Prag "Depasit" + + 0 zile + + + Termenele depasite (dupa data scadenta) sunt marcate rosu si raportate zilnic pana la rezolvare. +
Alerta expirare CU + + 30 zile (implicit) + + + Se poate configura per inregistrare (campul "Zile alerta expirare"). Implicit 30 zile inainte de expirare. +
Reminder lunar AC + + Lunar + + + In faza de valabilitate AC, se afiseaza reminder lunar. Se poate amana (+1 luna) sau dezactiva (dismiss) per AC. +
Cerere prelungire AC + + 45 zile lucr. + + + Alerta automata: cererea de prelungire trebuie depusa cu minim 45 zile lucratoare inainte de expirarea AC/executiei. +
Anuntare lucrari AC + + 10 zile cal. + + + Lucrarile trebuie anuntate la Primarie si ISC cu minim 10 zile calendaristice inainte de incepere. +
Transmitere in termen + + 1 zi (fundal) + + + Verificare automata in fundal: actul administrativ trebuie transmis in 1 zi de la emitere. Se creeaza automat la inchidere. +
+
+ + {/* Pause/resume info */} +
+

+ + Suspendare / reluare termene (clarificari) +

+

+ Cand se primeste o solicitare de clarificari (document intrat conex), termenele active ale inregistrarii mama se suspenda automat. + La depunerea completarilor (document iesit conex), termenele se reiau, iar data scadenta se decaleaza cu numarul de zile suspendate. + Suspendarea se poate face si manual din fisa termenului. +

+
+
+
+ {/* ── Document expiry overview ── */}
@@ -280,7 +399,7 @@ export function DeadlineConfigOverview() {
Autorizatie de Construire (AC) - — validitate 12 luni de la emitere, executie 6/12/24/36 luni, prelungire +24 luni. + — valabilitate 12 sau 24 luni (configurabil per AC), executie 6/12/24/36 luni, prelungire +24 luni. Reminder lunar automat (snooze/dismiss disponibil).
diff --git a/src/modules/registratura/types.ts b/src/modules/registratura/types.ts index 2d4f54e..2d04ec7 100644 --- a/src/modules/registratura/types.ts +++ b/src/modules/registratura/types.ts @@ -226,6 +226,8 @@ export interface ACReminder { dismissed: boolean; } +export type ACValidityPeriod = 12 | 24; + /** Full AC validity tracking state */ export interface ACValidityTracking { /** Whether AC tracking is enabled for this entry */ @@ -234,6 +236,8 @@ export interface ACValidityTracking { issuanceDate: string; /** Current phase */ phase: ACPhase; + /** Validity period in months (default 12, can be 24 for special cases) */ + validityMonths?: ACValidityPeriod; /** Execution duration selected (months) */ executionDuration: ACExecutionDuration; /** Date works were announced to City Hall & ISC */