ARCH: приоритизировать discovery-period в planner follow-up

This commit is contained in:
2026-04-22 17:49:09 +03:00
parent bd58ab490f
commit dca49ef4e1
4 changed files with 178 additions and 6 deletions
@@ -622,6 +622,9 @@ export function resolveAddressDebugCarryoverFilters(
const extractedFilters = readAddressDebugFilters(debug);
const nextFilters = extractedFilters ? { ...extractedFilters } : {};
const discoveryDateScope = readDiscoveryDateScopeFilters(debug, toNonEmptyString);
const preferGroundedDiscoveryDateScope =
hasGroundedDiscoveryBusinessAnswer(debug, toNonEmptyString) &&
Boolean(discoveryDateScope.asOfDate || discoveryDateScope.periodFrom || discoveryDateScope.periodTo);
const counterparty = readAddressDebugCounterparty(debug, toNonEmptyString);
const organization = readAddressDebugOrganization(debug, toNonEmptyString);
if (counterparty && !toNonEmptyString(nextFilters.counterparty)) {
@@ -630,14 +633,23 @@ export function resolveAddressDebugCarryoverFilters(
if (organization && !toNonEmptyString(nextFilters.organization)) {
nextFilters.organization = organization;
}
if (discoveryDateScope.asOfDate && !toNonEmptyString(nextFilters.as_of_date)) {
if (discoveryDateScope.asOfDate && (preferGroundedDiscoveryDateScope || !toNonEmptyString(nextFilters.as_of_date))) {
nextFilters.as_of_date = discoveryDateScope.asOfDate;
delete nextFilters.period_from;
delete nextFilters.period_to;
}
if (discoveryDateScope.periodFrom && !toNonEmptyString(nextFilters.period_from)) {
if (
discoveryDateScope.periodFrom &&
(preferGroundedDiscoveryDateScope || !toNonEmptyString(nextFilters.period_from))
) {
nextFilters.period_from = discoveryDateScope.periodFrom;
}
if (discoveryDateScope.periodTo && !toNonEmptyString(nextFilters.period_to)) {
if (
discoveryDateScope.periodTo &&
(preferGroundedDiscoveryDateScope || !toNonEmptyString(nextFilters.period_to))
) {
nextFilters.period_to = discoveryDateScope.periodTo;
delete nextFilters.as_of_date;
}
const inventoryRootFrame = buildInventoryRootFrameFromAddressDebug(debug, toNonEmptyString);
const rootFilters =