From f186be8639c191358d5284edd2c304af291fca87 Mon Sep 17 00:00:00 2001
From: Alex Saunders <acsauk@gmail.com>
Date: Wed, 1 May 2024 14:21:13 +0100
Subject: [PATCH] relax email+channel validation until consumer tests updated

---
 lambda/create/validate.go      |  6 ++--
 lambda/create/validate_test.go | 50 +++++++++++++++++-----------------
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/lambda/create/validate.go b/lambda/create/validate.go
index a10e7d72..24f9ff7c 100644
--- a/lambda/create/validate.go
+++ b/lambda/create/validate.go
@@ -127,8 +127,8 @@ func validateTrustCorporation(prefix string, trustCorporation shared.TrustCorpor
 		validate.Address(fmt.Sprintf("%s/address", prefix), trustCorporation.Address),
 		validate.IsValid(fmt.Sprintf("%s/channel", prefix), trustCorporation.Channel),
 		validate.IsValid(fmt.Sprintf("%s/status", prefix), trustCorporation.Status),
-		validate.IfElse(trustCorporation.Channel == shared.ChannelOnline,
-			validate.Required(fmt.Sprintf("%s/email", prefix), trustCorporation.Email),
-			validate.Empty(fmt.Sprintf("%s/email", prefix), trustCorporation.Email)),
+		//validate.IfElse(trustCorporation.Channel == shared.ChannelOnline,
+		//	validate.Required(fmt.Sprintf("%s/email", prefix), trustCorporation.Email),
+		//	validate.Empty(fmt.Sprintf("%s/email", prefix), trustCorporation.Email)),
 	)
 }
diff --git a/lambda/create/validate_test.go b/lambda/create/validate_test.go
index dbf298fc..9416ed02 100644
--- a/lambda/create/validate_test.go
+++ b/lambda/create/validate_test.go
@@ -299,31 +299,31 @@ func TestValidateLpaInvalid(t *testing.T) {
 				{Source: "/lifeSustainingTreatmentOption", Detail: "field must not be provided"},
 			},
 		},
-		"online trust corporation missing email": {
-			lpa: shared.LpaInit{
-				TrustCorporations: []shared.TrustCorporation{
-					{
-						Channel: shared.ChannelOnline,
-					},
-				},
-			},
-			contains: []shared.FieldError{
-				{Source: "/trustCorporations/0/email", Detail: "field is required"},
-			},
-		},
-		"paper trust corporation with email": {
-			lpa: shared.LpaInit{
-				TrustCorporations: []shared.TrustCorporation{
-					{
-						Channel: shared.ChannelPaper,
-						Email:   "a@example.com",
-					},
-				},
-			},
-			contains: []shared.FieldError{
-				{Source: "/trustCorporations/0/email", Detail: "field must not be provided"},
-			},
-		},
+		//"online trust corporation missing email": {
+		//	lpa: shared.LpaInit{
+		//		TrustCorporations: []shared.TrustCorporation{
+		//			{
+		//				Channel: shared.ChannelOnline,
+		//			},
+		//		},
+		//	},
+		//	contains: []shared.FieldError{
+		//		{Source: "/trustCorporations/0/email", Detail: "field is required"},
+		//	},
+		//},
+		//"paper trust corporation with email": {
+		//	lpa: shared.LpaInit{
+		//		TrustCorporations: []shared.TrustCorporation{
+		//			{
+		//				Channel: shared.ChannelPaper,
+		//				Email:   "a@example.com",
+		//			},
+		//		},
+		//	},
+		//	contains: []shared.FieldError{
+		//		{Source: "/trustCorporations/0/email", Detail: "field must not be provided"},
+		//	},
+		//},
 	}
 
 	for name, tc := range testcases {