From a898eeed6f76b2622c9e6307f2f2b8e3fa79770e Mon Sep 17 00:00:00 2001 From: Frede Hundewadt Date: Wed, 8 Nov 2023 16:07:04 +0100 Subject: [PATCH] clean up remove unused code customer validator --- Wonky.Client/Helpers/CustomerValidator.cs | 36 ----------------------- 1 file changed, 36 deletions(-) delete mode 100644 Wonky.Client/Helpers/CustomerValidator.cs diff --git a/Wonky.Client/Helpers/CustomerValidator.cs b/Wonky.Client/Helpers/CustomerValidator.cs deleted file mode 100644 index 4b43bf94..00000000 --- a/Wonky.Client/Helpers/CustomerValidator.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] -// - -using Wonky.Entity.DTO; - -namespace Wonky.Client.Helpers; - -internal interface IValidator -{ - bool Validate(T t); -} - -public class CustomerValidator : IValidator -{ - public bool Validate(CompanyDto t) - { - if (string.IsNullOrWhiteSpace(t.Name) - || string.IsNullOrWhiteSpace(t.ZipCode) - || string.IsNullOrWhiteSpace(t.City) - || string.IsNullOrWhiteSpace(t.CountryCode)) return false; - - return string.IsNullOrWhiteSpace(t.VatNumber) || VatUtils.ValidateFormat(t.CountryCode, t.VatNumber); - } -}