Locations

Locations is the master data to store the name of the area or city and the minimum wage per year.

GET/v1/locations

List locations

This endpoint allows you to retrieve a paginated list of all your locations.

Request

Optional query

  • Name
    page
    Type
    integer
    Description

    The page number of locations returned.

    • Default 1
  • Name
    page_size
    Type
    integer
    Description

    The page size number of locations returned.

    • Default 10

Response

  • Name
    data
    Type
    array<object>
    Description

    Array of location object

  • Name
    data._id
    Type
    string
    Description

    Unique identifier for the location.

  • Name
    data.name
    Type
    string
    Description

    The name for the location.

  • Name
    data.minimum_wages
    Type
    array<object>
    Description

    The array of minimum wage per year for the location.

  • Name
    data.minimum_wages.year
    Type
    number
    Description

    The minimum wage year.

  • Name
    data.minimum_wages.value
    Type
    number
    Description

    The minimum wage value.

  • Name
    data.minimum_wages.notes
    Type
    string
    Description

    The additional notes.

  • Name
    data.created_at
    Type
    datetime
    Description

    Datetime of when the location was created.

  • Name
    data.created_by
    Type
    string
    Description

    User identifier who create the location.

  • Name
    data.updated_at
    Type
    datetime
    Description

    Datetime of when the location was updated.

  • Name
    data.updated_by
    Type
    string
    Description

    User identifier who update the location.

  • Name
    pagination
    Type
    object
    Description

    Object of Pagination

  • Name
    pagination.page
    Type
    number
    Description

    Page number.

  • Name
    pagination.page_size
    Type
    number
    Description

    Number of total document per page.

  • Name
    pagination.page_count
    Type
    number
    Description

    Total page count.

  • Name
    pagination.total_document
    Type
    number
    Description

    Total filtered document.

Request

GET
/v1/locations
const response = axios.get('/v1/locations', {
  params: {
    page:1,
    page_size: 10
  }
})

Response

{
  "data": [
    {
      "_id": "637b569149e0c02e1036c35a",
      "name": "Surabaya",
      "minimum_wages": [
        {
          "year": 2024,
          "value": 4300000,
        },
        {
          "year": 2025,
          "value": 4500000,
        },
      ],
      "created_by": "637d83d15d2be122007524bf",
      "created_at": "2022-01-01T00:00:00.000Z",
    },
  ],
  "pagination": {
    "page": 1,
    "page_size": 1,
    "page_count": 1,
    "total_document": 2
  }
}

POST/v1/locations

Create location

This endpoint allows you to add a new location.

Request

Required attributes

  • Name
    name
    Type
    string
    Description

    The name for the location.

  • Name
    minimum_wages
    Type
    array<object>
    Description

    The array of minimum wage per year for the location.

  • Name
    minimum_wages.year
    Type
    number
    Description

    The minimum wage year.

  • Name
    minimum_wages.value
    Type
    number
    Description

    The minimum wage value.

Optional attributes

  • Name
    minimum_wages.notes
    Type
    string
    Description

    Optional notes.

Response

  • Name
    _id
    Type
    string
    Description

    Unique identifier for the location.

Request

POST
/v1/locations
const response = axios.post('/v1/locations', {
  name: "Surabaya",
  minimum_wages: [
    {
      year: 2024,
      value: 4300000,
    },
    {
      year: 2025,
      value: 4500000,
    },
  ],
  notes: ""
})

Response

{
  "inserted_id": "637d83d15d2be122007524bf"
}

GET/v1/locations/:id

Retrieve location

This endpoint allows you to retrieve a location by providing their id.

Response

  • Name
    _id
    Type
    string
    Description

    Unique identifier for the location.

  • Name
    name
    Type
    string
    Description

    The name for the location.

  • Name
    minimum_wages
    Type
    array<object>
    Description

    The array of minimum wage per year for the location.

  • Name
    minimum_wages.year
    Type
    number
    Description

    The minimum wage year.

  • Name
    minimum_wages.value
    Type
    number
    Description

    The minimum wage value.

  • Name
    minimum_wages.notes
    Type
    string
    Description

    The additional notes.

  • Name
    created_at
    Type
    datetime
    Description

    Datetime of when the location was created.

  • Name
    created_by
    Type
    string
    Description

    User identifier who create the location.

  • Name
    updated_at
    Type
    datetime
    Description

    Datetime of when the location was updated.

  • Name
    updated_by
    Type
    string
    Description

    User identifier who update the location.

Request

GET
/v1/locations/:id
const response = axios.get('/v1/locations/637d83d15d2be122007524bf')

Response

{
  "_id": "637d83d15d2be122007524bf",
  "name": "Surabaya",
  "minimum_wages": [
    {
      "year": 2024,
      "value": 4300000,
    },
    {
      "year": 2025,
      "value": 4500000,
    },
  ],
  "created_by": "637d83d15d2be122007524bf",
  "created_at": "2022-01-01T00:00:00.000Z",
}

PATCH/v1/locations/:id

Update location

This endpoint allows you to perform an update on a location.

Request

Required attributes

  • Name
    name
    Type
    string
    Description

    The name for the location.

  • Name
    minimum_wages
    Type
    array<object>
    Description

    The array of minimum wage per year for the location.

  • Name
    minimum_wages.year
    Type
    number
    Description

    The minimum wage year.

  • Name
    minimum_wages.value
    Type
    number
    Description

    The minimum wage value.

Optional attributes

  • Name
    minimum_wages.notes
    Type
    string
    Description

    Optional notes.

Request

PATCH
/v1/locations/:id
const response = axios.patch('/v1/locations/637d83d15d2be122007524bf', {
  name: "Surabaya",
  minimum_wages: [
    {
      year: 2024,
      value: 4300000,
    },
    {
      year: 2025,
      value: 4500000,
    },
  ],
  notes: ""
})

Response

{
  "matched_count": 1,
  "modified_count": 1
}

DELETE/v1/locations/:id

Delete location

This endpoint allows you to delete locations from your location list.

Request

DELETE
/v1/locations/:id
const response = axios.delete('/v1/locations/637d83d15d2be122007524bf')

Response

{
  "deleted_count": 1
}