End Date

When end dating a record, you need to provide an empty payload. This table shows the required date effective header parameters and the criteria to perform a PATCH End Date operation on date effective objects.

Header Attribute Applicable Required Default Value Criteria

RangeStartDate

No

NA

NA

NA

RangeEndDate

Yes

Yes

NA

You must provide the RangeEndDate value between EffectiveStartDate and EffectiveEndDate of the record in context.

For MCPD record, the latest changed record is end dated.

RangeMode

Yes

Yes

NA

You must provide the value END_DATE.

RangeSpan

No

NA

NA

NA

RangeStartSequence (MCPD Only)

No

NA

NA

NA

RangeEndSequence (MCPD Only)

No

NA

NA

NA

Examples

Let's look at some examples of PATCH End date operations performed on the visasPermits child resource of workers to end date records for date effective objects.

Let's say that Mark has two visa records, as shown in the table. Each row represents a physical record with an effective start date and an effective end date. This sample data is used in the following examples to retrieve the appropriate records, based on the context date provided, and end date them.

Physical Record Effective Start Date Effective End Date Visa

1

2016-01-01

4712-12-31

V1

1

2016-01-01

2016-12-31

V2

2

2017-01-01

2017-12-31

V2

3

2018-01-01

2018-12-31

V2

4

2019-01-01

4712-12-31

V2

Example 1

Let's get Mark's worker record effective as of 2019-02-25 and obtain the visa record to be end dated.

  1. Retrieve the worker record by performing a GET operation on the workers resource, providing the effectiveDate parameter in the URL.
    GET
    
    /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2019-02-25
  2. Obtain the visasPermits child singular link from the response.
  3. Perform a PATCH operation on the visasPermits child link by providing the RangeMode and RangeEndDate in the effective-Of header attribute, and an empty payload in the request body.
    PATCH
    
    /hcmRestApi/resources/11.13.18.05/workers/{workersUniqID}/child/visasPermits/{VisaPermitId}

    Header

    REST-Framework-Version : 4
    Content-Type : application/vnd.oracle.adf.resourceitem+json
    effective-Of : RangeMode=END_DATE;RangeEndDate=2020-12-31 

    Sample Request

    {
    
    }
  4. Verify the details returned in the response. The visa record as of 2019-02-25 is retrieved and end dated with the RangeEndDate (2020-12-31).
    Before End Date   After End Date
    Physical Record Effective Start Date Effective End Date Visa Physical Record Effective Start Date Effective End Date Visa

    1

    2016-01-01

    4712-12-31

    V1

     

    1

    2016-01-01

    2020-12-31

    V1

Example 2

Let's get Mark's worker record effective as of 2019-02-25 and obtain the visa record to be end dated.

  1. Retrieve the worker record by performing a GET operation on the workers resource, providing the effectiveDate parameter in the URL.
    GET
    
    /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2019-02-25
  2. Obtain the visasPermits child singular link from the response.
  3. Perform a PATCH operation on the visasPermits child link by providing the RangeMode and RangeEndDate in the effective-Of header attribute, and an empty payload in the request body.
    PATCH
    
    /hcmRestApi/resources/11.13.18.05/workers/{workersUniqID}/child/visasPermits/{VisaPermitId}

    Header

    REST-Framework-Version : 4
    Content-Type : application/vnd.oracle.adf.resourceitem+json
    effective-Of : RangeMode=END_DATE;RangeEndDate=2019-03-31

    Sample Request

    {
    
    }
  4. Verify the details returned in the response. The visa record effective as of 2019-02-25 is retrieved and end dated with the RangeEndDate (2019-12-31).
    Before End Date   After End Date
    Physical Record Effective Start Date Effective End Date Visa Physical Record Effective Start Date Effective End Date Visa

    1

    2016-01-01

    2016-12-31

    V2

     

    1

    2016-01-01

    2016-12-31

    V2

    2

    2017-01-01

    2017-12-31

    V2

    2

    2017-01-01

    2017-12-31

    V2

    3

    2018-01-01

    2018-12-31

    V2

    3

    2018-01-01

    2018-12-31

    V2

    4

    2019-01-01

    4712-12-31

    V2

    4

    2019-01-01

    2019-03-31

    V2