DO NOT REFER TO NOTES OR PAST CODING ASSIGNMENTS. You MAY use web resources like Google/Stackoverflow
The assessment consists of 2 parts: a coding challenge and then a code walkthrough with the staff where we will ask questions about your code.
You will create a bank account application that will let you create bank accounts and manage deposits and withdrawals.
You will implement this solution as a .NET MVC application utilizing the following:
- .NET MVC for backend and Razor templates/partials for content generation
- .NET Entity Framework for persistence
- .NET Identity Framework for User authentication and authorization
- PostMan tool for testing
Wire Frames
- Take some time at start to do some pre-thinking and design. At minimum you should have a basic wire frame drawn up (ADD A PICTURE OF DESIGN TO REPO)
-
Should have at minimum 4 endpoints/actions restricted by User role (admin, employee):
- List all bank accounts - admin, employee
- Create a new bank account - admin
- View bank account from list - admin, employee
- Deposit/withdraw into bank account - admin
-
Should have an entity model for
BankAccountModelwith all properties being required (add any additional annotations that will enhance the User experience):id- int (system generated)AccountNumber- intAccountType- string that specifies eitherCheckingorSavingsAccountName- stringAccountBalance- int (integer value with no decimal point is OK)
Available Bank Account List Page
- Should contain at least a basic header of
Available Bank Accountsand should be the home page after a User signs in - Should display the list of bank accounts
AccountNumber,AccountType,AccountName, andAccountBalanceAccountNumbershould be hyperlinked to the bank account details page- A Razor template partial should be used to render each account in the list
- You may use an HTML table or BootStrap cards with Grid to display account list
Bank Account Details Page
- Should display the
AccountNumber,AccountType,AccountName, andAccountBalance(read only) - Should include a form that allows the User to enter an amount to add or subtract from the account balance (i.e. positive number for deposit or negative number for withdrawal)
- A button for submission of the data from the form
- Submitting the deposit/withdrawl form should update account balance and return to the list of accounts
Add Account Form Page
- Contains the form for creating a new bank account
AccountNumberAn input field for entering the account number for the new accountAccountTypeAn input field for specifying 'checking' or 'savings'AccountNameAn input field for entering a name for the accountAccountBalanceAn input field for specifying starting balance- A button for submission of the data from the form
- When a valid form is submitted, should return to account list
Git
- Commit and push your changes no less than once per hour
Test Cases
- Create a test case for each endpoint in Postman and export/include completed test cases in this repo
If you need clarification of requirements ASK EARLY. Do not wait until right before it is due.
Read errors CAREFULLY when solving issues as Code School staff cannot help with bugs in your code
Take your time. Code a little, test a little, and Good Luck!
dotnet add package Microsoft.EntityFrameworkCore.Design
dotnet add package Microsoft.EntityFrameworkCore.Sqlite
dotnet add package Microsoft.AspNetCore.MVC.Razor.RuntimeCompilation
Startup.cs
- Razor View Compilation
services.AddControllersWithViews().AddRazorRuntimeCompilation();
- Authentication/Authorization
services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddRoles<IdentityRole>() // <- Add This
.AddEntityFrameworkStores<ApplicationDbContext>();
// Add support for user roles
services.AddMvc(obj =>
{
var policy = new AuthorizationPolicyBuilder()
.RequireAuthenticatedUser()
.Build();
});
User and User Roles
- Use the sqlite Visual Code plugin to insert roles and to associate roles to registered users using SQL (register users first)
INSERT INTO `AspNetRoles` (Id, ConcurrencyStamp, Name, NormalizedName) VALUES (1,'','admin','ADMIN')
INSERT INTO `AspNetRoles` (Id, ConcurrencyStamp, Name, NormalizedName) VALUES (2,'','employee','EMPLOYEE')
INSERT INTO `AspNetUserRoles` (UserId, RoleId) VALUES (`UserIdGUIDValueFromAspNetUsers','1');
INSERT INTO `AspNetUserRoles` (UserId, RoleId) VALUES (`UserIdGUIDValueFromAspNetUsers','2');
- Require User Registration/Login and create
AdminandEmployeeroles with at least one registered user for each role - Support for the following features (Properly restrict feature access by user role):
- List bank accounts
- View bank account
- Deposit/withdraw from a bank account
- Submission of wire frames
- Submission of Postman test cases
- Proper use of Git for version control