Skip to content

Onboarding a New Location - Software Tools

Prerequisites

You will need the following information:

- FacilityId and OrganizationId from the Otter API
- New location name (must match the name in Snowflake)
- New location abbreviation for the worker

Step-by-step Guide

1. Create Kitchen in MongoDB

Create a new kitchen document in the kitchens collection on Mongo.

2. Get FacilityId and OrganizationId

  1. Navigate to app.tryotter.com/orders
  2. Open browser DevTools and inspect the network requests
  3. Find the https://api.tryotter.com/facilities?with_locations=false API call
  4. Locate the new location by name in the response
  5. Copy the facilityId and OrganizationId values

3. Add Location to Bakery Forecast Integration

  1. Open the repository and navigate to:
    • Orbital.Services > Snowflake > SnowflakePrepProductionService.cs > GetBakeryItemsByWeek
  2. Add the new location name to the if-else block in this method
  3. Important: The location name must exactly match the name in ORBITAL_KITCHENS_DW.OTTER_DW.BAKERY_WEEKLY_FORECAST

4. Add Location to Post Sales Data to 7Shifts

  1. Open the repository and navigate to:
    • Orbital.ApiService > Controllers > HooksController.cs
  2. Add the new kitchen location ID from MongoDB mapped to the location_id from 7Shifts (which comes from the locations endpoint)

5. Create Key Performance Indicator View

Create a new record in the key_performance_indicator_views collection: - Set Type to 1

6. Add Worker to Orbital.Workers

  1. Navigate to the Orbital.Workers project
  2. Copy the SyncBrxRealtimeOrdersWorker.cs file
  3. Rename it, replacing "BRX" with the new location's abbreviation
  4. Update the code to reference the new location
  5. Navigate to Orbital.Workers > Workers > appsettings.json and add the new location's facility ID at the bottom
  6. Navigate to Orbital.Util > AppConfig.cs and a new property for the facility ID
  7. Navigate to Orbital.Workers > Program.cs and register the new realtime orders worker as a hosted service

7. Add Slack Webhook for 86 Tool

  1. Go to https://api.slack.com/apps > 86 Alerts > Incoming Webhooks > Add New Webhook
    • Add a new webhook for the new location's call center Slack Channel
  2. Go to the new location's call center Slack channel and type @86 Alerts to add the app to the channel
  3. Open the repository and navigate to:
    • Orbital.Services > Snowflake > EightySixLogicService.cs > GetSlackWebhookUrl
  4. Copy and paste the webhook URL next to the capitalized kitchen ID (from MongoDB kitchens) in the switch statement to add a mapping for the new location.

8. Update V2 Order Serivce

  1. In the locations table in Postgres, add a new row for the mapping from address to the three letter location abbreviation.
  2. In the stations table in Postgres, add a new row for the mapping from Otter station ID to station name and location. You can get them either from OK Manager KDS Stations OR from the GraphQL on Otter Business Manager.
    • In the future, there should be an automated job that scrapes the GraphQL query and inserts unrecognized mappings into the Postgres table. This existed in the legacy backend.
  3. In the stores table in Postgres, add a new row for the mapping from Otter store ID to brand name and location.
    • Navigate to developer.tryotter.com > click Orbital Kitchens POS > Stores > Onboarded for a complete list of mappings