From 27079698afabb408dc4d46154d1d4ee66fda6b87 Mon Sep 17 00:00:00 2001 From: JosephCrisostomo Date: Thu, 14 Dec 2023 18:03:19 +0800 Subject: [PATCH] Update main project to use the domain layer --- .../storemanagementsystemx.metadata.v7.bin | Bin 312029 -> 313909 bytes .../storemanagementsystemx.projects.v7.bin | Bin 7472847 -> 9093708 bytes .../DesignTimeBuild/.dtbcache.v2 | Bin 292667 -> 292667 bytes .vs/StoreManagementSystemX/v17/.futdcache.v2 | Bin 1593 -> 1593 bytes .vs/StoreManagementSystemX/v17/.suo | Bin 410624 -> 406528 bytes .../v17/TestStore/0/testlog.manifest | Bin 24 -> 24 bytes .../StockPurchaseRepositoryTests.cs | 1 + .../TransactionAggregateTests.cs | 6 +- .../TransactionRepositoryTests.cs | 6 +- .../UserRepositoryTests.cs | 4 +- .../Services/NavigationService.cs | 28 +++-- .../Services/StockPurchaseCreationService.cs | 21 ++-- .../Services/TransactionCreationService.cs | 27 +++-- .../Services/UserCreationService.cs | 9 +- .../ViewModels/DashboardViewModel.cs | 29 ++--- .../ViewModels/MainViewModel.cs | 22 +++- .../CreateStockPurchaseProductViewModel.cs | 86 +++++--------- .../CreateStockPurchaseViewModel.cs | 112 +++++++++++------- .../ICreateStockPurchaseProductViewModel.cs | 16 +-- .../StockPurchaseListViewModel.cs | 29 ++--- .../StockPurchaseProductViewModel.cs | 12 +- .../StockPurchases/StockPurchaseViewModel.cs | 7 +- .../CreateTransactionProductViewModel.cs | 66 +++++------ .../CreateTransactionViewModel.cs | 100 +++++++++------- .../ICreateTransactionProductViewModel.cs | 11 +- .../PayLaterTransactionRowViewModel.cs | 25 ++-- .../PayLaterTransactionsViewModel.cs | 50 +++----- .../Transactions/TransactionListViewModel.cs | 26 ++-- .../TransactionProductRowViewModel.cs | 7 +- .../Transactions/TransactionRowViewModel.cs | 20 ++-- .../ViewModels/Users/CreateUserViewModel.cs | 37 +++--- .../ViewModels/Users/UserListViewModel.cs | 46 ++++--- .../CreateStockPurchaseWindow.xaml | 6 +- .../CreateStockPurchaseWindow.xaml.cs | 6 +- .../CreateTransactionWindow.xaml.cs | 10 +- .../Views/Users/CreateUserWindow.xaml.cs | 9 +- .../Interfaces/IStockPurchase.cs | 10 +- .../Interfaces/IStockPurchaseProduct.cs | 6 +- .../Roots/StockPurchases/StockPurchase.cs | 54 +++++++-- .../Transactions/Interfaces/IPayLater.cs | 17 +++ .../Transactions/Interfaces/ITransaction.cs | 16 ++- .../Aggregates/Roots/Transactions/PayLater.cs | 25 ++++ .../Roots/Transactions/Transaction.cs | 55 +++++++-- .../Interfaces/ICreatePayLaterArgs.cs | 13 ++ .../Interfaces/IPayLaterFactory.cs | 14 +++ .../Interfaces/PayLaterFactory.cs | 23 ++++ .../Transactions/TransactionFactory.cs | 9 +- .../Users/Interfaces/ICreateUserArgs.cs | 4 +- StoreManagementX.Domain/Program.cs | 4 +- .../Interfaces/IStockPurchaseRepository.cs | 14 +++ .../StockPurchaseRepository.cs | 10 +- .../Interfaces/ITransactionRepository.cs | 14 +++ .../TransactionRepository.cs | 5 +- 53 files changed, 690 insertions(+), 437 deletions(-) create mode 100644 StoreManagementX.Domain/Aggregates/Roots/Transactions/Interfaces/IPayLater.cs create mode 100644 StoreManagementX.Domain/Aggregates/Roots/Transactions/PayLater.cs create mode 100644 StoreManagementX.Domain/Factories/Transactions/Interfaces/ICreatePayLaterArgs.cs create mode 100644 StoreManagementX.Domain/Factories/Transactions/Interfaces/IPayLaterFactory.cs create mode 100644 StoreManagementX.Domain/Factories/Transactions/Interfaces/PayLaterFactory.cs create mode 100644 StoreManagementX.Domain/Repositories/StockPurchases/Interfaces/IStockPurchaseRepository.cs rename StoreManagementX.Domain/Repositories/{ => StockPurchases}/StockPurchaseRepository.cs (84%) create mode 100644 StoreManagementX.Domain/Repositories/Transactions/Interfaces/ITransactionRepository.cs rename StoreManagementX.Domain/Repositories/{ => Transactions}/TransactionRepository.cs (87%) diff --git a/.vs/ProjectEvaluation/storemanagementsystemx.metadata.v7.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96j-9k+qhYrPhhj@VwK4}y)1S1;NTr^ zf&S{l-C@_4H>o_GlA7AGeK1&{BU4zq#wtk=n<=+u?J{~12dQ_`wRK4xiQNMt7X&)dS=O&pr@AV z(q$FV*)l#nK07%=XD1KVonT7Iv9}B@bRwlHV}tk=6}{P3eqBwE-o<%{(8@aUaWV%RM; zpDWre8eRz@zUVYl%#x4Ov0-6h@+<5U?Wx)|AMt3UeU}6FU72V%k%beT8s)o-*R)1* zbJ!tfNE#yfEYYTF`6Tl0up?H9@)j^jWG<4A7N5?`Q326PUexY%Tq+QP=%!NMsaAf- zV`+Y0OPA5N!@%VFk3lL|$6U*OF6=zKY=WfJ!>qH9cwI+9qUY&*p!=I_PR?UJnI!kalZnZZ zm?Kh3fU=)m48UTNH;$8r`5NHJo83jNlU>EcTd70Pm=4%h8yeHfnD#SIs2832wexr7 zMzdO~uN-~RiXH>zvV3l#UJ~yCk902;ioI0$(7hC}E!0b^SKbYKX|+_LUJAZ3Khkq4 GJMmwMiGE!G delta 239 zcmV~$wNV2A006*)gy8P(?(Pl=?(XhB0mZjWLdy^o++`*H|9l6dU%!D*F=7P-#R-X* zAW@QJDN?0LmmyP@Y&mk}$ycCIkzyrEl_^)DQk7~oYSpRNpiz@%En2l{*P&CFZasSS z={I1|kYOW6jTtv#(v)d4W`#w}nYUokl4UDaty#BW)0S;JcJ0}B;Lwp{Cr+I?cj3~N XYd3D)x%c4FlV>kpy?Ounh=%?F{|Z_U diff --git a/.vs/StoreManagementSystemX/DesignTimeBuild/.dtbcache.v2 b/.vs/StoreManagementSystemX/DesignTimeBuild/.dtbcache.v2 index 5a0cf02776e9a46ed3b1bf357c79b360fd7e2a10..5d19d6f094116998544297080d3c73dd40c580bb 100644 GIT binary patch delta 17201 zcmbW7349bq+Q!q}nVut=05K5mBb=fH5{@LWKnUTIgd^M%l}R#zNJv5wR;v z?yjov{8z1>|EiVpkDHZe6y?$LxkIwcO3O+Hmy{34EGa1)lv$EBz?Yp>UN$ht=kxh9 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S z^c3I9CHl2`lcuZAaE3uMgFD0N&QdPAOmaTWU%^MGfS%)T!Vmv&_iUq_Pup_dJ;FWB zJKSWXn?yT(#h2(SV!U?wK2MH)S2J&&$WeUOqfpt=45QuC*S_%`YvxTC)^zUeaCrV6 zSb;0yHozs_dCTxrd@OQ~GpXq2J;m5lQmp~TIt?H*<7|r6Z+~-tJeTNvdc<6v&+ALQ z7r&)-`U)?~OZYPEPjFr`?zeu^q)?P!?Uf1KoOo@C`pQ!ezX zRz`4PY08$VY+0r=LalZyq6c=*vV(GUG^tZ?Ssj$CvvPGY(cM<57`H!lR<>Ma%QMjv zSFy1xSGl?=S9cSAbdU=}Xt!ed%GJ|E?;YgIS1zl!vh^|1u?N|DD_cM1DlpOI2f6ww z*8t@jXyRoM~CsUbQPeM!Ci**DxKuV%5S>);Q%VRxb3ArNJ)robE*`vy^ST ziPua}VP(oTLAfTHc;y7SCMefk%Jn}c{V~{emvT)~uE{3d&8t+^&T^8n-J@*xnlvT2 zuzQqis&d_D(*41%sme7?xu%;mqq+;npQdaxm2H;ktf*D1*i7Y`qg)T*>8)NE<^#%A zu3U3XXHl+NS>?(#-?Ze5WPwQwgA1FlY>QN3i%l%-1+~~B<$6fD{$$dUVAn&+wN$y5 znLH=8sy9Ct3*8&zVP#uk(#qh%9#*aj&|*=wTf+1t|yf1Nt3pttb}T|CzNf6viWrSGi<)Y`}Mnb{V$zz BkW>Hw diff --git a/.vs/StoreManagementSystemX/v17/.futdcache.v2 b/.vs/StoreManagementSystemX/v17/.futdcache.v2 index e36b1dbd7d017d60baea344d588d498f25e26bb6..4be869af3e1e94c94c921f7398bbb2207842700c 100644 GIT binary patch delta 89 zcmdnVvy*4S3_Cw@ud>|a+27AOV^cx_(Ec!!zu l%N48tO+YpIKq05e7g$3@9@wXx)XQ^?z5z60oqq*b0|2lcEZ_hD delta 89 zcmdnVvy*4S48fc0pKX@;eVgO?p6;niK)Q1B1s3m#Uy?W@wp4=!ih%-Nn^!X4VdiW~ i+%yZMCLbu|H2DH+s7S-PB|g4=Me}8WqKdaSfMo&Ov@68` diff --git a/.vs/StoreManagementSystemX/v17/.suo b/.vs/StoreManagementSystemX/v17/.suo index 805f2722aae317881c1f38955a210e32117a4541..3a42d03536c561daa470a9ced9dc9b2b17d1c2ae 100644 GIT binary patch delta 23975 zcmeI42V4}#`~R8Qz4NF61O!Al5D^vdKt$|E5j&!yvBiLb6#?-u5euhLV<8c4k+BDf zVnd^%oN0>Pm>AKRXpAwISc2W4F>2)hnLV1u16)`xbhUq(u=Ei{WOzYhqE-AmaiL)9bwtfYDYLE& z@vHpsMGpQkcupSH6)Aq5ixdyz5pt2@aV{o*Rit?SDv`>3PNv>QVO*x{P*@$Al0{05 zbS}GpBvQQ4KNG0{+{;CZzfi46L0tYwrf%T|lT7{VBE>89ry_;to3#OdDpR=r-z8F+ zFUk}_qx1F_szL=qC8!5{fH|-LmcR<|yfz450k*&n*aM#KfY1>*fd*A+Je|`J=Wa^$ zpGJtd*SYA4xEE*)yg?Hn*;+VAY712}f1Ct>mOuk|N&IMqcra)ULU?-4#7$u%5E%&) zKq43g_zhzajs@eu_^PxC2$MkyNCguC3h~IyKx8VI2Bz~w`FW;46=;~D;0MqbFfbQv z1M|Uf;10e5rGSgxw+OoeJ(vb@3`DpTd=0E{J`W5-d>uH>)#+Fy48qA>zzc9dxB$`6Z`~xz&@Y_-+*!8JMbCs0!P4g zupG}fn+Ze|uoK~Jum+$ml@}4Ff_Z>zySd1751}{M3T$xx5yDDv7R&}_NE-#-M06l{ z1vJ8WJ%oCMW57eixf=gjzJ>(;d3NK3Ka?LE5pMuK=Y#e(y_yu*ikbg#$9b{eI9C48 z>NswH)^QA;zQw*H&XCN1pa=a~2g>{hdeEPBAV~LrM-Ms=*{tb7h|dHsb|5~)UgW*2 zx(Asf{#Sbt?*!F7$QAefQ4iwz2p+`4mvtcFbLjTUR_T__(0@B1BMzK5lhy|}G?(o* z3nbPUD^f*pA9KPB<7QZGvaWTEbbxBCd{K&@s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+NNPeAkHLKR(orb<|EiIJyhg*cWN9V)Yg6*1xz3b50jm}o;-Qty zmL|Kvx_9_+ZzsSfzFmjk_ZHP2YJG@Vs&hA{PEU;b1{&CDyDNLJoKsoA0rI(TN zk6S{#Uc)85tf^9@cIk+c>hd4U2&DD@SVlVjHI@-$t<=s z`w_M;3{;UL`DzP3QTDqzTdK_gf0@0+xyC-HB{h^wWGV}hhH66t2-d&_6w7MIveTaVrq75D-Z@`HInGH}&!X1a4>iowOt!T8I$;c25 zT>y+GOkDiZR%ghmj4qiVwSpBpZjU%_glVZS%d3@LlVuyzf}WAiNI#c!BYf&eaIS3y zM>Y8VHT-S1^6zMs3mtt(HqlaSQEJDYmiIHw)?7E%eb*xSZSdEnvQaZEk+;aSdMWeM zwlvY5^`xNJq!fqL=eXsG8#$6*%UB@~U^HNWJiu`;#CE?FptW8kudGuBrz z$roJd@Kl@-=vkyR`?Y*}>K~!&LgoTR)|M|)4muNCsx;D`TB4YAbZvo>N{h01tguA; zQI@OXqcvKke50dn<9Psy%>pW0rOco?q{PzH6^e^CZiN!Xej{Vale`tp&By5jzeULC U(*ifgYya_yQCVR1Mz { - var window = new CreateStockPurchaseWindow(authContext, unitOfWork, _dialogService, (Guid stockPurchaseId) => - { - newStockPurchase = stockPurchaseId; - }); - window.ShowDialog(); + newStockPurchase = stockPurchaseId; + }); + window.ShowDialog(); - } return newStockPurchase; } } diff --git a/StoreManagementSystemX/Services/TransactionCreationService.cs b/StoreManagementSystemX/Services/TransactionCreationService.cs index dbfddc9..850572f 100644 --- a/StoreManagementSystemX/Services/TransactionCreationService.cs +++ b/StoreManagementSystemX/Services/TransactionCreationService.cs @@ -1,5 +1,8 @@ using StoreManagementSystemX.Database.DAL.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Products.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Transactions.Interfaces; using StoreManagementSystemX.Services.Interfaces; +using StoreManagementSystemX.ViewModels.Transactions.Interfaces; using StoreManagementSystemX.Views.Transactions; using System; using System.Collections.Generic; @@ -12,30 +15,30 @@ namespace StoreManagementSystemX.Services public class TransactionCreationService : ITransactionCreationService { - public TransactionCreationService(IUnitOfWorkFactory unitOfWorkFactory, IDialogService dialogService) + public TransactionCreationService( + Domain.Repositories.Transactions.Interfaces.ITransactionRepository transactionRepository, + Domain.Repositories.Products.Interfaces.IProductRepository productRepository, + IDialogService dialogService) { - _unitOfWorkFactory = unitOfWorkFactory; + _transactionRepository = transactionRepository; + _productRepository = productRepository; _dialogService = dialogService; } - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private readonly Domain.Repositories.Transactions.Interfaces.ITransactionRepository _transactionRepository; + private readonly Domain.Repositories.Products.Interfaces.IProductRepository _productRepository; private readonly IDialogService _dialogService; public Guid? CreateNewTransaction(AuthContext authContext) { Guid? newTransaction = null; - using(var unitOfWork = _unitOfWorkFactory.CreateUnitOfWork()) + var window = new CreateTransactionWindow(authContext, _transactionRepository, _productRepository, _dialogService, (Guid transactionId) => { - var window = new CreateTransactionWindow(authContext, unitOfWork, _dialogService, (Guid transactionId) => - { - newTransaction = transactionId; - }); + newTransaction = transactionId; + }); - window.ShowDialog(); - - - } + window.ShowDialog(); return newTransaction; } diff --git a/StoreManagementSystemX/Services/UserCreationService.cs b/StoreManagementSystemX/Services/UserCreationService.cs index e663d97..60f79fd 100644 --- a/StoreManagementSystemX/Services/UserCreationService.cs +++ b/StoreManagementSystemX/Services/UserCreationService.cs @@ -1,4 +1,5 @@ using StoreManagementSystemX.Database.DAL.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Users.Interfaces; using StoreManagementSystemX.Services.Interfaces; using StoreManagementSystemX.Views.Users; using System; @@ -11,17 +12,17 @@ namespace StoreManagementSystemX.Services { public class UserCreationService : IUserCreationService { - public UserCreationService(IUnitOfWorkFactory unitOfWorkFactory) + public UserCreationService(Domain.Repositories.Users.Interfaces.IUserRepository userRepository) { - _unitOfWorkFactory = unitOfWorkFactory; + _userRepository = userRepository; } - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private readonly Domain.Repositories.Users.Interfaces.IUserRepository _userRepository; public Guid? CreateNewUser(AuthContext authContext) { Guid? newUserId = null; - var window = new CreateUserWindow(authContext, _unitOfWorkFactory, (Guid id) => + var window = new CreateUserWindow(authContext, _userRepository, (Guid id) => { newUserId = id; }); diff --git a/StoreManagementSystemX/ViewModels/DashboardViewModel.cs b/StoreManagementSystemX/ViewModels/DashboardViewModel.cs index eb64f54..aa282b4 100644 --- a/StoreManagementSystemX/ViewModels/DashboardViewModel.cs +++ b/StoreManagementSystemX/ViewModels/DashboardViewModel.cs @@ -1,5 +1,6 @@ using CommunityToolkit.Mvvm.Input; using StoreManagementSystemX.Database.DAL.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Transactions.Interfaces; using StoreManagementSystemX.Services; using StoreManagementSystemX.Services.Interfaces; using StoreManagementSystemX.ViewModels.Interfaces; @@ -19,21 +20,20 @@ public class DashboardViewModel : BaseViewModel, IDashboardViewModel { - public DashboardViewModel(AuthContext authContext, IUnitOfWorkFactory unitOfWorkFactory, IDialogService dialogService, ITransactionCreationService transactionCreationService) + public DashboardViewModel(AuthContext authContext, Domain.Repositories.Transactions.Interfaces.ITransactionRepository transactionRepository, IDialogService dialogService, ITransactionCreationService transactionCreationService) { - _unitOfWorkFactory = unitOfWorkFactory; + _transactionRepository = transactionRepository; _authContext = authContext; _dialogService = dialogService; _transactionCreationService = transactionCreationService; TransactionsToday = new ObservableCollection(); - using(var unitOfWork = unitOfWorkFactory.CreateUnitOfWork()) + + var transactions = _transactionRepository.GetAll(); + foreach (var transaction in transactions) { - var transactions = unitOfWork.TransactionRepository.Get(t => t.DateTime.Date == DateTime.Now.Date, t => t.OrderByDescending(e => e.DateTime), "TransactionProducts"); - foreach (var transaction in transactions) - { - TransactionsToday.Add(new TransactionRowViewModel(unitOfWorkFactory, _dialogService, transaction)); - } + TransactionsToday.Add(new TransactionRowViewModel(transactionRepository, _dialogService, transaction)); } + NewTransactionCommand = new RelayCommand(NewTransactionCommandHandler); if (TransactionsToday.Any()) { @@ -46,7 +46,7 @@ public DashboardViewModel(AuthContext authContext, IUnitOfWorkFactory unitOfWork } } - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private readonly Domain.Repositories.Transactions.Interfaces.ITransactionRepository _transactionRepository; private readonly AuthContext _authContext; private readonly IDialogService _dialogService; private readonly ITransactionCreationService _transactionCreationService; @@ -113,15 +113,12 @@ private void NewTransactionCommandHandler() var newTransactionId = _transactionCreationService.CreateNewTransaction(_authContext); if(newTransactionId != null) { - using(var unitOfWork = _unitOfWorkFactory.CreateUnitOfWork()) + var newTransaction = _transactionRepository.GetById((Guid) newTransactionId); + if(newTransaction != null) { - var newTransaction = unitOfWork.TransactionRepository.GetById((Guid) newTransactionId, "TransactionProducts,TransactionProducts.Product"); - if(newTransaction != null) - { - TransactionsToday.Insert(0, new TransactionRowViewModel(_unitOfWorkFactory, _dialogService, newTransaction)); - } - NotifyPropertiesChanged(); + TransactionsToday.Insert(0, new TransactionRowViewModel(_transactionRepository, _dialogService, newTransaction)); } + NotifyPropertiesChanged(); } } diff --git a/StoreManagementSystemX/ViewModels/MainViewModel.cs b/StoreManagementSystemX/ViewModels/MainViewModel.cs index 7dc577f..3a158f8 100644 --- a/StoreManagementSystemX/ViewModels/MainViewModel.cs +++ b/StoreManagementSystemX/ViewModels/MainViewModel.cs @@ -3,9 +3,12 @@ using StoreManagementSystemX.Domain.Factories.Products; using StoreManagementSystemX.Domain.Factories.StockPurchases; using StoreManagementSystemX.Domain.Factories.Transactions; +using StoreManagementSystemX.Domain.Factories.Transactions.Interfaces; using StoreManagementSystemX.Domain.Factories.Users; using StoreManagementSystemX.Domain.Factories.Users.Interfaces; using StoreManagementSystemX.Domain.Repositories.Products; +using StoreManagementSystemX.Domain.Repositories.StockPurchases; +using StoreManagementSystemX.Domain.Repositories.Transactions; using StoreManagementSystemX.Domain.Repositories.Users; using StoreManagementSystemX.Domain.Repositories.Users.Interfaces; using StoreManagementSystemX.Services; @@ -35,10 +38,15 @@ public MainViewModel() var barcodeGenerationService = new BarcodeGenerationService(productRepository); var productFactory = new ProductFactory(barcodeGenerationService); - var transactionFactory = new TransactionFactory(); + var stockPurchaseRepository = new Domain.Repositories.StockPurchases.StockPurchaseRepository(); + + var payLaterFactory = new PayLaterFactory(); + var transactionFactory = new TransactionFactory(payLaterFactory); var stockPurchaseFactory = new StockPurchaseFactory(); var userFactory = new Domain.Factories.Users.UserFactory(productFactory, transactionFactory, stockPurchaseFactory); + var transactionRepository = new Domain.Repositories.Transactions.TransactionRepository(); + IUserRepository userRepository = new Domain.Repositories.Users.UserRepository(userFactory); var admin = userFactory.Create(new CreateUserArgs { CreatorId = Guid.NewGuid(), Username = "admin", Password = "password" }); userRepository.Add(admin); @@ -46,11 +54,14 @@ public MainViewModel() LoginViewModel loginViewModel = new LoginViewModel(AuthenticationService, dialogService); NavigationService = new NavigationService( - loginViewModel, - unitOfWorkFactory, - AuthenticationService, + loginViewModel, + unitOfWorkFactory, + AuthenticationService, dialogService, - productRepository + productRepository, + stockPurchaseRepository, + transactionRepository, + userRepository ); } @@ -64,7 +75,6 @@ private class CreateUserArgs : ICreateUserArgs public INavigationService NavigationService { get; } public IAuthenticationService AuthenticationService { get; } - private readonly TransactionRepository _transactionRepository; private readonly Database.DAL.UserRepository _userRepository; } diff --git a/StoreManagementSystemX/ViewModels/StockPurchases/CreateStockPurchaseProductViewModel.cs b/StoreManagementSystemX/ViewModels/StockPurchases/CreateStockPurchaseProductViewModel.cs index cf02faa..eb51b71 100644 --- a/StoreManagementSystemX/ViewModels/StockPurchases/CreateStockPurchaseProductViewModel.cs +++ b/StoreManagementSystemX/ViewModels/StockPurchases/CreateStockPurchaseProductViewModel.cs @@ -1,6 +1,9 @@ using CommunityToolkit.Mvvm.Input; using StoreManagementSystemX.Database.DAL.Interfaces; using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Aggregates.Roots.Products.Interfaces; +using StoreManagementSystemX.Domain.Aggregates.Roots.StockPurchases.Interfaces; +using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; using StoreManagementSystemX.ViewModels.StockPurchases.Interfaces; using System; using System.Collections.Generic; @@ -13,61 +16,45 @@ namespace StoreManagementSystemX.ViewModels.StockPurchases { public class CreateStockPurchaseProductViewModel : BaseViewModel, ICreateStockPurchaseProductViewModel { - public CreateStockPurchaseProductViewModel(StockPurchase stockPurchase, Product product, Action onRemove, Action onIncrement, Action onDecrement) + internal CreateStockPurchaseProductViewModel(IStockPurchase stockPurchase, IProduct product, Action onRemove, Action onIncrement, Action onDecrement) { - Product = product; - StockPurchase = stockPurchase; - _stockPurchaseProduct = new StockPurchaseProduct - { - ProductId = product.Id, - StockPurchaseId = stockPurchase.Id, - Price = product.CostPrice, - }; + _stockPurchase = stockPurchase; + _product = product; + _incrementQuantityCommand = new RelayCommand(OnIncrementQuantity); + _decrementQuantityCommand = new RelayCommand(OnDecrementQuantity, CanDecrementQuantity); + Barcode = product.Barcode; + Name = product.Name; + Price = product.CostPrice; _onRemove = onRemove; _onIncrement = onIncrement; _onDecrement = onDecrement; RemoveCommand = new RelayCommand(OnRemove); - _incrementQuantityCommand = new RelayCommand(OnIncrementQuantity); - _decrementQuantityCommand = new RelayCommand(OnDecrementQuantity, CanDecrementQuantity); - // this needs to be executed at the end because it uses the command instances above - Quantity += 1; } - private readonly Action _onRemove; - private readonly Action _onIncrement; - private readonly Action _onDecrement; + private readonly Action _onRemove; + private readonly Action _onIncrement; + private readonly Action _onDecrement; - private StockPurchaseProduct _stockPurchaseProduct; + private IStockPurchase _stockPurchase; - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private IProduct _product; - public Product Product { get; } - public StockPurchase StockPurchase { get; } + public string Barcode { get; } - public string ProductBarcode => Product.Barcode; + public string Name { get; } - public string ProductName => Product.Name; + private int _quantity; + public int Quantity => _stockPurchase.StockPurchaseProducts.First(e => e.Barcode == _product.Barcode).QuantityBought; - public int Quantity - { - get => _stockPurchaseProduct.QuantityBought; - set - { - SetProperty(_stockPurchaseProduct.QuantityBought, value, _stockPurchaseProduct, (u, n) => u.QuantityBought = n); - Subtotal = Price * Quantity; - _decrementQuantityCommand.NotifyCanExecuteChanged(); - } - } + public decimal Price { get; } - public decimal Price => Product.CostPrice; + public decimal TotalPrice => _stockPurchase.StockPurchaseProducts.First(e => e.Barcode == _product.Barcode).TotalCost; - private decimal _subtotal; - public decimal Subtotal { get => _subtotal; private set => SetProperty(ref _subtotal, value); } public ICommand RemoveCommand { get; } @@ -80,41 +67,28 @@ public int Quantity private void OnRemove() { + _stockPurchase.RemoveProduct(_product); _onRemove(this); } private void OnIncrementQuantity() { - Quantity += 1; + _stockPurchase.IncrementProduct(_product); _onIncrement(this); + OnPropertyChanged(nameof(Quantity)); + _decrementQuantityCommand.NotifyCanExecuteChanged(); } private void OnDecrementQuantity() { - Quantity -= 1; + _stockPurchase.DecrementProduct(_product); + OnPropertyChanged(nameof(Quantity)); _onDecrement(this); + _decrementQuantityCommand.NotifyCanExecuteChanged(); } - private bool CanDecrementQuantity() => Quantity > 1; - private void Reset() - { - _stockPurchaseProduct = new StockPurchaseProduct - { - ProductId = Product.Id, - StockPurchaseId = StockPurchase.Id, - Price = Product.CostPrice, - }; - Quantity = 1; - } + private bool CanDecrementQuantity() => Quantity > 1; - public StockPurchaseProduct BuildStockPurchaseProduct() - { - var newStockPurchaseProduct = _stockPurchaseProduct; - Product.InStock += Quantity; - Reset(); - return newStockPurchaseProduct; - - } } } diff --git a/StoreManagementSystemX/ViewModels/StockPurchases/CreateStockPurchaseViewModel.cs b/StoreManagementSystemX/ViewModels/StockPurchases/CreateStockPurchaseViewModel.cs index aab68e1..362be51 100644 --- a/StoreManagementSystemX/ViewModels/StockPurchases/CreateStockPurchaseViewModel.cs +++ b/StoreManagementSystemX/ViewModels/StockPurchases/CreateStockPurchaseViewModel.cs @@ -3,6 +3,10 @@ using SQLitePCL; using StoreManagementSystemX.Database.DAL.Interfaces; using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Aggregates.Roots.Products.Interfaces; +using StoreManagementSystemX.Domain.Aggregates.Roots.StockPurchases.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Products.Interfaces; +using StoreManagementSystemX.Domain.Repositories.StockPurchases.Interfaces; using StoreManagementSystemX.Services; using StoreManagementSystemX.Services.Interfaces; using StoreManagementSystemX.ViewModels.StockPurchases.Interfaces; @@ -22,17 +26,21 @@ namespace StoreManagementSystemX.ViewModels.StockPurchases public class CreateStockPurchaseViewModel : BaseViewModel, ICreateStockPurchaseViewModel { - public CreateStockPurchaseViewModel(AuthContext authContext, IUnitOfWork unitOfWork, IDialogService dialogService, Action onDone, Action onCancel) + public CreateStockPurchaseViewModel( + AuthContext authContext, + Domain.Repositories.StockPurchases.Interfaces.IStockPurchaseRepository stockPurchaseRepository, + Domain.Repositories.Products.Interfaces.IProductRepository productRepository, + IDialogService dialogService, + Action onDone, + Action onCancel) { - _unitOfWork = unitOfWork; + _stockPurchaseRepository = stockPurchaseRepository; + _productRepository = productRepository; _authContext = authContext; _dialogService = dialogService; _onDone = onDone; - _stockPurchase = new StockPurchase - { - Id = Guid.NewGuid(), - MadeById = authContext.CurrentUser.Id, - }; + + _stockPurchase = authContext.CurrentUser.StockPurchaseFactory.Create(authContext.CurrentUser.Id); StockPurchaseProducts = new ObservableCollection(); _cancelCommand = new RelayCommand(onCancel); @@ -41,14 +49,17 @@ public CreateStockPurchaseViewModel(AuthContext authContext, IUnitOfWork unitOfW } - private readonly StockPurchase _stockPurchase; + private readonly IStockPurchase _stockPurchase; private readonly Action _onDone; private readonly AuthContext _authContext; + private readonly IDialogService _dialogService; - private readonly IUnitOfWork _unitOfWork; + private readonly Domain.Repositories.StockPurchases.Interfaces.IStockPurchaseRepository _stockPurchaseRepository; + + private readonly Domain.Repositories.Products.Interfaces.IProductRepository _productRepository; private string _barcode = string.Empty; public string Barcode { get => _barcode; set => SetProperty(ref _barcode, value); } @@ -57,42 +68,70 @@ public CreateStockPurchaseViewModel(AuthContext authContext, IUnitOfWork unitOfW public void AddProduct() { - Product? matchedProduct = null; - matchedProduct = _unitOfWork.ProductRepository.GetByBarcode(Barcode); + IProduct? matchedProduct = null; + matchedProduct = _productRepository.GetByBarcode(Barcode); + // a product with the barcode was found if (matchedProduct != null) { - var stockPurchaseProduct = StockPurchaseProducts.FirstOrDefault(p => p.ProductBarcode == Barcode); - if (stockPurchaseProduct == null) + // add the product to the actual stock purchase instance + + // check whether the view model for the stock purchase product already exists; + // if it is, create an instance and add to the collection + // otherwise: just increment the stock purchase product + var stockPurchaseProduct = _stockPurchase.StockPurchaseProducts.FirstOrDefault(e => e.ProductId == matchedProduct.Id); + if(stockPurchaseProduct == null)// stock purchase product doesn't exist yet { - var newStockPurchaseProduct = new CreateStockPurchaseProductViewModel(_stockPurchase, matchedProduct, RemoveStockPurchaseProduct, (stockPurchaseProduct) => - { - TotalAmount += stockPurchaseProduct.Price; - }, (stockPurchaseProduct) => - { - TotalAmount -= stockPurchaseProduct.Price; - }); - StockPurchaseProducts.Add(newStockPurchaseProduct); - } - else + var newStockPurchaseProduct = _stockPurchase.AddProduct(matchedProduct); + StockPurchaseProducts.Add( + new CreateStockPurchaseProductViewModel( + _stockPurchase, + matchedProduct, + (CreateStockPurchaseProductViewModel spp) => RemoveProductHandler(spp), + (CreateStockPurchaseProductViewModel spp) => IncrementProductQuantityHandler(matchedProduct), + (CreateStockPurchaseProductViewModel spp) => DecrementProductQuantityHandler(matchedProduct) + ) + ); + + + } else // stock purchase product already exists { - stockPurchaseProduct.Quantity += 1; + var createStockPurchaseProductViewModel = StockPurchaseProducts.First(e => e.Barcode == stockPurchaseProduct.Barcode); + createStockPurchaseProductViewModel.IncrementQuantityCommand.Execute(null); } - TotalAmount += matchedProduct.CostPrice; + OnPropertyChanged(nameof(TotalAmount)); _doneCommand.NotifyCanExecuteChanged(); + Barcode = ""; + } else { _dialogService.ShowMessageDialog("Product not found", $"Product with barcode {Barcode} does not exist in the records"); } - Barcode = ""; } - private decimal _totalAmount; + public void RemoveProductHandler(ICreateStockPurchaseProductViewModel stockPurchaseProduct) + { + StockPurchaseProducts.Remove(stockPurchaseProduct); + OnPropertyChanged(nameof(TotalAmount)); + _doneCommand.NotifyCanExecuteChanged(); + } + + public void IncrementProductQuantityHandler(IProduct product) + { + OnPropertyChanged(nameof(TotalAmount)); + _doneCommand.NotifyCanExecuteChanged(); + } + + public void DecrementProductQuantityHandler(IProduct product) + { + OnPropertyChanged(nameof(TotalAmount)); + _doneCommand.NotifyCanExecuteChanged(); + } + public decimal TotalAmount { - get => _totalAmount; - set => SetProperty(ref _totalAmount, value); + get => _stockPurchase.TotalAmount; } private readonly RelayCommand _cancelCommand; @@ -105,23 +144,10 @@ public decimal TotalAmount private bool CanSubmit() => StockPurchaseProducts.Any(); - private void RemoveStockPurchaseProduct(ICreateStockPurchaseProductViewModel stockPurchaseProduct) - { - StockPurchaseProducts.Remove(stockPurchaseProduct); - TotalAmount -= stockPurchaseProduct.Subtotal; - _doneCommand.NotifyCanExecuteChanged(); - } public void OnDone() { - _stockPurchase.DateTime = DateTime.Now; - _unitOfWork.StockPurchaseRepository.Insert(_stockPurchase); - foreach(var stockPurchaseProduct in StockPurchaseProducts) - { - var newStockPurchaseProduct = stockPurchaseProduct.BuildStockPurchaseProduct(); - _unitOfWork.StockPurchaseProductRepository.Insert(newStockPurchaseProduct); - } - _unitOfWork.Save(); + _stockPurchaseRepository.Add(_stockPurchase); _onDone(_stockPurchase.Id); } diff --git a/StoreManagementSystemX/ViewModels/StockPurchases/Interfaces/ICreateStockPurchaseProductViewModel.cs b/StoreManagementSystemX/ViewModels/StockPurchases/Interfaces/ICreateStockPurchaseProductViewModel.cs index 877a2be..743fbf4 100644 --- a/StoreManagementSystemX/ViewModels/StockPurchases/Interfaces/ICreateStockPurchaseProductViewModel.cs +++ b/StoreManagementSystemX/ViewModels/StockPurchases/Interfaces/ICreateStockPurchaseProductViewModel.cs @@ -1,4 +1,6 @@ using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Aggregates.Roots.Products.Interfaces; +using StoreManagementSystemX.Domain.Aggregates.Roots.StockPurchases.Interfaces; using System; using System.Collections.Generic; using System.Linq; @@ -10,20 +12,15 @@ namespace StoreManagementSystemX.ViewModels.StockPurchases.Interfaces { public interface ICreateStockPurchaseProductViewModel { - public string ProductBarcode { get; } + public string Barcode { get; } - public Product Product { get; } + public string Name { get; } - public StockPurchase StockPurchase { get; } - - - public string ProductName { get; } - - public int Quantity { get; set; } + public int Quantity { get; } public decimal Price { get; } - public decimal Subtotal { get; } + public decimal TotalPrice { get; } public ICommand RemoveCommand { get; } @@ -31,6 +28,5 @@ public interface ICreateStockPurchaseProductViewModel public ICommand DecrementQuantityCommand { get; } - public StockPurchaseProduct BuildStockPurchaseProduct(); } } diff --git a/StoreManagementSystemX/ViewModels/StockPurchases/StockPurchaseListViewModel.cs b/StoreManagementSystemX/ViewModels/StockPurchases/StockPurchaseListViewModel.cs index a380ce8..18e7a39 100644 --- a/StoreManagementSystemX/ViewModels/StockPurchases/StockPurchaseListViewModel.cs +++ b/StoreManagementSystemX/ViewModels/StockPurchases/StockPurchaseListViewModel.cs @@ -2,6 +2,8 @@ using StoreManagementSystemX.Database.DAL; using StoreManagementSystemX.Database.DAL.Interfaces; using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Aggregates.Roots.StockPurchases.Interfaces; +using StoreManagementSystemX.Domain.Repositories.StockPurchases.Interfaces; using StoreManagementSystemX.Services; using StoreManagementSystemX.Services.Interfaces; using System; @@ -16,20 +18,18 @@ namespace StoreManagementSystemX.ViewModels.StockPurchases { public class StockPurchaseListViewModel : BaseViewModel { - public StockPurchaseListViewModel(AuthContext authContext, IUnitOfWorkFactory unitOfWorkFactory, IDialogService dialogService, IStockPurchaseCreationService stockPurchaseCreationService) + public StockPurchaseListViewModel(AuthContext authContext, Domain.Repositories.StockPurchases.Interfaces.IStockPurchaseRepository stockPurchaseRepository, IDialogService dialogService, IStockPurchaseCreationService stockPurchaseCreationService) { - _unitOfWorkFactory = unitOfWorkFactory; + _stockPurchaseRepository = stockPurchaseRepository; _authContext = authContext; _createStockPurchaseWindowService = stockPurchaseCreationService; StockPurchases = new ObservableCollection(); - using(var unitOfWork = unitOfWorkFactory.CreateUnitOfWork()) + foreach (var stockPurchase in stockPurchaseRepository.GetAll()) { - foreach(var stockPurchase in unitOfWork.StockPurchaseRepository.Get(null, sp => sp.OrderByDescending(e => e.DateTime), "StockPurchaseProducts, StockPurchaseProducts.Product")) - { - StockPurchases.Add(new StockPurchaseViewModel(stockPurchase)); - } + StockPurchases.Add(new StockPurchaseViewModel(stockPurchase)); } + if (StockPurchases.Any()) { SelectedStockPurchase = StockPurchases.First(); @@ -38,7 +38,7 @@ public StockPurchaseListViewModel(AuthContext authContext, IUnitOfWorkFactory un NewStockPurchaseCommand = new RelayCommand(OnNewTransaction); } - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private readonly Domain.Repositories.StockPurchases.Interfaces.IStockPurchaseRepository _stockPurchaseRepository; private readonly AuthContext _authContext; @@ -48,7 +48,7 @@ public StockPurchaseListViewModel(AuthContext authContext, IUnitOfWorkFactory un public StockPurchaseViewModel? SelectedStockPurchase { get; set; } - public void AddStockPurchase(StockPurchase stockPurchase) + public void AddStockPurchase(IStockPurchase stockPurchase) { StockPurchases.Insert(0, new StockPurchaseViewModel(stockPurchase)); } @@ -59,15 +59,12 @@ public void OnNewTransaction() { var newStockPurchaseId = _createStockPurchaseWindowService.CreateStockPurchase(_authContext); { - using(var unitOfWork = _unitOfWorkFactory.CreateUnitOfWork()) + if(newStockPurchaseId != null) { - if(newStockPurchaseId != null) + var newStockPurchase = _stockPurchaseRepository.GetById((Guid)newStockPurchaseId); + if(newStockPurchase != null) { - var newStockPurchase = unitOfWork.StockPurchaseRepository.GetById((Guid)newStockPurchaseId, "StockPurchaseProducts, StockPurchaseProducts.Product"); - if(newStockPurchase != null) - { - AddStockPurchase(newStockPurchase); - } + AddStockPurchase(newStockPurchase); } } } diff --git a/StoreManagementSystemX/ViewModels/StockPurchases/StockPurchaseProductViewModel.cs b/StoreManagementSystemX/ViewModels/StockPurchases/StockPurchaseProductViewModel.cs index 6ef05b7..9131741 100644 --- a/StoreManagementSystemX/ViewModels/StockPurchases/StockPurchaseProductViewModel.cs +++ b/StoreManagementSystemX/ViewModels/StockPurchases/StockPurchaseProductViewModel.cs @@ -1,5 +1,7 @@ using CommunityToolkit.Mvvm.ComponentModel; using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Aggregates.Roots.StockPurchases.Interfaces; +using StoreManagementSystemX.ViewModels.StockPurchases.Interfaces; using System; using System.Collections.Generic; using System.Linq; @@ -10,20 +12,18 @@ namespace StoreManagementSystemX.ViewModels.StockPurchases { public class StockPurchaseProductViewModel : ObservableObject { - public StockPurchaseProductViewModel(StockPurchaseProduct stockPurchaseProduct) + public StockPurchaseProductViewModel(IStockPurchaseProduct stockPurchaseProduct) { _stockPurchaseProduct = stockPurchaseProduct; } - private readonly StockPurchaseProduct _stockPurchaseProduct; + private readonly IStockPurchaseProduct _stockPurchaseProduct; public Guid ProductId => _stockPurchaseProduct.ProductId; - public Guid TransactionId => _stockPurchaseProduct.StockPurchaseId; + public string Name => _stockPurchaseProduct.Name; - public string Name => _stockPurchaseProduct.Product.Name; - - public string Barcode => _stockPurchaseProduct.Product.Barcode; + public string Barcode => _stockPurchaseProduct.Barcode; public decimal Price => _stockPurchaseProduct.Price; diff --git a/StoreManagementSystemX/ViewModels/StockPurchases/StockPurchaseViewModel.cs b/StoreManagementSystemX/ViewModels/StockPurchases/StockPurchaseViewModel.cs index 503e7a2..b6f64ed 100644 --- a/StoreManagementSystemX/ViewModels/StockPurchases/StockPurchaseViewModel.cs +++ b/StoreManagementSystemX/ViewModels/StockPurchases/StockPurchaseViewModel.cs @@ -1,6 +1,7 @@ using CommunityToolkit.Mvvm.ComponentModel; using Microsoft.EntityFrameworkCore.Query; using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Aggregates.Roots.StockPurchases.Interfaces; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -15,12 +16,12 @@ namespace StoreManagementSystemX.ViewModels.StockPurchases { public class StockPurchaseViewModel : ObservableObject { - public StockPurchaseViewModel(StockPurchase stockPurchase) + public StockPurchaseViewModel(IStockPurchase stockPurchase) { _stockPurchase = stockPurchase; } - private readonly StockPurchase _stockPurchase; + private readonly IStockPurchase _stockPurchase; public Guid Id => _stockPurchase.Id; @@ -30,7 +31,5 @@ public StockPurchaseViewModel(StockPurchase stockPurchase) public decimal TotalCost => StockPurchaseProducts.Sum(e => e.TotalPrice); - public static IEnumerable From(IEnumerable stockPurchases) - => stockPurchases.Select(e => new StockPurchaseViewModel(e)); } } diff --git a/StoreManagementSystemX/ViewModels/Transactions/CreateTransactionProductViewModel.cs b/StoreManagementSystemX/ViewModels/Transactions/CreateTransactionProductViewModel.cs index 8557557..6cbfe6f 100644 --- a/StoreManagementSystemX/ViewModels/Transactions/CreateTransactionProductViewModel.cs +++ b/StoreManagementSystemX/ViewModels/Transactions/CreateTransactionProductViewModel.cs @@ -3,6 +3,9 @@ using SQLitePCL; using StoreManagementSystemX.Database.DAL.Interfaces; using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Aggregates.Roots.Products.Interfaces; +using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Transactions.Interfaces; using StoreManagementSystemX.ViewModels.Transactions.Interfaces; using System; using System.Runtime.InteropServices; @@ -13,56 +16,45 @@ namespace StoreManagementSystemX.ViewModels.Transactions public class CreateTransactionProductViewModel : ObservableObject, ICreateTransactionProductViewModel { - public CreateTransactionProductViewModel(IUnitOfWork unitOfWork, Transaction transaction, Product product) + public CreateTransactionProductViewModel( + Domain.Repositories.Transactions.Interfaces.ITransactionRepository transactionRepository, + ITransaction transaction, + IProduct product + ) { - _unitOfWork = unitOfWork; - _transaction = transaction; + _transactionRepository = transactionRepository; _product = product; - _transactionProduct = new TransactionProduct - { - TransactionId = transaction.Id, - ProductId = product.Id, - CostPrice = product.CostPrice, - PriceSold = product.SellingPrice, - ProductName = product.Name, - }; - - + _transaction = transaction; + Price = product.SellingPrice; RemoveCommand = new RelayCommand(OnRemove); _incrementQuantityCommand = new RelayCommand(OnIncrementQuantity); _decrementQuantityCommand = new RelayCommand(OnDecrementQuantity, CanDecrementQuantity); - Quantity += 1; } - private readonly Transaction _transaction; - private readonly IUnitOfWork _unitOfWork; - private readonly Product _product; + private readonly Domain.Repositories.Transactions.Interfaces.ITransactionRepository _transactionRepository; private readonly Action _onRemove; - private readonly TransactionProduct _transactionProduct; + private readonly ITransaction _transaction; + + private readonly IProduct _product; + + public IProduct Product => _product; public string ProductBarcode => _product.Barcode; public string ProductName => _product.Name; - public decimal Price => _transactionProduct.PriceSold; + public decimal Price { get; } public int Quantity { - get => _transactionProduct.QuantityBought; - set - { - SetProperty(_transactionProduct.QuantityBought, value, _transactionProduct, (u, n) => u.QuantityBought = n); - Subtotal = Quantity * Price; - _decrementQuantityCommand.NotifyCanExecuteChanged(); - } + get => _transaction.TransactionProducts.First(e => e.ProductId == _product.Id).QuantityBought; } - private decimal _subtotal; - public decimal Subtotal { get => _subtotal; private set => SetProperty(ref _subtotal, value); } + public decimal Subtotal => _transaction.TransactionProducts.First(e => e.ProductId == _product.Id).TotalPrice; public event EventHandler> ItemRemoved; public ICommand RemoveCommand { get; } @@ -77,7 +69,10 @@ private void OnRemove() public ICommand IncrementQuantityCommand { get => _incrementQuantityCommand; } private void OnIncrementQuantity() { - Quantity += 1; + _transaction.IncrementProduct(_product); + _decrementQuantityCommand.NotifyCanExecuteChanged(); + OnPropertyChanged(nameof(Quantity)); + OnPropertyChanged(nameof(Subtotal)); QuantityIncremented?.Invoke(this, new EventArgs(this)); } @@ -85,20 +80,19 @@ private void OnIncrementQuantity() public event EventHandler> QuantityDecremented; private readonly RelayCommand _decrementQuantityCommand; public ICommand DecrementQuantityCommand { get => _decrementQuantityCommand; } + + private void OnDecrementQuantity() { - Quantity -= 1; + _transaction.DecrementProduct(_product); + OnPropertyChanged(nameof(Quantity)); + OnPropertyChanged(nameof(Subtotal)); + _decrementQuantityCommand.NotifyCanExecuteChanged(); QuantityDecremented?.Invoke(this, new EventArgs(this)); } private bool CanDecrementQuantity() => Quantity > 1; - - public void OnDone() - { - _product.InStock -= Quantity; - _unitOfWork.TransactionProductRepository.Insert(_transactionProduct); - } } } \ No newline at end of file diff --git a/StoreManagementSystemX/ViewModels/Transactions/CreateTransactionViewModel.cs b/StoreManagementSystemX/ViewModels/Transactions/CreateTransactionViewModel.cs index cab684f..13911dc 100644 --- a/StoreManagementSystemX/ViewModels/Transactions/CreateTransactionViewModel.cs +++ b/StoreManagementSystemX/ViewModels/Transactions/CreateTransactionViewModel.cs @@ -3,6 +3,10 @@ using SQLitePCL; using StoreManagementSystemX.Database.DAL.Interfaces; using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Aggregates.Roots.Products.Interfaces; +using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Products.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Transactions.Interfaces; using StoreManagementSystemX.Services; using StoreManagementSystemX.Services.Interfaces; using StoreManagementSystemX.ViewModels.Transactions.Interfaces; @@ -20,18 +24,21 @@ namespace StoreManagementSystemX.ViewModels.Transactions public class CreateTransactionViewModel : ObservableObject, ICreateTransactionViewModel { - public CreateTransactionViewModel(AuthContext authContext, IUnitOfWork unitOfWork, IDialogService dialogService, Action onDone, Action onCancel) + public CreateTransactionViewModel( + AuthContext authContext, + Domain.Repositories.Transactions.Interfaces.ITransactionRepository transactionRepository, + Domain.Repositories.Products.Interfaces.IProductRepository productRepository, + IDialogService dialogService, + Action onDone, + Action onClose) { _authContext = authContext; - _unitOfWork = unitOfWork; + _transactionRepository = transactionRepository; + _productRepository = productRepository; DialogService = dialogService; - _transaction = new Transaction - { - Id = Guid.NewGuid(), - SellerId = authContext.CurrentUser.Id - }; + _transaction = authContext.CurrentUser.TransactionFactory.Create(authContext.CurrentUser.Id); - _onCancel = onCancel; + _onClose = onClose; _onDone = onDone; _doneCommand = new RelayCommand(OnDone, CanSubmitTransaction); @@ -41,11 +48,14 @@ public CreateTransactionViewModel(AuthContext authContext, IUnitOfWork unitOfWor private readonly AuthContext _authContext; public IDialogService DialogService; - private readonly IUnitOfWork _unitOfWork; - private readonly Transaction _transaction; + + private readonly Domain.Repositories.Transactions.Interfaces.ITransactionRepository _transactionRepository; + private readonly Domain.Repositories.Products.Interfaces.IProductRepository _productRepository; + + private readonly ITransaction _transaction; private readonly Action _onDone; - private readonly Action _onCancel; + private readonly Action _onClose; public ObservableCollection TransactionProducts { get; } = new ObservableCollection(); @@ -74,8 +84,7 @@ public bool IsPayLater } } - private decimal _totalAmount; - public decimal TotalAmount { get => _totalAmount; set => SetProperty(ref _totalAmount, value); } + public decimal TotalAmount => _transaction.TotalAmount; private RelayCommand _doneCommand; public ICommand DoneCommand { get => _doneCommand; } @@ -85,23 +94,21 @@ public bool IsPayLater public void AddProduct() { - var matchedProduct = _unitOfWork.ProductRepository.GetByBarcode(Barcode); + var matchedProduct = _productRepository.GetByBarcode(Barcode); if (matchedProduct != null) { - var transactionProduct = TransactionProducts.FirstOrDefault(e => e.ProductBarcode == matchedProduct.Barcode); - if (transactionProduct != null) + // check whether the product already exists in the transaction + var transactionProduct = _transaction.TransactionProducts.FirstOrDefault(e => e.ProductId == matchedProduct.Id); + if (transactionProduct == null) // product does not exist yet { - transactionProduct.Quantity += 1; + AddProduct(matchedProduct); } - else + else // product already exists { - var newTransactionProduct = new CreateTransactionProductViewModel(_unitOfWork, _transaction, matchedProduct); - newTransactionProduct.ItemRemoved += OnRemoveTransactionProduct; - newTransactionProduct.QuantityIncremented += OnTransactionProductQuantityIncrement; - newTransactionProduct.QuantityDecremented += OnTransactionProductQuantityDecrement; - TransactionProducts.Add(newTransactionProduct); + IncrementTransactionProduct(Barcode); } - TotalAmount += matchedProduct.SellingPrice; + + OnPropertyChanged(nameof(TotalAmount)); } else { @@ -116,21 +123,35 @@ private bool CanSubmitTransaction() private void OnDone() { - if (_isPayLater) + if (IsPayLater) { - var payLaterInstance = new PayLater { Id = Guid.NewGuid(), CustomerName = _customerName, TransactionId = _transaction.Id }; - _unitOfWork.PayLaterRepository.Insert(payLaterInstance); + _transaction.SetPayLaterDetails(CustomerName); } + _transactionRepository.Add(_transaction); + _onDone(_transaction.Id); + _onClose(); + } - foreach (var transactionProduct in TransactionProducts) - { - transactionProduct.OnDone(); - } + private void IncrementTransactionProduct(string barcode) + { + var transactionProductVM = TransactionProducts.First(e => e.ProductBarcode == barcode); + transactionProductVM.IncrementQuantityCommand.Execute(null); - _transaction.DateTime = DateTime.Now; - _unitOfWork.TransactionRepository.Insert(_transaction); - _unitOfWork.Save(); - _onDone(_transaction.Id); + } + + private void AddProduct(IProduct product) + { + var newTransactionProduct = _transaction.AddProduct(product); + var newTransactionProductViewModel = new CreateTransactionProductViewModel(_transactionRepository, _transaction, product); + SubscribeToTransactionProductEvents(newTransactionProductViewModel); + TransactionProducts.Add(newTransactionProductViewModel); + } + + private void SubscribeToTransactionProductEvents(ICreateTransactionProductViewModel item) + { + item.ItemRemoved += OnRemoveTransactionProduct; + item.QuantityIncremented += OnTransactionProductQuantityIncrement; + item.QuantityDecremented += OnTransactionProductQuantityDecrement; } private void UnsubscribeToTransactionProductEvents(ICreateTransactionProductViewModel item) @@ -144,24 +165,23 @@ private void OnRemoveTransactionProduct(object? sender, EventArgs e) { - TotalAmount += e.Item.Price; - + OnPropertyChanged(nameof(TotalAmount)); } private void OnTransactionProductQuantityDecrement(object? sender, EventArgs e) { - TotalAmount -= e.Item.Price; + OnPropertyChanged(nameof(TotalAmount)); } private void OnCancel() { - _onCancel(); + _onClose(); } diff --git a/StoreManagementSystemX/ViewModels/Transactions/Interfaces/ICreateTransactionProductViewModel.cs b/StoreManagementSystemX/ViewModels/Transactions/Interfaces/ICreateTransactionProductViewModel.cs index c6e4e4f..aab883a 100644 --- a/StoreManagementSystemX/ViewModels/Transactions/Interfaces/ICreateTransactionProductViewModel.cs +++ b/StoreManagementSystemX/ViewModels/Transactions/Interfaces/ICreateTransactionProductViewModel.cs @@ -1,6 +1,8 @@ -using System; +using StoreManagementSystemX.Domain.Aggregates.Roots.Products.Interfaces; +using System; using System.Collections.Generic; using System.Linq; +using System.Security.RightsManagement; using System.Text; using System.Threading.Tasks; using System.Windows.Input; @@ -9,13 +11,16 @@ namespace StoreManagementSystemX.ViewModels.Transactions.Interfaces { public interface ICreateTransactionProductViewModel { + + public IProduct Product { get; } + public string ProductBarcode { get; } public string ProductName { get; } public decimal Price { get; } - public int Quantity { get; set; } + public int Quantity { get; } public decimal Subtotal { get; } @@ -28,8 +33,6 @@ public interface ICreateTransactionProductViewModel public ICommand DecrementQuantityCommand { get; } public event EventHandler> QuantityDecremented; - public void OnDone(); - } public class EventArgs : EventArgs diff --git a/StoreManagementSystemX/ViewModels/Transactions/PayLaterTransactionRowViewModel.cs b/StoreManagementSystemX/ViewModels/Transactions/PayLaterTransactionRowViewModel.cs index 63c955e..0c42b9a 100644 --- a/StoreManagementSystemX/ViewModels/Transactions/PayLaterTransactionRowViewModel.cs +++ b/StoreManagementSystemX/ViewModels/Transactions/PayLaterTransactionRowViewModel.cs @@ -2,7 +2,10 @@ using SQLitePCL; using StoreManagementSystemX.Database.DAL.Interfaces; using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Transactions.Interfaces; using StoreManagementSystemX.Services.Interfaces; +using StoreManagementSystemX.ViewModels.Transactions.Interfaces; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -15,10 +18,13 @@ namespace StoreManagementSystemX.ViewModels.Transactions { public class PayLaterTransactionRowViewModel : BaseViewModel { - public PayLaterTransactionRowViewModel(IUnitOfWorkFactory unitOfWorkFactory, Transaction transaction, IDialogService dialogService) + public PayLaterTransactionRowViewModel( + Domain.Repositories.Transactions.Interfaces.ITransactionRepository transactionRepository, + ITransaction transaction, + IDialogService dialogService) { _transaction = transaction; - _unitOfWorkFactory = unitOfWorkFactory; + _transactionRepository = transactionRepository; _dialogService = dialogService; _markAsPaidCommand = new RelayCommand(MarkAsPaid, CanMarkAsPaid); foreach (var transactionProduct in transaction.TransactionProducts) @@ -27,9 +33,9 @@ public PayLaterTransactionRowViewModel(IUnitOfWorkFactory unitOfWorkFactory, Tra } } - private readonly Transaction _transaction; + private readonly ITransaction _transaction; - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private readonly Domain.Repositories.Transactions.Interfaces.ITransactionRepository _transactionRepository; private readonly IDialogService _dialogService; @@ -51,15 +57,8 @@ private void MarkAsPaid() { if (_transaction.PayLater != null) { - - using (var unitOfWork = _unitOfWorkFactory.CreateUnitOfWork()) - { - unitOfWork.Attach(_transaction.PayLater); - _transaction.PayLater.PaidAt = DateTime.Now; - _transaction.PayLater.IsPaid = true; - unitOfWork.Save(); - - } + _transaction.MarkAsPaid(); + _transactionRepository.Update(_transaction); } _markAsPaidCommand.NotifyCanExecuteChanged(); } diff --git a/StoreManagementSystemX/ViewModels/Transactions/PayLaterTransactionsViewModel.cs b/StoreManagementSystemX/ViewModels/Transactions/PayLaterTransactionsViewModel.cs index 8789132..60a987b 100644 --- a/StoreManagementSystemX/ViewModels/Transactions/PayLaterTransactionsViewModel.cs +++ b/StoreManagementSystemX/ViewModels/Transactions/PayLaterTransactionsViewModel.cs @@ -1,10 +1,13 @@ using CommunityToolkit.Mvvm.Input; using StoreManagementSystemX.Database.DAL.Interfaces; using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Transactions.Interfaces; using StoreManagementSystemX.Services; using StoreManagementSystemX.Services.Interfaces; using StoreManagementSystemX.ViewModels; using StoreManagementSystemX.ViewModels.Transactions; +using StoreManagementSystemX.ViewModels.Transactions.Interfaces; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -18,24 +21,21 @@ namespace StoreManagementSystemX.ViewModels.Transactions { public class PayLaterTransactionsViewModel: BaseViewModel { - public PayLaterTransactionsViewModel(AuthContext authContext, IUnitOfWorkFactory unitOfWorkFactory, IDialogService dialogService, ITransactionCreationService transactionCreationService) + public PayLaterTransactionsViewModel(AuthContext authContext, Domain.Repositories.Transactions.Interfaces.ITransactionRepository transactionRepository, IDialogService dialogService, ITransactionCreationService transactionCreationService) { - _unitOfWorkFactory = unitOfWorkFactory; + _transactionRepository = transactionRepository; _authContext = authContext; _dialogService = dialogService; _transactionCreationService = transactionCreationService; Transactions = new ObservableCollection(); NewTransactionCommand = new RelayCommand(NewTransactionCommandHandler); - using(var unitOfWork = _unitOfWorkFactory.CreateUnitOfWork()) + + foreach(var transaction in _transactionRepository.GetAll()) { - foreach(var transaction in unitOfWork.TransactionRepository.Get(t => t.PayLater != null, t => t.OrderByDescending(t => t.DateTime), "TransactionProducts, TransactionProducts.Product, PayLater")) + if(transaction != null) { - if(transaction != null) - { - Transactions.Add(new PayLaterTransactionRowViewModel(unitOfWorkFactory, transaction, dialogService)); - } + Transactions.Add(new PayLaterTransactionRowViewModel(transactionRepository, transaction, dialogService)); } - } if (Transactions.Any()) @@ -44,7 +44,7 @@ public PayLaterTransactionsViewModel(AuthContext authContext, IUnitOfWorkFactory } } - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private readonly Domain.Repositories.Transactions.Interfaces.ITransactionRepository _transactionRepository; private readonly AuthContext _authContext; private readonly IDialogService _dialogService; private readonly ITransactionCreationService _transactionCreationService; @@ -56,43 +56,27 @@ private void NewTransactionCommandHandler() var newTransactionId = _transactionCreationService.CreateNewTransaction(_authContext); if (newTransactionId != null) { - using (var unitOfWork = _unitOfWorkFactory.CreateUnitOfWork()) + var newTransaction = _transactionRepository.GetById((Guid)newTransactionId); + if(newTransaction != null && newTransaction.PayLater != null) { - var newTransaction = unitOfWork.TransactionRepository.GetById((Guid)newTransactionId, "TransactionProducts, TransactionProducts.Product, PayLater"); - if(newTransaction != null) - { - if (newTransaction.PayLater != null) { } - { - var newTransactionRow = new PayLaterTransactionRowViewModel(_unitOfWorkFactory, newTransaction, _dialogService); - //SubscribeToTransactionRowEvents(newTransactionRow); - Transactions.Insert(0, newTransactionRow); - } - } + var newTransactionRow = new PayLaterTransactionRowViewModel(_transactionRepository, newTransaction, _dialogService); + //SubscribeToTransactionRowEvents(newTransactionRow); + Transactions.Insert(0, newTransactionRow); } } } - //private void SubscribeToTransactionRowEvents(PayLaterTransactionRowViewModel transactionRow) - //{ - // transactionRow.TransactionDeleted += HandleTransactionDeletion; - //} - - //private void UnsubscribeToTransactionRowEvents(ITransactionRowViewModel transactionRow) - //{ - // transactionRow.TransactionDeleted -= PayLaterTransactionRowViewModel; - //} - public ObservableCollection Transactions { get; } public PayLaterTransactionRowViewModel? SelectedTransaction { get; set; } - public void OnCreateTransaction(Transaction newTransaction) + public void OnCreateTransaction(ITransaction newTransaction) { if(newTransaction.PayLater != null) { - Transactions?.Insert(0, new PayLaterTransactionRowViewModel(_unitOfWorkFactory, newTransaction, _dialogService)); + Transactions?.Insert(0, new PayLaterTransactionRowViewModel(_transactionRepository, newTransaction, _dialogService)); } } diff --git a/StoreManagementSystemX/ViewModels/Transactions/TransactionListViewModel.cs b/StoreManagementSystemX/ViewModels/Transactions/TransactionListViewModel.cs index cbcf1a2..76d6add 100644 --- a/StoreManagementSystemX/ViewModels/Transactions/TransactionListViewModel.cs +++ b/StoreManagementSystemX/ViewModels/Transactions/TransactionListViewModel.cs @@ -1,6 +1,8 @@ using CommunityToolkit.Mvvm.Input; using StoreManagementSystemX.Database.DAL.Interfaces; using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Transactions.Interfaces; using StoreManagementSystemX.Services; using StoreManagementSystemX.Services.Interfaces; using StoreManagementSystemX.ViewModels; @@ -18,20 +20,17 @@ namespace StoreManagementSystemX.ViewModels.Transactions { public class TransactionListViewModel : BaseViewModel, ITransactionListViewModel { - public TransactionListViewModel(AuthContext authContext, IUnitOfWorkFactory unitOfWorkFactory, IDialogService dialogService, ITransactionCreationService transactionCreationService) + public TransactionListViewModel(AuthContext authContext, Domain.Repositories.Transactions.Interfaces.ITransactionRepository transactionRepository, IDialogService dialogService, ITransactionCreationService transactionCreationService) { - _unitOfWorkFactory = unitOfWorkFactory; + _transactionRepository = transactionRepository; _authContext = authContext; _dialogService = dialogService; _transactionCreationService = transactionCreationService; Transactions = new ObservableCollection(); - using (var unitOfWork = _unitOfWorkFactory.CreateUnitOfWork()) + foreach (var transaction in _transactionRepository.GetAll()) { - foreach (var t in unitOfWork.TransactionRepository.Get(null, t => t.OrderByDescending(t => t.DateTime), "TransactionProducts, PayLater")) - { - AddTransaction(t); - } + AddTransaction(transaction); } @@ -42,7 +41,7 @@ public TransactionListViewModel(AuthContext authContext, IUnitOfWorkFactory unit NewTransactionCommand = new RelayCommand(NewTransactionCommandHandler); } - private IUnitOfWorkFactory _unitOfWorkFactory { get; } + private Domain.Repositories.Transactions.Interfaces.ITransactionRepository _transactionRepository { get; } private AuthContext _authContext { get; } private IDialogService _dialogService { get; } private ITransactionCreationService _transactionCreationService { get; } @@ -70,21 +69,22 @@ private void NewTransactionCommandHandler() var newTransactionId = _transactionCreationService.CreateNewTransaction(_authContext); if (newTransactionId != null) { - using (var unitOfWork = _unitOfWorkFactory.CreateUnitOfWork()) + var newTransaction = _transactionRepository.GetById((Guid)newTransactionId); + if(newTransaction != null && newTransaction.PayLater == null) { - var newTransaction = unitOfWork.TransactionRepository.GetById((Guid)newTransactionId, "TransactionProducts,TransactionProducts.Product"); - var newTransactionRow = new TransactionRowViewModel(_unitOfWorkFactory, _dialogService, newTransaction); + var newTransactionRow = new TransactionRowViewModel(_transactionRepository, _dialogService, newTransaction); SubscribeToTransactionRowEvents(newTransactionRow); Transactions.Insert(0, newTransactionRow); + } } } - private void AddTransaction(Transaction newTransaction) + private void AddTransaction(ITransaction newTransaction) { - var newTransactionRow = new TransactionRowViewModel(_unitOfWorkFactory, _dialogService, newTransaction); + var newTransactionRow = new TransactionRowViewModel(_transactionRepository, _dialogService, newTransaction); SubscribeToTransactionRowEvents(newTransactionRow); Transactions.Add(newTransactionRow); } diff --git a/StoreManagementSystemX/ViewModels/Transactions/TransactionProductRowViewModel.cs b/StoreManagementSystemX/ViewModels/Transactions/TransactionProductRowViewModel.cs index f5ca800..8a3e83d 100644 --- a/StoreManagementSystemX/ViewModels/Transactions/TransactionProductRowViewModel.cs +++ b/StoreManagementSystemX/ViewModels/Transactions/TransactionProductRowViewModel.cs @@ -1,23 +1,24 @@  using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; using StoreManagementSystemX.Views.Transactions; namespace StoreManagementSystemX.ViewModels.Transactions { public class TransactionProductRowViewModel : ITransactionProductRowViewModel { - public TransactionProductRowViewModel(TransactionProduct transactionProduct) + public TransactionProductRowViewModel(ITransactionProduct transactionProduct) { _transactionProduct = transactionProduct; } - private readonly TransactionProduct _transactionProduct; + private readonly ITransactionProduct _transactionProduct; public string ProductName => _transactionProduct.ProductName; public int Quantity => _transactionProduct.QuantityBought; - public decimal SellingPrice => _transactionProduct.PriceSold; + public decimal SellingPrice => _transactionProduct.SellingPrice; public decimal TotalCost => Quantity * _transactionProduct.CostPrice; diff --git a/StoreManagementSystemX/ViewModels/Transactions/TransactionRowViewModel.cs b/StoreManagementSystemX/ViewModels/Transactions/TransactionRowViewModel.cs index 930557d..6fcf27e 100644 --- a/StoreManagementSystemX/ViewModels/Transactions/TransactionRowViewModel.cs +++ b/StoreManagementSystemX/ViewModels/Transactions/TransactionRowViewModel.cs @@ -2,6 +2,8 @@ using SQLitePCL; using StoreManagementSystemX.Database.DAL.Interfaces; using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Transactions.Interfaces; using StoreManagementSystemX.Services.Interfaces; using StoreManagementSystemX.ViewModels.Transactions; using StoreManagementSystemX.ViewModels.Transactions.Interfaces; @@ -19,7 +21,7 @@ namespace StoreManagementSystemX.ViewModels.Transactions { public class TransactionRowViewModel : ITransactionRowViewModel { - public TransactionRowViewModel(IUnitOfWorkFactory unitOfWorkFactory, IDialogService dialogService, Transaction transaction) + public TransactionRowViewModel(Domain.Repositories.Transactions.Interfaces.ITransactionRepository transactionRepository, IDialogService dialogService, ITransaction transaction) { _transaction = transaction; _transactionProducts = new List(); @@ -27,18 +29,18 @@ public TransactionRowViewModel(IUnitOfWorkFactory unitOfWorkFactory, IDialogServ { _transactionProducts.Add(new TransactionProductRowViewModel(t)); } - _unitOfWorkFactory = unitOfWorkFactory; + _transactionRepository = transactionRepository; _dialogService = dialogService; DeleteCommand = new RelayCommand(DeleteCommandHandler); } - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private readonly Domain.Repositories.Transactions.Interfaces.ITransactionRepository _transactionRepository; private readonly IDialogService _dialogService; - private readonly Transaction _transaction; + private readonly ITransaction _transaction; public Guid Id => _transaction.Id; - public string CustomerName => _transaction?.PayLater?.CustomerName ?? ""; + public string CustomerName => _transaction.PayLater?.CustomerName ?? ""; public DateTime DateTime => _transaction.DateTime; @@ -65,12 +67,8 @@ private void DeleteCommandHandler() { if(_dialogService.ShowConfirmationDialog("Confirm Delete", "Do you really want to delete this transaction record?")) { - using(var unitOfWork = _unitOfWorkFactory.CreateUnitOfWork()) - { - unitOfWork.TransactionRepository.Delete(Id); - unitOfWork.Save(); - OnTransactionDeleted(new EventArgs(this)); - }; + _transactionRepository.Remove(Id); + OnTransactionDeleted(new EventArgs(this)); } } diff --git a/StoreManagementSystemX/ViewModels/Users/CreateUserViewModel.cs b/StoreManagementSystemX/ViewModels/Users/CreateUserViewModel.cs index 9b5b38f..d9f84c8 100644 --- a/StoreManagementSystemX/ViewModels/Users/CreateUserViewModel.cs +++ b/StoreManagementSystemX/ViewModels/Users/CreateUserViewModel.cs @@ -3,6 +3,8 @@ using StoreManagementSystemX.Database.DAL; using StoreManagementSystemX.Database.DAL.Interfaces; using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Factories.Users.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Users.Interfaces; using StoreManagementSystemX.Services; using StoreManagementSystemX.ViewModels.Users.Interfaces; using System; @@ -15,11 +17,15 @@ namespace StoreManagementSystemX.ViewModels.Users { - public class CreateUserViewModel : ObservableObject, ICreateUserViewModel + public class CreateUserViewModel : ObservableObject, ICreateUserViewModel, ICreateUserArgs { - public CreateUserViewModel(AuthContext authContext, IUnitOfWorkFactory unitOfWorkFactory, Action onCreate, Action close) + public CreateUserViewModel( + AuthContext authContext, + Domain.Repositories.Users.Interfaces.IUserRepository userRepository, + Action onCreate, + Action close) { - _unitOfWorkFactory = unitOfWorkFactory; + _userRepository = userRepository; _authContext = authContext; _onCreate = onCreate; _close = close; @@ -27,21 +33,25 @@ public CreateUserViewModel(AuthContext authContext, IUnitOfWorkFactory unitOfWor CancelCommand = new RelayCommand(CancelCommandHandler); } - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + public Guid CreatorId => _authContext.CurrentUser.Id; + private string _username; + public string Username { get => _username; set => SetProperty(ref _username, value); } + public string Password { get; private set; } + + private readonly Domain.Repositories.Users.Interfaces.IUserRepository _userRepository; private readonly AuthContext _authContext; private Action _onCreate; private Action _close; - private string _username; - public string Username { get => _username; set => SetProperty(ref _username, value); } private RelayCommand _submitCommand; public ICommand SubmitCommand => _submitCommand; public ICommand CancelCommand { get; } + private bool CanSubmitCommandExecute(string? password) => Username.Length > 0 && password != null && password.Length > 0; @@ -49,16 +59,11 @@ private void SubmitCommandHandler(string? password) { if (password != null && password.Length > 0) { - Console.WriteLine("password: " + password); - User newUser = new User { Id = Guid.NewGuid(), CreatedById = _authContext.CurrentUser.Id, Username = Username, Password = password }; - using(var unitOfWork = _unitOfWorkFactory.CreateUnitOfWork()) - { - unitOfWork.UserRepository.Insert(newUser); - unitOfWork.Save(); - _onCreate(newUser.Id); - _close(); - - } + Password = password; + var newlyCreatedUser = _authContext.CurrentUser.UserFactory.Create(this); + _userRepository.Add(newlyCreatedUser); + _onCreate(newlyCreatedUser.Id); + _close(); } } diff --git a/StoreManagementSystemX/ViewModels/Users/UserListViewModel.cs b/StoreManagementSystemX/ViewModels/Users/UserListViewModel.cs index bae22ce..ed281c7 100644 --- a/StoreManagementSystemX/ViewModels/Users/UserListViewModel.cs +++ b/StoreManagementSystemX/ViewModels/Users/UserListViewModel.cs @@ -1,6 +1,8 @@ using CommunityToolkit.Mvvm.Input; using StoreManagementSystemX.Database.DAL.Interfaces; using StoreManagementSystemX.Database.Models; +using StoreManagementSystemX.Domain.Aggregates.Roots.Users.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Users.Interfaces; using StoreManagementSystemX.Services; using StoreManagementSystemX.Services.Interfaces; using StoreManagementSystemX.ViewModels.Transactions.Interfaces; @@ -18,9 +20,13 @@ namespace StoreManagementSystemX.ViewModels.Users public class UserListViewModel : BaseViewModel, IUserListViewModel { - public UserListViewModel(AuthContext authContext, IUnitOfWorkFactory unitOfWorkFactory, IDialogService dialogService, IUserCreationService userCreationService) + public UserListViewModel( + AuthContext authContext, + Domain.Repositories.Users.Interfaces.IUserRepository userRepository, + IDialogService dialogService, + IUserCreationService userCreationService) { - _unitOfWorkFactory = unitOfWorkFactory; + _userRepository = userRepository; _authContext = authContext; Users = new ObservableCollection(); @@ -28,19 +34,16 @@ public UserListViewModel(AuthContext authContext, IUnitOfWorkFactory unitOfWorkF _dialogService = dialogService; _userCreationService = userCreationService; - using (var unitOfWork = unitOfWorkFactory.CreateUnitOfWork()) + foreach (var user in _userRepository.GetAll()) { - foreach (var user in unitOfWork.UserRepository.Get()) - { - AddUser(user); - } + AddUserToCollection(user); } NewUserCommand = new RelayCommand(NewUserCommandHandler); } private IUserCreationService _userCreationService; - private IUnitOfWorkFactory _unitOfWorkFactory; + private Domain.Repositories.Users.Interfaces.IUserRepository _userRepository; private AuthContext _authContext; @@ -55,19 +58,17 @@ private void NewUserCommandHandler() var newUserId = _userCreationService.CreateNewUser(_authContext); if (newUserId != null && newUserId.HasValue) { - using (var unitOfWork = _unitOfWorkFactory.CreateUnitOfWork()) + var newUser = _userRepository.GetById((Guid)newUserId); + if (newUser != null) { - var newUser = unitOfWork.UserRepository.GetById((Guid)newUserId); - if (newUser != null) - AddUser(newUser); - + AddUserToCollection(newUser); } } } - private void AddUser(User newUser) + private void AddUserToCollection(IUser user) { - var userRow = new UserRowViewModel(this, newUser); + var userRow = new UserRowViewModel(this, user); SubscribeToUserRow(userRow); Users.Add(userRow); } @@ -100,7 +101,7 @@ private void RemoveUser(IUserRowViewModel userRow) class UserRowViewModel : IUserRowViewModel { private readonly UserListViewModel _parent; - public UserRowViewModel(UserListViewModel parent, User user) + public UserRowViewModel(UserListViewModel parent, IUser user) { _user = user; _parent = parent; @@ -108,7 +109,7 @@ public UserRowViewModel(UserListViewModel parent, User user) UpdateCommand = new RelayCommand(UpdateCommandHandler, () => _user.Username != "admin"); } - private readonly User _user; + private readonly IUser _user; public Guid Id => _user.Id; @@ -128,12 +129,8 @@ private void DeleteCommandHandler() { if (_parent._dialogService.ShowConfirmationDialog("Confirm Delete", "Do you really want to delete this user?")) { - using (var unitOfWork = _parent._unitOfWorkFactory.CreateUnitOfWork()) - { - unitOfWork.UserRepository.Delete(_user.Id); - unitOfWork.Save(); - OnUserDeleted(new EventArgs(this)); - } + _parent._userRepository.Remove(_user.Id); + OnUserDeleted(new EventArgs(this)); } } @@ -141,9 +138,6 @@ protected virtual void OnUserDeleted(EventArgs e) { UserDeleted?.Invoke(this, e); } - - public static IEnumerable From(UserListViewModel parent, IEnumerable users) - => users.Select(e => new UserRowViewModel(parent, e)); } diff --git a/StoreManagementSystemX/Views/StockPurchases/CreateStockPurchaseWindow.xaml b/StoreManagementSystemX/Views/StockPurchases/CreateStockPurchaseWindow.xaml index a713929..796daaf 100644 --- a/StoreManagementSystemX/Views/StockPurchases/CreateStockPurchaseWindow.xaml +++ b/StoreManagementSystemX/Views/StockPurchases/CreateStockPurchaseWindow.xaml @@ -43,11 +43,11 @@ - - + + - + diff --git a/StoreManagementSystemX/Views/StockPurchases/CreateStockPurchaseWindow.xaml.cs b/StoreManagementSystemX/Views/StockPurchases/CreateStockPurchaseWindow.xaml.cs index 5fba588..aca8119 100644 --- a/StoreManagementSystemX/Views/StockPurchases/CreateStockPurchaseWindow.xaml.cs +++ b/StoreManagementSystemX/Views/StockPurchases/CreateStockPurchaseWindow.xaml.cs @@ -1,4 +1,6 @@ using StoreManagementSystemX.Database.DAL.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Products.Interfaces; +using StoreManagementSystemX.Domain.Repositories.StockPurchases.Interfaces; using StoreManagementSystemX.Services; using StoreManagementSystemX.Services.Interfaces; using StoreManagementSystemX.ViewModels.StockPurchases; @@ -23,10 +25,10 @@ namespace StoreManagementSystemX.Views.StockPurchases; /// public partial class CreateStockPurchaseWindow : Window { - public CreateStockPurchaseWindow(AuthContext authContext, IUnitOfWork unitOfWork, IDialogService dialogService, Action onAdd) + public CreateStockPurchaseWindow(AuthContext authContext, Domain.Repositories.StockPurchases.Interfaces.IStockPurchaseRepository stockPurchaseRepository, Domain.Repositories.Products.Interfaces.IProductRepository productRepository, IDialogService dialogService, Action onAdd) { InitializeComponent(); - ViewModel = new CreateStockPurchaseViewModel(authContext, unitOfWork, dialogService, (Guid newStockPurchaseId) => + ViewModel = new CreateStockPurchaseViewModel(authContext, stockPurchaseRepository, productRepository, dialogService, (Guid newStockPurchaseId) => { onAdd(newStockPurchaseId); Close(); diff --git a/StoreManagementSystemX/Views/Transactions/CreateTransactionWindow.xaml.cs b/StoreManagementSystemX/Views/Transactions/CreateTransactionWindow.xaml.cs index 54d2e6d..ac546ff 100644 --- a/StoreManagementSystemX/Views/Transactions/CreateTransactionWindow.xaml.cs +++ b/StoreManagementSystemX/Views/Transactions/CreateTransactionWindow.xaml.cs @@ -1,7 +1,10 @@ using StoreManagementSystemX.Database.DAL.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Products.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Transactions.Interfaces; using StoreManagementSystemX.Services; using StoreManagementSystemX.Services.Interfaces; using StoreManagementSystemX.ViewModels.Transactions; +using StoreManagementSystemX.ViewModels.Transactions.Interfaces; using System; using System.Collections.Generic; using System.Linq; @@ -25,10 +28,13 @@ namespace StoreManagementSystemX.Views.Transactions public partial class CreateTransactionWindow : Window { - public CreateTransactionWindow(AuthContext authContext, IUnitOfWork unitOfWork, IDialogService dialogService, Action onSave) + public CreateTransactionWindow( + AuthContext authContext, + Domain.Repositories.Transactions.Interfaces.ITransactionRepository transactionRepository, + Domain.Repositories.Products.Interfaces.IProductRepository productRepository, IDialogService dialogService, Action onSave) { InitializeComponent(); - _viewModel = new CreateTransactionViewModel(authContext, unitOfWork, dialogService, (Guid newTransactionId) => + _viewModel = new CreateTransactionViewModel(authContext, transactionRepository, productRepository, dialogService, (Guid newTransactionId) => { onSave(newTransactionId); Close(); diff --git a/StoreManagementSystemX/Views/Users/CreateUserWindow.xaml.cs b/StoreManagementSystemX/Views/Users/CreateUserWindow.xaml.cs index f7b35a1..8c171ed 100644 --- a/StoreManagementSystemX/Views/Users/CreateUserWindow.xaml.cs +++ b/StoreManagementSystemX/Views/Users/CreateUserWindow.xaml.cs @@ -1,5 +1,6 @@ using StoreManagementSystemX.Database.DAL; using StoreManagementSystemX.Database.DAL.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Users.Interfaces; using StoreManagementSystemX.Services; using StoreManagementSystemX.ViewModels.Users; using System; @@ -16,6 +17,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; +using IUserRepository = StoreManagementSystemX.Domain.Repositories.Users.Interfaces.IUserRepository; namespace StoreManagementSystemX.Views.Users { @@ -24,12 +26,15 @@ namespace StoreManagementSystemX.Views.Users /// public partial class CreateUserWindow : Window { - public CreateUserWindow(AuthContext authContext, IUnitOfWorkFactory unitOfWorkFactory, Action onCreate) + public CreateUserWindow( + AuthContext authContext, + IUserRepository userRepository, + Action onCreate) { InitializeComponent(); this.Owner = Application.Current.MainWindow; - _viewModel = new CreateUserViewModel(authContext, unitOfWorkFactory, onCreate, () => + _viewModel = new CreateUserViewModel(authContext, userRepository, onCreate, () => { Close(); }); diff --git a/StoreManagementX.Domain/Aggregates/Roots/StockPurchases/Interfaces/IStockPurchase.cs b/StoreManagementX.Domain/Aggregates/Roots/StockPurchases/Interfaces/IStockPurchase.cs index 5f9c334..d1f6d8e 100644 --- a/StoreManagementX.Domain/Aggregates/Roots/StockPurchases/Interfaces/IStockPurchase.cs +++ b/StoreManagementX.Domain/Aggregates/Roots/StockPurchases/Interfaces/IStockPurchase.cs @@ -15,18 +15,22 @@ public interface IStockPurchase { public Guid Id { get; } + public DateTime DateTime { get; } + public Guid StockManagerId { get; } public IReadOnlyList StockPurchaseProducts { get; } public decimal TotalAmount { get; } - public void AddProduct(IProduct product); + public IStockPurchaseProduct AddProduct(IProduct product); - public void RemoveProduct(IProduct product); + public IStockPurchaseProduct IncrementProduct(IProduct product, int quantity = 1); + public IStockPurchaseProduct DecrementProduct(IProduct product, int quantity = 1); + + public IStockPurchaseProduct RemoveProduct(IProduct product); - } } diff --git a/StoreManagementX.Domain/Aggregates/Roots/StockPurchases/Interfaces/IStockPurchaseProduct.cs b/StoreManagementX.Domain/Aggregates/Roots/StockPurchases/Interfaces/IStockPurchaseProduct.cs index 47d3b03..b117a55 100644 --- a/StoreManagementX.Domain/Aggregates/Roots/StockPurchases/Interfaces/IStockPurchaseProduct.cs +++ b/StoreManagementX.Domain/Aggregates/Roots/StockPurchases/Interfaces/IStockPurchaseProduct.cs @@ -10,9 +10,11 @@ public interface IStockPurchaseProduct { public Guid ProductId { get; } - public string ProductName { get; } + public string Barcode { get; } - public decimal CostPrice { get; } + public string Name { get; } + + public decimal Price { get; } public int QuantityBought { get; } diff --git a/StoreManagementX.Domain/Aggregates/Roots/StockPurchases/StockPurchase.cs b/StoreManagementX.Domain/Aggregates/Roots/StockPurchases/StockPurchase.cs index 20f8e10..dae2ef4 100644 --- a/StoreManagementX.Domain/Aggregates/Roots/StockPurchases/StockPurchase.cs +++ b/StoreManagementX.Domain/Aggregates/Roots/StockPurchases/StockPurchase.cs @@ -19,6 +19,7 @@ internal StockPurchase(Guid stockManagerId, Guid id) { Id = id; StockManagerId = stockManagerId; + DateTime = DateTime.Now; } public Guid Id { get; } @@ -31,7 +32,10 @@ internal StockPurchase(Guid stockManagerId, Guid id) public Guid StockManagerId { get; } - public void AddProduct(IProduct product) + public DateTime DateTime { get; } + + // Add single quantity of the product + public IStockPurchaseProduct AddProduct(IProduct product) { var matchedProduct = _stockPurchaseProduct.FirstOrDefault(tp => tp.ProductId == product.Id); @@ -39,19 +43,44 @@ public void AddProduct(IProduct product) { var stockPurchaseProduct = new StockPurchaseProduct(this, product); _stockPurchaseProduct.Add(stockPurchaseProduct); + product.InStock += 1; + return stockPurchaseProduct; } else { matchedProduct.QuantityBought += 1; + product.InStock += 1; + return matchedProduct; } - product.InStock += 1; } - public void RemoveProduct(IProduct product) + + public IStockPurchaseProduct IncrementProduct(IProduct product, int quantity = 1) { - var stockPurchaseProductFound = _stockPurchaseProduct.First(); - _stockPurchaseProduct.Remove(stockPurchaseProductFound); + var stockPurchaseProduct = _stockPurchaseProduct.First(tp => tp.ProductId == product.Id); + stockPurchaseProduct.QuantityBought += quantity; + product.InStock += quantity; + + return stockPurchaseProduct; + } + + public IStockPurchaseProduct DecrementProduct(IProduct product, int quantity = 1) + { + var stockPurchaseProduct = _stockPurchaseProduct.First(tp => tp.ProductId == product.Id); + stockPurchaseProduct.QuantityBought -= quantity; + product.InStock -= quantity; + return stockPurchaseProduct; + } + + // Remove all of this product in the stock purchase + public IStockPurchaseProduct RemoveProduct(IProduct product) + { + var stockPurchaseProductFound = _stockPurchaseProduct.First(e => e.ProductId == product.Id); + product.InStock -= stockPurchaseProductFound.QuantityBought; + _stockPurchaseProduct.Remove(stockPurchaseProductFound); TotalAmount -= stockPurchaseProductFound.TotalCost; + + return stockPurchaseProductFound; } public override bool Equals(object? obj) @@ -71,6 +100,7 @@ public override string ToString() + // id value object public class StockPurchaseProduct : IStockPurchaseProduct { @@ -79,8 +109,9 @@ internal StockPurchaseProduct(StockPurchase stockPurchase, IProduct product) _stockPurchase = stockPurchase; ProductId = product.Id; - ProductName = product.Name; - CostPrice = product.CostPrice; + Name = product.Name; + Price = product.CostPrice; + Barcode = product.Barcode; QuantityBought = 1; } @@ -88,9 +119,9 @@ internal StockPurchaseProduct(StockPurchase stockPurchase, IProduct product) public Guid ProductId { get; } - public string ProductName { get; } + public string Name { get; } - public decimal CostPrice { get; } + public decimal Price { get; } private int _quantityBought; public int QuantityBought @@ -108,8 +139,9 @@ internal set } - public decimal TotalCost => CostPrice * QuantityBought; - + public decimal TotalCost => Price * QuantityBought; + + public string Barcode { get; } public override bool Equals(object? obj) { diff --git a/StoreManagementX.Domain/Aggregates/Roots/Transactions/Interfaces/IPayLater.cs b/StoreManagementX.Domain/Aggregates/Roots/Transactions/Interfaces/IPayLater.cs new file mode 100644 index 0000000..30adafd --- /dev/null +++ b/StoreManagementX.Domain/Aggregates/Roots/Transactions/Interfaces/IPayLater.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces +{ + public interface IPayLater + { + public string CustomerName { get; } + + public bool IsPaid { get; } + + public DateTime? PaidAt { get; } + } +} diff --git a/StoreManagementX.Domain/Aggregates/Roots/Transactions/Interfaces/ITransaction.cs b/StoreManagementX.Domain/Aggregates/Roots/Transactions/Interfaces/ITransaction.cs index f4fde28..68d924b 100644 --- a/StoreManagementX.Domain/Aggregates/Roots/Transactions/Interfaces/ITransaction.cs +++ b/StoreManagementX.Domain/Aggregates/Roots/Transactions/Interfaces/ITransaction.cs @@ -15,15 +15,27 @@ public interface ITransaction { public Guid SellerId { get; } + public DateTime DateTime { get; } + public Guid Id { get; } + public IPayLater? PayLater { get; } + public IReadOnlyList TransactionProducts { get; } public decimal TotalAmount { get; } - public void AddProduct(IProduct product); + public void SetPayLaterDetails(string customerName); + + public void MarkAsPaid(); + + public ITransactionProduct AddProduct(IProduct product); + + public ITransactionProduct IncrementProduct(IProduct product, int quantity = 1); + + public ITransactionProduct DecrementProduct(IProduct product, int quantity = 1); - public void RemoveProduct(IProduct product); + public ITransactionProduct RemoveProduct(IProduct product); diff --git a/StoreManagementX.Domain/Aggregates/Roots/Transactions/PayLater.cs b/StoreManagementX.Domain/Aggregates/Roots/Transactions/PayLater.cs new file mode 100644 index 0000000..83b8cb7 --- /dev/null +++ b/StoreManagementX.Domain/Aggregates/Roots/Transactions/PayLater.cs @@ -0,0 +1,25 @@ +using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StoreManagementSystemX.Domain.Aggregates.Roots.Transactions +{ + public class PayLater : IPayLater + { + public PayLater(string customerName) + { + CustomerName = customerName; + IsPaid = false; + } + + public string CustomerName { get; set; } = String.Empty; + + public bool IsPaid { get; internal set; } + + public DateTime? PaidAt { get; set; } + + } +} diff --git a/StoreManagementX.Domain/Aggregates/Roots/Transactions/Transaction.cs b/StoreManagementX.Domain/Aggregates/Roots/Transactions/Transaction.cs index e8b63e4..3c15ec0 100644 --- a/StoreManagementX.Domain/Aggregates/Roots/Transactions/Transaction.cs +++ b/StoreManagementX.Domain/Aggregates/Roots/Transactions/Transaction.cs @@ -7,6 +7,7 @@ using StoreManagementSystemX.Domain.Aggregates.Roots.Products; using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; using StoreManagementSystemX.Domain.Aggregates.Roots.Products.Interfaces; +using StoreManagementSystemX.Domain.Factories.Transactions.Interfaces; namespace StoreManagementSystemX.Domain.Aggregates.Roots.Transactions { @@ -17,12 +18,16 @@ namespace StoreManagementSystemX.Domain.Aggregates.Roots.Transactions public class Transaction : ITransaction { - internal Transaction(Guid sellerId, Guid id) + internal Transaction(Guid sellerId, Guid id, PayLaterFactory payLaterFactory) { Id = id; SellerId = sellerId; + DateTime = DateTime.Now; + _payLaterFactory = payLaterFactory; } + private readonly PayLaterFactory _payLaterFactory; + public Guid SellerId { get; } public Guid Id { get; } @@ -33,7 +38,13 @@ internal Transaction(Guid sellerId, Guid id) public decimal TotalAmount { get; private set; } - public void AddProduct(IProduct product) + private PayLater _payLater { get; set; } + + public IPayLater? PayLater => _payLater; + + public DateTime DateTime { get; } + + public ITransactionProduct AddProduct(IProduct product) { var matchedProduct = _transactionProducts.FirstOrDefault(tp => tp.ProductId == product.Id); @@ -41,19 +52,45 @@ public void AddProduct(IProduct product) { var transactionProduct = new TransactionProduct(this, product); _transactionProducts.Add(transactionProduct); + product.InStock -= 1; + return transactionProduct; } else { - matchedProduct.QuantityBought += 1; + return IncrementProduct(product); } - product.InStock -= 1; } - public void RemoveProduct(IProduct product) + public ITransactionProduct IncrementProduct(IProduct product, int quantity = 1) + { + var transactionProduct = _transactionProducts.First(tp => tp.ProductId == product.Id); + transactionProduct.QuantityBought += quantity; + product.InStock -= quantity; + + return transactionProduct; + } + + public ITransactionProduct DecrementProduct(IProduct product, int quantity = 1) + { + var transactionProduct = _transactionProducts.First(tp => tp.ProductId == product.Id); + transactionProduct.QuantityBought -= quantity; + product.InStock += quantity; + + return transactionProduct; + } + + public ITransactionProduct RemoveProduct(IProduct product) { var transactionProductFound = _transactionProducts.First(); + product.InStock += transactionProductFound.QuantityBought; _transactionProducts.Remove(transactionProductFound); - TotalAmount -= transactionProductFound.TotalPrice; + + return transactionProductFound; + } + + public void MarkAsPaid() + { + _payLater.IsPaid = true; } public override bool Equals(object? obj) @@ -62,6 +99,7 @@ public override bool Equals(object? obj) Id.Equals(transaction.Id); } + public override int GetHashCode() { return HashCode.Combine(Id); @@ -70,7 +108,10 @@ public override int GetHashCode() public override string ToString() => $"{nameof(Transaction)}: {Id} - Total Amount: {TotalAmount}"; - + public void SetPayLaterDetails(string customerName) + { + _payLater = (PayLater) _payLaterFactory.Create(customerName); + } // id value object diff --git a/StoreManagementX.Domain/Factories/Transactions/Interfaces/ICreatePayLaterArgs.cs b/StoreManagementX.Domain/Factories/Transactions/Interfaces/ICreatePayLaterArgs.cs new file mode 100644 index 0000000..544a5f4 --- /dev/null +++ b/StoreManagementX.Domain/Factories/Transactions/Interfaces/ICreatePayLaterArgs.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StoreManagementSystemX.Domain.Factories.Transactions.Interfaces +{ + public interface ICreatePayLaterArgs + { + public string CustomerName { get; set; } + } +} diff --git a/StoreManagementX.Domain/Factories/Transactions/Interfaces/IPayLaterFactory.cs b/StoreManagementX.Domain/Factories/Transactions/Interfaces/IPayLaterFactory.cs new file mode 100644 index 0000000..de6c76f --- /dev/null +++ b/StoreManagementX.Domain/Factories/Transactions/Interfaces/IPayLaterFactory.cs @@ -0,0 +1,14 @@ +using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StoreManagementSystemX.Domain.Factories.Transactions.Interfaces +{ + public interface IPayLaterFactory + { + public IPayLater Create(string customerName); + } +} diff --git a/StoreManagementX.Domain/Factories/Transactions/Interfaces/PayLaterFactory.cs b/StoreManagementX.Domain/Factories/Transactions/Interfaces/PayLaterFactory.cs new file mode 100644 index 0000000..8952e7d --- /dev/null +++ b/StoreManagementX.Domain/Factories/Transactions/Interfaces/PayLaterFactory.cs @@ -0,0 +1,23 @@ +using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions; +using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StoreManagementSystemX.Domain.Factories.Transactions.Interfaces +{ + public class PayLaterFactory : IPayLaterFactory + { + public PayLaterFactory() + { + + } + + public IPayLater Create(string customerName) + { + return new PayLater(customerName); + } + } +} diff --git a/StoreManagementX.Domain/Factories/Transactions/TransactionFactory.cs b/StoreManagementX.Domain/Factories/Transactions/TransactionFactory.cs index 42d135e..657c573 100644 --- a/StoreManagementX.Domain/Factories/Transactions/TransactionFactory.cs +++ b/StoreManagementX.Domain/Factories/Transactions/TransactionFactory.cs @@ -11,9 +11,16 @@ namespace StoreManagementSystemX.Domain.Factories.Transactions { public class TransactionFactory : ITransactionFactory { + public TransactionFactory(PayLaterFactory payLaterFactory) + { + _payLaterFactory = payLaterFactory; + } + + private readonly PayLaterFactory _payLaterFactory; + public ITransaction Create(Guid sellerId) { - return new Transaction(sellerId, Guid.NewGuid()); + return new Transaction(sellerId, Guid.NewGuid(), _payLaterFactory); } } } diff --git a/StoreManagementX.Domain/Factories/Users/Interfaces/ICreateUserArgs.cs b/StoreManagementX.Domain/Factories/Users/Interfaces/ICreateUserArgs.cs index 14917de..38e3d78 100644 --- a/StoreManagementX.Domain/Factories/Users/Interfaces/ICreateUserArgs.cs +++ b/StoreManagementX.Domain/Factories/Users/Interfaces/ICreateUserArgs.cs @@ -4,8 +4,8 @@ public interface ICreateUserArgs { Guid CreatorId { get; } - string Username { get; set; } + string Username { get; } - string Password { get; set; } + string Password { get; } } } \ No newline at end of file diff --git a/StoreManagementX.Domain/Program.cs b/StoreManagementX.Domain/Program.cs index cfa880e..2af2347 100644 --- a/StoreManagementX.Domain/Program.cs +++ b/StoreManagementX.Domain/Program.cs @@ -2,6 +2,7 @@ using StoreManagementSystemX.Domain.Factories.Products.Interfaces; using StoreManagementSystemX.Domain.Factories.StockPurchases; using StoreManagementSystemX.Domain.Factories.Transactions; +using StoreManagementSystemX.Domain.Factories.Transactions.Interfaces; using StoreManagementSystemX.Domain.Factories.Users; using StoreManagementSystemX.Domain.Factories.Users.Interfaces; using StoreManagementSystemX.Domain.Repositories.Products; @@ -11,7 +12,8 @@ var productRepository = new ProductRepository(); var barcodeGenerationService = new BarcodeGenerationService(productRepository); var productFactory = new ProductFactory(barcodeGenerationService); -var transactionFactory = new TransactionFactory(); +var payLaterFactory = new PayLaterFactory(); +var transactionFactory = new TransactionFactory(payLaterFactory); var stockPurchaseFactory = new StockPurchaseFactory(); IUserFactory userFactory = new UserFactory(productFactory, transactionFactory, stockPurchaseFactory); diff --git a/StoreManagementX.Domain/Repositories/StockPurchases/Interfaces/IStockPurchaseRepository.cs b/StoreManagementX.Domain/Repositories/StockPurchases/Interfaces/IStockPurchaseRepository.cs new file mode 100644 index 0000000..51f0b95 --- /dev/null +++ b/StoreManagementX.Domain/Repositories/StockPurchases/Interfaces/IStockPurchaseRepository.cs @@ -0,0 +1,14 @@ +using StoreManagementSystemX.Domain.Aggregates.Roots.StockPurchases.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StoreManagementSystemX.Domain.Repositories.StockPurchases.Interfaces +{ + public interface IStockPurchaseRepository : IRepository + { + } +} diff --git a/StoreManagementX.Domain/Repositories/StockPurchaseRepository.cs b/StoreManagementX.Domain/Repositories/StockPurchases/StockPurchaseRepository.cs similarity index 84% rename from StoreManagementX.Domain/Repositories/StockPurchaseRepository.cs rename to StoreManagementX.Domain/Repositories/StockPurchases/StockPurchaseRepository.cs index 1a4bb68..1927f50 100644 --- a/StoreManagementX.Domain/Repositories/StockPurchaseRepository.cs +++ b/StoreManagementX.Domain/Repositories/StockPurchases/StockPurchaseRepository.cs @@ -1,15 +1,16 @@ using StoreManagementSystemX.Domain.Aggregates.Roots.StockPurchases; using StoreManagementSystemX.Domain.Aggregates.Roots.StockPurchases.Interfaces; using StoreManagementSystemX.Domain.Repositories.Interfaces; +using StoreManagementSystemX.Domain.Repositories.StockPurchases.Interfaces; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace StoreManagementSystemX.Domain.Repositories +namespace StoreManagementSystemX.Domain.Repositories.StockPurchases { - public class StockPurchaseRepository : IRepository + public class StockPurchaseRepository : IStockPurchaseRepository { private readonly List _stockPurchases; @@ -38,7 +39,8 @@ public void Remove(Guid id) if (stockPurchaseToRemove != null) { _stockPurchases.Remove(stockPurchaseToRemove); - } else + } + else { throw new Exception($"Stock purchase with id - {id} does not exist."); } @@ -47,7 +49,7 @@ public void Remove(Guid id) public void Update(IStockPurchase updatedStockPurchase) { var stockPurchaseToUpdateIndex = _stockPurchases.FindIndex(e => e.Id == updatedStockPurchase.Id); - if(stockPurchaseToUpdateIndex != -1) + if (stockPurchaseToUpdateIndex != -1) { _stockPurchases[stockPurchaseToUpdateIndex] = updatedStockPurchase; } diff --git a/StoreManagementX.Domain/Repositories/Transactions/Interfaces/ITransactionRepository.cs b/StoreManagementX.Domain/Repositories/Transactions/Interfaces/ITransactionRepository.cs new file mode 100644 index 0000000..dfa2589 --- /dev/null +++ b/StoreManagementX.Domain/Repositories/Transactions/Interfaces/ITransactionRepository.cs @@ -0,0 +1,14 @@ +using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StoreManagementSystemX.Domain.Repositories.Transactions.Interfaces +{ + public interface ITransactionRepository : IRepository + { + } +} diff --git a/StoreManagementX.Domain/Repositories/TransactionRepository.cs b/StoreManagementX.Domain/Repositories/Transactions/TransactionRepository.cs similarity index 87% rename from StoreManagementX.Domain/Repositories/TransactionRepository.cs rename to StoreManagementX.Domain/Repositories/Transactions/TransactionRepository.cs index 8de08fa..ce1b38e 100644 --- a/StoreManagementX.Domain/Repositories/TransactionRepository.cs +++ b/StoreManagementX.Domain/Repositories/Transactions/TransactionRepository.cs @@ -1,6 +1,7 @@ using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions; using StoreManagementSystemX.Domain.Aggregates.Roots.Transactions.Interfaces; using StoreManagementSystemX.Domain.Repositories.Interfaces; +using StoreManagementSystemX.Domain.Repositories.Transactions.Interfaces; using System; using System.Collections.Generic; using System.Linq; @@ -8,9 +9,9 @@ using System.Text; using System.Threading.Tasks; -namespace StoreManagementSystemX.Domain.Repositories +namespace StoreManagementSystemX.Domain.Repositories.Transactions { - public class TransactionRepository : IRepository + public class TransactionRepository : ITransactionRepository { private readonly List _transactions; public TransactionRepository()