Index: APPS/EDI/Bestel/impl/BestelService/UnishopBesteller.cls.xml =================================================================== diff -u -r38006 -r38432 --- APPS/EDI/Bestel/impl/BestelService/UnishopBesteller.cls.xml (.../UnishopBesteller.cls.xml) (revision 38006) +++ APPS/EDI/Bestel/impl/BestelService/UnishopBesteller.cls.xml (.../UnishopBesteller.cls.xml) (revision 38432) @@ -43,8 +43,13 @@ 1 + +APPS.EDI.common.impl.ProductValidator +1 + + -ExterneVerkoopService:APPS.EC.Verkoop.ExterneVerkoopService,ProductConverter:APPS.EDI.common.impl.ProductConverter,OfferteService:APPS.VKP.OfferteService,OrderIngaveService:APPS.VKP.OrderIngaveService,OfferteHoofding:APPS.EC.dto.Hoofding +ExterneVerkoopService:APPS.EC.Verkoop.ExterneVerkoopService,ProductConverter:APPS.EDI.common.impl.ProductConverter,OfferteService:APPS.VKP.OfferteService,OrderIngaveService:APPS.VKP.OrderIngaveService,OfferteHoofding:APPS.EC.dto.Hoofding,ProductValidator:APPS.EDI.common.impl.ProductValidator 1 1 %Status @@ -56,6 +61,7 @@ Set ..ProductRepository = ##class(APPS.EDI.Bestel.impl.BestelService.UnishopBesteller.ProductRepository).%New() Set ..OrderIngaveService = $$$Inject(OrderIngaveService,##class(APPS.VKP.OrderIngaveService).%New()) Set ..OfferteHoofding = $$$Inject(OfferteHoofding,##class(APPS.EC.dto.Hoofding).%New()) + Set ..ProductValidator = $$$Inject(ProductValidator,##class(APPS.EDI.common.impl.ProductValidator).%New()) Quit $$$OK ]]> @@ -177,8 +183,23 @@ #dim ConvertOpties As TECH.KeyValue.List = ##class(TECH.KeyValue.List).%New() Do ConvertOpties.InsertKeyValue("KlantID",..Aanvraag.Header.KlantID) Do ConvertOpties.InsertKeyValue("PersonalityID",..Aanvraag.Header.PersonalityID) - #dim IngegevenKenmerken As APPS.PM.Maatwerk.dto.IngegevenKenmerken = ..ProductConverter.Convert(Lijn.Product,ConvertOpties) - Do ..OfferteService.VoegToeMaatwerk(..OfferteService.GeefOfferte(OfferteID),IngegevenKenmerken,Lijn.Aantal,Lijn.Referentie) + + Set Exceptions = ##class(TECH.ExceptionList).%New() + #dim ExceptionsSmijten As %Boolean = $$$False + #dim ProbleemLijnen As %String = "" + If ..ProductValidator.IsValid(Lijn.Product, .Exceptions) { + #dim IngegevenKenmerken As APPS.PM.Maatwerk.dto.IngegevenKenmerken = ..ProductConverter.Convert(Lijn.Product,ConvertOpties) + Do ..OfferteService.VoegToeMaatwerk(..OfferteService.GeefOfferte(OfferteID),IngegevenKenmerken,Lijn.Aantal,Lijn.Referentie) + } Else { + Set ProbleemLijnen = ProbleemLijnen _ " " _ ..LijnenIterator.Key() + Set ExceptionsSmijten = $$$True + } + + If ExceptionsSmijten { + Set Exception = ##class(TECH.Exceptions.InvalidInputException).%New("Ongeldige data TandemboxBesteller op lijn(en) "_ProbleemLijnen) + Do Exception.ZetInnerExcepties(Exceptions) + Do ##class(TECH.ExceptionHandler).Throw(Exception) + } ]]> Index: vhUnitTest/APPS/EDI/Bestel/impl/BestelService/UnishopBesteller/PlaatsBestelling/Test.cls.xml =================================================================== diff -u -r38006 -r38432 --- vhUnitTest/APPS/EDI/Bestel/impl/BestelService/UnishopBesteller/PlaatsBestelling/Test.cls.xml (.../Test.cls.xml) (revision 38006) +++ vhUnitTest/APPS/EDI/Bestel/impl/BestelService/UnishopBesteller/PlaatsBestelling/Test.cls.xml (.../Test.cls.xml) (revision 38432) @@ -570,6 +570,39 @@ ]]> + + + + 1 @@ -608,7 +641,7 @@ Set Aanvraag.Header.KlantID = ..#KlantID Set Aanvraag.Header.PersonalityID = ..#PersonalityID Set Aanvraag.Order.GevraagdeLeverdatum = "2011.01.01" - quit Aanvraag + Quit Aanvraag ]]>