Skip to content

Commit e19e1ed

Browse files
authored
OHRM5X-2191: Add API docs for attendance and dashboard (orangehrm#1691)
1 parent db31fe2 commit e19e1ed

26 files changed

+964
-7
lines changed

src/plugins/orangehrmAttendancePlugin/Api/AttendanceConfigurationAPI.php

+42
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,23 @@ class AttendanceConfigurationAPI extends Endpoint implements ResourceEndpoint
4848
public const PARAMETER_CAN_SUPERVISOR_MODIFY_ATTENDANCE = 'canSupervisorModifyAttendance';
4949

5050
/**
51+
* @OA\Get(
52+
* path="/api/v2/attendance/configs",
53+
* tags={"Attendance/Configuration"},
54+
* @OA\Response(
55+
* response="200",
56+
* description="Success",
57+
* @OA\JsonContent(
58+
* @OA\Property(
59+
* property="data",
60+
* type="object",
61+
* ref="#/components/schemas/Attendance-AttendanceConfigurationModel"
62+
* ),
63+
* @OA\Property(property="meta", type="object")
64+
* )
65+
* )
66+
* )
67+
*
5168
* @inheritDoc
5269
*/
5370
public function getOne(): EndpointResult
@@ -75,6 +92,31 @@ public function getValidationRuleForGetOne(): ParamRuleCollection
7592
}
7693

7794
/**
95+
* @OA\Put(
96+
* path="/api/v2/attendance/configs",
97+
* tags={"Attendance/Configuration"},
98+
* @OA\RequestBody(
99+
* @OA\JsonContent(
100+
* type="object",
101+
* @OA\Property(property="canUserChangeCurrentTime", type="boolean", example="true"),
102+
* @OA\Property(property="canUserModifyAttendance", type="boolean", example="false"),
103+
* @OA\Property(property="canSupervisorModifyAttendance", type="boolean", example="false"),
104+
* )
105+
* ),
106+
* @OA\Response(
107+
* response="200",
108+
* description="Success",
109+
* @OA\JsonContent(
110+
* @OA\Property(
111+
* property="data",
112+
* type="object",
113+
* ref="#/components/schemas/Attendance-AttendanceConfigurationModel"
114+
* ),
115+
* @OA\Property(property="meta", type="object")
116+
* )
117+
* )
118+
* )
119+
*
78120
* @inheritDoc
79121
*/
80122
public function update(): EndpointResult

src/plugins/orangehrmAttendancePlugin/Api/AttendanceEditPunchInRecordOverlapAPI.php

+59
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,65 @@ class AttendanceEditPunchInRecordOverlapAPI extends Endpoint implements Resource
5656
public const PARAMETER_IS_PUNCH_IN_OVERLAP = 'valid';
5757

5858
/**
59+
* @OA\Get(
60+
* path="/api/v2/attendance/records/punch-in-overlaps",
61+
* tags={"Attendance/Attendance Overlap Edit"},
62+
* @OA\Parameter(
63+
* name="recordId",
64+
* in="query",
65+
* required=true,
66+
* @OA\Schema(type="integer")
67+
* ),
68+
* @OA\Parameter(
69+
* name="punchInTimezoneOffset",
70+
* in="query",
71+
* required=true,
72+
* @OA\Schema(type="number")
73+
* ),
74+
* @OA\Parameter(
75+
* name="punchInDate",
76+
* in="query",
77+
* required=true,
78+
* @OA\Schema(type="string", format="date")
79+
* ),
80+
* @OA\Parameter(
81+
* name="punchInTime",
82+
* in="query",
83+
* required=true,
84+
* @OA\Schema(type="string")
85+
* ),
86+
* @OA\Parameter(
87+
* name="punchOutTimezoneOffset",
88+
* in="query",
89+
* required=true,
90+
* @OA\Schema(type="number")
91+
* ),
92+
* @OA\Parameter(
93+
* name="punchOutDate",
94+
* in="query",
95+
* required=false,
96+
* @OA\Schema(type="string", format="date")
97+
* ),
98+
* @OA\Parameter(
99+
* name="punchOutTime",
100+
* in="query",
101+
* required=false,
102+
* @OA\Schema(type="string")
103+
* ),
104+
* @OA\Response(
105+
* response="200",
106+
* description="Success",
107+
* @OA\JsonContent(
108+
* @OA\Property(
109+
* property="data",
110+
* type="object",
111+
* @OA\Property(property="valid", type="boolean")
112+
* ),
113+
* @OA\Property(property="meta", type="object")
114+
* )
115+
* )
116+
* )
117+
*
59118
* @inheritDoc
60119
*/
61120
public function getOne(): EndpointResult

src/plugins/orangehrmAttendancePlugin/Api/AttendanceEditPunchOutRecordOverlapAPI.php

+59
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,65 @@ class AttendanceEditPunchOutRecordOverlapAPI extends Endpoint implements Resourc
5656
public const PARAMETER_IS_PUNCH_OUT_OVERLAP = 'valid';
5757

