feat: avize deadline restructure with interruption mechanism + comisie toggle
- Add "Necesita analiza in comisie" toggle for avize category (mirrors CJ toggle)
- When OFF: auto-creates 5-day working limit for completari requests
- When ON: no limit (institution can request completions anytime)
- Add interruption mechanism: resolve aviz as "intrerupt" when institution
requests completions → auto-creates new 15-day deadline from completions date
- New resolution type "intrerupt" with yellow badge + chain support
- Restructure avize catalog entries:
- aviz-ac-15 (L50) and aviz-urbanism-30 (L350) now have chain to
aviz-emitere-dupa-completari for interruption flow
- aviz-mediu: updated hints about procedure closure prerequisite
- aviz-cultura-comisie: 2-phase with auto-track depunere la comisie (30 days)
- aeronautica, ISU, transport-eu: all get interruption chain
- 3 new auto-track entries: aviz-completari-limit (5zl), aviz-emitere-dupa-completari
(15zc), aviz-cultura-depunere-comisie (30zc)
- New document type: "Convocare sedinta"
- Info boxes in dialog explaining auto-track behavior + interruption mechanism
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -256,7 +256,7 @@ export function RegistryEntryForm({
|
||||
const handleAddDeadline = (
|
||||
typeId: string,
|
||||
startDate: string,
|
||||
options?: { isCJ?: boolean; chainParentId?: string },
|
||||
options?: { isCJ?: boolean; isComisie?: boolean; chainParentId?: string },
|
||||
) => {
|
||||
const tracked = createTrackedDeadline(
|
||||
typeId,
|
||||
@@ -300,6 +300,25 @@ export function RegistryEntryForm({
|
||||
}
|
||||
}
|
||||
|
||||
// Auto-create completari limit for avize (when Comisie toggle is OFF)
|
||||
const addedDef = getDeadlineType(typeId);
|
||||
if (addedDef?.category === "avize" && !options?.isComisie) {
|
||||
const completariLimit = createTrackedDeadline(
|
||||
"aviz-completari-limit",
|
||||
startDate,
|
||||
);
|
||||
if (completariLimit) newDeadlines.push(completariLimit);
|
||||
}
|
||||
|
||||
// Auto-create Cultura Phase 1 (depunere la comisie) when adding cultura-comisie
|
||||
if (typeId === "aviz-cultura-comisie") {
|
||||
const culturaPhase1 = createTrackedDeadline(
|
||||
"aviz-cultura-depunere-comisie",
|
||||
startDate,
|
||||
);
|
||||
if (culturaPhase1) newDeadlines.push(culturaPhase1);
|
||||
}
|
||||
|
||||
// Auto-create comunicare catre beneficiar for all iesit deadlines
|
||||
// (legal obligation: institution must communicate on the day of issuance)
|
||||
if (direction === "iesit") {
|
||||
@@ -325,7 +344,8 @@ export function RegistryEntryForm({
|
||||
prev.map((d) => (d.id === resolved.id ? resolved : d)),
|
||||
);
|
||||
|
||||
if (chainNext) {
|
||||
// Standard chain (completed / aprobat-tacit)
|
||||
if (chainNext && resolution !== "intrerupt") {
|
||||
const def = getDeadlineType(resolvingDeadline.typeId);
|
||||
if (def?.chainNextTypeId) {
|
||||
const resolvedDate = new Date().toISOString().slice(0, 10);
|
||||
@@ -337,6 +357,34 @@ export function RegistryEntryForm({
|
||||
if (chained) setTrackedDeadlines((prev) => [...prev, chained]);
|
||||
}
|
||||
}
|
||||
|
||||
// Interruption chain — institution requested completions, term interrupted
|
||||
// Creates chained deadline with today as placeholder start date
|
||||
// User must update start date when completions are actually submitted
|
||||
if (resolution === "intrerupt") {
|
||||
const def = getDeadlineType(resolvingDeadline.typeId);
|
||||
if (def?.chainNextTypeId) {
|
||||
const today = new Date().toISOString().slice(0, 10);
|
||||
const chained = createTrackedDeadline(
|
||||
def.chainNextTypeId,
|
||||
today,
|
||||
resolvingDeadline.id,
|
||||
);
|
||||
if (chained) {
|
||||
chained.auditLog = [
|
||||
...(chained.auditLog ?? []),
|
||||
{
|
||||
action: "modified",
|
||||
timestamp: new Date().toISOString(),
|
||||
detail:
|
||||
"ATENTIE: Actualizati data start cand se depun completarile/clarificarile",
|
||||
},
|
||||
];
|
||||
setTrackedDeadlines((prev) => [...prev, chained]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setResolvingDeadline(null);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user