Гант: отрицательные дни, этапы До CP-0 / Договоры PreConstruction / Договор Construction, Пермит после договоров; предупреждение о сроке только при наличии зависимостей
All checks were successful
ci / test (push) Successful in 23s
ci / deploy (push) Successful in 1m30s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 09:09:12 +03:00
parent e8ac83e8a3
commit bfe6b4338b
3 changed files with 16 additions and 10 deletions

View File

@@ -8,7 +8,8 @@ export interface ParsedConstraint {
recurring: "weekly" | "daily" | null;
}
const numbers = (s: string): number[] => [...s.matchAll(/\d+/g)].map((m) => Number(m[0]));
/** Числа в тексте; «-2» - отрицательный день только если минус не приклеен к цифре слева («0-44» - диапазон). */
const numbers = (s: string): number[] => [...s.matchAll(/(?<!\d)-\d+|\d+/g)].map((m) => Number(m[0]));
/**
* Разбор поля date_constraint (дни от первой встречи с архитектором).
@@ -149,7 +150,7 @@ export function computeSchedule(rows: ProcessRow[]): Schedule {
};
timings.set(id, t);
if (!c.recurring && t.fromConstraint && end < depEnd) warnings.push({ id, message: `срок (день ${end}) раньше окончания предшественников (день ${depEnd})` });
if (!c.recurring && t.fromConstraint && row.dependsOn.length > 0 && end < depEnd) warnings.push({ id, message: `срок (день ${end}) раньше окончания предшественников (день ${depEnd})` });
if (c.start !== null && c.end !== null && d !== null && Math.abs(end - start - d) > 7) warnings.push({ id, message: `срок ${start}→${end} (${end - start} дн.) не сходится с длительностью ${d} дн.` });
return t;
};