feat(registratura): remove publicitate category, auto-track comunicare, late receipt badge, AC validity conditional
- Remove publicitate/comunicare category entirely (AC publicity handled by AC validity tracker) - comunicare-aviz-beneficiar moved to auto-track: created alongside any iesit deadline - Late receipt badge on incoming aviz entries: shows "Primit cu X zile intarziere" when document date < today - Valabilitate document + AC Validity Tracker visible only when documentType is "aviz" (act administrativ) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -282,6 +282,16 @@ export function RegistryEntryForm({
|
||||
}
|
||||
}
|
||||
|
||||
// Auto-create comunicare catre beneficiar for all iesit deadlines
|
||||
// (legal obligation: institution must communicate on the day of issuance)
|
||||
if (direction === "iesit") {
|
||||
const comunicare = createTrackedDeadline(
|
||||
"comunicare-aviz-beneficiar",
|
||||
startDate,
|
||||
);
|
||||
if (comunicare) newDeadlines.push(comunicare);
|
||||
}
|
||||
|
||||
setTrackedDeadlines((prev) => [...prev, ...newDeadlines]);
|
||||
}
|
||||
};
|
||||
@@ -787,6 +797,32 @@ export function RegistryEntryForm({
|
||||
nr. secvențial.
|
||||
</p>
|
||||
)}
|
||||
{/* Late receipt indicator for incoming admin acts */}
|
||||
{direction === "intrat" &&
|
||||
documentType === "aviz" &&
|
||||
date &&
|
||||
(() => {
|
||||
const docDate = new Date(date);
|
||||
const today = new Date();
|
||||
docDate.setHours(0, 0, 0, 0);
|
||||
today.setHours(0, 0, 0, 0);
|
||||
const diffDays = Math.floor(
|
||||
(today.getTime() - docDate.getTime()) / (1000 * 60 * 60 * 24),
|
||||
);
|
||||
if (diffDays > 0) {
|
||||
return (
|
||||
<p className="text-[10px] text-orange-600 dark:text-orange-400 mt-0.5 flex items-center gap-1">
|
||||
<span>
|
||||
Actul are data emiterii cu {diffDays}{" "}
|
||||
{diffDays === 1 ? "zi" : "zile"} in urma — primit cu
|
||||
intarziere fata de obligatia de comunicare in ziua
|
||||
emiterii (L350 art. 44).
|
||||
</span>
|
||||
</p>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
})()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1138,11 +1174,13 @@ export function RegistryEntryForm({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Document Expiry — CU/AC validity tracking */}
|
||||
{/* Document Expiry — CU/AC validity tracking (only for act administrativ) */}
|
||||
{documentType === "aviz" && (
|
||||
<>
|
||||
<div className="rounded-md border border-muted p-3 space-y-3">
|
||||
<Label className="flex items-center gap-1.5 text-sm font-medium">
|
||||
<Calendar className="h-3.5 w-3.5" />
|
||||
Valabilitate document
|
||||
Valabilitate act administrativ
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
@@ -1150,8 +1188,8 @@ export function RegistryEntryForm({
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="right" className="max-w-xs">
|
||||
<p className="text-xs">
|
||||
Pentru documente cu termen de valabilitate (CU, AC etc.).
|
||||
Sistemul va genera alerte înainte de expirare.
|
||||
Pentru acte administrative cu termen de valabilitate (CU,
|
||||
AC, avize). Sistemul genereaza alerte inainte de expirare.
|
||||
</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
@@ -1217,6 +1255,8 @@ export function RegistryEntryForm({
|
||||
onChange={setAcValidity}
|
||||
entryDate={date}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* Web scraping prep — external tracking */}
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
|
||||
Reference in New Issue
Block a user