Employee Adjustment Rule Assignments - Aggregated

Adjustment rules change a person's wages or pays a person extra based on time entered in a timecard. Adjustments can be made based on multiple labor accounts and selection criteria, such as a labor category or cost center, or both.

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 adjustment rule assignments.

Create or update assignments

The create or update request:

  • uses personIdentity to identify the person using their person number
  • uses adjustmentRule inside personAssignments to define the adjustment rule to assign

Example request

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

[
    {
        "personIdentity": {
            "personNumber": "90107"
        },
        "personAssignments": {
            "adjustmentRule": {
                "assignments": [
                    {
                        "effectiveDate": "2020-05-01",
                        "expirationDate": "3000-01-01",
                        "processor": "AR1"
                    }
                ]
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "20335"
        },
        "personAssignments": {
            "adjustmentRule": {
                "assignments": [
                    {
                        "effectiveDate": "2020-05-01",
                        "expirationDate": "2020-05-07",
                        "processor": "AR1"
                    },
                    {
                        "effectiveDate": "2020-05-07",
                        "expirationDate": "3000-01-01",
                        "processor": "AR2"
                    }
                ]
            }
        }
    }
]

Example response

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

[
    {
        "personIdentity": {
            "personNumber": "90107"
        },
        "personAssignments": {
            "adjustmentRule": {
                "assignments": [
                    {
                        "effectiveDate": "2020-05-01",
                        "expirationDate": "3000-01-01",
                        "processor": "AR1"
                    }
                ]
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "20335"
        },
        "personAssignments": {
            "adjustmentRule": {
                "assignments": [
                    {
                        "effectiveDate": "2020-05-01",
                        "expirationDate": "2020-05-07",
                        "processor": "AR1"
                    },
                    {
                        "effectiveDate": "2020-05-07",
                        "expirationDate": "3000-01-01",
                        "processor": "AR2"
                    }
                ]
            }
        }
    }
]

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": [
        "90107","20335"
      ]
    },
    "personAssignments": [
         "adjustmentRule"
    ]
  }
}

Example response

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

[
    {
        "personIdentity": {
            "personNumber": "90107"
        },
        "personAssignments": {
            "adjustmentRule": {
                "assignments": [
                    {
                        "effectiveDate": "2020-05-01",
                        "expirationDate": "3000-01-01",
                        "processor": "AR1"
                    }
                ]
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "20335"
        },
        "personAssignments": {
            "adjustmentRule": {
                "assignments": [
                    {
                        "effectiveDate": "2020-05-01",
                        "expirationDate": "2020-05-07",
                        "processor": "AR1"
                    },
                    {
                        "effectiveDate": "2020-05-07",
                        "expirationDate": "3000-01-01",
                        "processor": "AR2"
                    }
                ]
            }
        }
    }
]

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 adjustment rule assignments.

In the following example, the system makes no changes. Setting an empty assignments array results 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": "90105"
        },
        "personAssignments": {
            "adjustmentRule": {
                "assignments": []
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "20335"
        },
        "personAssignments": {
            "adjustmentRule": {
                "assignments": []
            }
        }
    }
]

Example response

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

[
    {
        "personIdentity": {
            "personNumber": "90105"
        },
        "personAssignments": {
            "adjustmentRule": {
                "assignments": []
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "20335"
        },
        "personAssignments": {
            "adjustmentRule": {
                "assignments": []
            }
        }
    }
]

Delete assignments

You can delete, or unassign, adjustment rule assignments. To delete our example's adjustment rule 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": "90105"
        },
        "personAssignments": {
            "adjustmentRule": {
                "unAssignExisting": true,
                "assignments": []
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "20335"
        },
        "personAssignments": {
            "adjustmentRule": {
                "unAssignExisting": true,
                "assignments": []
            }
        }
    }
]

Example response

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

[
    {
        "personIdentity": {
            "personNumber": "90105"
        },
        "personAssignments": {
            "adjustmentRule": {
                "assignments": []
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "20335"
        },
        "personAssignments": {
            "adjustmentRule": {
                "assignments": []
            }
        }
    }
]

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.