fix(registratura): prevent duplicate numbers, add upload progress, submission lock, unified close/resolve, backdating support

- generateRegistryNumber: parse max existing number instead of counting entries
- addEntry: fetch fresh entries before generating number (race condition fix)
- Form: isSubmitting lock prevents double-click submission
- Form: uploadingCount tracks FileReader progress, blocks submit while uploading
- Form: submit button shows Loader2 spinner during save/upload
- CloseGuardDialog: added ClosureResolution selector (finalizat/aprobat-tacit/respins/retras/altele)
- ClosureBanner: displays resolution badge
- Types: ClosureResolution type, registrationDate field on RegistryEntry
- Date field renamed 'Data document' with tooltip explaining backdating
- Registry table shows '(înr. DATE)' when registrationDate differs from document date
This commit is contained in:
AI Assistant
2026-02-27 21:56:47 +02:00
parent db6662be39
commit 8042df481f
7 changed files with 403 additions and 185 deletions
@@ -71,7 +71,7 @@ export function RegistryTable({
<thead>
<tr className="border-b bg-muted/40">
<th className="px-3 py-2 text-left font-medium">Nr.</th>
<th className="px-3 py-2 text-left font-medium">Data</th>
<th className="px-3 py-2 text-left font-medium">Data doc.</th>
<th className="px-3 py-2 text-left font-medium">Dir.</th>
<th className="px-3 py-2 text-left font-medium">Tip</th>
<th className="px-3 py-2 text-left font-medium">Subiect</th>
@@ -103,6 +103,15 @@ export function RegistryTable({
</td>
<td className="px-3 py-2 text-xs whitespace-nowrap">
{formatDate(entry.date)}
{entry.registrationDate &&
entry.registrationDate !== entry.date && (
<span
className="block text-[10px] text-muted-foreground"
title={`Înregistrat pe ${formatDate(entry.registrationDate)}`}
>
(înr. {formatDate(entry.registrationDate)})
</span>
)}
</td>
<td className="px-3 py-2">
<Badge