Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [x] Pas de régression - [x] TU/TI/TF rédigée - [x] TU/TI/TF OK - [x] CHANGELOG modifié Reviewed-on: #19 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
26 lines
863 B
TypeScript
26 lines
863 B
TypeScript
import type { EmployeeRttSummary } from './dto/employee-rtt-summary'
|
|
|
|
export const getEmployeeRttSummary = async (employeeId: number, year?: number, phaseId?: number) => {
|
|
const api = useApi()
|
|
const query: Record<string, number> = {}
|
|
if (year) query.year = year
|
|
if (phaseId !== undefined) query.phaseId = phaseId
|
|
return api.get<EmployeeRttSummary>(`/employees/${employeeId}/rtt-summary`, query, { toast: false })
|
|
}
|
|
|
|
export const createRttPayment = async (
|
|
employeeId: number,
|
|
month: number,
|
|
base25Minutes: number,
|
|
bonus25Minutes: number,
|
|
base50Minutes: number,
|
|
bonus50Minutes: number,
|
|
year?: number
|
|
) => {
|
|
const api = useApi()
|
|
const body: Record<string, unknown> = { month, base25Minutes, bonus25Minutes, base50Minutes, bonus50Minutes }
|
|
if (year) body.year = year
|
|
return api.patch(`/employees/${employeeId}/rtt-payments`, body)
|
|
}
|
|
|