diff --git a/pkg/bff/models/v1/organization.go b/pkg/bff/models/v1/organization.go index ef15a48b4..010f0678d 100644 --- a/pkg/bff/models/v1/organization.go +++ b/pkg/bff/models/v1/organization.go @@ -204,7 +204,7 @@ func NewRegisterForm() *RegistrationForm { // response to ensure that we're able to submit valid forms and that validation only // occurs in one place in the code. func (r *RegistrationForm) ReadyToSubmit(network string) bool { - if r.VaspCategories == nil || r.Entity == nil || r.Contacts == nil || r.Trixo == nil { + if r.Entity == nil || r.Contacts == nil || r.Trixo == nil { return false } diff --git a/pkg/bff/models/v1/organization_test.go b/pkg/bff/models/v1/organization_test.go index 08a579a99..87286d1d7 100644 --- a/pkg/bff/models/v1/organization_test.go +++ b/pkg/bff/models/v1/organization_test.go @@ -129,7 +129,6 @@ func TestReadyToSubmit(t *testing.T) { }, { r: &models.RegistrationForm{ - Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, Testnet: &models.NetworkDetails{CommonName: "test.trisa.example.com"}, @@ -137,27 +136,14 @@ func TestReadyToSubmit(t *testing.T) { }, assert: require.False, networks: []string{"testnet", "mainnet", "all", "both", ""}, - message: "registration form without vasp categories should not be ready to submit", - }, - { - r: &models.RegistrationForm{ - VaspCategories: []string{"P2P", "other"}, - Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, - Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, - Testnet: &models.NetworkDetails{CommonName: "test.trisa.example.com"}, - Mainnet: &models.NetworkDetails{CommonName: "trisa.example.com"}, - }, - assert: require.False, - networks: []string{"testnet", "mainnet", "all", "both", ""}, message: "registration form without entity should not be ready to submit", }, { r: &models.RegistrationForm{ - VaspCategories: []string{"P2P", "other"}, - Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, - Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, - Testnet: &models.NetworkDetails{CommonName: "test.trisa.example.com"}, - Mainnet: &models.NetworkDetails{CommonName: "trisa.example.com"}, + Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, + Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, + Testnet: &models.NetworkDetails{CommonName: "test.trisa.example.com"}, + Mainnet: &models.NetworkDetails{CommonName: "trisa.example.com"}, }, assert: require.False, networks: []string{"testnet", "mainnet", "all", "both", ""}, @@ -165,11 +151,10 @@ func TestReadyToSubmit(t *testing.T) { }, { r: &models.RegistrationForm{ - VaspCategories: []string{"P2P", "other"}, - Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, - Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, - Testnet: &models.NetworkDetails{CommonName: "test.trisa.example.com"}, - Mainnet: &models.NetworkDetails{CommonName: "trisa.example.com"}, + Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, + Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, + Testnet: &models.NetworkDetails{CommonName: "test.trisa.example.com"}, + Mainnet: &models.NetworkDetails{CommonName: "trisa.example.com"}, }, assert: require.False, networks: []string{"testnet", "mainnet", "all", "both", ""}, @@ -177,10 +162,9 @@ func TestReadyToSubmit(t *testing.T) { }, { r: &models.RegistrationForm{ - VaspCategories: []string{"P2P", "other"}, - Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, - Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, - Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, + Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, + Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, + Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, }, assert: require.False, networks: []string{"testnet", "mainnet", "all", "both", ""}, @@ -188,11 +172,10 @@ func TestReadyToSubmit(t *testing.T) { }, { r: &models.RegistrationForm{ - VaspCategories: []string{"P2P", "other"}, - Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, - Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, - Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, - Testnet: &models.NetworkDetails{CommonName: "test.trisa.example.com"}, + Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, + Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, + Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, + Testnet: &models.NetworkDetails{CommonName: "test.trisa.example.com"}, }, assert: require.False, networks: []string{"mainnet", "all", "both", ""}, @@ -200,11 +183,10 @@ func TestReadyToSubmit(t *testing.T) { }, { r: &models.RegistrationForm{ - VaspCategories: []string{"P2P", "other"}, - Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, - Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, - Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, - Testnet: &models.NetworkDetails{CommonName: "test.trisa.example.com"}, + Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, + Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, + Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, + Testnet: &models.NetworkDetails{CommonName: "test.trisa.example.com"}, }, assert: require.True, networks: []string{"testnet"}, @@ -212,11 +194,10 @@ func TestReadyToSubmit(t *testing.T) { }, { r: &models.RegistrationForm{ - VaspCategories: []string{"P2P", "other"}, - Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, - Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, - Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, - Mainnet: &models.NetworkDetails{CommonName: "trisa.example.com"}, + Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, + Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, + Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, + Mainnet: &models.NetworkDetails{CommonName: "trisa.example.com"}, }, assert: require.False, networks: []string{"testnet", "all", "both", ""}, @@ -224,11 +205,10 @@ func TestReadyToSubmit(t *testing.T) { }, { r: &models.RegistrationForm{ - VaspCategories: []string{"P2P", "other"}, - Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, - Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, - Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, - Mainnet: &models.NetworkDetails{CommonName: "trisa.example.com"}, + Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, + Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, + Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, + Mainnet: &models.NetworkDetails{CommonName: "trisa.example.com"}, }, assert: require.True, networks: []string{"mainnet"}, @@ -236,12 +216,11 @@ func TestReadyToSubmit(t *testing.T) { }, { r: &models.RegistrationForm{ - VaspCategories: []string{"P2P", "other"}, - Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, - Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, - Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, - Testnet: &models.NetworkDetails{CommonName: "test.trisa.example.com"}, - Mainnet: &models.NetworkDetails{CommonName: "trisa.example.com"}, + Entity: &ivms101.LegalPerson{CountryOfRegistration: "GY"}, + Contacts: &gds.Contacts{Technical: &gds.Contact{Email: "jdoe@example.com"}}, + Trixo: &gds.TRIXOQuestionnaire{PrimaryNationalJurisdiction: "GY"}, + Testnet: &models.NetworkDetails{CommonName: "test.trisa.example.com"}, + Mainnet: &models.NetworkDetails{CommonName: "trisa.example.com"}, }, assert: require.True, networks: []string{"testnet", "mainnet", "all", "both", ""},