# Scheduling UI State Workflow
1. Go to url
2. Validate query string parameters
1. If not valid, exit to invalid parameter page
2. ...otherwise continue
3. Fetching form appointment configuration data
1. Fetch appointment types (parallel)
1. If fails, exit to failed to load config data page
2. ...otherwise continue
2. Fetch customer (parallel)
1. If fails, exit to failed to load config data page
2. ...otherwise continue
4. Use selected appointment type...
1. Fetch resources based on appointment type's resource configurations
1. If fails, exit to failed to load resource data page
2. ...otherwise continue
```sql
// By country
SELECT ... WHERE country = 'US' AND type IN ('FITTER_INTERNAL', 'VIDEO_CARE_CALL');
// By shop
SELECT ... WHERE shop_gid IN ('GID') AND type IN ('FITTER');
```
5. Given the resources...
1. Fetch their availabilities for now to X days in the future
1. If fails, notify user
2. ...otherwise continue
6. Calculate earliest availability