Skip to content

Commit

Permalink
feat: make scheduler respect initial start date
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-wasmeier-titanom committed May 21, 2024
1 parent 1e4a785 commit c87e146
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/src/db/functions/assignment.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { count, desc, eq, or, sql } from 'drizzle-orm';
import { AssignmentResponse } from 'src/types';
import { db } from '..';
import {
Expand All @@ -7,7 +8,6 @@ import {
taskTable,
userTable,
} from '../schema';
import { count, desc, eq, or, sql } from 'drizzle-orm';

export async function dbGetAllAssignments(): Promise<AssignmentResponse[]> {
try {
Expand Down Expand Up @@ -90,6 +90,7 @@ export async function dbGetTasksToAssignForCurrentInterval() {
.from(taskGroupTable)
.innerJoin(taskTable, eq(taskGroupTable.id, taskTable.taskGroupId))
.leftJoin(assignmentTable, eq(taskTable.id, assignmentTable.taskId))
.where(sql`${taskGroupTable.initialStartDate}::date <= NOW()::date`)
.groupBy(taskGroupTable.id, taskTable.id)
.having(
or(
Expand Down

0 comments on commit c87e146

Please sign in to comment.