public EditReporterCommandHandler(
     ICurrentUser currentUser,
     IReporterDomainRepository reporterRepository)
 {
     this.currentUser        = currentUser;
     this.reporterRepository = reporterRepository;
 }
Exemplo n.º 2
0
 public DeleteReportCommandHandler(
     ICurrentUser currentUser,
     IReportQueryRepository reportRepository,
     IReporterDomainRepository reporterRepository)
 {
     this.currentUser        = currentUser;
     this.reportRepository   = reportRepository;
     this.reporterRepository = reporterRepository;
 }
 public ChangeAprovelCommand(
     ICurrentUser currentUser,
     IReportQueryRepository reportRepository,
     IReporterDomainRepository reporterRepository)
 {
     this.currentUser        = currentUser;
     this.reportRepository   = reportRepository;
     this.reporterRepository = reporterRepository;
 }
 public CreateReportCommandHandler(
     ICurrentUser currentUser,
     IReporterDomainRepository reporterRepository,
     IReportDomainRepository reportRepository,
     IReportFactory reportFactory)
 {
     this.currentUser        = currentUser;
     this.reporterRepository = reporterRepository;
     this.reportRepository   = reportRepository;
     this.reportFactory      = reportFactory;
 }
Exemplo n.º 5
0
        public static async Task <Result> ReporterHasReport(
            this ICurrentUser currentUser,
            IReporterDomainRepository reporterRepository,
            int reportId,
            CancellationToken cancellationToken)
        {
            var reporterId = await reporterRepository.GetReporterId(
                currentUser.UserId,
                cancellationToken);

            var reporterHasReport = await reporterRepository.HasReport(
                reporterId,
                reportId,
                cancellationToken);

            return(reporterHasReport
                ? Result.Success
                : "You cannot edit this report.");
        }