Automate issuer overlay creation from ticker searches
This commit is contained in:
@@ -37,7 +37,7 @@ export function periodSorter(left: FinancialStatementPeriod, right: FinancialSta
|
||||
return left.id.localeCompare(right.id);
|
||||
}
|
||||
|
||||
export function isInstantPeriod(period: FinancialStatementPeriod) {
|
||||
function isInstantPeriod(period: FinancialStatementPeriod) {
|
||||
return period.periodStart === null;
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ function selectPrimaryPeriodFromSnapshot(
|
||||
candidates.map((period) => [period.id, coverageScore(coverageRows, period.id)])
|
||||
);
|
||||
|
||||
if (statement === 'balance') {
|
||||
if (statement === 'balance' || statement === 'equity') {
|
||||
return [...candidates].sort((left, right) => compareBalancePeriods(left, right, rowCoverage))[0] ?? null;
|
||||
}
|
||||
|
||||
@@ -238,6 +238,10 @@ export function surfaceToStatementKind(surfaceKind: FinancialSurfaceKind): Finan
|
||||
return 'balance';
|
||||
case 'cash_flow_statement':
|
||||
return 'cash_flow';
|
||||
case 'equity_statement':
|
||||
return 'equity';
|
||||
case 'disclosures':
|
||||
return 'disclosure';
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -417,7 +421,7 @@ export function buildLtmFaithfulRows(
|
||||
const sourceValues = slice.map((period) => sourceRow.values[period.id] ?? null);
|
||||
const sourceUnits = slice.map((period) => sourceRow.units[period.id] ?? null).filter((unit): unit is string => unit !== null);
|
||||
|
||||
row.values[ltmPeriod.id] = statement === 'balance'
|
||||
row.values[ltmPeriod.id] = statement === 'balance' || statement === 'equity'
|
||||
? sourceValues[sourceValues.length - 1] ?? null
|
||||
: aggregateValues(sourceValues);
|
||||
row.units[ltmPeriod.id] = sourceUnits[sourceUnits.length - 1] ?? null;
|
||||
|
||||
Reference in New Issue
Block a user