Team:
- Brandon Moore - Services
- Christian Felix - Sales
-
Clone the repository:
https://gitlab.com/1christianfelix1/car-car -
Run Docker and run the following commands to build and start the Docker container
docker volume create beta-data
docker-compose build
docker-compose up
- Make and apply migrations
docker exec -it «api-container-name» bash
python manage.py makemigrations
python manage.py migrate
- Once everything is loaded, you can view the application at:
http://localhost:3000/
This application serves the purpose of:
- Managing and tracking automobile service appointments
- Providing user with the ability to create appointments through a user-friendly form
- View a comprehensive list of scheduled appointments
On the front-end, users can also access features to mark appointments as canceled or completed and add information related to technicians via a dedicated form. In addition, the application offers a service history view.
The back-end functionality encompasses creating appointments and technicians, along with persisting their details.
To further enhance the user experience, the application integrates with an inventory microservice that leverages the VIN to verify whether the automobile has been sold by the dealership.
Every 60 seconds, the Service microservice polls the Inventory microservice for automobile updates
Action | Method | URL |
---|---|---|
List All Appointments | GET | http://localhost:8080/api/appointments/ |
List Appointments Output
{
"appointments": [
{
"id": 2,
"vin": "JT2BB5BA8BCBZRU2Z",
"owner": "bob",
"date_and_time": "2023-03-10T23:42:00+00:00",
"technician": {
"name": "sdfsf",
"id": 1,
"employee_number": 32
},
"reason": "sdasd",
"vip": false,
"finished": true
},
{
"id": 3,
"vin": "JT2BB5BA8BCBZRU2Z",
"owner": "da",
"date_and_time": "2023-03-03T22:51:00+00:00",
"technician": {
"name": "sdfsf",
"id": 1,
"employee_number": 32
},
"reason": "wqeq",
"vip": false,
"finished": true
},
{
"id": 4,
"vin": "JT2BB5BA8BCBZRU2Z",
"owner": "bob",
"date_and_time": "2023-03-08T09:53:00+00:00",
"technician": {
"name": "sdfsf",
"id": 1,
"employee_number": 32
},
"reason": "ewrwer",
"vip": false,
"finished": true
}
]
}
Action | Method | URL |
---|---|---|
List Technicians | GET | http://localhost:8080/api/technicians/ |
Create a Technician | POST | http://localhost:8080/api/technicians/ |
Show Technician Details | GET | http://localhost:8080/api/technicians/:id/ |
List Technicians Output
{
"technicians": [
{
"name": "sdfsf",
"id": 1,
"employee_number": 32
}
]
}
Create Technician Input/Output
{
"name": "bob",
"employee_number": 1891
}
{
"name": "bob",
"id": 2,
"employee_number": 1891
}
The sales application allows users to manage and view data surrounding sales:
- Add Customers and new Sales People through forms
- Record and track the history of sales between Customer, Sales Person, and the Automobile
- Filter the history of sales records by sales person
The front-end interface of the Sales service provides the user with forms to add Sales People, Customers, and create Sale Records. Some forms contain dropdown menus that allow the user to identify and use known records.
The user also has access to view a detailed list of all sales records or records by a certain sales person.
Every model in the back-end has a relationship with the Sales Record model. The sales service also utilizes data from the inventory service in order to create relationships between sales records and automobiles. This data was fetched by polling the Inventory API, uniquely identified by VIN numbers and ten associated with an Automobile Value Object within the Sales microservices.
The Polling rate from Sales to Inventory has been reduced to 5 seconds from the original 60 seconds. This is to match the polling rate of the self-updating dropdown menu for automobiles when creating a Sales Record. The dropdown will reflect newly added automobiles every 5 seconds and will show a disclaimer if there are no vehicles for sale.
For each model, there exist a view to create, delete, and list.
Action | Method | URL |
---|---|---|
List Sales People | GET | http://localhost:8090/api/sales_person/ |
Create a Sales Person | POST | http://localhost:8090/api/sales_person/ |
Delete a Sales Person | DELETE | http://localhost:8090/api/sales_person/:id/ |
List Sales People Output
{
"sales_people": [
{
"href": "/api/sales_person/1/",
"name": "Christian Felix",
"employee_number": "1"
},
{
"href": "/api/sales_person/2/",
"name": "Jeff",
"employee_number": "2"
},
]
}
Create Sales People Input/Output
{
"name": "Jeff",
"employee_number": "1"
}
{
"href": "/api/sales_person/1/",
"name": "Jeff",
"employee_number": "1",
"id": 1
}
Action | Method | URL |
---|---|---|
List Customers | GET | http://localhost:8090/api/customer/ |
Create a Custom | POST | http://localhost:8090/api/customer/ |
Delete a Customer | DELETE | http://localhost:8090/api/customer/:id/ |
List Customer Output
{
"customers": [
{
"href": "/api/customer/1/",
"name": "billy",
"address": "1",
"phone_number": "111-222-3333"
}
]
}
Create Customer Input/Output
{
"name": "billy",
"address": "2 house",
"phone_number": "111-222-3333"
}
{
"href": "/api/customer/1/",
"name": "billy",
"address": "2 house",
"phone_number": "111-222-3333",
"id": 1
}
Action | Method | URL |
---|---|---|
List Sales Records | GET | http://localhost:8090/api/sales_records/ |
Create Sales Record | POST | http://localhost:8090/api/sales_records/ |
Delete Sales Record | DELETE | http://localhost:8090/api/sales_records/:id/ |
List Sales Records Output
{
"sales_records": [
{
"href": "/api/sales_records/1/",
"sale_price": "40000",
"sales_person": {
"href": "/api/sales_person/1/",
"name": "Jeff",
"employee_number": "1"
"id": 1
},
"customer": {
"href": "/api/customer/1/",
"name": "billy",
"address": "1",
"phone_number": "111-222-3333"
"id": 1
},
"automobile": {
"import_href": "/api/automobiles/2C3CCAFJ7CH100286/",
"color": "yellow",
"year": 2013,
"vin": "1C3CC5FB2AN120174",
"sold": true
}
}
]
}
Create Sales Record Input/Output
{
"sale_price": "40000",
"sales_person": 1,
"customer": 1,
"automobile": "1C3CC5FB2AN120174"
}
{
"href": "/api/sales_records/1/",
"sale_price": "40000",
"sales_person": {
"href": "/api/sales_person/1/",
"name": "Jeff",
"employee_number": "1"
"id": 1
},
"customer": {
"href": "/api/customer/1/",
"name": "billy",
"address": "1",
"phone_number": "111-222-3333"
"id": 1
},
"automobile": {
"import_href": "/api/automobiles/1C3CC5FB2AN120174/",
"color": "yellow",
"year": 2013,
"vin": "1C3CC5FB2AN120174",
"sold": true
}
}
The inventory service provides users the ability to create/update, delete, list, and view details for Manufacturers, VehicleModels, and Automobiles.
Action | Method | URL |
---|---|---|
List manufacturers | GET | http://localhost:8100/api/manufacturers/ |
Create a manufacturer | POST | http://localhost:8100/api/manufacturers/ |
Get a specific manufacturer | GET | http://localhost:8100/api/manufacturers/:id/ |
Update a specific manufacturer | PUT | http://localhost:8100/api/manufacturers/:id/ |
Delete a specific manufacturer | DELETE | http://localhost:8100/api/manufacturers/:id/ |
Create, Update, Getting a specific Manufacturer Output
{
"href": "/api/manufacturers/1/",
"id": 1,
"name": "Chrysler"
}
Listing Manufacturer Output
{
"manufacturers": [
{
"href": "/api/manufacturers/1/",
"id": 1,
"name": "Daimler-Chrysler"
}
]
}
Action | Method | URL |
---|---|---|
List vehicle models | GET | http://localhost:8100/api/models/ |
Create a vehicle model | POST | http://localhost:8100/api/models/ |
Get a specific vehicle model | GET | http://localhost:8100/api/models/:id/ |
Update a specific vehicle model | PUT | http://localhost:8100/api/models/:id/ |
Delete a specific vehicle model | DELETE | http://localhost:8100/api/models/:id/ |
Create and Update Vehicle Input
{
"name": "Sebring",
"picture_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Chrysler_Sebring_front_20090302.jpg/320px-Chrysler_Sebring_front_20090302.jpg",
"manufacturer_id": 1
}
Updating a Vehicle Input
{
"name": "Sebring",
"picture_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Chrysler_Sebring_front_20090302.jpg/320px-Chrysler_Sebring_front_20090302.jpg"
}
Create, Update, Getting a specific Vehicle Model Output
{
"href": "/api/models/1/",
"id": 1,
"name": "Sebring",
"picture_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Chrysler_Sebring_front_20090302.jpg/320px-Chrysler_Sebring_front_20090302.jpg",
"manufacturer": {
"href": "/api/manufacturers/1/",
"id": 1,
"name": "Daimler-Chrysler"
}
}
Listing Vehicle Model Output
{
"models": [
{
"href": "/api/models/1/",
"id": 1,
"name": "Sebring",
"picture_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Chrysler_Sebring_front_20090302.jpg/320px-Chrysler_Sebring_front_20090302.jpg",
"manufacturer": {
"href": "/api/manufacturers/1/",
"id": 1,
"name": "Daimler-Chrysler"
}
}
]
}
Action | Method | URL |
---|---|---|
List automobiles | GET | http://localhost:8100/api/automobiles/ |
Create an automobile | POST | http://localhost:8100/api/automobiles/ |
Get a specific automobile | GET | http://localhost:8100/api/automobiles/:vin/ |
Update a specific automobile | PUT | http://localhost:8100/api/automobiles/:vin/ |
Delete a specific automobile | DELETE | http://localhost:8100/api/automobiles/:vin/ |
Creating an Automobile Input
{
"color": "red",
"year": 2012,
"vin": "1C3CC5FB2AN120174",
"model_id": 1
}
Getting Details of an Automobile Output
{
"href": "/api/automobiles/1C3CC5FB2AN120174/",
"id": 1,
"color": "yellow",
"year": 2013,
"vin": "1C3CC5FB2AN120174",
"model": {
"href": "/api/models/1/",
"id": 1,
"name": "Sebring",
"picture_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Chrysler_Sebring_front_20090302.jpg/320px-Chrysler_Sebring_front_20090302.jpg",
"manufacturer": {
"href": "/api/manufacturers/1/",
"id": 1,
"name": "Daimler-Chrysler"
}
}
}
Listing Automobiles Output
{
"autos": [
{
"href": "/api/automobiles/1C3CC5FB2AN120174/",
"id": 1,
"color": "yellow",
"year": 2013,
"vin": "1C3CC5FB2AN120174",
"model": {
"href": "/api/models/1/",
"id": 1,
"name": "Sebring",
"picture_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Chrysler_Sebring_front_20090302.jpg/320px-Chrysler_Sebring_front_20090302.jpg",
"manufacturer": {
"href": "/api/manufacturers/1/",
"id": 1,
"name": "Daimler-Chrysler"
}
}
}
]
}