# Simple Resscheduling Flow
```flow
invoke=>start: Start Reschedule
op=>operation: Can Dates Be Provided?
cond=>condition: Yes or No?
iocondition=>doRescheduleWithDate: Query Dates
doPendingReschedule=>end: Do Pending Reschedule
doRescheduleWithDate=>end: Do Reschedule with Date
invoke->op->cond
cond(yes)->doRescheduleWithDate
cond(no)->doPendingReschedule
```
The rescheduling implmentation can be simplified and limited to determining if there is a date that can be selected. If not, perform a pending reschedule. If a date can be selected then perform a reschedule for a specificly selected available date.
# Implementation of Resscheduling Flow
```flow
invoke=>start: Start Reschedule
op=>operation: Connectivity Available?
yesNo=>condition: Yes or No?
datesAvailable=>condition: Dates Available?
dateSelected=>condition: Dates Selected?
io=>doRescheduleWithDate: Query Dates
doPendingReschedule=>end: Do Pending Reschedule
doRescheduleWithDate=>operation: Do Reschedule with Date
lookupDates=>inputoutput: GET Available Dates
performDatedReschedule=>inputoutput: POST Dated Reschedule
rescheduleComplete=>end: Reschedule Complete
invoke->op->yesNo
yesNo(no)->doPendingReschedule
yesNo(yes)->doRescheduleWithDate
doRescheduleWithDate->lookupDates->datesAvailable
datesAvailable(no)->doPendingReschedule
datesAvailable(yes)->dateSelected
dateSelected(no)->doPendingReschedule
dateSelected(yes)->performDatedReschedule->rescheduleComplete
```
# Reschedule with Date *(Date Available and Selected)*
### Mobile App Process I: Consumer Selects Specific Date
```mermaid
sequenceDiagram
Consumer ->> Technician/App: I need to reschedule
Technician/App ->> Server: GET /ato/{atoReference}/reschedule/availability
activate Server
Server -->> Technician/App: Response Get Availability [date1,date2]
Note right of Server: The API<br/>queries scheduling<br/>availability.<br/>Returns array of dates
deactivate Server
Technician/App ->> Consumer: Pick select date1 or date2
activate Consumer
Consumer ->> Technician/App: I would like to pick date1
deactivate Consumer
Technician/App ->> Server: POST /ato/reschedule/{atoReference}/{selectedDate}
activate Server
Server -->> Technician/App: Return HTTP 200 OK
Note right of Server: The API<br/>sets ATO to new<br>scheduling date.
deactivate Server
Note right of Technician/App: The app should<br/>refresh allow Tech<br/>to comment and skip <br/>that stop.
```
### ATO ERP Reschedule (Reschedule Date) Behavior
_In the case of a Rescheduling Order with a Selected Reschedule Date_
- In ***sched*** table (original ***sched*** date record):
- The original `sched.total_sched` record is decremented to return the available to that ***sched*** representation that the order was originally a part of
- In ***sched*** table context for the **new** scheduling record (new ***sched*** date related record):
- The new `sched.total_sched` record is incremented to reduce availability in the new ***sched*** representation of the new date
- In ***orderMaster***
- `orderMaster.dateScheduled` date is removed and converted to the newly selected schedule date
- `orderMaster.scheduleLater` is changed from either 0/1 to 0
- `orderMaster.status toggles` from Any to Active
- `orderMaster.callType` toggles from any to 20 (note this does not happen in pending ops)
- For each in ***orderDetail***:
- `orderDetail.dateScheduled` is covered from previous date to new date
- `orderDetail.scheduleLater` toggles from any to 0
- `orderDetail.callType` toggles from any to 20 (note this does not happen in pending ops)
- New record is inserted into reschedule with following values:
- `reschedule.businessType` copied from OM
- `reschedule.orderNumber` is copied from OM
- `reschedule.oldDateScheduled`, previous value of `orderMaster.dateScheduled` is entered in this field
- `reschedule.newDateScheduled` is entered as new date value
- `reschedule.dateChanged` current date and time the reschedule was expedited by the operator
- `reschedule.operator` the id of the ATO user making the reschedule
- `reschedule.reason` is entered which is selected from the dropdown/select list of reschedule reasons
- `reschedule.comments` is entered from a comment field presented to the ATO user during reschedule operation
- Followup Server-Side Actions
- If selected/before e-mail update occurs and the consumer elected to receive an e-mail confirmation of the change to a dated reschedule (if that checkbox is marked) ATO generates an e-mail to the consumer’s e-mail address informing them of the reschedule
- Future implementations will also need to support SMS text message gateways SaaS services
---
# Reschedule Process Diagram: Pending Reschedule
**Business Knowledge/Definition of a Pending Reschedule**
When an order is set to a pending reschedule. The order is changed and no longer has a specific scheduled date. In this case the order is marked as pending and requiring rescheduling.
**Downstream Rescheduling Process**
- The order is placed in to a queue for ARCA customer service department to investigate;
- If ARCA does not have scheduling availability ARCA Operations Dispatch will be tasked to add capacity to scheduling availability;
- ARCA's call center/customer service then make an outbound call to the consumer to negotiate and confirm a firm scheduling date;
- Customer service will perform a reschedule of that order, setting it for a specific date.
### Mobile App Process II.A: Reschedule Process Diagram: Set as Pending Reschedule
```mermaid
sequenceDiagram
Consumer ->> Technician/App: I need to reschedule
Technician/App ->> Server: GET /ato/{atoReference}/reschedule/availability
activate Server
Server -->> Technician/App: Response Get Availability [date1,date2]
Note right of Server: The API<br/>queries scheduling<br/>availability.<br/>Returns array of dates
deactivate Server
Technician/App ->> Consumer: Pick select date1 or date2
activate Consumer
Consumer ->> Technician/App: NONE OF THESE DATES ARE ACCEPTABLE
deactivate Consumer
Technician/App ->> Server: POST /ato/reschedule/{atoReference}/
activate Server
Server -->> Technician/App: Return HTTP 200 OK
Note right of Server: The API<br/>sets ATO to a status<br>Pending Reschedule.
deactivate Server
Note right of Technician/App: The app should<br/>refresh allow Tech<br/>to comment and skip <br/>that stop.
```
In this case connectivity is available however the consumer either cannot agree to the provided dates, communication may not be available with the consumer (in the case of a consumer not home), or the consumer is not available to commit to any of the available/offered rescheduling dates.
### Mobile App Process II.B: Reschedule Process Diagram: Set as Pending Reschedule Due to Lack of Connectivity
```mermaid
sequenceDiagram
Consumer ->> Technician/App: I need to reschedule
Technician/App ->> Server: GET /ato/{atoReference}/reschedule/availability
activate Server
Server -->> Technician/App: Connection Cannot be Established
Note right of Server: The API is<br/>unavailable to query<br/>scheduling availability.
Technician/App ->> Consumer: Connect to dispatch, customer service will call you
Technician/App ->> Server: POST /ato/reschedule/{atoReference}/
activate Server
Server -->> Technician/App: Request Tolled
Note right of Server: When connectivity<br/>with the API can<br/>be restablished<br/>the App will POST<br/>to the pending<br/>reschedule endpoint
deactivate Server
```
In this case connectivity cannot be established and the device will cache the reqeust until connection can be re-established, then the request will be sent to POST pending reschedule.
### ATO ERP Reschedule (Pending Reschedule) Behavior
In the case of a Scheduled Order to a Pending-Reschedule
When a reschedule date is unavailable, consumer cannot commit to a date, communication cannot be established with consumer, communications failure between mobile device and API, bad weather:
- In ***sched*** table (or ***lowIncomeSched*** table for 500 series programs)
- The original sched.total_sched record is decremented to return the available to that ***sched*** representation that the order was originally a part of
- In ***orderMaster*** table
- `orderMaster.dateScheduled` date is removed and converted to NULL
- `orderMaster.scheduleLater` is changed from 0 to 1
- `orderMaster.status` toggles from Active to Hold
- For each in ***orderDetail***:
- `orderDetail.dateScheduled` is covered from a date to a null
- `orderDetail.scheduleLater` toggles from 0 to 1
- New record is inserted into ***reschedule***
- `reschedule.businessType` copied from OM
- `reschedule.orderNumber` is copied from OM `reschedule.oldDateScheduled`, previous value of `om.dateScheduled` is entered in this field
- `reschedule.newDateScheduled` is entered as a NULL value
- `reschedule.dateChanged` current date and time the reschedule was expedited by the operator
- `reschedule.operator` the id of the ato user making the reschedule
- `reschedule.reason` is entered which is selected from the dropdown/select list of reschedule reasons
- `reschedule.comments` is entered from a comment field presented to the ATO user during reschedule operation
- Followup Server-Side Actions
- If selected/before e-mail update occurs and the consumer elected to receive an e-mail confirmation of the change to a pending reschedule (if that checkbox is marked) ATO generates an e-mail to the consumer’s e-mail address informing them of the reschedule
- Future implementations will also need to support SMS text message gateways SaaS services
#### Downstream ERP Processes Affected by Reschedule (Pending Reschedule) Behavior
- Operations:
- Dispatching
- Scheduling and Capacity Management
- Executive & Client Services:
- Customer Complaint Reporting
- Customer Complaint and Issue Impact Mitigation
- Key Performance Indicator (KPI) Reporting
- Institutional Utility Customer Owned Customer Service Operations
- ETL
- Web Portal
- ARCA Las Vegas Customer Service:
- CRM & Java ATO
- Reschedule Task Queue
- Telephony Integration (five9 live agent autodialer integration)
- Autodialer Nuance Processes, Autodialer VRU Automated Rescheduling Operations and Chron/ETL
---
Edit Note Flowchart Documentation: http://flowchart.js.org/
Example Implementation: https://github.com/adrai/flowchart.js/blob/master/example/index.html
```flow
st=>start: Start|past:>http://www.google.com[blank]
e=>end: End:>http://www.google.com
op1=>operation: My Operation|past
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes
or No?|approved:>http://www.google.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|request
para=>parallel: parallel tasks
st->op1(right)->cond
cond(yes, right)->c2
cond(no)->para
c2(true)->io->e
c2(false)->e
para(path1, bottom)->sub1(left)->op1
para(path2, right)->op2->e
st@>op1({"stroke":"Red"})@>cond({"stroke":"Red","stroke-width":6,"arrow-end":"classic-wide-long"})@>c2({"stroke":"Red"})@>op2({"stroke":"Red"})@>e({"stroke":"Red"})
```