ProjectsModule · library/project/src/repos/projects.ts:27

ProjectsRepo

component

No JSDoc comment in source yet.

API

@Component()
export class ProjectsRepo implements Projects {
  @Use() private readonly db!: Db;
  insert(row: ProjectRow): void;
  findById(projectId: string): ProjectRow | null;
  listAll(): ProjectRow[];
  listAccessible(userId: string): AccessibleProjectRow[];
  listByOwner(userId: string): ProjectRow[];
  delete(projectId: string): void;
}

Dependencies & Wiring

Extracted from class decorators
implementsinterfaces
@Userequires (1)
db: Db

Methods (6)

insert

insert(row: ProjectRow): void
@paramrowProjectRow
@returnsvoid

findById

findById(projectId: string): ProjectRow | null
@paramprojectIdstring
@returnsProjectRow | null

listAll

listAll(): ProjectRow[]

All Projects (used by the scheduler's reconciliation scan), ascending by creation time.

@returnsProjectRow[]

listAccessible

listAccessible(userId: string): AccessibleProjectRow[]

Projects owned by or shared with the current user (including their role), ascending by creation time.

@paramuserIdstring
@returnsAccessibleProjectRow[]

listByOwner

listByOwner(userId: string): ProjectRow[]

All Projects owned by a given user (used for cascading cleanup when an admin deletes a user).

@paramuserIdstring
@returnsProjectRow[]

delete

delete(projectId: string): void
@paramprojectIdstring
@returnsvoid