testes/src_2/features/prafrot/services/prafrotStatisticsService.js

78 lines
2.6 KiB
JavaScript

import api from '@/services/api';
import { handleRequest } from '@/services/serviceUtils';
const ENDPOINTS = {
TOTAL_PLACAS: '/dashs_frota/cadastro_frota/total_placas',
PLACAS_POR_BASE: '/dashs_frota/cadastro_frota/placas_por_base',
PLACAS_POR_ANO: '/dashs_frota/cadastro_frota/placas_por_ano',
PLACAS_POR_CATEGORIA: '/dashs_frota/cadastro_frota/placas_por_categoria',
PLACAS_POR_MODELO: '/dashs_frota/cadastro_frota/placas_por_modelo',
PLACAS_POR_TIPO: '/dashs_frota/cadastro_frota/placas_por_tipo',
PLACAS_POR_STATUS: '/dashs_frota/status_frota/placas_por_status',
PLACAS_POR_MANUTENCAO: '/dashs_frota/status_frota/placas_por_manutencao',
PLACAS_POR_PROPRIETARIO: '/dashs_frota/status_frota/placas_por_proprietario',
PLACAS_POR_DISPONIBILIDADE: '/dashs_frota/disponibilidade/placas',
PLACAS_POR_UNIDADE: '/dashs_frota/monitoramento/placas_por_unidade',
PLACAS_POR_SINISTRO: '/dashs_frota/sinistro/placas_por_status',
PLACAS_POR_MANUTENCAO_STATUS: '/dashs_frota/manutencao/placas_por_manutencao_status',
QUANTITATIVO_MANUTENCAO: '/quantitativo_manutencao'
};
export const prafrotStatisticsService = {
getTotalPlacas: () => handleRequest({
apiFn: () => api.get(ENDPOINTS.TOTAL_PLACAS)
}),
getPlacasPorBase: () => handleRequest({
apiFn: () => api.get(ENDPOINTS.PLACAS_POR_BASE)
}),
getPlacasPorAno: () => handleRequest({
apiFn: () => api.get(ENDPOINTS.PLACAS_POR_ANO)
}),
getPlacasPorCategoria: () => handleRequest({
apiFn: () => api.get(ENDPOINTS.PLACAS_POR_CATEGORIA)
}),
getPlacasPorModelo: () => handleRequest({
apiFn: () => api.get(ENDPOINTS.PLACAS_POR_MODELO)
}),
getPlacasPorTipo: () => handleRequest({
apiFn: () => api.get(ENDPOINTS.PLACAS_POR_TIPO)
}),
getPlacasPorStatus: () => handleRequest({
apiFn: () => api.get(ENDPOINTS.PLACAS_POR_STATUS)
}),
getPlacasPorManutencao: () => handleRequest({
apiFn: () => api.get(ENDPOINTS.PLACAS_POR_MANUTENCAO)
}),
getPlacasPorProprietario: () => handleRequest({
apiFn: () => api.get(ENDPOINTS.PLACAS_POR_PROPRIETARIO)
}),
getPlacasPorDisponibilidade: () => handleRequest({
apiFn: () => api.get(ENDPOINTS.PLACAS_POR_DISPONIBILIDADE)
}),
getPlacasPorUnidade: () => handleRequest({
apiFn: () => api.get(ENDPOINTS.PLACAS_POR_UNIDADE)
}),
getPlacasPorSinistro: () => handleRequest({
apiFn: () => api.get(ENDPOINTS.PLACAS_POR_SINISTRO)
}),
getPlacasPorManutencaoStatus: () => handleRequest({
apiFn: () => api.get(ENDPOINTS.PLACAS_POR_MANUTENCAO_STATUS)
}),
getQuantitativoManutencao: () => handleRequest({
apiFn: () => api.get(ENDPOINTS.QUANTITATIVO_MANUTENCAO)
})
};