Skip to content

napatwongchr/restaurant-bill-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Restaurant bill calculator

This project was created for assignment purpose.

View project online here

To run development

npm run start

To test (Automated tests have just added not cover all cases yet)

npm run test

Test cases document (for manual)

Instructions

This application is divided into 3 parts.

  1. Employee - User can be able to calculate bill according to table.
  2. Admin - User can be able to Add/Edit/Delete discount codes.
  3. Customer - User can be able to reserve the seats.(Soon)

Data

The application stores data in the form of json in /src/data. All related data will be loaded from MainApp component. (You can edit data here for testing purpose) It contains 2 entities, as followings:

  1. Table.json
  • Table composes of many different fields: id, type, capacity, people, items (list of foods)
  1. DiscountCode.json
  • Discount code composes of many different fields: codeName, amountDiscount, discountCodeType, limitPeople

Initial data

The application has generated initial data for itself.

In Table.json, there are 24 tables, which are

  • Counter table (1 seat) for 12 tables
  • 2 seats table for 4 tables
  • 4 seats table for 6 tables
  • 8 seats table for 2 tables

I have initialized data for testing purpose as followings: (All this data can be able to apply along with test cases document)

  • Table 1 contains 1 people 1 buffet item, which is 459 baht (can apply with test case No:6,11)
  • Table 2 contains 1 people 1 buffet item, which is 1200 baht (can apply with test case No:7,8)
  • Table 3 contains 1 people 1 buffet item, which is 7000 baht (can apply with test case No:7,15)
  • Table 4 contains no people, so no reservation pop up (can apply with test case No:2 )
  • Table 13 contains 2 people 2 buffet item, which is 918 baht (can apply with test case No:7,9,12)
  • Table 17 contains 8 people 8 buffet item, which is 3672 baht
  • Table 19 contains 4 people 4 buffet item, which is 1836 baht (can apply with test case No:7,10,13,14)

In DiscountCodes, there are 3 different codes, which are

  • "LUCKY ONE" for 1 people for 15% discount
  • "LUCKY TWO" for 2 people for 20% discount
  • "4PAY3" for 4 people for 459 baht discount

There are also other 2 codes that discount from bill, which are

  • Total price > 6000 then discount for 25% (CODE_6000)
  • Total price > 1000 then discount for 15% (LUCKY ONE) These 2 codes are not editable like 3 codes above, it's automatically calculated

Application capabilities summary

Employee section

  • System can be able to calculate the bill price according to table.
  • System can be able to applied discount code
  • System is automatically applied code according to bill's total price (For instance, total price > 6000 or 1000).
  • System can be able to applied highest discount price code for customer automatically, if the bill is within the scope of discount rules.
  • System can be able to remove discount code from bill.
  • System can be able to calculate exchanges.
  • System can be able to apply 1 discount code only no top up discount code.

Admin section

  • System can be able to add / edit / delete discount code (EXCLUDE 6000, 1000 condition for now)
  • Added / Edited codes can be able to applied from bill calculation.

Customer section

  • Future task

Future tasks

  • Seats reservation module
  • Responsive
  • Create storybook and build style guide
  • More automation tests
  • Etc.