Coupon Codes
This project is an extension of the Little Shop group project. You will add functionality for merchants to create coupons for their shop.
Important Note
This is a solo project. All code must be written by you. You should use your resources as needed, but you must be prepared to explain and defend any code you write. Failure to be able to do so would indicate a lack of technical readiness for the next mod and result in a repeat.
Learning Goals
- Write migrations to create tables and relationships between tables
- Implement CRUD functionality for a resource
- Use MVC to organize code effectively, limiting the amount of logic included in serializers and controllers
- Use built-in ActiveRecord methods to join tables of data, make calculations, and group data based on one or more attributes
- Write model tests that fully cover the data logic of the application
- Write request tests that fully cover the functionality of the application
- Display data for users in a frontend application by targeting DOM elements
Details
- Must use Rails 7.1.x and Ruby 3.2.2.
- Additional gems to be added to the project must have instructor approval.
- RSpec, Pry, Simplecov, Shoulda-Matchers, Orderly, jsonapi-serializer (or other serializer gem), HTTParty, Faker, Faraday, and FactoryBot are pre-approved
- Scaffolding is not permitted on this project.
Setup
This project is an extension of Little Shop. You’ll need to start this project with a frontend repo and backend repo. Read below carefully for the set-up instructions.
Backend Repo
- If your Little Shop project is complete, you can use the backend repo as your starting point for this project. 🚨 IMPORTANT: Each team member who wants to use your Little Shop group project repo must fork the repo, including the repo owner. No work should be pushed to your original group project repo throughout this project.
- If your Little Shop backend is not complete, fork this backend repo as a starting point for this project. Do not clone it into the BE directory - keep them separate.
Frontend Repo
- All students must use a forked copy of this frontend repo for this project. Keep this repo separate from your BE repo when you fork and clone it down. They will be separate repos, do not nest one in the other.
Evaluation
Evaluation information for this project can be found here.
BE Technical Requirements
The BE Technical Requirements for this project can be found here
FE Technical Requirements
The FE Requirements for this project can be found here
Extensions (Optional)
You may pick one or more of these extension features to add to your project, only if you have completed all prior requirements and have refactored your code as needed for code quality.
BE Extensions:
- Inactive coupons cannot be added to an Invoice.
- A Coupon has a maximum number of uses before it is automatically deactivated. When implemented, prove that the number of times used on the Merchant Coupon Show Page is updated accordingly.
- Generate unique coupon codes as suggestions when creating a new coupon.
FE Extensions: As a user…
- When I am viewing the coupons for a merchant, I should see a “View Active Coupons” button that will update the list to only showing active coupons. There should be a way to go back to viewing all coupons (active AND inactive).
- When I am viewing the coupons for a merchant, I should see a count of total coupons and total invoices with coupons applied.