Removed all sync controllers from Biskilog account backend #14
Merged
barhen
merged 1 commits from checkpoint-split-cloud-manager-controllers
into dev
1 year ago
11 changed files with 8 additions and 516 deletions
@ -1,18 +0,0 @@ |
|||||
using Biskilog_Accounting.Shared.CustomModels; |
|
||||
using Biskilog_Accounting.Shared.Interfaces; |
|
||||
using Microsoft.AspNetCore.SignalR; |
|
||||
|
|
||||
namespace Biskilog_Accounting.Server.CloudHubs |
|
||||
{ |
|
||||
public class SalesHub : Hub<ISalesHub> |
|
||||
{ |
|
||||
public async Task JoinCompanyGroup(string a_companyId) |
|
||||
{ |
|
||||
await Groups.AddToGroupAsync(Context.ConnectionId, a_companyId); |
|
||||
} |
|
||||
public async Task AddTransaction(string a_companyId, SaleItem a_sale) |
|
||||
{ |
|
||||
await Clients.OthersInGroup(a_companyId).TransactionMade(a_sale); |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,151 +0,0 @@ |
|||||
using Biskilog_Accounting.Shared.CustomModels; |
|
||||
using Biskilog_Accounting.Shared.Interfaces; |
|
||||
using Biskilog_Accounting.Shared.POSModels; |
|
||||
using Microsoft.AspNetCore.Authorization; |
|
||||
using Microsoft.AspNetCore.Http; |
|
||||
using Microsoft.AspNetCore.Mvc; |
|
||||
using System.Runtime.InteropServices; |
|
||||
|
|
||||
namespace Biskilog_Accounting.Server.SyncControllers |
|
||||
{ |
|
||||
[Route("api/[controller]")]
|
|
||||
[ApiController] |
|
||||
public class SyncCompanyInfoController : ControllerBase |
|
||||
{ |
|
||||
private readonly ISalesInterface m_salesService; |
|
||||
private readonly ICustomer m_customer; |
|
||||
private readonly IUser m_users; |
|
||||
private readonly ICompanyInfo m_companyInfo; |
|
||||
public SyncCompanyInfoController(ISalesInterface a_salesService, ICustomer customer, IUser users,ICompanyInfo a_companyInfo) |
|
||||
{ |
|
||||
m_salesService = a_salesService; |
|
||||
m_customer = customer; |
|
||||
m_users = users; |
|
||||
m_companyInfo = a_companyInfo; |
|
||||
} |
|
||||
// GET: api/<SyncCompanyInfoController>
|
|
||||
[Authorize] |
|
||||
[HttpGet, Route("lastsyncdate/{a_tableName}")] |
|
||||
public DateTime GetLastSyncDate(string a_tableName) |
|
||||
{ |
|
||||
return m_salesService.GetLastSyncDate(a_tableName); |
|
||||
} |
|
||||
// Post: api/<SyncCompanyInfoController>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("setsyncdate")] |
|
||||
public void SetLastSyncDate(SyncTimestamp a_timestamp) |
|
||||
{ |
|
||||
m_salesService.SetLastSyncDate(a_timestamp.TableName, a_timestamp.Timestamp); |
|
||||
} |
|
||||
// POST api/<SyncCompanyInfoController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of SystemUserRoles rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/SystemRoles")] |
|
||||
public async Task SyncSyatemRolesAsync(List<Systemuserrole> a_item) |
|
||||
{ |
|
||||
await m_companyInfo.SyncSystemRoles(a_item); |
|
||||
} |
|
||||
// POST api/<SyncCompanyInfoController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblDriver rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblDriver")] |
|
||||
public async Task SyncDriversAsync(List<Tbldriver> a_item) |
|
||||
{ |
|
||||
await m_companyInfo.SyncDriverDetails(a_item); |
|
||||
} |
|
||||
// POST api/<SyncCompanyInfoController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of CompanyDetails rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblcompanydetails")] |
|
||||
public async Task SyncCompanyAsync(List<Tblcompanydetail> a_item) |
|
||||
{ |
|
||||
await m_companyInfo.SyncCompanyDetails(a_item); |
|
||||
} |
|
||||
// POST api/<SyncCompanyInfoController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblUsers rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblusers")] |
|
||||
public async Task SyncUsersAsync(List<Tbluser> a_item) |
|
||||
{ |
|
||||
await m_users.SyncUserAsync(a_item); |
|
||||
} |
|
||||
// POST api/<SyncCompanyInfoController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of Trucks rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tbltrucks")] |
|
||||
public async Task SyncTrucksAsync(List<Tbltruck> a_item) |
|
||||
{ |
|
||||
await m_companyInfo.SyncTrucks(a_item); |
|
||||
} |
|
||||
// POST api/<SyncCompanyInfoController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblBranch rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblbranch")] |
|
||||
public async Task SyncBranchAsync(List<Tblbranch> a_item) |
|
||||
{ |
|
||||
await m_companyInfo.SyncBranches(a_item); |
|
||||
} |
|
||||
// POST api/<SyncCompanyInfoController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblCustomers rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblcustomers")] |
|
||||
public async Task SyncCustomersAsync(List<Tblcustomer> a_item) |
|
||||
{ |
|
||||
await m_customer.SyncCustomers(a_item); |
|
||||
} |
|
||||
// POST api/<SyncCompanyInfoController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblTruck Inventory rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tbltruckinventory")] |
|
||||
public async Task SyncTruckInventoryAsync(List<Tbltruckinventory> a_item) |
|
||||
{ |
|
||||
await m_companyInfo.SyncTruckInventory(a_item); |
|
||||
} |
|
||||
// POST api/<SyncCompanyInfoController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblTruckAssignment rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblTruckAssignment")] |
|
||||
public async Task SyncTruckAssignmentSync(List<Tbltruckassignment> a_item) |
|
||||
{ |
|
||||
await m_companyInfo.SyncTruckAssignments(a_item); |
|
||||
} |
|
||||
// POST api/<SyncCompanyInfoController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblDriverMapping rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tbldrivermappings")] |
|
||||
public async Task SyncTruckDriverMappingSync(List<TbltruckDrivermapping> a_item) |
|
||||
{ |
|
||||
await m_companyInfo.SyncTruckMappings(a_item); |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,145 +0,0 @@ |
|||||
using Biskilog_Accounting.Server.Services; |
|
||||
using Biskilog_Accounting.Shared.CustomModels; |
|
||||
using Biskilog_Accounting.Shared.Interfaces; |
|
||||
using Biskilog_Accounting.Shared.POSModels; |
|
||||
using Microsoft.AspNetCore.Authorization; |
|
||||
using Microsoft.AspNetCore.Http; |
|
||||
using Microsoft.AspNetCore.Mvc; |
|
||||
|
|
||||
namespace Biskilog_Accounting.Server.SyncControllers |
|
||||
{ |
|
||||
[Route("api/[controller]")]
|
|
||||
[ApiController] |
|
||||
public class SyncProductsController : ControllerBase |
|
||||
{ |
|
||||
private readonly IProduct m_productService; |
|
||||
public SyncProductsController(IProduct a_productService) |
|
||||
{ |
|
||||
m_productService = a_productService; |
|
||||
} |
|
||||
// GET: api/<SyncProductsController>
|
|
||||
[Authorize] |
|
||||
[HttpGet, Route("lastsyncdate/{a_tableName}")] |
|
||||
public DateTime GetLastSyncDate(string a_tableName) |
|
||||
{ |
|
||||
return m_productService.GetLastSyncDate(a_tableName); |
|
||||
} |
|
||||
// Post: api/<SyncProductsController>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("setsyncdate")] |
|
||||
public void SetLastSyncDate(SyncTimestamp a_timestamp) |
|
||||
{ |
|
||||
m_productService.SetLastSyncDate(a_timestamp.TableName, a_timestamp.Timestamp); |
|
||||
} |
|
||||
// POST api/<SyncProductsController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblProduct rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblProducts")] |
|
||||
public async Task SyncProductsAsync(List<Tblproduct> a_item) |
|
||||
{ |
|
||||
await m_productService.SyncProducts(a_item); |
|
||||
} |
|
||||
// POST api/<SyncProductsController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblInventory rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblInventory")] |
|
||||
public async Task SyncInventoryAsync(List<Tblinventory> a_item) |
|
||||
{ |
|
||||
await m_productService.SyncInventory(a_item); |
|
||||
} |
|
||||
// POST api/<SyncProductsController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of Restock rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblRestock")] |
|
||||
public async Task SyncRestockAsync(List<Restocklevel> a_item) |
|
||||
{ |
|
||||
await m_productService.SyncRestockAsync(a_item); |
|
||||
} |
|
||||
// POST api/<SyncProductsController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblInventoryEntries rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblInventoryentry")] |
|
||||
public async Task SyncInventoryEntriesAsync(List<Tblinventoryentry> a_item) |
|
||||
{ |
|
||||
await m_productService.SyncInventoryEntries(a_item); |
|
||||
} |
|
||||
// POST api/<SyncProductsController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of PriceChanges rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tlpricechanges")] |
|
||||
public async Task SyncPriceChangesAsync(List<Tblpricechange> a_item) |
|
||||
{ |
|
||||
await m_productService.SyncPriceChanges(a_item); |
|
||||
} |
|
||||
// POST api/<SyncProductsController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of ProductAltUnit rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblProductAltUnit")] |
|
||||
public async Task SyncProductAltUnitAsync(List<Productaltunit> a_item) |
|
||||
{ |
|
||||
await m_productService.SyncProductAltUnit(a_item); |
|
||||
} |
|
||||
// POST api/<SyncProductsController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TbStock rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblStock")] |
|
||||
public async Task SyncStockAsync(List<Tbstock> a_item) |
|
||||
{ |
|
||||
await m_productService.SyncStockAsync(a_item); |
|
||||
} |
|
||||
// POST api/<SyncProductsController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblBrands rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblbrands")] |
|
||||
public async Task SyncBrandsAsync(List<Tblbrand> a_item) |
|
||||
{ |
|
||||
await m_productService.SyncBrandsAsync(a_item); |
|
||||
} |
|
||||
// POST api/<SyncProductsController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblCategory rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblCategories")] |
|
||||
public async Task SyncCategoriesAsync(List<Tblcategory> a_item) |
|
||||
{ |
|
||||
await m_productService.SyncCategoriesAsync(a_item); |
|
||||
} |
|
||||
// POST api/<SyncProductsController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of UnitOfMeasure rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblunitofmeasure")] |
|
||||
public async Task SyncUnitMeasureAsync(List<Unitofmeasure> a_item) |
|
||||
{ |
|
||||
await m_productService.SyncUnitOfMeasureAsync(a_item); |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,145 +0,0 @@ |
|||||
using Biskilog_Accounting.Shared.CustomModels; |
|
||||
using Biskilog_Accounting.Shared.Interfaces; |
|
||||
using Biskilog_Accounting.Shared.POSModels; |
|
||||
using Microsoft.AspNetCore.Authorization; |
|
||||
using Microsoft.AspNetCore.Mvc; |
|
||||
|
|
||||
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
|
||||
|
|
||||
namespace Biskilog_Accounting.Server.SyncControllers |
|
||||
{ |
|
||||
[Route("api/[controller]")]
|
|
||||
[ApiController] |
|
||||
public class SyncSalesController : ControllerBase |
|
||||
{ |
|
||||
private readonly ISalesInterface m_salesService; |
|
||||
public SyncSalesController(ISalesInterface a_salesService) |
|
||||
{ |
|
||||
m_salesService = a_salesService; |
|
||||
} |
|
||||
// GET: api/<SyncSalesController>
|
|
||||
[Authorize] |
|
||||
[HttpGet, Route("lastsyncdate/{a_tableName}")] |
|
||||
public DateTime GetLastSyncDate(string a_tableName) |
|
||||
{ |
|
||||
return m_salesService.GetLastSyncDate(a_tableName); |
|
||||
} |
|
||||
// Post: api/<SyncSalesController>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("setsyncdate")] |
|
||||
public void SetLastSyncDate(SyncTimestamp a_timestamp) |
|
||||
{ |
|
||||
m_salesService.SetLastSyncDate(a_timestamp.TableName, a_timestamp.Timestamp); |
|
||||
} |
|
||||
// POST api/<SyncSalesController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblCart rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblCart")] |
|
||||
public async Task SyncSalesAsync(List<Tblcart> a_item) |
|
||||
{ |
|
||||
await m_salesService.SyncCart(a_item); |
|
||||
} |
|
||||
// POST api/<SyncSalesController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblCancelledTransation rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblcancelledtransaction")] |
|
||||
public async Task SyncCancelledTransactionAsync(List<Tblcancelledtransaction> a_item) |
|
||||
{ |
|
||||
await m_salesService.SyncCancelledTransaction(a_item); |
|
||||
} |
|
||||
// POST api/<SyncSalesController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of TblInvoice rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblinvoice")] |
|
||||
public async Task SyncInvoiceAsync(List<Tblinvoice> a_item) |
|
||||
{ |
|
||||
await m_salesService.SyncInvoice(a_item); |
|
||||
} |
|
||||
// POST api/<SyncSalesController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of CreditPurchase rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblCreditpurchase")] |
|
||||
public async Task SyncCreditPurchaseAsync(List<Creditpurchase> a_item) |
|
||||
{ |
|
||||
await m_salesService.SyncCreditPurchase(a_item); |
|
||||
} |
|
||||
// POST api/<SyncSalesController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of Customer Account rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblCustomerAccount")] |
|
||||
public async Task SyncCustomerAccountAsync(List<Customeraccount> a_item) |
|
||||
{ |
|
||||
await m_salesService.SyncCustomerAccount(a_item); |
|
||||
} |
|
||||
// POST api/<SyncSalesController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of Customer Purchase rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/CustomerPurchase")] |
|
||||
public async Task SyncCustomerPurchaseAsync(List<Tblcustomerpurchase> a_item) |
|
||||
{ |
|
||||
await m_salesService.SyncCustomerPurchase(a_item); |
|
||||
} |
|
||||
// POST api/<SyncSalesController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of Discount logs rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/DiscountLogs")] |
|
||||
public async Task SyncDiscountLogsAsync(List<Tbldiscountlog> a_item) |
|
||||
{ |
|
||||
await m_salesService.SyncDiscountLogs(a_item); |
|
||||
} |
|
||||
// POST api/<SyncSalesController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of Delivery Head rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblDeliveryhead")] |
|
||||
public async Task SyncDeliveryHeadAsync(List<Tbldeliveryhead> a_item) |
|
||||
{ |
|
||||
await m_salesService.SyncDeliveryHead(a_item); |
|
||||
} |
|
||||
// POST api/<SyncSalesController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of Delivery Details rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblDeliverydetails")] |
|
||||
public async Task SyncDeliveryDetailsAsync(List<Tbldeliverydetail> a_item) |
|
||||
{ |
|
||||
await m_salesService.SyncDeliveryDetails(a_item); |
|
||||
} |
|
||||
// POST api/<SyncSalesController>
|
|
||||
/// <summary>
|
|
||||
/// Endpoint to publish a collection of Delivery Recipient rows to the cloud
|
|
||||
/// </summary>
|
|
||||
/// <param name="a_item"></param>
|
|
||||
[Authorize] |
|
||||
[HttpPost, Route("publish/tblDeliveryrecipient")] |
|
||||
public async Task SyncDeliveryRecipientAsync(List<Tbldeliveryrecipient> a_item) |
|
||||
{ |
|
||||
await m_salesService.SyncDeliveryRecipients(a_item); |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,10 +0,0 @@ |
|||||
using Biskilog_Accounting.Shared.CustomModels; |
|
||||
|
|
||||
namespace Biskilog_Accounting.Shared.Interfaces |
|
||||
{ |
|
||||
public interface ISalesHub |
|
||||
{ |
|
||||
Task TransactionMade(SaleItem a_transaction); |
|
||||
Task JoinCompanyGroup(); |
|
||||
} |
|
||||
} |
|
Loading…
Reference in new issue