This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Inter, a custom Google Font.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
GET /api/food-and-drink
Fetches all food and drink note, by default ordered by when note are indicating not when it is created
limit(number, optional) : The number of data are takenorderIn(string : (desc | asc) = asc, optional): change the default ordering direction
[
...
{
"id": 1,
"category": "drink",
"amount": 1,
"cost": 20000,
"description": "Galon Le Minerale",
"date": "2024-08-01T07:10:06.602Z",
"createdAt": "2024-08-05T07:10:53.258Z",
"updatedAt": "2024-08-05T07:10:53.258Z"
},
...
]GET /api/attendances
Fetches all attendances, by default ordered by created in desc direction
limit(number, optional) : The number of data are takengrouped-name-date(boolean, optional): UNIQUE this will change the return data to be automatically grouped by User->name => {Month Year} => Attendanceof(string, optional) : numbers of user id seperated by comas (,). Will return only attendance of said users.month(number, optional | required): will query only attendance of said month (1 - 12)year(number, optional | required): will query only attendances of said year (if one of month or year are inserted, the other becomes required)type(string, optional) : will query only the specified logs with matching type
[
...
{
"id": 189,
"type": "work_from_office",
"user_id": 5,
"date": "2024-08-06T00:00:00.000Z",
"clock_in_time": "1970-01-01T08:55:51.000Z",
"clock_in_latitude": "-7.6595027",
"clock_in_longitude": "112.7973733",
"created_at": "2024-08-06T01:55:51.000Z",
"updated_at": "2024-08-06T01:55:51.000Z",
"work": [],
"clock_out_time": null,
"clock_out_latitude": null,
"clock_out_longitude": null,
"user": {
...
"job_position" : {...}
}
},
...
]GET /api/attendances/best
This api will return the best employee with the highest score based on attendances and late attendances
{
"Employee name": {
"score": 12,
"totalLate": 2,
"workFromHome": 7,
"attendances": 14
}
}GET /api/attendances/sumarize
Return the latest 5 days attendances (Weekday only)
[
...
{
"total": 5,
"attendances": `Log[]`,
"totalLate": 2,
"date": "2024-12-23",
"latestClockInTime": "09:23:12" | null
}
...
]GET /api/holidays
Fetches all holidays, by default ordered by created in desc direction
No Options
[
...
{
"id": 5,
"date": "2024-07-06T17:00:00.000Z",
"name": "Tahun Baru Hijriah",
"created_at": "2024-07-08T08:51:32.000Z",
"updated_at": "2024-07-08T08:51:32.000Z"
}
...
]GET /api/users
Fetches all users, by default ordered by created in desc direction
role(string:intern|employee): fetch only users with said role, by default fetch all users except adminwithMonthLogs(string:no value): include fetching the logs of current month of each userwithMonthDayOffRequest(string:no value): include day off request of current month of each user
[
...
{
"job_position":
{
"id": 3,
"name": "Intern Developer",
"shift_start": "09:00",
"shift_end": "16:00",
"created_at": "2024-07-01T02:09:21.000Z",
"updated_at": "2024-07-01T02:09:21.000Z",
"work_day": "1,2,3,4,5",
"salary": 0
},
"name": "Dewa Raditya Rochman",
"work_id": "ID008",
"role": "intern",
"job_position_id": 3,
"created_at": "2024-07-01T02:17:42.000Z",
"updated_at": "2024-07-10T01:03:32.000Z",
"gender": "male",
"id": 16,
"profile_picture": null,
"api_profile_picture": null
},
...
]GET /api/images/[...filepath]
Fetches the uploaded image from storage with path of filepath. this api can be directly placed on image src
...filepath(string): fetch the image according to the filepath (...filepath means it can be : /profile/image-name.jpg or /projects/private/image-name.jpg). every/in ..filepath will be considered a directory
Content-type: image/*