ARCH: приоритизировать discovery-period в planner follow-up
This commit is contained in:
@@ -425,6 +425,8 @@ function resolveAddressDebugCarryoverFilters(debug, toNonEmptyString = fallbackT
|
||||
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)) {
|
||||
@@ -433,14 +435,19 @@ function resolveAddressDebugCarryoverFilters(debug, toNonEmptyString = fallbackT
|
||||
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 = inventoryRootFrame?.filters && typeof inventoryRootFrame.filters === "object"
|
||||
|
||||
Reference in New Issue
Block a user