generated from CMU-17-356/dronut-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Object Data Model
Ananya Bhat edited this page Feb 15, 2022
·
29 revisions
There are a number of different key objects in the Dronuts system. These are outlined below.
{
"customer_id" : int, // Unique integer id
"first_name" : string,
"last_name" : string,
"email" : string,
"phone_number" : string,
"password" : string, // Salted, hashed password.
"addresses": [Location] // Reference to LOCATION objects
}
{
"customer_id" : 12,
"first_name": "Riccardo",
"last_name": "Santoni",
"email": "[email protected]",
"phone_number": "415-509-2866",
"password": "735ed12abec12bdcb42b",
"addresses": [
{
"location_id": 12,
"street": "5350 beeler street",
"city": "Pittsburgh",
"state": "PA",
"zipcode": "15217",
}
]
}
{
"store_id" : int, // Unique integer id
"name" : string,
"email" : string,
"phone_number" : string,
"address": Location // Reference to LOCATION object
}
{
"store_id" : 12,
"name" : "Dronuts Store #12",
"email" : "[email protected]",
"phone_number": "412-291-8119",
"address": {
"location_id": 12,
"street": "732 Filbert St",
"city": "Pittsburgh",
"state": "PA",
"zipcode": "15232",
}
}
{
"employee_id" : int, // UNIQUE
"password" : string, // Hashed password, salted
"first_name": string,
"last_name": string,
"email": string,
"phone_number": string,
"address": [Location]
}
{
"employee_id" : 1432,
"password" : a12skdi8Ehd,
"first_name" : John,
"last_name":Smith,
"email": [email protected],
"phone_number": 412-102-3456,
"address": {
"location_id": 12,
"street": "100 Fifth Avenue",
"city": "Pittsburgh",
"state": "PA",
"zipcode": "15252",
}
}
{
"drone_id" : int, //UNIQUE
"battery_life": int,
"drone_location": int //Reference to LOCATION objects
"drone_orderId": int, //Reference to the id number of a specific order
"critical" : boolean //set based on battery life and drone malfunctions
}
{
"drone_id" : 3,
"battery_life" : 80,
"drone_location": 12,
"drone_orderId": 2,
"critical" : False
}
{
"drone_id" : 3,
"battery_life" : 10,
"drone_location": 12,
"drone_orderId": 2,
"critical" : True
}
{
"location_id" : int, // Unique integer id
"street_address" : string,
"city" : string,
"state" : string,
"zipcode": string
}
{
"location_id": 12,
"street": "732 Filbert St",
"city": "Pittsburgh",
"state": "PA",
"zipcode": "15232",
}
{
"donut_id" : int, // Unique integer id
"flavor" : string,
"price" : float
}
{
"order_id" : 8,
"flavor" : "Cinnamon Sugar",
"price" : 3.0
}
{
"order_id" : int, // Unique integer id
"customer" : Customer, // Reference to CUSTOMER object
"drone" : Drone, // Reference to DRONE object
"location_id" : Location, // Reference to LOCATION object
"store_id" : Store, // Reference to STORE object
"order_items": [Donut], // Reference to DONUT objects
"order_total": float // Sum of prices of DONUT objects and sales tax
}
{
"order_id": 10,
"customer": {
"customer_id" : 12,
"first_name": "Riccardo",
"last_name": "Santoni",
"email": "[email protected]",
"phone_number": "415-509-2866",
"password": "735ed12abec12bdcb42b",
"addresses": [
{
"location_id": 12,
"street": "5350 beeler street",
"city": "Pittsburgh",
"state": "PA",
"zipcode": "15217",
}
]
},
"drone": {
"drone_id" : 3,
"battery_life" : 80,
"drone_location": 12,
"drone_orderId": 2,
"critical" : False
},
"location": {
"location_id": 12,
"street": "100 Fifth Avenue",
"city": "Pittsburgh",
"state": "PA",
"zipcode": "15252",
},
"store" : {
"store_id" : 12,
"name" : "Dronuts Store #12",
"email" : "[email protected]",
"phone_number": "412-291-8119",
"address": {
"location_id": 12,
"street": "732 Filbert St",
"city": "Pittsburgh",
"state": "PA",
"zipcode": "15232",
}
},
"order_items": [
{
"donut_id": 8,
"flavor": "Cinnamon Sugar",
"price": 3.0,
},
{
"donut_id": 11,
"flavor": "Boston Kreme",
"price": 3.5,
}
],
"order_total": 6.89
}