in super-mode-calculator/src/lib/dynamo.ts [87:107]
export async function queryActiveArticlesForSuperMode(
stage: string,
docClient: AWS.DynamoDB.DocumentClient,
now: Date = new Date(),
): Promise<DynamoRecord[]> {
const tomorrow = addDays(now, 1);
const todayEndDate = toDateString(now);
const tomorrowEndDate = toDateString(tomorrow);
const endTimestamp = toDateHourString(now);
const [todayResult, tomorrowResult] = await Promise.all([
queryDateForSuperMode(todayEndDate, endTimestamp, stage, docClient),
queryDateForSuperMode(tomorrowEndDate, endTimestamp, stage, docClient),
]);
return [
...(todayResult.Items ?? []),
...(tomorrowResult.Items ?? []),
] as DynamoRecord[];
}