Skip to content

futuricon/E_Wallet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E_Wallet

Task.

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:

  1. Check if the e-wallet account exists.
  2. Replenish e-wallet account.
  3. Get the total number and amount of recharge operations for the current month.
  4. Get the e-wallet balance.

So let's get started.

You must have .NET 6 SDK.

1 Clone this repository

git clone https://github.com/futuricon/E_Wallet.git

2 Update Database

cd E-Wallet/src
dotnet ef database update --project "Core\E_Wallet.EntityFramework" -s "Core\E_Wallet.DbMigrator" -c AppDbContext

3 Seed default data to DB

dotnet run --project Core/E_Wallet.DbMigrator

4 Run the Web API

dotnet run --project API/E_Wallet.WebApi

5 Run simple client app

dotnet run --project Apps/E_Wallet.SimpleClientApp

That's all :/

'Add Migration' Query just in case

dotnet ef migrations add InitDatabase --project "src\Core\E_Wallet.EntityFramework" -s "src\Core\E_Wallet.DbMigrator" -c AppDbContext