ekyc

Electronic KYC process with uploading ID document using OAuth 2.1 (experimental)
Log | Files | Refs | README | LICENSE

is_admin.ts (521B)


      1 import { AdminRepository } from "#core/application/id_document/admin_repository.ts";
      2 import { UUID } from "#core/domain/uuid.ts";
      3 
      4 export type IsIDDocumentAdminRequest = { uuid: string }
      5 
      6 
      7 export class IsIDDocumentAdminUseCase {
      8   constructor(private readonly adminRepo: AdminRepository) {
      9   }
     10 
     11   async execute(request: IsIDDocumentAdminRequest): Promise<boolean> {
     12     try {
     13       const uuid = new UUID(request.uuid)
     14       await this.adminRepo.find(uuid);
     15       return true;
     16     } catch {
     17       return false
     18     }
     19   }
     20 }