From a786e269d7cfd8283a78b7d61233936b78a87bd5 Mon Sep 17 00:00:00 2001 From: Shoma Gujjar Date: Mon, 27 Apr 2020 13:44:46 +0100 Subject: [PATCH] CON-1712-make review comment fixes --- ....DAS.EAS.Employer_Account.Database.sqlproj | 1 - .../Scripts/Manual/CON-1712-alterTable.sql | 4 ---- .../Tables/EmployerAgreementTemplate.sql | 3 ++- .../Mappings/AgreementMappings.cs | 21 ++++++------------- 4 files changed, 8 insertions(+), 21 deletions(-) delete mode 100644 src/SFA.DAS.EAS.Employer_Account.Database/Scripts/Manual/CON-1712-alterTable.sql diff --git a/src/SFA.DAS.EAS.Employer_Account.Database/SFA.DAS.EAS.Employer_Account.Database.sqlproj b/src/SFA.DAS.EAS.Employer_Account.Database/SFA.DAS.EAS.Employer_Account.Database.sqlproj index a8f78e9ce3..0fd9815492 100644 --- a/src/SFA.DAS.EAS.Employer_Account.Database/SFA.DAS.EAS.Employer_Account.Database.sqlproj +++ b/src/SFA.DAS.EAS.Employer_Account.Database/SFA.DAS.EAS.Employer_Account.Database.sqlproj @@ -151,7 +151,6 @@ - diff --git a/src/SFA.DAS.EAS.Employer_Account.Database/Scripts/Manual/CON-1712-alterTable.sql b/src/SFA.DAS.EAS.Employer_Account.Database/Scripts/Manual/CON-1712-alterTable.sql deleted file mode 100644 index 35691fa439..0000000000 --- a/src/SFA.DAS.EAS.Employer_Account.Database/Scripts/Manual/CON-1712-alterTable.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE [employer_account].[EmployerAgreementTemplate] -ADD PublishedDate DATETIME NULL; - - diff --git a/src/SFA.DAS.EAS.Employer_Account.Database/Tables/EmployerAgreementTemplate.sql b/src/SFA.DAS.EAS.Employer_Account.Database/Tables/EmployerAgreementTemplate.sql index e602821447..fd246b7288 100644 --- a/src/SFA.DAS.EAS.Employer_Account.Database/Tables/EmployerAgreementTemplate.sql +++ b/src/SFA.DAS.EAS.Employer_Account.Database/Tables/EmployerAgreementTemplate.sql @@ -4,7 +4,8 @@ [PartialViewName] NVARCHAR(50) NOT NULL, [CreatedDate] DATETIME NOT NULL, [VersionNumber] INT NOT NULL, - [AgreementType] TINYINT NOT NULL DEFAULT 0 + [AgreementType] TINYINT NOT NULL DEFAULT 0, + [PublishedDate] DATETIME NULL ) GO diff --git a/src/SFA.DAS.EmployerAccounts.Web/Mappings/AgreementMappings.cs b/src/SFA.DAS.EmployerAccounts.Web/Mappings/AgreementMappings.cs index 8f1589a838..87411b99e1 100644 --- a/src/SFA.DAS.EmployerAccounts.Web/Mappings/AgreementMappings.cs +++ b/src/SFA.DAS.EmployerAccounts.Web/Mappings/AgreementMappings.cs @@ -1,5 +1,4 @@ -using System; -using AutoMapper; +using AutoMapper; using SFA.DAS.EAS.Account.Api.Types; using SFA.DAS.EmployerAccounts.Dtos; using SFA.DAS.EmployerAccounts.Queries.GetEmployerAgreement; @@ -14,19 +13,14 @@ public AgreementMappings() { CreateMap() .ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.StatusId)) - .ForMember(dest => dest.LegalEntityAddress, - opt => opt.MapFrom(src => src.LegalEntity.RegisteredAddress)) - .ForMember(dest => dest.LegalEntityInceptionDate, - opt => opt.MapFrom(src => src.LegalEntity.DateOfIncorporation)) + .ForMember(dest => dest.LegalEntityAddress, opt => opt.MapFrom(src => src.LegalEntity.RegisteredAddress)) + .ForMember(dest => dest.LegalEntityInceptionDate, opt => opt.MapFrom(src => src.LegalEntity.DateOfIncorporation)) .ForMember(dest => dest.Sector, opt => opt.MapFrom(src => src.LegalEntity.Sector)) .ForMember(dest => dest.LegalEntitySource, opt => opt.MapFrom(src => src.LegalEntity.Source)) - .ForMember(dest => dest.TemplatePartialViewName, - opt => opt.MapFrom(src => src.Template.PartialViewName)) + .ForMember(dest => dest.TemplatePartialViewName, opt => opt.MapFrom(src => src.Template.PartialViewName)) .ForMember(dest => dest.AgreementType, opt => opt.MapFrom(src => src.Template.AgreementType)) - .ForMember(dest => dest.AccountLegalEntityId, - opt => opt.MapFrom(src => src.LegalEntity.AccountLegalEntityId)) - .ForMember(dest => dest.AccountLegalEntityPublicHashedId, - opt => opt.MapFrom(src => src.LegalEntity.AccountLegalEntityPublicHashedId)) + .ForMember(dest => dest.AccountLegalEntityId, opt => opt.MapFrom(src => src.LegalEntity.AccountLegalEntityId)) + .ForMember(dest => dest.AccountLegalEntityPublicHashedId, opt => opt.MapFrom(src => src.LegalEntity.AccountLegalEntityPublicHashedId)) .ForMember(dest => dest.AgreementType, opts => opts.Ignore()) .ForMember(dest => dest.VersionNumber, opts => opts.Ignore()); @@ -47,9 +41,6 @@ public AgreementMappings() .ForMember(dest => dest.SignedDateText, opt => opt.Ignore()) .ForMember(dest => dest.AccountLegalEntityPublicHashedId, opts => opts.Ignore()); - CreateMap() - .ForMember(dest => dest.PublishedDate, opt => opt.Ignore()); - CreateMap(); } }