before adding COA packages

This commit is contained in:
2020-10-15 08:48:11 -04:00
parent d990c53029
commit 4630b54fd2
10 changed files with 60 additions and 8 deletions

View File

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>COA.EnterpriseServices.Creditors</AssemblyName>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\COA.EnterpriseServices.DataAccess\COA.EnterpriseServices.DataAccess.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,27 @@
namespace COA.EnterpriseServices.Creditors
{
public class CreditorController
{
private readonly CreditorLibrary creditorLibrary;
public CreditorController(CreditorLibrary creditorLibrary)
{
this.creditorLibrary = creditorLibrary;
}
public string GetCreditorStatus(int creditorId)
{
return creditorLibrary.GetCreditorStatus(creditorId);
}
public bool SetCreditorStatus(int creditorId, string status)
{
return creditorLibrary.SetCreditorStatus(creditorId, status);
}
public void AddOfferResponse()
{
creditorLibrary.AddOfferResponse();
}
}
}

View File

@ -0,0 +1,33 @@
using COA.EnterpriseServices.DataAccess.Helpers;
namespace COA.EnterpriseServices.Creditors
{
public class CreditorLibrary
{
private readonly CreditorHelper creditorHelper;
public CreditorLibrary(CreditorHelper creditorHelper)
{
this.creditorHelper = creditorHelper;
}
public string GetCreditorStatus(int creditorId)
{
var creditor = creditorHelper.GetCreditor(creditorId);
return creditor.Status;
}
public bool SetCreditorStatus(int creditorId, string status)
{
return creditorHelper.SetCreditorStatus(creditorId, status);
}
public void AddOfferResponse()
{
// just a stub until we add actual DataObjects
creditorHelper.SetOriginalCreditorAsPrimary(1);
}
}
}