Esempio n. 1
0
        public static IncidentApplication Create(Title title,
                                                 Content content,
                                                 IncidentType incidentType,
                                                 EmployeeId applicantId,
                                                 List <EmployeeId> suspiciousEmployees,
                                                 List <Attachment> attachments)
        {
            var id                      = IncidentApplicationId.Create();
            var postDate                = SystemClock.Now;
            var applicationNumber       = new ApplicationNumber(postDate, incidentType);
            var suspiciousEmployeesList = suspiciousEmployees.Select(x => new SuspiciousEmployee(x)).ToList();

            var application = new IncidentApplication(id, content, title, incidentType, applicantId, suspiciousEmployeesList, attachments, postDate, applicationNumber);

            application.AddDomainEvent(new IncidentApplicationCreated(application));

            return(application);
        }
Esempio n. 2
0
        public static IncidentApplication Create(ApplicationNumber applicationNumber)
        {
            var id = IncidentApplicationId.Create();

            return(new IncidentApplication(id, applicationNumber));
        }