-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement factories and repositories
- Loading branch information
Showing
112 changed files
with
3,268 additions
and
215 deletions.
There are no files selected for viewing
Binary file modified
BIN
+13.7 KB
(100%)
.vs/ProjectEvaluation/storemanagementsystemx.metadata.v7.bin
Binary file not shown.
Binary file modified
BIN
+1.83 MB
(120%)
.vs/ProjectEvaluation/storemanagementsystemx.projects.v7.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
.vs/StoreManagementSystemX/v17/TestStore/0/testlog.manifest
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; | ||
using StoreManagementSystemX.Domain.Factories.Transactions.Interfaces; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace StoreManagementSystemX.Infrastructure.DTO | ||
{ | ||
public class PayLaterDTO : IPayLaterReconstitutionArgs | ||
{ | ||
public PayLaterDTO(IPayLater payLater) | ||
{ | ||
CustomerName = payLater.CustomerName; | ||
IsPaid = payLater.IsPaid; | ||
PaidAt = payLater.PaidAt; | ||
} | ||
|
||
public PayLaterDTO(PayLaterDBModel payLater) | ||
{ | ||
CustomerName = payLater.CustomerName; | ||
IsPaid = payLater.IsPaid; | ||
PaidAt = payLater.PaidAt; | ||
} | ||
|
||
public string CustomerName { get; set; } | ||
|
||
public bool IsPaid { get; set; } | ||
|
||
public DateTime? PaidAt { get; set; } | ||
|
||
public PayLaterDBModel ToDBModel() | ||
{ | ||
return new PayLaterDBModel | ||
{ | ||
CustomerName = CustomerName, | ||
IsPaid = IsPaid, | ||
PaidAt = PaidAt | ||
}; | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
StoreManagementSystemX.Infrastructure/DTO/ProductDBModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using StoreManagementSystemX.Domain.Aggregates.Roots.Products.Interfaces; | ||
using StoreManagementSystemX.Domain.Factories.Products.Interfaces; | ||
using StoreManagementSystemX.Infrastructure.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace StoreManagementSystemX.Infrastructure.DTO | ||
{ | ||
public class ProductDBModel : IProductReconstitutionArgs | ||
{ | ||
public ProductDBModel() { } | ||
|
||
public Guid Id { get; set; } | ||
|
||
public string Barcode { get; set; } = string.Empty; | ||
|
||
public string Name { get; set; } = string.Empty; | ||
|
||
public decimal CostPrice { get; set; } | ||
|
||
public decimal SellingPrice { get; set; } | ||
|
||
public int InStock { get; set; } | ||
|
||
public UserDBModel Creator { get; set; } = null!; | ||
|
||
public Guid CreatorId { get; set; } | ||
|
||
public List<TransactionProductDBModel> TransactionProducts { get; set; } = new List<TransactionProductDBModel>(); | ||
|
||
public List<TransactionDBModel> Transactions { get; set; } = new List<TransactionDBModel>(); | ||
|
||
public List<StockPurchaseDBModel> StockPurchases { get; set; } = new List<StockPurchaseDBModel>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
using StoreManagementSystemX.Domain.Aggregates.Roots.Products; | ||
using StoreManagementSystemX.Domain.Aggregates.Roots.Products.Interfaces; | ||
using StoreManagementSystemX.Domain.Factories.Products.Interfaces; | ||
using StoreManagementSystemX.Infrastructure.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace StoreManagementSystemX.Infrastructure.DTO | ||
{ | ||
public class ProductDTO : IProductReconstitutionArgs | ||
{ | ||
public ProductDTO(IProduct product) | ||
{ | ||
Id = product.Id; | ||
Barcode = product.Barcode; | ||
Name = product.Name; | ||
CostPrice = product.CostPrice; | ||
SellingPrice = product.SellingPrice; | ||
InStock = product.InStock; | ||
CreatorId = product.CreatorId; | ||
} | ||
|
||
public ProductDTO(ProductDBModel product) | ||
{ | ||
Id = product.Id; | ||
Barcode = product.Barcode; | ||
Name = product.Name; | ||
CostPrice = product.CostPrice; | ||
SellingPrice = product.SellingPrice; | ||
InStock = product.InStock; | ||
CreatorId = product.CreatorId; | ||
} | ||
|
||
public Guid Id { get; set; } | ||
|
||
public string Barcode { get; set; } = string.Empty; | ||
|
||
public string Name { get; set; } = string.Empty; | ||
|
||
public decimal CostPrice { get; set; } | ||
|
||
public decimal SellingPrice { get; set; } | ||
|
||
public int InStock { get; set; } | ||
|
||
public Guid CreatorId { get; set; } | ||
|
||
public ProductDBModel ToDBModel() | ||
{ | ||
return new ProductDBModel | ||
{ | ||
Id = Id, | ||
Barcode = Barcode, | ||
Name = Name, | ||
CostPrice = CostPrice, | ||
SellingPrice = SellingPrice, | ||
InStock = InStock, | ||
CreatorId = CreatorId, | ||
}; | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
StoreManagementSystemX.Infrastructure/DTO/StockPurchaseDTO.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using StoreManagementSystemX.Domain.Aggregates.Roots.StockPurchases; | ||
using StoreManagementSystemX.Domain.Aggregates.Roots.StockPurchases.Interfaces; | ||
using StoreManagementSystemX.Domain.Factories.StockPurchases.Interfaces; | ||
using StoreManagementSystemX.Infrastructure.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace StoreManagementSystemX.Infrastructure.DTO | ||
{ | ||
public class StockPurchaseDTO : IStockPurchaseReconstitutionArgs | ||
{ | ||
public StockPurchaseDTO(StockPurchaseDBModel stockPurchase, IList<StockPurchaseProductDTO> stockPurchaseProducts) | ||
{ | ||
StockManagerId = stockPurchase.StockManagerId; | ||
Id = stockPurchase.Id; | ||
DateTime = stockPurchase.DateTime; | ||
StockPurchaseProducts = stockPurchaseProducts; | ||
} | ||
|
||
public StockPurchaseDTO(IStockPurchase stockPurchase, IEnumerable<StockPurchaseProductDTO> stockPurchaseProducts) | ||
{ | ||
StockManagerId = stockPurchase.StockManagerId; | ||
Id = stockPurchase.Id; | ||
DateTime = stockPurchase.DateTime; | ||
StockPurchaseProducts = stockPurchaseProducts; | ||
} | ||
|
||
public Guid StockManagerId { get; } | ||
|
||
public Guid Id { get; } | ||
|
||
public DateTime DateTime { get; } | ||
|
||
public IEnumerable<IStockPurchaseProductReconstitutionArgs> StockPurchaseProducts { get; } | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
StoreManagementSystemX.Infrastructure/DTO/StockPurchaseProductDTO.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using StoreManagementSystemX.Domain.Aggregates.Roots.StockPurchases.Interfaces; | ||
using StoreManagementSystemX.Domain.Factories.StockPurchases.Interfaces; | ||
using StoreManagementSystemX.Infrastructure.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace StoreManagementSystemX.Infrastructure.DTO | ||
{ | ||
public class StockPurchaseProductDTO : IStockPurchaseProductReconstitutionArgs | ||
{ | ||
public StockPurchaseProductDTO(StockPurchaseProductDBModel stockPurchaseProduct) | ||
{ | ||
ProductId = stockPurchaseProduct.ProductId; | ||
Barcode = stockPurchaseProduct.Barcode; | ||
Name = stockPurchaseProduct.Name; | ||
Price = stockPurchaseProduct.Price; | ||
QuantityBought = stockPurchaseProduct.QuantityBought; | ||
} | ||
|
||
public StockPurchaseProductDTO(IStockPurchaseProduct stockPurchaseProduct) | ||
{ | ||
ProductId = stockPurchaseProduct.ProductId; | ||
Barcode = stockPurchaseProduct.Barcode; | ||
Name = stockPurchaseProduct.Name; | ||
Price = stockPurchaseProduct.Price; | ||
QuantityBought = stockPurchaseProduct.QuantityBought; | ||
} | ||
|
||
public Guid ProductId { get; } | ||
|
||
public string Barcode { get; } | ||
|
||
public string Name { get; } | ||
|
||
public decimal Price { get; } | ||
|
||
public int QuantityBought { get; } | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
StoreManagementSystemX.Infrastructure/DTO/TransactionDTO.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using StoreManagementSystemX.Domain.Factories.Transactions.Interfaces; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace StoreManagementSystemX.Infrastructure.DTO | ||
{ | ||
public class TransactionDTO : ITransactionReconstitutionArgs | ||
{ | ||
public TransactionDTO(TransactionDBModel transaction, PayLaterDTO? payLater, IEnumerable<TransactionProductDTO> transactionProducts) | ||
{ | ||
Id = transaction.Id; | ||
SellerId = transaction.SellerId; | ||
DateTime = transaction.DateTime; | ||
PayLater = payLater; | ||
TransactionProducts = transactionProducts; | ||
} | ||
|
||
public Guid SellerId { get; set; } | ||
|
||
public DateTime DateTime { get; set; } | ||
|
||
public Guid Id { get; set; } | ||
|
||
public IPayLaterReconstitutionArgs? PayLater { get; set; } = null!; | ||
|
||
public IEnumerable<ITransactionProductReconstitutionArgs> TransactionProducts { get; } | ||
|
||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
StoreManagementSystemX.Infrastructure/DTO/TransactionProductDTO.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using StoreManagementSystemX.Domain.Factories.Transactions.Interfaces; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace StoreManagementSystemX.Infrastructure.DTO | ||
{ | ||
public class TransactionProductDTO : ITransactionProductReconstitutionArgs | ||
{ | ||
public Guid ProductId { get; set; } | ||
|
||
public string ProductName { get; set; } | ||
|
||
public decimal CostPrice { get; set; } | ||
|
||
public decimal SellingPrice { get; set; } | ||
|
||
public int QuantityBought { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using StoreManagementSystemX.Domain.Aggregates.Roots.Users.Interfaces; | ||
using StoreManagementSystemX.Domain.Factories.Users.Interfaces; | ||
using StoreManagementSystemX.Infrastructure.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace StoreManagementSystemX.Infrastructure.DTO | ||
{ | ||
public class UserDTO : IUserReconstitutionArgs | ||
{ | ||
|
||
public UserDTO(IUser user) | ||
{ | ||
Id = user.Id; | ||
CreatorId = user.CreatorId; | ||
Username = user.Username; | ||
Password = user.Password; | ||
} | ||
|
||
public UserDTO(UserDBModel user) | ||
{ | ||
Id = user.Id; | ||
CreatorId = user.CreatorId; | ||
Username = user.Username; | ||
Password = user.Password; | ||
} | ||
|
||
public Guid Id { get; set; } | ||
|
||
public Guid? CreatorId { get; set; } | ||
|
||
public string Username { get; set; } | ||
|
||
public string Password { get; set; } | ||
|
||
public UserDBModel ToDBModel() | ||
{ | ||
return new UserDBModel | ||
{ | ||
Id = Id, | ||
CreatorId = CreatorId, | ||
Username = Username, | ||
Password = Password, | ||
}; | ||
} | ||
} | ||
} |
Oops, something went wrong.