diff --git a/.cr/personal/FavoritesList/List.xml b/.cr/personal/FavoritesList/List.xml
new file mode 100644
index 0000000..a60e5ed
--- /dev/null
+++ b/.cr/personal/FavoritesList/List.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.deepsource.toml b/.deepsource.toml
deleted file mode 100644
index 9b460c4..0000000
--- a/.deepsource.toml
+++ /dev/null
@@ -1,5 +0,0 @@
-version = 1
-
-[[analyzers]]
-name = "csharp"
-enabled = true
\ No newline at end of file
diff --git a/.dockerignore b/.dockerignore
deleted file mode 100644
index 3729ff0..0000000
--- a/.dockerignore
+++ /dev/null
@@ -1,25 +0,0 @@
-**/.classpath
-**/.dockerignore
-**/.env
-**/.git
-**/.gitignore
-**/.project
-**/.settings
-**/.toolstarget
-**/.vs
-**/.vscode
-**/*.*proj.user
-**/*.dbmdl
-**/*.jfm
-**/azds.yaml
-**/bin
-**/charts
-**/docker-compose*
-**/Dockerfile*
-**/node_modules
-**/npm-debug.log
-**/obj
-**/secrets.dev.yaml
-**/values.dev.yaml
-LICENSE
-README.md
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..33f87b3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+################################################################################
+# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
+################################################################################
+
+/FastMonitor/bin
diff --git a/.vs/FastMonitor/DesignTimeBuild/.dtbcache.v2 b/.vs/FastMonitor/DesignTimeBuild/.dtbcache.v2
new file mode 100644
index 0000000..6803eb0
Binary files /dev/null and b/.vs/FastMonitor/DesignTimeBuild/.dtbcache.v2 differ
diff --git a/.vs/FastMonitor/FileContentIndex/27b3e6be-0a31-4099-a02d-950ec7e64680.vsidx b/.vs/FastMonitor/FileContentIndex/27b3e6be-0a31-4099-a02d-950ec7e64680.vsidx
new file mode 100644
index 0000000..dea4df9
Binary files /dev/null and b/.vs/FastMonitor/FileContentIndex/27b3e6be-0a31-4099-a02d-950ec7e64680.vsidx differ
diff --git a/.vs/FastMonitor/v17/.futdcache.v2 b/.vs/FastMonitor/v17/.futdcache.v2
new file mode 100644
index 0000000..6be8f07
Binary files /dev/null and b/.vs/FastMonitor/v17/.futdcache.v2 differ
diff --git a/.vs/FastMonitor/v17/.suo b/.vs/FastMonitor/v17/.suo
new file mode 100644
index 0000000..f579fd5
Binary files /dev/null and b/.vs/FastMonitor/v17/.suo differ
diff --git a/.vs/FastMonitor/v17/DocumentLayout.json b/.vs/FastMonitor/v17/DocumentLayout.json
new file mode 100644
index 0000000..4675a76
--- /dev/null
+++ b/.vs/FastMonitor/v17/DocumentLayout.json
@@ -0,0 +1,23 @@
+{
+ "Version": 1,
+ "WorkspaceRootPath": "C:\\Frank\\projects\\fastmonitor\\",
+ "Documents": [],
+ "DocumentGroupContainers": [
+ {
+ "Orientation": 0,
+ "VerticalTabListWidth": 256,
+ "DocumentGroups": [
+ {
+ "DockedWidth": 200,
+ "SelectedChildIndex": -1,
+ "Children": [
+ {
+ "$type": "Bookmark",
+ "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.vs/ProjectEvaluation/fastmonitor.metadata.v7.bin b/.vs/ProjectEvaluation/fastmonitor.metadata.v7.bin
new file mode 100644
index 0000000..856be0e
Binary files /dev/null and b/.vs/ProjectEvaluation/fastmonitor.metadata.v7.bin differ
diff --git a/.vs/ProjectEvaluation/fastmonitor.projects.v7.bin b/.vs/ProjectEvaluation/fastmonitor.projects.v7.bin
new file mode 100644
index 0000000..e439ee3
Binary files /dev/null and b/.vs/ProjectEvaluation/fastmonitor.projects.v7.bin differ
diff --git a/BusinessLogics/BusinessLogics.csproj b/BusinessLogics/BusinessLogics.csproj
deleted file mode 100644
index df13a41..0000000
--- a/BusinessLogics/BusinessLogics.csproj
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
- netcoreapp3.1
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/BusinessLogics/CustomerBusiness/CustomerBusiness.cs b/BusinessLogics/CustomerBusiness/CustomerBusiness.cs
deleted file mode 100644
index 670a5d5..0000000
--- a/BusinessLogics/CustomerBusiness/CustomerBusiness.cs
+++ /dev/null
@@ -1,424 +0,0 @@
-using AutoMapper;
-using BusinessLogics.DTO;
-using BusinessLogics.Extensions;
-using BusinessLogics.MallBusiness;
-using BusinessLogics.StandBusiness;
-using DataAcess.DataModels;
-using DataAcess.DataServices;
-using DataAcess.Interfaces;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace BusinessLogics.CustomerBusiness
-{
- public class CustomerBusiness : ICustomerBusiness
- {
- private readonly Customer _customer;
- private readonly IDataServices _dataServices;
- private readonly IMapper _mapper;
- private readonly IStandBusiness _standBusiness;
- private readonly IMallBusiness _mallBusiness;
-
- public bool ConfigValue { get; private set; }
-
- public CustomerBusiness(ICustomer customer, IDataServices dataServices, IMapper mapper, IStandBusiness standBusiness, IMallBusiness mallBusiness)
- {
- _customer = customer as Customer;
- _dataServices = dataServices;
- _mapper = mapper;
- _standBusiness = standBusiness;
- _mallBusiness = mallBusiness;
- }
-
- ///
- /// Adds a customer
- ///
- ///
- ///
- /// A customer DTO
- public async Task AddCustomer(string standID, CustomerDTO customerDTO)
- {
- try
- {
- var result = new OperationalResult();
-
- if (_mallBusiness.GetMallOpenedStatus().OpenedState == DataAcess.Enums.States.Closed)
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 500, ErrorMessage = "Sorry the Mall is closed, no new customers are accepted. Kindly process only the in-mall users." });
- return result;
- }
-
- // A customer is added to a queue on a stand
- var stand = await _standBusiness.GetStand(standID);
- if (stand == null)
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 404, ErrorMessage = "The stand specified could not be found" });
- return result;
- }
-
- // A customer is created
- var customer = _mapper.Map(customerDTO);
-
- // Check and add customer to queue
- if (!stand.CustomerQueue.Contains(customer.Id.ToString()))
- stand.CustomerQueue.Add(customer.Id.ToString());
-
- // Update the stand the Customer joined
- var updatedStand = _mapper.Map(stand);
- await _standBusiness.UpdateStandQueue(updatedStand);
-
- // Update the customer with his currently joined queue
- customer.CurrentStandJoined = stand.Id;
- customer.Products.Add(new Product { Id = stand.Product.Id.ToString(), DisplayName = stand.Product.DisplayName, Name = stand.Product.Name });
- customer.DoneShopping = false;
- await _dataServices.AddData(customer);
-
- // A customerDTO is created
- var returncustomerDTO = _mapper.Map(customer);
- result.Data.Add(returncustomerDTO);
- return result;
- }
- catch (Exception)
- {
- throw;
- }
- }
-
- ///
- /// Gets a customer
- ///
- ///
- /// Returns a customer DTO
- public async Task GetCustomer(string customerId)
- {
- try
- {
- var result = new OperationalResult();
-
- // first get the customer
- var customer = await _dataServices.GetDataByID(customerId);
- if (customer == null)
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 404, ErrorMessage = "The Customer specified could not be found" });
- return result;
- }
-
- // A customerDTO is created
- var returncustomerDTO = _mapper.Map(customer);
- result.Data.Add(returncustomerDTO);
- return result;
- }
- catch (Exception)
- {
- throw;
- }
- }
-
- ///
- /// Gets a list of customers
- ///
- /// Returns List CustomersDTO
- public async Task GetCustomers()
- {
- try
- {
- var result = new OperationalResult();
- var customers = await _dataServices.GetAllData();
-
- // A customerDTO is created
- var returncustomersDTO = _mapper.Map>(customers);
- result.Data.Add(returncustomersDTO);
-
- return result;
- }
- catch (Exception)
- {
- throw;
- }
- }
-
- ///
- /// Get customers by list of Ids
- ///
- ///
- /// Returns List of customer DTOs
- public async Task GetCustomers(List Ids)
- {
- try
- {
- var result = new OperationalResult();
-
- List customers = new List();
- foreach (var Id in Ids)
- {
- var customer = await GetCustomer(Id);
- if (customer.Data.Count != 0)
- customers.Add(customer.Data.FirstOrDefault() as CustomerDTO);
- }
-
- result.Data.Add(customers);
- return result;
- }
- catch (Exception)
- {
- throw;
- }
- }
-
- ///
- /// handles the product purchases
- ///
- ///
- /// Returns the customerDTO
- public async Task BuyProduct(string customerId)
- {
- try
- {
- var result = new OperationalResult();
-
- // first get the customer
- var customer = await _dataServices.GetDataByID(customerId);
- var stands = await _standBusiness.GetStands();
-
- if (customer == null)
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 404, ErrorMessage = "The Customer specified could not be found" });
- return result;
- }
-
- var customerProductIds = customer.Products.Select(c => c.Id).ToList();
- if (!customerProductIds.Any(c => stands.Select(s => s.Product.Id).Any(s => s == c)))
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 500, ErrorMessage = "The Customer has some products which has their stands removed. The purchase cannot continue now." });
- return result;
- }
-
- if (customer.Products.Count == 0)
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 500, ErrorMessage = "The Customer specified has no products to purchase." });
- return result;
- }
-
- if (customer.DoneShopping)
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 500, ErrorMessage = "Sorry this Customer already left completed purchases and left the Mall." });
- return result;
- }
-
- // update the customers current stand and save the transaction info
- customer.CurrentStandJoined = string.Empty;
- customer.DoneShopping = true;
-
- var transactionData = new Transactions { CustomerId = customer.Id, BoughtProducts = customer.Products };
- await _dataServices.UpSertData(customer.Id, customer);
- await _dataServices.UpSertData(customer.Id, transactionData);
-
- // A customerDTO is created
- var returncustomerDTO = _mapper.Map(customer);
- result.Data.Add(returncustomerDTO);
- return result;
- }
- catch (Exception)
- {
- throw;
- }
- }
-
- ///
- /// Handles the product addition operation
- ///
- /// We assume that a
- ///
- ///
- /// A valid stand Id must be provided. That is an assumption
- /// Returns the customerDTO
- public async Task AddProduct(string customerId, string standId)
- {
- try
- {
- var result = new OperationalResult();
-
- // first get the customer
- var customer = await _dataServices.GetDataByID(customerId);
- if (customer == null)
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 404, ErrorMessage = "The Customer specified could not be found" });
- return result;
- }
-
- // first get the customer
- var stand = await _dataServices.GetDataByID(standId);
- if (stand == null)
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 404, ErrorMessage = "The Stand specified could not be found" });
- return result;
- }
- else if (stand.OutOfProducts)
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 500, ErrorMessage = "This Stand is out of products. Kindly move to another Stand" });
- return result;
- }
-
- var customerTransaction = await _dataServices.GetDataByID(customerId);
- if (customerTransaction != null && customerTransaction.BoughtProducts.Any(p => p.Id == stand.Product.Id))
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 500, ErrorMessage = "The product has already been bought, You cannot purchase from this stand again." });
- return result;
- }
-
- if (customer.Products.Any(p => p.Id == stand.Product.Id))
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 500, ErrorMessage = "The product is already in the list of Items to buy." });
- return result;
- }
- else if (customer.DoneShopping)
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 500, ErrorMessage = "Sorry this Customer already left completed purchases and left the Mall" });
- return result;
- }
-
- // update the customers current stand and save the transaction info
- customer.CurrentStandJoined = stand.Id;
- customer.Products.Add(stand.Product);
- await _dataServices.UpSertData(customer.Id, customer);
-
- // A customerDTO is created
- var returncustomerDTO = _mapper.Map(customer);
- result.Data.Add(returncustomerDTO);
- return result;
- }
- catch (Exception)
- {
- throw;
- }
- }
-
- ///
- /// Handles the customer update operation
- ///
- ///
- ///
- ///
- public async Task UpdateCustomer(CustomerDTO customerDTO)
- {
- try
- {
- var result = new OperationalResult();
-
- // A customer is added to a queue on a stand
- var customerResult = await GetCustomer(customerDTO.Id);
- var customerResultDTO = customerResult.Data.FirstOrDefault() as CustomerDTO;
- if (customerResultDTO == null)
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 404, ErrorMessage = "The Customer specified could not be found" });
- return result;
- }
-
- // A customer is created
- var customer = _mapper.Map(customerResultDTO);
- await _dataServices.UpSertData(customer.Id, customer);
-
- return result;
- }
- catch (Exception)
- {
- throw;
- }
- }
-
- ///
- /// Handles the update of a list of Customers
- ///
- ///
- ///
- public async Task UpdateCustomers(List customerDTOs)
- {
- try
- {
- var result = new OperationalResult();
- foreach (var customerDTO in customerDTOs)
- {
- // A customer is added to a queue on a stand
- var customerResult = await GetCustomer(customerDTO.Id);
- var customerResultDTO = customerResult.Data.FirstOrDefault() as CustomerDTO;
- if (customerResultDTO == null)
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 404, ErrorMessage = $"The Customer {customerDTO.Id} specified could not be found" });
- }
- else
- {
- // A customer is created
- var customer = _mapper.Map(customerResultDTO);
- await _dataServices.UpSertData(customer.Id, customer);
- }
- }
-
- return result;
- }
- catch (Exception)
- {
- throw;
- }
- }
-
- ///
- /// Handles the customer deletion operation
- ///
- ///
- ///
- public async Task DeleteCustomer(string Id)
- {
- try
- {
- var result = new OperationalResult();
-
- // A customer is added to a queue on a stand
- var customerResult = await GetCustomer(Id);
- var customerResultDTO = customerResult.Data.FirstOrDefault() as CustomerDTO;
- if (customerResultDTO == null)
- {
- result.Status = true;
- result.ErrorList.Add(new Error { ErrorCode = 404, ErrorMessage = "The Customer specified could not be found" });
- return result;
- }
-
- await _dataServices.DeleteData(customerResultDTO.Id); ;
-
- return result;
- }
- catch (Exception)
- {
- throw;
- }
- }
-
- public async Task DeleteCustomers(List Ids)
- {
- try
- {
- await _dataServices.DeleteDataBulk(Ids);
- }
- catch (Exception)
- {
- throw;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/BusinessLogics/CustomerBusiness/ICustomerBusiness.cs b/BusinessLogics/CustomerBusiness/ICustomerBusiness.cs
deleted file mode 100644
index 20cfc54..0000000
--- a/BusinessLogics/CustomerBusiness/ICustomerBusiness.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using BusinessLogics.DTO;
-using DataAcess.DataModels;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace BusinessLogics.CustomerBusiness
-{
- public interface ICustomerBusiness
- {
- Task GetCustomer(string Id);
- Task GetCustomers();
- Task GetCustomers(List Ids);
- Task AddCustomer(string standID, CustomerDTO customerDTO);
- Task UpdateCustomer(CustomerDTO customerDTO);
- Task UpdateCustomers(List customerDTOs);
- Task DeleteCustomer(string Id);
- Task DeleteCustomers(List Ids);
- Task BuyProduct(string customerId);
- Task AddProduct(string customerId, string standId);
- }
-}
diff --git a/BusinessLogics/DTO/Customer.cs b/BusinessLogics/DTO/Customer.cs
deleted file mode 100644
index 6fe5c83..0000000
--- a/BusinessLogics/DTO/Customer.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace BusinessLogics.DTO
-{
- public class CustomerDTO
- {
- public string Id { get; set; } = Guid.NewGuid().ToString();
- public string Name { get; set; }
- public string DisplayName { get; set; }
- public List Products { get; set; }
- public bool DoneShopping { get; set; } = false;
- public string CurrentStandJoined { get; set; }
-
- }
-}
diff --git a/BusinessLogics/DTO/Mall.cs b/BusinessLogics/DTO/Mall.cs
deleted file mode 100644
index 05aa2b2..0000000
--- a/BusinessLogics/DTO/Mall.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using DataAcess.Enums;
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace BusinessLogics.DTO
-{
- public class MallDTO
- {
- public string Id { get; set; }
- public string Name { get; set; }
- public string DisplayName { get; set; }
- public States OpenedState { get; set; }
- public Capacity MallCapacity { get; set; }
- public int OpenClosedDuration { get; set; }
- }
-}
diff --git a/BusinessLogics/DTO/OperationalResult.cs b/BusinessLogics/DTO/OperationalResult.cs
deleted file mode 100644
index 583aa01..0000000
--- a/BusinessLogics/DTO/OperationalResult.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace BusinessLogics.DTO
-{
- public class OperationalResult
- {
- //True or False status of operation
- public bool Status { get; set; } = false;
- //Single messsage from operation
- public string Message { get; set; }
- //Result of successfully operation
- public List