16 lines
635 B
TypeScript
16 lines
635 B
TypeScript
import type { EmployeeRttSummary } from './dto/employee-rtt-summary'
|
|
|
|
export const getEmployeeRttSummary = async (employeeId: number, year?: number) => {
|
|
const api = useApi()
|
|
const query = year ? { year } : {}
|
|
return api.get<EmployeeRttSummary>(`/employees/${employeeId}/rtt-summary`, query, { toast: false })
|
|
}
|
|
|
|
export const createRttPayment = async (employeeId: number, month: number, minutes: number, rate: '25' | '50', year?: number) => {
|
|
const api = useApi()
|
|
const body: Record<string, unknown> = { month, minutes, rate }
|
|
if (year) body.year = year
|
|
return api.patch(`/employees/${employeeId}/rtt-payments`, body)
|
|
}
|
|
|