diff --git a/packages/db/src/repository/board.repo.ts b/packages/db/src/repository/board.repo.ts index 8507cb4c..5a37635a 100644 --- a/packages/db/src/repository/board.repo.ts +++ b/packages/db/src/repository/board.repo.ts @@ -164,6 +164,7 @@ export const getByPublicId = async ( description: true, listId: true, index: true, + dueDate: true, }, with: { labels: { @@ -353,6 +354,7 @@ export const getBySlug = async ( description: true, listId: true, index: true, + dueDate: true, }, with: { labels: { diff --git a/packages/db/src/repository/card.repo.ts b/packages/db/src/repository/card.repo.ts index 075687d2..378206e3 100644 --- a/packages/db/src/repository/card.repo.ts +++ b/packages/db/src/repository/card.repo.ts @@ -23,6 +23,7 @@ export const create = async ( createdBy: string; listId: number; position: "start" | "end"; + dueDate?: Date | null; }, ) => { return db.transaction(async (tx) => { @@ -71,6 +72,7 @@ export const create = async ( createdBy: cardInput.createdBy, listId: cardInput.listId, index: index, + dueDate: cardInput.dueDate ?? null, }) .returning({ id: cards.id, listId: cards.listId }); @@ -163,6 +165,7 @@ export const update = async ( cardInput: { title?: string; description?: string; + dueDate?: Date | null; }, args: { cardPublicId: string; @@ -173,6 +176,8 @@ export const update = async ( .set({ title: cardInput.title, description: cardInput.description, + dueDate: cardInput.dueDate !== undefined ? cardInput.dueDate : undefined, + updatedAt: new Date(), }) .where(and(eq(cards.publicId, args.cardPublicId), isNull(cards.deletedAt))) .returning({ @@ -180,6 +185,7 @@ export const update = async ( publicId: cards.publicId, title: cards.title, description: cards.description, + dueDate: cards.dueDate, }); return result; @@ -214,6 +220,7 @@ export const getByPublicId = (db: dbClient, cardPublicId: string) => { title: true, description: true, listId: true, + dueDate: true, }, where: eq(cards.publicId, cardPublicId), }); @@ -397,6 +404,7 @@ export const getWithListAndMembersByPublicId = async ( publicId: true, title: true, description: true, + dueDate: true, }, with: { labels: { @@ -780,6 +788,7 @@ export const reorder = async ( publicId: true, title: true, description: true, + dueDate: true, }, where: eq(cards.id, card.id), }); diff --git a/packages/db/src/repository/cardActivity.repo.ts b/packages/db/src/repository/cardActivity.repo.ts index 0e95b383..28119179 100644 --- a/packages/db/src/repository/cardActivity.repo.ts +++ b/packages/db/src/repository/cardActivity.repo.ts @@ -22,6 +22,8 @@ export const create = async ( commentId?: number; fromComment?: string; toComment?: string; + fromDueDate?: Date; + toDueDate?: Date; sourceBoardId?: number; }, ) => { @@ -45,6 +47,8 @@ export const create = async ( commentId: activityInput.commentId, fromComment: activityInput.fromComment, toComment: activityInput.toComment, + fromDueDate: activityInput.fromDueDate, + toDueDate: activityInput.toDueDate, sourceBoardId: activityInput.sourceBoardId, }) .returning({ id: cardActivities.id }); @@ -68,6 +72,8 @@ export const bulkCreate = async ( fromDescription?: string; toDescription?: string; createdBy: string; + fromDueDate?: Date; + toDueDate?: Date; sourceBoardId?: number; }[], ) => {