Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
{
|
||||
public interface IAbstractInterface
|
||||
{
|
||||
bool SaveChanges();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Microsoft.SelfService.Portal.Core.API.Models;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
{
|
||||
public interface IDeploymentBatchInterface
|
||||
{
|
||||
ICollection<DeploymentGroupModel> GetDeploymentBatches();
|
||||
|
||||
DeploymentGroupModel? GetDeploymentBatchById(Guid id);
|
||||
|
||||
bool AddDeploymentBatchById(DeploymentGroupModel deploymentBatch, ICollection<Guid>? targetIds);
|
||||
|
||||
bool DeleteDeploymentBatchById(DeploymentGroupModel deploymentBatch);
|
||||
|
||||
bool EditDeploymentBatchById(DeploymentGroupModel deploymentBatch);
|
||||
|
||||
bool CheckDeploymentBatchById(Guid id);
|
||||
|
||||
bool SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
using Microsoft.SelfService.Portal.Core.API.Models;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
{
|
||||
public interface IDeploymentGroupInterface
|
||||
{
|
||||
ICollection<DeploymentGroupModel> GetDeploymentGroups();
|
||||
|
||||
DeploymentGroupModel GetDeploymentGroupById(Guid Id);
|
||||
bool AddDeploymentGroupById(DeploymentGroupModel deploymentgroup, ICollection<Guid>? virtualMachineIds);
|
||||
bool DeleteDeploymentGroupById(DeploymentGroupModel deploymentgroup);
|
||||
bool EditDeploymentGroupById(DeploymentGroupModel deploymentgroup);
|
||||
|
||||
bool CheckDeploymentGroupById(Guid Id);
|
||||
|
||||
bool SaveChanges();
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,11 @@ namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
bool AddDeploymentById(DeploymentModel deployment);
|
||||
bool DeleteDeploymentById(DeploymentModel deployment);
|
||||
bool EditDeploymentById(DeploymentModel deployment);
|
||||
DeploymentModel GetDeploymentByCompositeId(Guid deploymentGroupId, Guid targetId);
|
||||
bool CheckDeploymentByCompositeId(Guid deploymentGroupId, Guid targetId);
|
||||
|
||||
bool CheckDeploymentById(Guid Id);
|
||||
bool SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
bool EditDomainById(DomainModel domain);
|
||||
|
||||
DomainModel GetDomainByIdInEnvironments(Guid Id);
|
||||
DomainModel GetVirtualMachinesByDomainId(Guid Id);
|
||||
DomainModel GetTargetsByDomainId(Guid Id);
|
||||
|
||||
bool LinkDomainByIdToEnvironment(EnvironmentDomainsModel environmentDomain);
|
||||
bool UnlinkDomainByIdFromEnvironment(EnvironmentDomainsModel environmentDomain);
|
||||
@@ -23,3 +23,4 @@ namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
bool SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,3 +20,4 @@ namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
bool SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
using Microsoft.SelfService.Portal.Core.API.Models;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
{
|
||||
public interface IJobInterface : IAbstractInterface
|
||||
{
|
||||
ICollection<JobModel> GetJobs();
|
||||
JobModel GetJobById(Guid Id);
|
||||
|
||||
bool CreateJobById(JobModel job);
|
||||
bool UpdateJobById(JobModel job);
|
||||
bool DeleteJobById(JobModel job);
|
||||
|
||||
bool CheckJobById(Guid Id);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
{
|
||||
public interface IQueueJobService
|
||||
{
|
||||
Guid EnqueueTemplateJsonChanged(Guid templateId, string oldJsonData, string newJsonData);
|
||||
Guid EnqueueDeploymentRequest(Guid deploymentGroupId, ICollection<Guid> virtualMachineIds, string jsonData);
|
||||
Guid EnqueueDeploymentRequest(Guid deploymentGroupId, ICollection<Guid> targetIds, string jsonData);
|
||||
bool RetryQueueJob(Guid queueJobId);
|
||||
bool ApproveQueueJobStep(Guid queueJobStepId, string approvedBy, string? comment);
|
||||
bool RejectQueueJobStep(Guid queueJobStepId, string approvedBy, string? comment);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
using Microsoft.SelfService.Portal.Core.API.Models;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
{
|
||||
public interface IRunbookInterface
|
||||
{
|
||||
ICollection<RunbookModel> GetRunbooks();
|
||||
|
||||
RunbookModel GetRunbookById(Guid Id);
|
||||
bool AddRunbookById(RunbookModel runbook);
|
||||
bool EditRunbookById(RunbookModel runbook);
|
||||
|
||||
bool CheckRunbookById(Guid Id);
|
||||
bool CheckRunbookByName(string Name);
|
||||
|
||||
bool SaveChanges();
|
||||
}
|
||||
}
|
||||
@@ -28,3 +28,4 @@ namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using Microsoft.SelfService.Portal.Core.API.Models;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
{
|
||||
public interface ITargetInterface
|
||||
{
|
||||
ICollection<TargetModel> GetTargets();
|
||||
bool AddTargetById(TargetModel target);
|
||||
bool EditTargetById(TargetModel target);
|
||||
bool DeleteTargetById(TargetModel target);
|
||||
|
||||
TargetModel GetTargetById(Guid Id);
|
||||
TargetModel GetTargetByName(string Name);
|
||||
|
||||
bool CheckTargetById(Guid Id);
|
||||
bool CheckTargetByName(String Name);
|
||||
bool SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Microsoft.SelfService.Portal.Core.API.Models;
|
||||
using Microsoft.SelfService.Portal.Core.API.Models;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
{
|
||||
@@ -18,3 +18,4 @@ namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
bool SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,14 @@ namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
bool CheckTemplateById(Guid Id);
|
||||
TemplateModel GetTemplateByName(string Name);
|
||||
bool CheckTemplateByName(string Name);
|
||||
ICollection<TemplateVersionModel> GetTemplateVersions(Guid templateId);
|
||||
TemplateVersionModel? GetTemplateVersionById(Guid templateId, Guid versionId);
|
||||
TemplateVersionModel? GetPublishedTemplateVersion(Guid templateId);
|
||||
bool AddTemplateVersion(Guid templateId, TemplateVersionModel version, bool publish);
|
||||
bool PublishTemplateVersion(Guid templateId, Guid versionId, string? publishedBy);
|
||||
bool CheckTemplateVersionById(Guid templateId, Guid versionId);
|
||||
bool CheckTemplateVersionByVersion(Guid templateId, string version);
|
||||
bool SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
using Microsoft.SelfService.Portal.Core.API.Models;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Interfaces
|
||||
{
|
||||
public interface IVirtualMachineInterface
|
||||
{
|
||||
ICollection<VirtualMachineModel> GetVirtualMachines();
|
||||
bool AddVirtualMachineById(VirtualMachineModel virtualMachine);
|
||||
bool EditVirtualMachineById(VirtualMachineModel virtualMachine);
|
||||
bool DeleteVirtualMachineById(VirtualMachineModel virtualMachine);
|
||||
|
||||
VirtualMachineModel GetVirtualMachineById(Guid Id);
|
||||
VirtualMachineModel GetVirtualMachineByName(string Name);
|
||||
|
||||
bool CheckVirtualMachineById(Guid Id);
|
||||
bool CheckVirtualMachineByName(String Name);
|
||||
bool SaveChanges();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user