Exemple #1
0
        public static DraftApplication Create(
            Title tile,
            Content content,
            IncidentType incidentType,
            EmployeeId applicantId,
            List <EmployeeId> suspiciousEmployees)
        {
            var id = DraftApplicationId.Create();
            var suspiciousEmployeesList = suspiciousEmployees.Select(x => new SuspiciousEmployee(x)).ToList();

            var draftApplication = new DraftApplication(id, content, tile, incidentType, applicantId, suspiciousEmployeesList);

            draftApplication.AddDomainEvent(new DraftApplicationCreated(id, content,
                                                                        incidentType, applicantId, suspiciousEmployeesList));

            return(draftApplication);
        }