Implement Rest API for a financial institution where it provides e-wallet services to its partners. It has two types of e-wallet accounts: identified and unidentified.
The API can support multiple clients and should only use http, post methods with json as the data format. Clients must be authenticated via the http parameter header X-UserId and X-Digest.
X-Digest is hmac-sha1, the hash sum of the request body. There must be pre-recorded e-wallets, with different balances, and the maximum balance is 10,000 somoni for unidentified accounts and 100,000 somoni for identified accounts. You can use for data storage of your choice.
API service methods:
- Check if the e-wallet account exists.
- Replenish e-wallet account.
- Get the total number and amount of recharge operations for the current month.
- Get the e-wallet balance.
You must have .NET 6 SDK.
git clone https://github.com/futuricon/E_Wallet.git
cd E-Wallet/src
dotnet ef database update --project "Core\E_Wallet.EntityFramework" -s "Core\E_Wallet.DbMigrator" -c AppDbContext
dotnet run --project Core/E_Wallet.DbMigrator
dotnet run --project API/E_Wallet.WebApi
dotnet run --project Apps/E_Wallet.SimpleClientApp
dotnet ef migrations add InitDatabase --project "src\Core\E_Wallet.EntityFramework" -s "src\Core\E_Wallet.DbMigrator" -c AppDbContext