All files / src/application/specialist specialist-repository.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16                               
import { Specialist } from '../../domain/specialist/specialist';
 
export interface SpecialistRepository {
  findById(id: string): Promise<Specialist | null>;
  /**
   * Everything this user is allowed to see, which is the union of three sources and nothing else:
   * they created it, it is linked to a child they can reach, or it was shared with them by name.
   *
   * The union lives here rather than in a use case because only the database can answer the middle
   * one without loading every guardian row into memory.
   */
  findAllVisibleTo(userId: string): Promise<Specialist[]>;
  save(specialist: Specialist): Promise<void>;
  delete(id: string): Promise<void>;
}