5858
/**
59+
* @OA\Get(
60+
* path="/api/v2/attendance/records/punch-out-overlaps",
61+
* tags={"Attendance/Attendance Overlap Edit"},
62+
* @OA\Parameter(
63+
* name="recordId",
64+
* in="query",
65+
* required=true,
66+
* @OA\Schema(type="integer")
67+
* ),
68+
* @OA\Parameter(
69+
* name="punchInTimezoneOffset",
70+
* in="query",
71+
* required=true,
72+
* @OA\Schema(type="number")
73+
* ),
74+
* @OA\Parameter(
75+
* name="punchInDate",
76+
* in="query",
77+
* required=true,
78+
* @OA\Schema(type="string", format="date")
79+
* ),
80+
* @OA\Parameter(
81+
* name="punchInTime",
82+
* in="query",
83+
* required=true,
84+
* @OA\Schema(type="string")
85+
* ),
86+
* @OA\Parameter(
87+
* name="punchOutTimezoneOffset",
88+
* in="query",
89+
* required=true,
90+
* @OA\Schema(type="number")
91+
* ),
92+
* @OA\Parameter(
93+
* name="punchOutDate",
94+
* in="query",
95+
* required=true,
96+
* @OA\Schema(type="string", format="date")
97+
* ),
98+
* @OA\Parameter(
99+
* name="punchOutTime",
100+
* in="query",
101+
* required=true,
102+
* @OA\Schema(type="string")
103+
* ),
104+
* @OA\Response(
105+
* response="200",
106+
* description="Success",
107+
* @OA\JsonContent(
108+
* @OA\Property(
109+
* property="data",
110+
* type="object",
111+
* @OA\Property(property="valid", type="boolean")
112+
* ),
113+
* @OA\Property(property="meta", type="object")
114+
* )
115+
* )
116+
* )
117+
*
59118
* @inheritDoc
60119
*/
61120
public function getOne(): EndpointResult

src/plugins/orangehrmAttendancePlugin/Api/AttendancePunchInRecordOverlapAPI.php

+41
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,47 @@ class AttendancePunchInRecordOverlapAPI extends Endpoint implements ResourceEndp
5050
public const PARAMETER_IS_PUNCH_IN_OVERLAP = 'valid';
5151

5252
/**
53+
* @OA\Get(
54+
* path="/api/v2/attendance/punch-in/overlaps",
55+
* tags={"Attendance/Attendance Overlap"},
56+
* @OA\Parameter(
57+
* name="empNumber",
58+
* in="query",
59+
* required=false,
60+
* @OA\Schema(type="integer")
61+
* ),
62+
* @OA\Parameter(
63+
* name="timezoneOffset",
64+
* in="query",
65+
* required=true,
66+
* @OA\Schema(type="number")
67+
* ),
68+
* @OA\Parameter(
69+
* name="date",
70+
* in="query",
71+
* required=true,
72+
* @OA\Schema(type="string", format="date")
73+
* ),
74+
* @OA\Parameter(
75+
* name="time",
76+
* in="query",
77+
* required=true,
78+
* @OA\Schema(type="string")
79+
* ),
80+
* @OA\Response(
81+
* response="200",
82+
* description="Success",
83+
* @OA\JsonContent(
84+
* @OA\Property(
85+
* property="data",
86+
* type="object",
87+
* @OA\Property(property="valid", type="boolean")
88+
* ),
89+
* @OA\Property(property="meta", type="object")
90+
* )
91+
* )
92+
* )
93+
*
5394
* @inheritDoc
5495
*/
5596
public function getOne(): EndpointResult

src/plugins/orangehrmAttendancePlugin/Api/AttendancePunchOutRecordOverlapAPI.php

+41
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,47 @@ class AttendancePunchOutRecordOverlapAPI extends AttendancePunchInRecordOverlapA
3131
public const PARAMETER_IS_PUNCH_OUT_OVERLAP = 'valid';
3232

3333
/**
34+
* @OA\Get(
35+
* path="/api/v2/attendance/punch-out/overlaps",
36+
* tags={"Attendance/Attendance Overlap"},
37+
* @OA\Parameter(
38+
* name="empNumber",
39+
* in="query",
40+
* required=false,
41+
* @OA\Schema(type="integer")
42+
* ),
43+
* @OA\Parameter(
44+
* name="timezoneOffset",
45+
* in="query",
46+
* required=true,
47+
* @OA\Schema(type="number")
48+
* ),
49+
* @OA\Parameter(
50+
* name="date",
51+
* in="query",
52+
* required=true,
53+
* @OA\Schema(type="string", format="date")
54+
* ),
55+
* @OA\Parameter(
56+
* name="time",
57+
* in="query",
58+
* required=true,
59+
* @OA\Schema(type="string")
60+
* ),
61+
* @OA\Response(
62+
* response="200",
63+
* description="Success",
64+
* @OA\JsonContent(
65+
* @OA\Property(
66+
* property="data",
67+
* type="object",
68+
* @OA\Property(property="valid", type="boolean")
69+
* ),
70+
* @OA\Property(property="meta", type="object")
71+
* )
72+
* )
73+
* )
74+
*
3475
* @inheritDoc
3576
*/
3677
public function getOne(): EndpointResult

0 commit comments

Comments
 (0)