Skip to content

Object Data Model

santoniriccardo edited this page Feb 10, 2022 · 29 revisions

Object Data Model

There are a number of different key objects in the Dronuts system. These are outlined below.

Customer

{
    "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
} 

Example 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",
                            }
                        ]
}

Store

{
    "store_id" :       int,        // Unique integer id
    "name" :           string,
    "email" :          string,
    "phone_number" :   string,
    "address":         Location   // Reference to LOCATION object
} 

Example 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",
                        }
}

Employee

` { "employee_id" : int, // UNIQUE "password" : string, // Hashed password, salted "employee_fullName": string,

} `

Employee example

{ "employee_id" : 1432, "password" : a12skdi8Ehd "employee_firstName" : John Smith, }

Drone

{ "drone_id" : int, //UNIQUE "battery_life": int, "drone_location": [string] //Reference to LOCATION objects "drone_orderId": int, //Reference to the id number of a specific order }

Clone this wiki locally