feat: show the full work history and load every lead stage on the board

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-14 19:47:32 +03:30
co-authored by Cursor
parent 2cc81bb596
commit 831c682eb3
13 changed files with 669 additions and 66 deletions
@@ -22,6 +22,10 @@ class ListDeletionsQueryDto {
@IsString()
q?: string;
@IsOptional()
@IsString()
deletedById?: string;
@IsOptional()
@Type(() => Number)
@IsInt()
@@ -47,7 +51,7 @@ export class DeletionsController {
constructor(private readonly deletions: DeletionsService) {}
@Get()
@Roles('owner', 'admin')
@Roles('owner')
list(
@CurrentUser() user: { organizationId: string },
@Query() query: ListDeletionsQueryDto,
@@ -57,11 +61,12 @@ export class DeletionsController {
query.page,
query.limit,
query.q,
query.deletedById,
);
}
@Patch('settings')
@Roles('owner', 'admin')
@Roles('owner')
updateSettings(
@CurrentUser() user: { organizationId: string },
@Body() dto: RetentionDto,
@@ -70,7 +75,7 @@ export class DeletionsController {
}
@Post(':id/restore')
@Roles('owner', 'admin')
@Roles('owner')
restore(
@CurrentUser() user: { organizationId: string },
@Param('id') id: string,
@@ -79,7 +84,7 @@ export class DeletionsController {
}
@Delete(':id')
@Roles('owner', 'admin')
@Roles('owner')
purge(
@CurrentUser() user: { organizationId: string },
@Param('id') id: string,
+9 -1
View File
@@ -30,12 +30,20 @@ const RETENTION_DAYS: Record<DeletionRetention, number | null> = {
export class DeletionsService {
constructor(private readonly prisma: PrismaService) {}
async list(organizationId: string, page = 1, limit = 30, q?: string) {
async list(
organizationId: string,
page = 1,
limit = 30,
q?: string,
deletedById?: string,
) {
const take = Math.min(100, Math.max(1, limit));
const skip = (Math.max(1, page) - 1) * take;
const query = q?.trim();
const actorId = deletedById?.trim();
const where = {
organizationId,
...(actorId ? { deletedById: actorId } : {}),
...(query
? {
OR: [