Add desk-style task workflow on Activities and Project boards.

Managers can switch my desk vs team, reassign activities, and filter project cards to their work; assignees can see and move cards.
This commit is contained in:
2026-09-28 12:28:14 +03:30
parent 8effd4cbc6
commit 32e27d45f7
13 changed files with 303 additions and 50 deletions
@@ -62,6 +62,7 @@ export class ActivitiesController {
from: query.from,
to: query.to,
},
query.desk,
);
}
@@ -128,6 +128,7 @@ export class ActivitiesService {
from?: string;
to?: string;
},
desk?: 'mine' | 'team',
): Promise<PaginatedResponse<ActivityDto>> {
const where = this.buildWhere(
organizationId,
@@ -136,6 +137,7 @@ export class ActivitiesService {
q,
entity,
range,
desk,
);
const take = Math.min(Math.max(limit, 1), 200);
const [rows, total] = await this.prisma.$transaction([
@@ -324,11 +326,14 @@ export class ActivitiesService {
from?: string;
to?: string;
},
desk?: 'mine' | 'team',
): Prisma.ActivityWhereInput {
const { start, end } = dayBounds();
const scope =
desk === 'mine' ? { assigneeId: actor.userId } : assigneeWhere(actor);
const base: Prisma.ActivityWhereInput = {
organizationId,
...assigneeWhere(actor),
...scope,
...(entity?.personId ? { personId: entity.personId } : {}),
...(entity?.companyId ? { companyId: entity.companyId } : {}),
...(entity?.dealId ? { dealId: entity.dealId } : {}),
+4
View File
@@ -28,6 +28,10 @@ export class ListActivitiesQueryDto {
@IsString()
q?: string;
@IsOptional()
@IsIn(['mine', 'team'])
desk?: 'mine' | 'team';
@IsOptional()
@IsString()
personId?: string;