API Server

Get Started. It's Free
or sign up with your email address
API Server by Mind Map: API Server

1. Stores

1.1. Model

1.1.1. Store Name

1.1.2. Domain

1.1.3. Allowed Time Windows

1.1.4. Opening Time

1.1.5. Closing Time

1.1.6. Abbreviation

2. Delivery Time Window

2.1. Model

2.1.1. Start Time

2.1.2. End Time

2.1.3. Orders

2.1.3.1. Perhaps do not need this. Only complicates the CRUD operations

2.1.3.2. In any case routebrain should use order doc to calculate, not time window docs. because multiple time window can be handled by order doc

2.1.4. Max Orders

2.2. Actions

2.2.1. Create time windows

2.2.2. Delete time windows

2.2.2.1. Deleting time window must unassign all orders from this time window

2.2.3. View time windows with all orders in that window

2.2.4. View orders for a specific store in that time window

2.2.4.1. Can be done through a query to orders

2.2.5. Query for time windows in a certain time range

3. Orders

3.1. Model

3.1.1. Store

3.1.2. Delivery Time Window

3.1.3. SKU

3.1.4. Order Data

3.1.5. Destination Address

3.1.6. Estimated Pickup Time

3.1.7. Estimated Delivery Time

3.1.8. Status

3.1.9. Scheduled

3.1.10. Tracking Number

3.1.10.1. shortId

3.1.10.2. autoincrement

3.1.11. Route

3.1.11.1. mongoose deep populate

3.2. Actions

3.2.1. Create order with time window assigned

3.2.2. Create order with time window unassigned

3.2.3. Change time window of order

3.2.4. Query for orders belonging to a store

3.2.5. Query for orders in a delivery time window

3.2.6. Get the pickup times for orders of a certain store for future time windows (e.g. today) - can query for the orders with time windows. Or can just query for orders of the store with status != complete and filter client side

3.2.7. Update order status which triggers notifications

4. User

4.1. Model

4.1.1. Username

4.1.2. Password

4.1.3. Role (visitor, driver, storeManager, admin)

4.1.3.1. Role will determine access to different apps

4.1.4. Store (if role = store manager)

4.1.5. Name

5. Tasks

5.1. Adding Order: - get list of available delivery times for store - choose a delivery time window - send POST request to server with order address, SKU, and order data - if server responds 200, then user is done - on server: add order to AlgoHandler. AlgoHandler responds okay, then set delivery time on order. otherwise, return 400

5.2. Rescheduling Order: - same as adding order, except must go through AlgoHandler again

5.3. Adding Driver: - must specify shift start time and shift end time  - is added as a route

6. RouteBrain

6.1. Purpose

6.1.1. Keeps state of routes

6.1.2. 1. Must say whether an order can be added to a time window (available time windows and confirmations)

6.1.3. 2. Must update the Route model so that driver can load the most updated routes

6.1.4. 3. Must update the Order model so that the user can see the estimated arrival time

6.2. Implementation

6.2.1. Ideally should be hosted separately from the API Server

6.2.2. If held on API server, RouteBrain should not hold state in memory, should only

6.2.3. All time dependance is encapsulated in the route brain

7. Route

7.1. Model

7.1.1. Shift Start Time

7.1.2. Shift End Time

7.1.3. Waypoint Order

7.1.3.1. Can be a subdoc of waypoint info

7.1.4. Orders

7.1.5. Driver (User ref)

7.1.6. Current Driver Location

8. Options

8.1. key value pairs

8.1.1. #days available in advance