Skip to content

ATG

ATG is a data source from computer applications (like Hanindo's Desktop App) that's integrated with fuel pumps, providing more accurate numerical data. However, errors still occur frequently when the numbers exceed the limit. This module is used to manage ATG data, including the ability to correct data that reseted to 0.

INFO

Make sure to add /api prefix in the API endpoint.

Get Index ATG Endpoint

http
GET /atgs
GET /atgs

Headers

  • Content-Type: application/json
  • Authorization: Bearer {token}

Query Parameters

NameTypeDescription
pageintThe page number to get.
search_fuelintThe fuel id to search.
search_machineintThe machine id to search.
search_tankintThe tank id to search.
searc_per_pageintThe number of items per page.
order_columnstringThe column name to order results by.
order_directionstringThe direction to order results by.

Responses

200 OK
json
{
    "data": [
        {
            "id": 3,
            "user": "Triali Ulfanudin",
            "role": "Kepala Shift",
            "fuel": "Pertalite",
            "hose": 1,
            "machine": "Pulau 1 - A2 R2",
            "tank": "T3 - Pertalite",
            "position": "814484.99",
            "updated_at": "15 September 2023"
        },
        {
            "id": 4,
            "user": "Gunarto",
            "role": "Kepala Shift",
            "fuel": "Pertamax",
            "hose": 2,
            "machine": "Pulau 1 - A2 R2",
            "tank": "T2 - Pertamax",
            "position": "790489.97",
            "updated_at": "15 September 2023"
        },
        // and so on...
    ],
    "links": {
        "first": "http://espbu.test/atgs?page=1",
        "last": "http://espbu.test/atgs?page=5",
        "prev": null,
        "next": "http://espbu.test/atgs?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 5,
        "links": [
            {
                "url": null,
                "label": "« Sebelumnya",
                "active": false
            },
            {
                "url": "http://espbu.test/atgs?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "http://espbu.test/atgs?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "http://espbu.test/atgs?page=3",
                "label": "3",
                "active": false
            },
            {
                "url": "http://espbu.test/atgs?page=4",
                "label": "4",
                "active": false
            },
            {
                "url": "http://espbu.test/atgs?page=5",
                "label": "5",
                "active": false
            },
            {
                "url": "http://espbu.test/atgs?page=2",
                "label": "Berikutnya »",
                "active": false
            }
        ],
        "path": "http://espbu.test/atgs",
        "per_page": 10,
        "to": 10,
        "total": 44
    }
}
{
    "data": [
        {
            "id": 3,
            "user": "Triali Ulfanudin",
            "role": "Kepala Shift",
            "fuel": "Pertalite",
            "hose": 1,
            "machine": "Pulau 1 - A2 R2",
            "tank": "T3 - Pertalite",
            "position": "814484.99",
            "updated_at": "15 September 2023"
        },
        {
            "id": 4,
            "user": "Gunarto",
            "role": "Kepala Shift",
            "fuel": "Pertamax",
            "hose": 2,
            "machine": "Pulau 1 - A2 R2",
            "tank": "T2 - Pertamax",
            "position": "790489.97",
            "updated_at": "15 September 2023"
        },
        // and so on...
    ],
    "links": {
        "first": "http://espbu.test/atgs?page=1",
        "last": "http://espbu.test/atgs?page=5",
        "prev": null,
        "next": "http://espbu.test/atgs?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 5,
        "links": [
            {
                "url": null,
                "label": "« Sebelumnya",
                "active": false
            },
            {
                "url": "http://espbu.test/atgs?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "http://espbu.test/atgs?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "http://espbu.test/atgs?page=3",
                "label": "3",
                "active": false
            },
            {
                "url": "http://espbu.test/atgs?page=4",
                "label": "4",
                "active": false
            },
            {
                "url": "http://espbu.test/atgs?page=5",
                "label": "5",
                "active": false
            },
            {
                "url": "http://espbu.test/atgs?page=2",
                "label": "Berikutnya »",
                "active": false
            }
        ],
        "path": "http://espbu.test/atgs",
        "per_page": 10,
        "to": 10,
        "total": 44
    }
}
401 Unauthorized
json
{
    "message": "Unauthenticated."
}
{
    "message": "Unauthenticated."
}
403 Forbidden

Possibilities:

  • User don't have permission to access the endpoint
json
{
	"message": "This action is unauthorized"
}
{
	"message": "This action is unauthorized"
}
404 Not Found
json
{
    "message": "ATG tidak ditemukan",
    "data": []
}
{
    "message": "ATG tidak ditemukan",
    "data": []
}

Used on pages

  • /atgs

Get Show ATG Endpoint

http
GET /atgs/{id}
GET /atgs/{id}

Headers

  • Content-Type: application/json
  • Authorization: Bearer {token}

Path Variable

NameTypeDescription
idintATG ID

Responses

200 OK
json
{
    "message": "Hasil ditemukan",
    "data": {
        "id": 4,
        "user": "Gunarto",
        "fuel_id": null,
        "fuel": "Pertamax",
        "machine_id": null,
        "machine": "Pulau 1 - A2 R2",
        "tank": {
            "id": 2,
            "name": "T2 - Pertamax",
            "fuel_id": 2,
            "profit": "0.0000",
            "created_at": null,
            "updated_at": "2023-09-15T06:58:29.000000Z",
            "bussiness_unit_id": null
        },
        "position": 790489.97,
        "created_at_idn": "16 November 2022",
        "updated_at_idn": "16 November 2022",
        "updated_at": "15 September 2023",
        "atgTimelines": [
            {
                "id": 470,
                "user": "Gunarto",
                "role": "Kepala Shift",
                "prev_position": 764417.72,
                "next_position": 764587.86,
                "created_at_idn": "25 Februari 2023"
            },
            {
                "id": 432,
                "user": "Gunarto",
                "role": "Kepala Shift",
                "prev_position": 764044.79,
                "next_position": 764378.76,
                "created_at_idn": "24 Februari 2023"
            },
            {
                "id": 394,
                "user": "Gunarto",
                "role": "Kepala Shift",
                "prev_position": 763668.91,
                "next_position": 764044.79,
                "created_at_idn": "22 Februari 2023"
            },
            {
                "id": 362,
                "user": "Gunarto",
                "role": "Kepala Shift",
                "prev_position": 763239.61,
                "next_position": 763652.51,
                "created_at_idn": "20 Februari 2023"
            },
            {
                "id": 335,
                "user": "Achmad Arifin",
                "role": "Kepala Shift",
                "prev_position": 763088.97,
                "next_position": 763239.61,
                "created_at_idn": "18 Februari 2023"
            }
        ]
    }
}
{
    "message": "Hasil ditemukan",
    "data": {
        "id": 4,
        "user": "Gunarto",
        "fuel_id": null,
        "fuel": "Pertamax",
        "machine_id": null,
        "machine": "Pulau 1 - A2 R2",
        "tank": {
            "id": 2,
            "name": "T2 - Pertamax",
            "fuel_id": 2,
            "profit": "0.0000",
            "created_at": null,
            "updated_at": "2023-09-15T06:58:29.000000Z",
            "bussiness_unit_id": null
        },
        "position": 790489.97,
        "created_at_idn": "16 November 2022",
        "updated_at_idn": "16 November 2022",
        "updated_at": "15 September 2023",
        "atgTimelines": [
            {
                "id": 470,
                "user": "Gunarto",
                "role": "Kepala Shift",
                "prev_position": 764417.72,
                "next_position": 764587.86,
                "created_at_idn": "25 Februari 2023"
            },
            {
                "id": 432,
                "user": "Gunarto",
                "role": "Kepala Shift",
                "prev_position": 764044.79,
                "next_position": 764378.76,
                "created_at_idn": "24 Februari 2023"
            },
            {
                "id": 394,
                "user": "Gunarto",
                "role": "Kepala Shift",
                "prev_position": 763668.91,
                "next_position": 764044.79,
                "created_at_idn": "22 Februari 2023"
            },
            {
                "id": 362,
                "user": "Gunarto",
                "role": "Kepala Shift",
                "prev_position": 763239.61,
                "next_position": 763652.51,
                "created_at_idn": "20 Februari 2023"
            },
            {
                "id": 335,
                "user": "Achmad Arifin",
                "role": "Kepala Shift",
                "prev_position": 763088.97,
                "next_position": 763239.61,
                "created_at_idn": "18 Februari 2023"
            }
        ]
    }
}
401 Unauthorized
json
{
    "message": "Unauthenticated."
}
{
    "message": "Unauthenticated."
}
403 Forbidden

Possibilities:

  • User don't have permission to access the endpoint
json
{
  "message": "This action is unauthorized"
}
{
  "message": "This action is unauthorized"
}
404 Not Found
json
{
    "message": "ATG tidak ditemukan",
    "data": []
}
{
    "message": "ATG tidak ditemukan",
    "data": []
}

Used on pages

  • /atgs/show/{id}

Create ATG Endpoint

http
POST /atgs
POST /atgs

Headers

  • Content-Type: application/json
  • Authorization: Bearer {token}

Body

json
{
  "meter_id": 1,
  "tank_id": 1,
  "position": 123456.78
}
{
  "meter_id": 1,
  "tank_id": 1,
  "position": 123456.78
}
NameTypeDescription
meter_idintThe meter id of the ATG.
tank_idintThe tank id of the ATG.
positionfloatThe position of the ATG.

Responses

201 Created
json
{
  "message": "ATG berhasil dibuat"
}
{
  "message": "ATG berhasil dibuat"
}
401 Unauthorized
json
{
    "message": "Unauthenticated."
}
{
    "message": "Unauthenticated."
}
403 Forbidden

Possibilities:

  • User don't have permission to access the endpoint
json
{
  "message": "This action is unauthorized"
}
{
  "message": "This action is unauthorized"
}
422 Unprocessable Entity

Possibilities:

  • Validations error
json
{
    "message": "The given data was invalid.",
    "errors": {
        "meter_id": [
            "The meter id field is required."
        ],
        "tank_id": [
            "The tank id field is required."
        ],
        "position": [
            "The position field is required."
        ]
    }
}
{
    "message": "The given data was invalid.",
    "errors": {
        "meter_id": [
            "The meter id field is required."
        ],
        "tank_id": [
            "The tank id field is required."
        ],
        "position": [
            "The position field is required."
        ]
    }
}

Used on pages

  • /atgs/create

Update ATG Endpoint

http
PUT /atgs/{id}
PUT /atgs/{id}

Headers

  • Content-Type: application/json
  • Authorization: Bearer {token}

Body

json
{
  "position": 123456.78
}
{
  "position": 123456.78
}
NameTypeDescriptionNullable
positionfloatThe position of the ATG.false

Responses

200 OK
json
{
  "message": "ATG berhasil diupdate"
}
{
  "message": "ATG berhasil diupdate"
}
401 Unauthorized
json
{
    "message": "Unauthenticated."
}
{
    "message": "Unauthenticated."
}
403 Forbidden

Possibilities:

  • User don't have permission to access the endpoint
json
{
  "message": "This action is unauthorized"
}
{
  "message": "This action is unauthorized"
}
422 Unprocessable Entity

Possibilities:

  • Validations error
json
{
    "message": "The given data was invalid.",
    "errors": {
        "position": [
            "The position field is required."
        ]
    }
}
{
    "message": "The given data was invalid.",
    "errors": {
        "position": [
            "The position field is required."
        ]
    }
}

Used on pages

  • /atgs/edit/{id}

Get ATG Options Endpoint

http
GET /atgs/select
GET /atgs/select

Headers

  • Content-Type: application/json
  • Authorization: Bearer {token}

Responses

200 OK
json
{
    "data": [
        {
            "id": 2,
            "text": "Pulau 1 - A1 R2 - T2 - Pertamax - 234180.93 L"
        },
        {
            "id": 1,
            "text": "Pulau 1 - A1 R2 - T3 - Pertalite - 618732.23 L"
        },
        {
            "id": 4,
            "text": "Pulau 1 - A2 R2 - T2 - Pertamax - 790489.97 L"
        },
        {
            "id": 3,
            "text": "Pulau 1 - A2 R2 - T3 - Pertalite - 814484.99 L"
        },
        {
            "id": 19,
            "text": "Pulau 2 - A1 - T1 - Pertamina Dex - 193231.32 L"
        },
        {
            "id": 17,
            "text": "Pulau 2 - A1 - T2 - Pertamax - 944544.77 L"
        },
        {
            "id": 6,
            "text": "Pulau 2 - A1 - T3 - Pertalite - 358543.97 L"
        },
        // and so on...
    ]
}
{
    "data": [
        {
            "id": 2,
            "text": "Pulau 1 - A1 R2 - T2 - Pertamax - 234180.93 L"
        },
        {
            "id": 1,
            "text": "Pulau 1 - A1 R2 - T3 - Pertalite - 618732.23 L"
        },
        {
            "id": 4,
            "text": "Pulau 1 - A2 R2 - T2 - Pertamax - 790489.97 L"
        },
        {
            "id": 3,
            "text": "Pulau 1 - A2 R2 - T3 - Pertalite - 814484.99 L"
        },
        {
            "id": 19,
            "text": "Pulau 2 - A1 - T1 - Pertamina Dex - 193231.32 L"
        },
        {
            "id": 17,
            "text": "Pulau 2 - A1 - T2 - Pertamax - 944544.77 L"
        },
        {
            "id": 6,
            "text": "Pulau 2 - A1 - T3 - Pertalite - 358543.97 L"
        },
        // and so on...
    ]
}
401 Unauthorized
json
{
    "message": "Unauthenticated."
}
{
    "message": "Unauthenticated."
}
403 Forbidden

Possibilities:

  • User don't have permission to access the endpoint
json
{
  "message": "This action is unauthorized"
}
{
  "message": "This action is unauthorized"
}

Released under the MIT License.