public AssessmentOrganisationViewModel Map(AssessmentOrganisation item)
        {
            if (item == null)
            {
                return(null);
            }

            var assessmentOrganisation = new AssessmentOrganisationViewModel();

            assessmentOrganisation.Name    = item.Name;
            assessmentOrganisation.Website = item.Website;
            assessmentOrganisation.Email   = item.Email;
            assessmentOrganisation.Phone   = item.Phone;

            return(assessmentOrganisation);
        }
        public AssessmentOrganisation Map(Organisation document)
        {
            if (document == null)
            {
                return(null);
            }

            var assessmentOrgainisation = new AssessmentOrganisation()
            {
                Name    = document.Name,
                Email   = document.Email,
                Phone   = document.Phone,
                Website = document.Website
            };

            return(assessmentOrgainisation);
        }
Beispiel #3
0
            private void SeedData()
            {
                ApprenticeshipId = _autoFixture.Create <long>();

                Provider = new Provider
                {
                    UkPrn = _autoFixture.Create <long>(),
                    Name  = _autoFixture.Create <string>()
                };

                var account = new Account(0, "", "", "", DateTime.UtcNow);

                AccountLegalEntity = new AccountLegalEntity(account,
                                                            AccountLegalEntityId,
                                                            0,
                                                            "",
                                                            publicHashedId: _autoFixture.Create <string>(),
                                                            _autoFixture.Create <string>(),
                                                            OrganisationType.PublicBodies,
                                                            "",
                                                            DateTime.UtcNow);

                Cohort = new Cohort
                {
                    Id = _autoFixture.Create <long>(),
                    AccountLegalEntity = AccountLegalEntity,
                    EmployerAccountId  = _autoFixture.Create <long>(),
                    ProviderId         = Provider.UkPrn,
                    Provider           = Provider,
                    ApprenticeshipEmployerTypeOnApproval = ApprenticeshipEmployerType.Levy
                };

                EndpointAssessmentOrganisation = new AssessmentOrganisation
                {
                    EpaOrgId = _autoFixture.Create <string>(),
                    Id       = _autoFixture.Create <int>(),
                    Name     = _autoFixture.Create <string>()
                };

                var previousAccount = new Account();

                PreviousAccountLegalEntity = new AccountLegalEntity(previousAccount,
                                                                    _autoFixture.Create <long>(),
                                                                    0,
                                                                    "",
                                                                    publicHashedId: _autoFixture.Create <string>(),
                                                                    _autoFixture.Create <string>(),
                                                                    OrganisationType.PublicBodies,
                                                                    "",
                                                                    DateTime.UtcNow);

                var previousCohort = new Cohort
                {
                    ProviderId           = Provider.UkPrn,
                    Provider             = Provider,
                    EmployerAccountId    = previousAccount.Id,
                    AccountLegalEntityId = PreviousAccountLegalEntity.Id,
                    AccountLegalEntity   = PreviousAccountLegalEntity,
                };

                PreviousApprenticeship = new Apprenticeship
                {
                    Id     = _autoFixture.Create <long>(),
                    Cohort = previousCohort
                };

                var nextApprenticeship = new Apprenticeship
                {
                    Id = _autoFixture.Create <long>()
                };

                Apprenticeship = new Apprenticeship
                {
                    Id                     = ApprenticeshipId,
                    CommitmentId           = Cohort.Id,
                    Cohort                 = Cohort,
                    AgreedOn               = _autoFixture.Create <DateTime>(),
                    CourseCode             = _autoFixture.Create <string>(),
                    CourseName             = _autoFixture.Create <string>(),
                    FirstName              = _autoFixture.Create <string>(),
                    LastName               = _autoFixture.Create <string>(),
                    DateOfBirth            = _autoFixture.Create <DateTime>(),
                    StartDate              = _autoFixture.Create <DateTime>(),
                    EndDate                = _autoFixture.Create <DateTime>(),
                    Uln                    = _autoFixture.Create <string>(),
                    PaymentStatus          = _autoFixture.Create <PaymentStatus>(),
                    EpaOrg                 = EndpointAssessmentOrganisation,
                    EmployerRef            = _autoFixture.Create <string>(),
                    ContinuationOfId       = PreviousApprenticeship.Id,
                    PreviousApprenticeship = PreviousApprenticeship,
                    OriginalStartDate      = PreviousApprenticeship.StartDate,
                    Continuation           = nextApprenticeship,
                    MadeRedundant          = _autoFixture.Create <bool?>()
                };

                switch (Apprenticeship.PaymentStatus)
                {
                case PaymentStatus.Withdrawn:
                    Apprenticeship.StopDate = _autoFixture.Create <DateTime>();
                    break;

                case PaymentStatus.Paused:
                    Apprenticeship.PauseDate = _autoFixture.Create <DateTime>();
                    break;

                case PaymentStatus.Completed:
                    Apprenticeship.CompletionDate = _autoFixture.Create <DateTime>();
                    break;
                }

                _db.Apprenticeships.Add(Apprenticeship);
                _db.SaveChanges();
            }