feat(registratura): redesign CU deadline tracking — direction filtering, CJ toggle, auto-track, verification badge
- CU has NO tacit approval on any entry - Direction-dependent categories: iesiri (CU, Avize, Completari, Urbanism, Autorizare), intrari (Contestatie) - Rename: Analiza → Urbanism (PUD/PUZ/PUG), Autorizare (AC) → Autorizare (AD/AC) - Auto-track deadlines: cu-verificare (10zl) created automatically with CU emitere - CJ toggle: auto-creates arhitect-sef solicita aviz (3zc) + primar emite aviz (5zc) - Verification badge: after 10 days shows "Nu mai pot returna documentatia" - Prelungire helper: CU issue date + 6/12/24 month calculator - cu-prelungire-emitere changed to 30zc (practica administrativa) - New DeadlineTypeDef fields: autoTrack, directionFilter Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -238,10 +238,52 @@ export function RegistryEntryForm({
|
||||
const handleAddDeadline = (
|
||||
typeId: string,
|
||||
startDate: string,
|
||||
chainParentId?: string,
|
||||
options?: { isCJ?: boolean; chainParentId?: string },
|
||||
) => {
|
||||
const tracked = createTrackedDeadline(typeId, startDate, chainParentId);
|
||||
if (tracked) setTrackedDeadlines((prev) => [...prev, tracked]);
|
||||
const tracked = createTrackedDeadline(
|
||||
typeId,
|
||||
startDate,
|
||||
options?.chainParentId,
|
||||
);
|
||||
if (tracked) {
|
||||
const newDeadlines = [tracked];
|
||||
|
||||
// Auto-create verification deadline for CU emitere types
|
||||
const isCUEmitere =
|
||||
typeId === "cu-emitere-l50" || typeId === "cu-emitere-l350";
|
||||
if (isCUEmitere) {
|
||||
const verification = createTrackedDeadline(
|
||||
"cu-verificare",
|
||||
startDate,
|
||||
);
|
||||
if (verification) newDeadlines.push(verification);
|
||||
}
|
||||
|
||||
// Auto-create CJ sub-deadlines if CJ toggle is on
|
||||
if (isCUEmitere && options?.isCJ) {
|
||||
const cjRequest = createTrackedDeadline(
|
||||
"cu-cj-solicitare-aviz",
|
||||
startDate,
|
||||
);
|
||||
if (cjRequest) {
|
||||
newDeadlines.push(cjRequest);
|
||||
// Chain: primar responds 5 days from when arhitect-sef requests (3 days from start)
|
||||
const requestDue = new Date(startDate);
|
||||
requestDue.setDate(requestDue.getDate() + 3);
|
||||
const y = requestDue.getFullYear();
|
||||
const m = String(requestDue.getMonth() + 1).padStart(2, "0");
|
||||
const d = String(requestDue.getDate()).padStart(2, "0");
|
||||
const cjResponse = createTrackedDeadline(
|
||||
"cu-cj-aviz-primar",
|
||||
`${y}-${m}-${d}`,
|
||||
cjRequest.id,
|
||||
);
|
||||
if (cjResponse) newDeadlines.push(cjResponse);
|
||||
}
|
||||
}
|
||||
|
||||
setTrackedDeadlines((prev) => [...prev, ...newDeadlines]);
|
||||
}
|
||||
};
|
||||
|
||||
const handleResolveDeadline = (
|
||||
@@ -1394,6 +1436,7 @@ export function RegistryEntryForm({
|
||||
open={deadlineAddOpen}
|
||||
onOpenChange={setDeadlineAddOpen}
|
||||
entryDate={date}
|
||||
direction={direction}
|
||||
onAdd={handleAddDeadline}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user