This Clothes Shop has six categories of clothes:
- women’s footwear
- men’s footwear
- women’s casualwear
- men’s casualwear
- women’s formalwear
- men’s formalwear
The products available are listed here below, along with the variable name in order to use the program on irb.
- almondtoecourtshoes: 'Almond Toe Court Shoes, Patent Black', £99.00
- suedeshoesblue: 'Suede Shoes, Blue', £42.00
- leatherloafers: 'Leather Driver Saddle Loafers, Tan', £34.00
- redflipflop: 'Flip Flops, Red', £19.00
- blueflipflop: 'Flip Flops, Blue', £19.00
- blackcardigan: 'Gold Button Cardigan, Black', £167.00
- cottonshorts: 'Cotton Shorts, Medium Red', £30.00
- greyshortsleeveshirt: 'Fine Stripe Short Sleeve Shirt, Grey', £49.99
- greenshortsleeveshirt: 'Fine Stripe Short Sleeve Shirt, Green', £39.99
- birdprintdress: 'Bird Print Dress, Black', £270.00
- pinkdress: 'Mid Twist CutOut Dress, Pink', £540.00
- sharkskinwaistcoat: 'Sharkskin Waistcoat, Charcoal', £75.00
- blazer: 'Lightweight Patch Pocket Blazer, Deer', £175.50
There are some available vouchers as well, to be applied with a code depending on the criteria listed:
- £5.00 off your order with code 'voucher5' (total spend of at least £5)
- £10.00 off with code 'voucher10' when you spend over £50.00
- £15.00 off with code 'voucher15' when you have bought at least one footwear item and spent over £75.00
This program has been implemented only back-end, in order to prioritise features and edge-cases coverage. All User Stories have been covered.
- As a User I can add a product to my shopping cart.
- As a User I can remove a product from my shopping cart.
- As a User I can view the total price for the products in my shopping cart.
- As a User I can apply a voucher to my shopping cart.
- As a User I can view the total price for the products in my shopping cart with discounts applied.
- As a User I am alerted when I apply an invalid voucher to my shopping cart.
- As a User I am unable to add Out of Stock products to the shopping cart.
Only one voucher per shopping cart can be added.
The voucher's criteria is checked everytime that an item is removed from the shopping cart, to eventually remove the voucher as well, if it does not apply anymore.
Invalid vouchers raise errors, as well as a shopping cart not meeting the criteria for it.
A user can not add items out of stock, nor an available item more times than the availability specified.
As a valid memeber of a team, a back-end developer must provide a fully working program, covering all edge cases, in order for the frontend team to implement it without encountering problems. I am passionate about back-end development and I wanted to focus on implementing a solid base for this program.
The shop can create category of items and subsequently it can create items in them. It can also create vouchers to be applied to the shopping cart. 3 criteria of vouchers, as specified above, have been implemented.
These instructions assume that ruby and rspec are installed in the machine.
- clone locally
- move into the folder from the command line
- run rspec to check that all tests pass
- run
irb
- For simplicity, copy and paste into irb all the content of the file 'store_product_data' to stock the store with the information listed above
- start adding to cart with
shop.shopping_cart.add_to_cart(pinkdress)
replacing pinkdress to any of the variables listed here above - try applying a voucher
shop.shopping_cart.apply_voucher('voucher5')
replacing voucher5 to any of the voucher codes listed here above ('voucher10', 'voucher15') - try removing items with
shop.shopping_cart.remove_item_from_cart(pinkdress)
replacing pinkdress with any variable of clothes listed here above - notice how an item with no availability can not be added to the cart
- notice how a voucher can not be applied if the shopping cart does not meet the criteria for it
- notice how a voucher is removed while removing items from the shopping cart, when the criteria don't meet anymore
- notice how maximum one voucher can be applied per shopping cart
The program has been ran for demonstration and can be seen in the video uploaded: https://youtu.be/QfUOofRCXWo