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:
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { Clock, CheckCircle2, X, History } from "lucide-react";
|
||||
import { Clock, CheckCircle2, X, History, ShieldCheck, Building2 } from "lucide-react";
|
||||
import { Badge } from "@/shared/components/ui/badge";
|
||||
import { Button } from "@/shared/components/ui/button";
|
||||
import type { TrackedDeadline } from "../types";
|
||||
@@ -42,6 +42,19 @@ export function DeadlineCard({
|
||||
const [showAudit, setShowAudit] = useState(false);
|
||||
const auditLog = deadline.auditLog ?? [];
|
||||
|
||||
const isAutoTrack = def?.autoTrack === true;
|
||||
const isVerificationDeadline = deadline.typeId === "cu-verificare";
|
||||
const isCJDeadline =
|
||||
deadline.typeId === "cu-cj-solicitare-aviz" ||
|
||||
deadline.typeId === "cu-cj-aviz-primar";
|
||||
|
||||
// For verification deadlines, check if the 10-day period has passed
|
||||
const verificationExpired =
|
||||
isVerificationDeadline &&
|
||||
deadline.resolution === "pending" &&
|
||||
status.daysRemaining !== null &&
|
||||
status.daysRemaining < 0;
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
@@ -50,12 +63,25 @@ export function DeadlineCard({
|
||||
)}
|
||||
>
|
||||
<div className="flex items-center gap-3">
|
||||
<Clock className="h-4 w-4 shrink-0 text-muted-foreground" />
|
||||
{isAutoTrack ? (
|
||||
isCJDeadline ? (
|
||||
<Building2 className="h-4 w-4 shrink-0 text-amber-500" />
|
||||
) : (
|
||||
<ShieldCheck className="h-4 w-4 shrink-0 text-blue-500" />
|
||||
)
|
||||
) : (
|
||||
<Clock className="h-4 w-4 shrink-0 text-muted-foreground" />
|
||||
)}
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex items-center gap-2 flex-wrap">
|
||||
<span className="text-sm font-medium truncate">
|
||||
{def?.label ?? deadline.typeId}
|
||||
</span>
|
||||
{isAutoTrack && (
|
||||
<Badge variant="outline" className="text-[10px] text-purple-600 border-purple-300">
|
||||
auto
|
||||
</Badge>
|
||||
)}
|
||||
<Badge
|
||||
className={cn(
|
||||
"text-[10px] border-0",
|
||||
@@ -67,21 +93,30 @@ export function DeadlineCard({
|
||||
<span className="ml-1">
|
||||
(
|
||||
{status.daysRemaining < 0
|
||||
? `${Math.abs(status.daysRemaining)}z depășit`
|
||||
? `${Math.abs(status.daysRemaining)}z depasit`
|
||||
: `${status.daysRemaining}z`}
|
||||
)
|
||||
</span>
|
||||
)}
|
||||
</Badge>
|
||||
</div>
|
||||
{/* Verification badge: institution lost right to return docs */}
|
||||
{verificationExpired && (
|
||||
<div className="flex items-center gap-1 mt-1">
|
||||
<Badge className="text-[10px] border-0 bg-emerald-100 text-emerald-800 dark:bg-emerald-900 dark:text-emerald-200">
|
||||
<ShieldCheck className="h-3 w-3 mr-0.5" />
|
||||
Nu mai pot returna documentatia
|
||||
</Badge>
|
||||
</div>
|
||||
)}
|
||||
<div className="text-xs text-muted-foreground mt-0.5">
|
||||
{def?.isBackwardDeadline ? "Termen limită" : "Start"}:{" "}
|
||||
{def?.isBackwardDeadline ? "Termen limita" : "Start"}:{" "}
|
||||
{formatDate(deadline.startDate)}
|
||||
{" → "}
|
||||
{def?.isBackwardDeadline ? "Depunere până la" : "Termen"}:{" "}
|
||||
{" \u2192 "}
|
||||
{def?.isBackwardDeadline ? "Depunere pana la" : "Termen"}:{" "}
|
||||
{formatDate(deadline.dueDate)}
|
||||
{def?.dayType === "working" && (
|
||||
<span className="ml-1">(zile lucrătoare)</span>
|
||||
<span className="ml-1">(zile lucratoare)</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user