API Server

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

1. Delivery Time Window

1.1. Model

1.1.1. Start Time

1.1.2. End Time

1.1.3. Orders

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

1.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

1.1.4. Max Orders

1.2. Actions

1.2.1. Create time windows

1.2.2. Delete time windows

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

1.2.3. View time windows with all orders in that window

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

1.2.4.1. Can be done through a query to orders

1.2.5. Query for time windows in a certain time range

2. User

2.1. Model

2.1.1. Username

2.1.2. Password

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

2.1.3.1. Role will determine access to different apps

2.1.4. Store (if role = store manager)

2.1.5. Name

3. RouteBrain

3.1. Purpose

3.1.1. Keeps state of routes

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

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

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

3.2. Implementation

3.2.1. Ideally should be hosted separately from the API Server

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

3.2.3. All time dependance is encapsulated in the route brain

4. Options

4.1. key value pairs

4.1.1. #days available in advance

5. Stores

5.1. Model

5.1.1. Store Name

5.1.2. Domain

5.1.3. Allowed Time Windows

5.1.4. Opening Time

5.1.5. Closing Time

5.1.6. Abbreviation

6. Orders

6.1. Model

6.1.1. Store

6.1.2. Delivery Time Window

6.1.3. SKU

6.1.4. Order Data

6.1.5. Destination Address

6.1.6. Estimated Pickup Time

6.1.7. Estimated Delivery Time

6.1.8. Status

6.1.9. Scheduled

6.1.10. Tracking Number

6.1.10.1. shortId

6.1.10.2. autoincrement

6.1.11. Route

6.1.11.1. mongoose deep populate

6.2. Actions

6.2.1. Create order with time window assigned

6.2.2. Create order with time window unassigned

6.2.3. Change time window of order

6.2.4. Query for orders belonging to a store

6.2.5. Query for orders in a delivery time window

6.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

6.2.7. Update order status which triggers notifications

7. Tasks

7.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

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

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

8. Route

8.1. Model

8.1.1. Shift Start Time

8.1.2. Shift End Time

8.1.3. Waypoint Order

8.1.3.1. Can be a subdoc of waypoint info

8.1.4. Orders

8.1.5. Driver (User ref)

8.1.6. Current Driver Location