public IncidentApplication Build() { this._suspiciousEmployees = this.TryBuildSuspiciousEmployees(); this._attachments = this.TryBuildAttachments(); return(IncidentApplication.Create(this._title, this._content, this._incidentType, this._applicantId, this._suspiciousEmployees, this._attachments)); }
public void SaveIncidentApplicationInDb(IncidentApplication incidentApplication) { TestDatabaseInitializer.SeedDataForTest(dbContext => { dbContext.IncidentApplication.Add(incidentApplication); } ); }
public async Task Create(IncidentApplication incidentApplication, CancellationToken cancellationToken) { if (incidentApplication == null) { throw new ArgumentNullException(nameof(incidentApplication)); } await this._writeContext.IncidentApplication.AddAsync(incidentApplication, cancellationToken); }
public IncidentApplication CreateApplication(PostApplicationInput request, List <Attachment> attachments) { return(IncidentApplication.Create( new Title(request.Title), new Content(request.Content), new IncidentType(request.IncidentType), new EmployeeId(this._applicantContext.UserId), new List <EmployeeId>( request.SuspiciousEmployees.Select(x => new EmployeeId(x))), attachments)); }
public IncidentApplication CreatePostedWithAttachments(EmployeeId applicant, EmployeeId suspiciousEmployee) { var incidentApplication = IncidentApplication.Create( new Title(FakeData.Alpha(12)), new Content(FakeData.Alpha(100)), IncidentType.AdverseEffectForTheCompany, applicant, new List <EmployeeId>() { suspiciousEmployee }, this.CreateAttachment()); return(incidentApplication); }
private void BuildOutput(IncidentApplication incidentApplication) { var postApplicationOutput = new PostApplicationOutput(incidentApplication.Id.Value); this._outputPort.Standard(postApplicationOutput); }
public IncidentApplicationCreated(IncidentApplication application) : base(application.Id.Value.ToString()) { this.IncidentApplication = application; }