Skip to content

Object Data Model

Brian Luo edited this page Feb 16, 2022 · 3 revisions

Customer

{
    username: string,      // unique, url-safe
    password: string,      // hashed
    phoneNumber: number,   // limited in length
    emailAddress: string,  // use regex
    paymentMethod: ???,    // depends on API implementation
    savedPickupPoints: [PickupPoint],
    orders: [Order]
}

Donut

{
    name: string,
    price: number,
    weight: number,
    discount: number,
    picture: string,   // url for picture
    description: string,
    availability: boolean,
    tags: [Tag]
}

Drone

{
    // More fields depending on API implementation
    availability: boolean
}

Employee

{
    name: string,          // unique, url-safe
    password: string,      // hashed
    phoneNumber: number,   // limited in length
    emailAddress: string,  // regex
}

Order

{
    customer: Customer,
    donuts: [Donut],
    status: string,  // use enum
    tax: number,
    serviceFee: number,
    deliveryFee: number,
    totalCost: number,
    rating: number,
}

PickupPoint

{
    name: string,      // unique, url-safe
    latitude: number,  // between certain values
    longitude: number  // between certain values
}

Tag

{
    name: string,
    donuts: [Donut]
}
Clone this wiki locally