Preventive plan MO generation
Endpoint: POST {{host}}/preventive-plans/actions/generate-orders
or alternative for only one specific plan
POST {{host}}/preventive-plans/actions/generate-orders/{{id}}
Input Parameters: -
Steps:
- Preventive plan cycle end must be higher than current time (today) 
- Preventive plan is generated for each associated equipment 
- Cycle start is defined: - If no MO is created yet = Cycle start from PP definition 
- Otherwise latest MO is used and its Preventive plan Generation Time 
 
- Period for MO generation time frame is calculated - If current time + Create in advance parameter is lower than Cycle end, it is used 
- Otherwise, Cycle end is used as the time frame. 
 
- Date iterations are created based on the unit type with following rules: - Day - Date is calculated as Cycle start + Cycle defined 
- If parameter Include weekend is enabled, iterations are created only for non-weekend days 
 
- Week - Date is calculated as Cycle start + Cycle defined 
 
- Month - Date is calculated as Cycle start + Cycle defined 
- If Month lenght is longer than previous month, the last day of the month is used, otherwise specific day of the month is used 
 
- Year - Date is calculated as Cycle start + Cycle defined 
 
 
- Each date iteration creates new Maintenance Order if no MO is already created for the date - If Shift factor is set, MO sheduled finish time is modified accordingly 
- If DST is valid for the timezone, it is considered when creating MO 
- If Setting parameter - automatic_assignment_to_responsible_teamand- allow_maintenance_planning_mode_by_teamsis enabled MO is connected with the team (based on Equipment x Team relation) and status is set to Assigned to team
- Maintenance Order history is created for new MO 
- Completition confirmation is created for New MO 
 
- If Preventive plan has associated Instructions or instruction sets it is assigned to new MOs 
