Skip to content

Commit

Permalink
Disable yesterday
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-vasconcelos committed Jan 30, 2025
1 parent ef863ed commit 51654aa
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions apps/sync-metrics/src/tasks/videowall-validations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ export const videowallValidations = async () => {

const todayOperationalDate = getOperationalDate();

const yesterdayOperationalDate = createOperationalDate(
DateTime
.fromFormat(todayOperationalDate, OPERATIONAL_DATE_FORMAT)
.minus({ days: 1 })
.toFormat(OPERATIONAL_DATE_FORMAT),
);
// const yesterdayOperationalDate = createOperationalDate(
// DateTime
// .fromFormat(todayOperationalDate, OPERATIONAL_DATE_FORMAT)
// .minus({ days: 1 })
// .toFormat(OPERATIONAL_DATE_FORMAT),
// );

const yesterdayUntilNow = DateTime
.now()
.minus({ days: 1 });
// const yesterdayUntilNow = DateTime
// .now()
// .minus({ days: 1 });

const lastWeekOperationalDate = createOperationalDate(
DateTime
Expand Down Expand Up @@ -81,8 +81,8 @@ export const videowallValidations = async () => {
// For Area 1
responseResult._41_today_valid_count = await apexT11.count({
agency_id: '41',
created_at: { $lte: yesterdayUntilNow.toJSDate() },
operational_date: yesterdayOperationalDate,
// created_at: { $lte: yesterdayUntilNow.toJSDate() },
operational_date: todayOperationalDate,
validation_status: { $in: ALLOWED_VALIDATION_STATUSES },
});
responseResult._41_last_week_valid_count = await apexT11.count({
Expand All @@ -94,8 +94,8 @@ export const videowallValidations = async () => {
// For Area 2
responseResult._42_today_valid_count = await apexT11.count({
agency_id: '42',
created_at: { $lte: yesterdayUntilNow.toJSDate() },
operational_date: yesterdayOperationalDate,
// created_at: { $lte: yesterdayUntilNow.toJSDate() },
operational_date: todayOperationalDate,
validation_status: { $in: ALLOWED_VALIDATION_STATUSES },
});
responseResult._42_last_week_valid_count = await apexT11.count({
Expand All @@ -107,8 +107,8 @@ export const videowallValidations = async () => {
// For Area 3
responseResult._43_today_valid_count = await apexT11.count({
agency_id: '43',
created_at: { $lte: yesterdayUntilNow.toJSDate() },
operational_date: yesterdayOperationalDate,
// created_at: { $lte: yesterdayUntilNow.toJSDate() },
operational_date: todayOperationalDate,
validation_status: { $in: ALLOWED_VALIDATION_STATUSES },
});
responseResult._43_last_week_valid_count = await apexT11.count({
Expand All @@ -120,8 +120,8 @@ export const videowallValidations = async () => {
// For Area 4
responseResult._44_today_valid_count = await apexT11.count({
agency_id: '44',
created_at: { $lte: yesterdayUntilNow.toJSDate() },
operational_date: yesterdayOperationalDate,
// created_at: { $lte: yesterdayUntilNow.toJSDate() },
operational_date: todayOperationalDate,
validation_status: { $in: ALLOWED_VALIDATION_STATUSES },
});
responseResult._44_last_week_valid_count = await apexT11.count({
Expand All @@ -133,8 +133,8 @@ export const videowallValidations = async () => {
// For the whole CM
responseResult._cm_today_valid_count = await apexT11.count({
agency_id: { $in: ['41', '42', '43', '44'] },
created_at: { $lte: yesterdayUntilNow.toJSDate() },
operational_date: yesterdayOperationalDate,
// created_at: { $lte: yesterdayUntilNow.toJSDate() },
operational_date: todayOperationalDate,
validation_status: { $in: ALLOWED_VALIDATION_STATUSES },
});
responseResult._cm_last_week_valid_count = await apexT11.count({
Expand Down

0 comments on commit 51654aa

Please sign in to comment.