add labels and priority fields to task collection

This commit is contained in:
2025-05-20 10:15:31 +05:30
parent b082b221d1
commit 690f8c71de
2 changed files with 10 additions and 3 deletions

View File

@@ -9,6 +9,8 @@ const taskSchema = new mongoose.Schema({
pid: { type: String, required: true, unique: true },
title: String,
dueDate: Date,
labels: [String],
priority: String,
documents: [
new mongoose.Schema(
{
@@ -51,6 +53,8 @@ const createTaskInput = z.object({
dueDate: z.date().optional(),
files: z.array(files).optional(),
assignedTo: z.string().optional(),
labels: z.array(z.string()).optional(),
priority: z.string().optional(),
stage: z
.object({
pipeline: z.array(
@@ -71,6 +75,8 @@ const updateTaskInput = z.object({
dueDate: z.date().optional(),
files: z.array(files).optional(),
assignedTo: z.string().optional(),
labels: z.array(z.string()).optional(),
priority: z.string().optional(),
stage: z
.object({
pipeline: z.array(

View File

@@ -1,6 +1,4 @@
import { userInfo } from "os";
import { AuthenticatedUser } from "../auth";
import { orgModel } from "../organization/organization.schema";
import { getFilterObject, getSortObject, PageQueryParams } from "../pagination";
import { generateId } from "../utils/id";
import { taskPipeline } from "../utils/pipeline";
@@ -11,7 +9,6 @@ import {
UpdateTaskInput,
UploadTaskInput,
} from "./task.schema";
import { userModel } from "../user/user.schema";
export async function createTask(
input: CreateTaskInput,
@@ -90,6 +87,8 @@ export async function listTasks(params: PageQueryParams, tenantId: string) {
pid: 1,
title: 1,
dueDate: 1,
labels: 1,
priority: 1,
documents: 1,
stage: 1,
createdAt: 1,
@@ -183,6 +182,8 @@ export async function searchTasks(params: PageQueryParams, tenantId: string) {
pid: 1,
title: 1,
dueDate: 1,
labels: 1,
priority: 1,
documents: 1,
stage: 1,
createdAt: 1,