Minor Rule and School Calendar Assignments - Aggregated

Minor Rules are legally binding scheduling rules and penalties that regulate minor employees, who are typically aged 14 to 18. The age range may vary by jurisdiction. School calendars define a minor employee's school schedule and work in conjunction with Minor Rules to meet a jurisdiction's rules and regulations concerning the employment of minors.

Minor Rules are legally binding scheduling rules and penalties that regulate minor employees, who are typically aged 14 to 18. The age range may vary by jurisdiction.

Scheduler and the Auto-Scheduler can schedule minor employees according to labor laws in their jurisdiction. Different Minor Rule sets can be configured for each jurisdiction.

Prerequisites

A person ID is the same identifier as personKey and employee ID, and is not the same as a person number.

Example

In this example, we assign, verify, delete, and pass a request that makes no change to multiple people's assignments.

Create or update assignments

The create or update request:

  • uses personIdentity to identify the person using their person number
  • uses minorRule inside personAssignments to define the minor rule and school calendar to assign

Example request

Call POST /v1/commons/persons/assignments/multi_upsert with the following request payload.

[
    {
        "personIdentity": {
            "personNumber": "30105"
        },
        "personAssignments": {
            "minorRule": {
                "emancipatedMinor": false,
                "minorRule": {
                    "id": 19,
                    "qualifier": "USAZ"
                },
                "schoolCalendar": {
                    "id": 1,
                    "qualifier": "Universal School Calendar"
                }
            }
        }
    }
]

Example response

A success response returns HTTP status code 200 and a response body similar to the following example.

[
    {
        "personIdentity": {
            "personNumber": "30105"
        },
        "personAssignments": {
            "minorRule": {
                "emancipatedMinor": false,
                "minorRule": {
                    "id": 19,
                    "qualifier": "USAZ"
                },
                "schoolCalendar": {
                    "id": 1,
                    "qualifier": "Universal School Calendar"
                }
            }
        }
    }
]

Verify assignments

You can use the bulk multi-read operation to verify assignments for multiple people at once.

Example request

To verify, call POST /v1/commons/persons/assignments/multi_read with the following request payload.

{
  "where": {
    "employees": {
      "key": "personNumber",
      "values": [
        "10032","30105"
      ]
    },
    "personAssignments": [
    "minorRule"
  ]
  }
}

Example response

A success response returns HTTP status code 200 and a response body similar to the following example.

[
    {
        "personIdentity": {
            "personNumber": "10032"
        },
        "personAssignments": {
            "minorRule": {
                "emancipatedMinor": false
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "30105"
        },
        "personAssignments": {
            "minorRule": {
                "emancipatedMinor": false,
                "minorRule": {
                    "id": 19,
                    "qualifier": "USAZ"
                },
                "schoolCalendar": {
                    "id": 1,
                    "qualifier": "Universal School Calendar"
                }
            }
        }
    }
]

Make no change to assignments

When working with large numbers of people, you may wish to pass a request payload that makes no changes to a person's minor rule and school calendar assignments.

In the following example, the system makes no changes. Setting an empty minorRule or passing the unAssignExisting Boolean as false both result in no changes to a person's assignments.

Example request

Call POST /v1/commons/persons/assignments/multi_upsert with the following request payload.

[
    {
        "personIdentity": {
            "personNumber": "10020"
        },
        "personAssignments": {
            "minorRule": {}
        }
    },
    {
        "personIdentity": {
            "personNumber": "10030"
        },
        "personAssignments": {
            "minorRule": {
                "unAssignExisting":false
            }
        }
    }
]

Example response

A success response returns HTTP status code 200 and a response body similar to the following example.

[
    {
        "personIdentity": {
            "personNumber": "10020"
        },
        "personAssignments": {
            "minorRule": {
                "emancipatedMinor": false
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "10030"
        },
        "personAssignments": {
            "minorRule": {
                "emancipatedMinor": false
            }
        }
    }
]

Delete assignments

You can delete, or unassign, minor rule and school calendar assignments. To delete our example's minor rule and school calendar assignments, call POST /v1/commons/persons/assignments/multi_upsert using the unAssignExisting property.

Example request

Call POST /v1/commons/persons/assignments/multi_upsert with the following request payload.

[
    {
        "personIdentity": {
            "personNumber": "30105"
        },
        "personAssignments": {
            "minorRule": {
                "unAssignExisting":true
                 
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "10032"
        },
        "personAssignments": {
            "minorRule": {
                "unAssignExisting":true
                 
            }
        }
    }
]

Example response

A success response returns HTTP status code 200 and a response body similar to the following example.

[
    {
        "personIdentity": {
            "personNumber": "30105"
        },
        "personAssignments": {
            "minorRule": {
                "emancipatedMinor": false
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "10032"
        },
        "personAssignments": {
            "minorRule": {
                "emancipatedMinor": false
            }
        }
    }
]

Note: You can verify that the assignments were deleted by calling POST /v1/commons/persons/assignments/multi_read with a request payload specifying all of the affected person identities.