Skip to content

Sample state

Jan Viefhues edited this page Jan 21, 2020 · 2 revisions
{
   entities: {
       users: {
           1: {
               id: 1,
               email: "peter@peter.com",
               name: "Peter",
               role: "provider"
           },
           2: {
               id: 2,
               email: "jeff@peter.com",
               name: "jeff",
               role: "provider" 
           },
           3: {
               id: 3,
               email: "ak@peter.com",
               name: "Ak",
               role: "owner" 
           }
       },
       businesses: {
           1: {
               id: 1,
               title: "jeff's Cars",
               location: "Polk Street, San Francisco, CA",
               hours: "6am-9pm",
               serviceIds: [
                   12,
                   2,
               ],
               providerId: 2,
           },
           2: {
               id: 2,
               title: "Peters's Cars",
               location: "Battery Street, San Francisco, CA",
               hours: "5am-10pm",
               serviceIds: [
                   1,
                   5,
               ],
               providerId: 1,
           }
       },
       services: {
           1: {
               id: 1,
               type: "Oil change",
               price: "$100",
               description: "The best one in the city",
           },
           2: {
               id: 2,
               type: "Oil change",
               price: "$200",
               description: "The really best one in the city",
           },
           5: {
               id: 5,
               type: "Battery change",
               price: "$1,000"
           },
           12: {
               id: 12,
               type: "Tire rotation",
               price: "$50"
           }
       },
       appointments: {
           1: {
               id: 1,
               startTime: "2020-02-12, 12pm",
               endTime: "2020-02-12, 5pm",
               vehicleId: 2,
               serviceId: 12,
               confirmed: false,
 
               done: false,
           }
       },
       vehicles: {
           1: {
               id: 1,
               VIN: "12231278263401241894124120du1",
               attributes: {
                   make: "Audi",
                   model: "S5",
                   year: 2010
               },
               location: {
                   latitude: 40.636363,
                   longtitude: 200.23726
               },
               currOdometer: 104.3,
               lastOdometer: 95.45,
               tirePressure: {
                   "backLeft": 219.3,
                   "backRight": 219.3,
                   "frontLeft": 219.3,
                   "frontRight": 219.3
               },
           }
       }
   },
   ui: {
       loading: true/false
   },
   errors: {
       login: ["Incorrect username/password combination"],
       register: ["Email can't be blank"]
   },
   session: {currentUserId: 1}
}

Clone this wiki locally