- Project name: CarCar (dealership management software)
- Time: 9/12/2022 - 9/17/2022
- Url: https://gitlab.com/kanpii/project-beta.git
- Purposes:
- demonstrate ability to use Django to create RESTful APIs in microservices
- demonstrate ability to use React to create a front-end app that uses the RESTful APIs
- demonstrate ability to work with others in a team setting
- Team & duties:
- Qingying Meng: Automobile Service + Inventory List
- Carmen Tang: Auto Sales + Inventory Forms
- RESTful APIs & front-end overview:
Start project with the following commands in terminal while in the project-beta directory:
- docker volume create beta-data
- docker-compose build
- docker-compose up
- Inventory:
- http://localhost:8100/
- This bounded context provides the Automobiles that Sales and Services interact with!
- Sales:
- http://localhost:8090/
- This bounded context interacts with Inventory by looking at Inventory's available automobiles.
- Django: http://localhost:8090/admin/
- Services:
- http://localhost:8080/
- this bounded context keep track of service appointments for automobiles and their owners
- Django: http://localhost:8080/admin/
- front-end: http://localhost:3000/
Inventory has all the data of cars that are available to be sold under their Automobile model.
- Automobile Model
- color
- year
- vin
- model
Services uses the VIN of the automobile model to create appointments for cars to be worked on. Sales uses the VIN of the automobile model to track if a car has been sold or unsold.
Sales has a SalesPerson, Customer, SalesRecord and AutomobileVO model. The AutomobileVO model is how the sales interacts with Inventory's Automobile model. Salesperson model is needed to have sales employees to sell the cars. Customer model is needed to sell the cars to. SalesRecord calls back to Salesperson, Customer, and AutomobileVO to create a record of sold automobiles.
The above Sales URL is the starting point for all URLs related to the sales microservice. The ending half of the URL can be found in sales/sales_rest/urls.py. These can be used in Insomnia or similar programs to interact with the sales microservice. You can also go to the React URL and click the links in the top navbar to reach the pages you want.
Pages available will allow you to:
-
Create a Customer which requires:
- Name
- Address
- Phone Number
-
Create a SalesPerson which requires:
- Name
- Employee Number
-
Create a Sale which requires:
- Automobile(populated by Inventory)
- Sales Person
- Customer
- Price
-
Look at a list of all Sales
-
Look at a list of all Sales by a single Sales Person
Note: A sale can only be created if you have created a Customer, Salesperson, and a Vehicle beforehand. A sale cannot exist without a vehicle to sell, a person to sell it, or a person to sell it to!
-
Models:
- class AutomobileVO with attributes VIN, year, and color
- class Technician with attributes employee number and technician name
- class Appointment with attributes VIN, customer name, appointent date, appointment time, technician name, reason to make the appointment, receive vip service, appointment canceled, and appointment finished
-
Views:
-
Encoders:
- AutomobileVOEncoder
- TechnicianEncoder
- AppointmentEncoder
-
Functions:
- api_list_technicians:
- create a technician (use id to target the technician)
- list technicians
- api_show_technician:
- update a technician (use id to target the technician)
- show / delete a technician
- likewise for the appointment counterparts (api_list_appointments, api_show_appointment)
- api_list_technicians:
-
-
Components:
- create technician by entering employee number and technician name
- create appointment by specifying VIN, customer, technician, appointment date/time, appointment reason, receive vip service or not, and appointment status
- list appointment with VIN, customer, technician, appointment date/time, reason, and appointment status (canceled or finished)
- list services history by filtering VIN number