---
# System prepended metadata

title: Appointments vNext

---

# Appointments vNext


Auth

How we will make requests to appointment service without a token? We would usually have the UI wrapped in an auth0 provider that requires a user to login so that we can make authenticated requests. In this case, we need to make authenticated requests to appointment service to get a shop, customer and create an appointment.

Auth0 account per consultant:
- Consume SF users in account-service
- Create auth0 accounts for consultants
- consultants login to scheduling UI

Auth0 account per sales region
- add consultant role to auth0 
- consultants login to scheduling UI with regional user
- appointment-service fetches SF user to verify they exist and have access
    - IE) consultant gets fired, even if they save the URL they won't be able to access the UI
    - Could we share password via lastpass and change with turnover?



## TODOs:

### Backend Tasks

- [ ] Add Journey to appointment configuration types


### Frontend Tasks
- [ ] Create UI stories for new [shared components](https://www.figma.com/file/98UIVXX7zghxS4e7nMxrMw/Appointments-Service?node-id=85%3A44133)
    - [ ] AppointmentScheduler
        - [ ] InputContainer
            - [ ] AppointmentType
                - [ ] CustomerTitle
                - [ ] Dropdown (AppointmentType)
                - [ ] Dropdown (Fitter)
                - [ ] Dropdown (CustomerTimezone)
                - [ ] Chip (FitterTimezone)
            - [ ] AppointmentDaySelect
                - [ ] Date input
            - [ ] AppointmentTimeSelect
                - [ ] DateTitle
                - [ ] Timepicker
                - [ ] AvailableBlocks (whitespace)
        - [ ] CallToActions
            - [ ] Cancel Button
            - [ ] Save Button

- [ ] Create new frontend repo for embedding in SF (scheduler)
- [ ] Create shared components in library and use them in scheduler
- [ ] Embed scheduler in Salesforce

### Other tasks for v1
- [ ] Update roger sales to send appointments to Salesforce
    - [ ] Launch new nodejs version of RS
    - [ ] Need customer's timezone from account service (machine-to-machine)
    - [ ] Do we need to wonk the time to eastern going to SF?
- [ ] Add shops and resources permisisons to staging/prod

### Future Tasks
- [ ] Complete openapi spec
- [ ] Add consultants to account-service (consume users from pulsar) and auth0 (Brea usually does via UI but we'll need to automate)
- [ ] Add email from auth token to created_by/updated_by
    - [ ] Update auth-middleware
    - [ ] update appointment service auth middleware
    - [ ] Add rule to auth0 for adding email to usermeta
- [ ] Fix import for `AppointmentStatus` into seed.ts
- [ ] Fix/remove husky
- [ ] Add build/jenkins
- [ ] Privacy considerations for customers when they start creating appointments
- [ ] Add coverage gutters extension to suggested VSCode extensions
- [ ] New Relic single request id (via headers)


## ta-appointment-ui

- [x] Protect branches accordingly
- [ ] Get jenkins/build passing
- [ ] Add infra to build
- [ ] Ensure linting & type-checking is working
- [ ] Add Makefile

## DONE
- [x] Get jenkins working
    - [x] Fix port for tfvars health check
    - [x] Kill docker containers before running tests
    - [x] Fix deployment to testing error
- [x] Add `/appointment-types` endpoint
- [x] Implement unit tests
    - [x] Implement repository integration tests
        - [x] Shops
        - [x] Appointments
        - [x] AppointmentsToResources
        - [x] Customers
        - [x] Resources
    - [x] Implement service unit tests
        - [x] Shops
        - [x] Appointments
        - [x] Customers
        - [x] Resources
    - [x] Implement API handler unit tests
        - [x] shops
        - [x] resources
        - [x] appointments
        - [x] customers