(Feat): More changes
This commit is contained in:
@@ -166,6 +166,57 @@ class ApiService {
|
||||
return this.request<any[]>(`/attendance/summary/stats${query ? `?${query}` : ''}`);
|
||||
}
|
||||
|
||||
async updateAttendanceStatus(id: number, status: string, remark?: string) {
|
||||
return this.request<any>(`/attendance/${id}/status`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ status, remark }),
|
||||
});
|
||||
}
|
||||
|
||||
async markAbsent(employeeId: number, workDate: string, remark?: string) {
|
||||
return this.request<any>('/attendance/mark-absent', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ employeeId, workDate, remark }),
|
||||
});
|
||||
}
|
||||
|
||||
// Employee Swaps
|
||||
async getEmployeeSwaps(params?: { status?: string; employeeId?: number; startDate?: string; endDate?: string }) {
|
||||
const query = params ? new URLSearchParams(params as any).toString() : '';
|
||||
return this.request<any[]>(`/employee-swaps${query ? `?${query}` : ''}`);
|
||||
}
|
||||
|
||||
async getEmployeeSwap(id: number) {
|
||||
return this.request<any>(`/employee-swaps/${id}`);
|
||||
}
|
||||
|
||||
async createEmployeeSwap(data: {
|
||||
employeeId: number;
|
||||
targetDepartmentId: number;
|
||||
targetContractorId?: number;
|
||||
swapReason: string;
|
||||
reasonDetails?: string;
|
||||
workCompletionPercentage?: number;
|
||||
swapDate: string;
|
||||
}) {
|
||||
return this.request<any>('/employee-swaps', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
}
|
||||
|
||||
async completeEmployeeSwap(id: number) {
|
||||
return this.request<any>(`/employee-swaps/${id}/complete`, {
|
||||
method: 'PUT',
|
||||
});
|
||||
}
|
||||
|
||||
async cancelEmployeeSwap(id: number) {
|
||||
return this.request<any>(`/employee-swaps/${id}/cancel`, {
|
||||
method: 'PUT',
|
||||
});
|
||||
}
|
||||
|
||||
// Contractor Rates
|
||||
async getContractorRates(params?: { contractorId?: number; subDepartmentId?: number }) {
|
||||
const query = params ? new URLSearchParams(params as any).toString() : '';
|
||||
|
||||
Reference in New Issue
Block a user