From 44d46158ee654018ec4c563281b0f7edd46ddc03 Mon Sep 17 00:00:00 2001 From: Jack Edwards Date: Mon, 13 Jan 2025 21:13:30 -0600 Subject: [PATCH] Move AddUserContactError.cs and thus eliminate a namespace --- .../Controllers/UserContactController.cs | 1 - .../Requests/UserContactRequests.cs | 1 - .../Requests/IUserContactRequests.cs | 1 - .../Services/IUserContactsService.cs | 1 - .../Services/UserContactsService.cs | 1 - .../{ErrorCodes => }/AddUserContactError.cs | 68 +++++++++---------- .../Commands/AddUserContactCommand.cs | 1 - .../UserContact_Tests/AddUserContact_Tests.cs | 1 - .../UserContact_Tests/GetUserContact_Tests.cs | 1 - .../RemoveUserContact_Tests.cs | 1 - 10 files changed, 34 insertions(+), 43 deletions(-) rename Crypter.Common/Contracts/Features/Contacts/{ErrorCodes => }/AddUserContactError.cs (92%) diff --git a/Crypter.API/Controllers/UserContactController.cs b/Crypter.API/Controllers/UserContactController.cs index 6ce5bfde1..269edad56 100644 --- a/Crypter.API/Controllers/UserContactController.cs +++ b/Crypter.API/Controllers/UserContactController.cs @@ -31,7 +31,6 @@ using Crypter.API.Controllers.Base; using Crypter.Common.Contracts; using Crypter.Common.Contracts.Features.Contacts; -using Crypter.Common.Contracts.Features.Contacts.RequestErrorCodes; using Crypter.Core.Features.UserContacts.Commands; using Crypter.Core.Features.UserContacts.Queries; using EasyMonads; diff --git a/Crypter.Common.Client/HttpClients/Requests/UserContactRequests.cs b/Crypter.Common.Client/HttpClients/Requests/UserContactRequests.cs index 4b79fec30..bc387b301 100644 --- a/Crypter.Common.Client/HttpClients/Requests/UserContactRequests.cs +++ b/Crypter.Common.Client/HttpClients/Requests/UserContactRequests.cs @@ -29,7 +29,6 @@ using Crypter.Common.Client.Interfaces.HttpClients; using Crypter.Common.Client.Interfaces.Requests; using Crypter.Common.Contracts.Features.Contacts; -using Crypter.Common.Contracts.Features.Contacts.RequestErrorCodes; using EasyMonads; namespace Crypter.Common.Client.HttpClients.Requests; diff --git a/Crypter.Common.Client/Interfaces/Requests/IUserContactRequests.cs b/Crypter.Common.Client/Interfaces/Requests/IUserContactRequests.cs index c26d26d9b..fee8cc5ae 100644 --- a/Crypter.Common.Client/Interfaces/Requests/IUserContactRequests.cs +++ b/Crypter.Common.Client/Interfaces/Requests/IUserContactRequests.cs @@ -27,7 +27,6 @@ using System.Collections.Generic; using System.Threading.Tasks; using Crypter.Common.Contracts.Features.Contacts; -using Crypter.Common.Contracts.Features.Contacts.RequestErrorCodes; using EasyMonads; namespace Crypter.Common.Client.Interfaces.Requests; diff --git a/Crypter.Common.Client/Interfaces/Services/IUserContactsService.cs b/Crypter.Common.Client/Interfaces/Services/IUserContactsService.cs index 5401a2064..d8efba6fb 100644 --- a/Crypter.Common.Client/Interfaces/Services/IUserContactsService.cs +++ b/Crypter.Common.Client/Interfaces/Services/IUserContactsService.cs @@ -27,7 +27,6 @@ using System.Collections.Generic; using System.Threading.Tasks; using Crypter.Common.Contracts.Features.Contacts; -using Crypter.Common.Contracts.Features.Contacts.RequestErrorCodes; using EasyMonads; namespace Crypter.Common.Client.Interfaces.Services; diff --git a/Crypter.Common.Client/Services/UserContactsService.cs b/Crypter.Common.Client/Services/UserContactsService.cs index ea0ef7393..3f87de5ed 100644 --- a/Crypter.Common.Client/Services/UserContactsService.cs +++ b/Crypter.Common.Client/Services/UserContactsService.cs @@ -33,7 +33,6 @@ using Crypter.Common.Client.Interfaces.HttpClients; using Crypter.Common.Client.Interfaces.Services; using Crypter.Common.Contracts.Features.Contacts; -using Crypter.Common.Contracts.Features.Contacts.RequestErrorCodes; using EasyMonads; namespace Crypter.Common.Client.Services; diff --git a/Crypter.Common/Contracts/Features/Contacts/ErrorCodes/AddUserContactError.cs b/Crypter.Common/Contracts/Features/Contacts/AddUserContactError.cs similarity index 92% rename from Crypter.Common/Contracts/Features/Contacts/ErrorCodes/AddUserContactError.cs rename to Crypter.Common/Contracts/Features/Contacts/AddUserContactError.cs index e10f9ad99..bf2bdd150 100644 --- a/Crypter.Common/Contracts/Features/Contacts/ErrorCodes/AddUserContactError.cs +++ b/Crypter.Common/Contracts/Features/Contacts/AddUserContactError.cs @@ -1,34 +1,34 @@ -/* - * Copyright (C) 2023 Crypter File Transfer - * - * This file is part of the Crypter file transfer project. - * - * Crypter 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. - * - * The Crypter source code 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 . - * - * You can be released from the requirements of the aforementioned license - * by purchasing a commercial license. Buying such a license is mandatory - * as soon as you develop commercial activities involving the Crypter source - * code without disclosing the source code of your own applications. - * - * Contact the current copyright holder to discuss commercial license options. - */ - -namespace Crypter.Common.Contracts.Features.Contacts.RequestErrorCodes; - -public enum AddUserContactError -{ - UnknownError, - NotFound, - InvalidUser -} +/* + * Copyright (C) 2023 Crypter File Transfer + * + * This file is part of the Crypter file transfer project. + * + * Crypter 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. + * + * The Crypter source code 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 . + * + * You can be released from the requirements of the aforementioned license + * by purchasing a commercial license. Buying such a license is mandatory + * as soon as you develop commercial activities involving the Crypter source + * code without disclosing the source code of your own applications. + * + * Contact the current copyright holder to discuss commercial license options. + */ + +namespace Crypter.Common.Contracts.Features.Contacts; + +public enum AddUserContactError +{ + UnknownError, + NotFound, + InvalidUser +} diff --git a/Crypter.Core/Features/UserContacts/Commands/AddUserContactCommand.cs b/Crypter.Core/Features/UserContacts/Commands/AddUserContactCommand.cs index 9733ad670..50044e370 100644 --- a/Crypter.Core/Features/UserContacts/Commands/AddUserContactCommand.cs +++ b/Crypter.Core/Features/UserContacts/Commands/AddUserContactCommand.cs @@ -29,7 +29,6 @@ using System.Threading; using System.Threading.Tasks; using Crypter.Common.Contracts.Features.Contacts; -using Crypter.Common.Contracts.Features.Contacts.RequestErrorCodes; using Crypter.Core.LinqExpressions; using Crypter.Core.MediatorMonads; using Crypter.DataAccess; diff --git a/Crypter.Test/Integration_Tests/UserContact_Tests/AddUserContact_Tests.cs b/Crypter.Test/Integration_Tests/UserContact_Tests/AddUserContact_Tests.cs index 63c1b5077..7b969be79 100644 --- a/Crypter.Test/Integration_Tests/UserContact_Tests/AddUserContact_Tests.cs +++ b/Crypter.Test/Integration_Tests/UserContact_Tests/AddUserContact_Tests.cs @@ -28,7 +28,6 @@ using Crypter.Common.Client.Interfaces.HttpClients; using Crypter.Common.Client.Interfaces.Repositories; using Crypter.Common.Contracts.Features.Contacts; -using Crypter.Common.Contracts.Features.Contacts.RequestErrorCodes; using Crypter.Common.Contracts.Features.UserAuthentication; using Crypter.Common.Enums; using EasyMonads; diff --git a/Crypter.Test/Integration_Tests/UserContact_Tests/GetUserContact_Tests.cs b/Crypter.Test/Integration_Tests/UserContact_Tests/GetUserContact_Tests.cs index 1d9ec6b4b..1e8da2137 100644 --- a/Crypter.Test/Integration_Tests/UserContact_Tests/GetUserContact_Tests.cs +++ b/Crypter.Test/Integration_Tests/UserContact_Tests/GetUserContact_Tests.cs @@ -29,7 +29,6 @@ using Crypter.Common.Client.Interfaces.HttpClients; using Crypter.Common.Client.Interfaces.Repositories; using Crypter.Common.Contracts.Features.Contacts; -using Crypter.Common.Contracts.Features.Contacts.RequestErrorCodes; using Crypter.Common.Contracts.Features.UserAuthentication; using Crypter.Common.Enums; using EasyMonads; diff --git a/Crypter.Test/Integration_Tests/UserContact_Tests/RemoveUserContact_Tests.cs b/Crypter.Test/Integration_Tests/UserContact_Tests/RemoveUserContact_Tests.cs index 3e6fa18a5..e08372ad4 100644 --- a/Crypter.Test/Integration_Tests/UserContact_Tests/RemoveUserContact_Tests.cs +++ b/Crypter.Test/Integration_Tests/UserContact_Tests/RemoveUserContact_Tests.cs @@ -29,7 +29,6 @@ using Crypter.Common.Client.Interfaces.HttpClients; using Crypter.Common.Client.Interfaces.Repositories; using Crypter.Common.Contracts.Features.Contacts; -using Crypter.Common.Contracts.Features.Contacts.RequestErrorCodes; using Crypter.Common.Contracts.Features.UserAuthentication; using Crypter.Common.Enums; using EasyMonads;