Procházet zdrojové kódy

chore: muda nome de campos e deixa alguns texto capitalizados

Gustavo Mantovani před 1 dnem
rodič
revize
90ccc5aa1f

+ 27 - 15
src/helpers/buildMetricCards.js

@@ -5,6 +5,12 @@ import {
   formatPercent,
 } from "./utils";
 
+const capitalize = (text) => {
+  if (!text) return text;
+
+  return text.charAt(0).toLocaleUpperCase("pt-BR") + text.slice(1);
+};
+
 export function buildMetricCards(summary, options = {}) {
   const { isAllPropertiesSelected = false, referenceLabel = "" } = options;
 
@@ -25,47 +31,47 @@ export function buildMetricCards(summary, options = {}) {
     ? "percentual do período"
     : `${formatInteger(summary.occupied_nights_in_month)} de ${formatInteger(summary.days_in_month)} dias`;
 
-  return [
+  const cards = [
     // INDICADORES
 
     {
-      label: "Ocupação",
+      label: "ocupação",
       value: formatPercent(summary.occupancy_rate, 1),
       caption: occupancyCaption,
     },
 
     {
-      label: "Total de Reservas",
+      label: "total de reservas",
       value: formatInteger(summary.reservations_count),
       caption: "no período",
     },
 
     {
-      label: "Dias por Reserva",
+      label: "dias por reserva",
       value: formatDecimal(summary.average_nights_per_reservation),
       caption: "média de permanência",
     },
 
     {
-      label: "Diária Média",
+      label: "diária média",
       value: formatCurrency(summary.average_price_per_night),
       caption: "Bruto ÷ diárias",
     },
 
     {
-      label: "Limpezas",
+      label: "limpezas",
       value: formatInteger(summary.cleanings_count),
       caption: "total no período",
     },
 
     {
-      label: "Manutenção",
+      label: "manutenção",
       value: formatCurrency(maintenanceExpenseAmount),
       caption: "despesas manuais",
     },
 
     {
-      label: "Ticket Médio/Reserva",
+      label: "ticket médio/reserva",
       value: formatCurrency(summary.average_reservation_ticket),
       caption: isAllPropertiesSelected
         ? "Todos apartamentos"
@@ -75,47 +81,53 @@ export function buildMetricCards(summary, options = {}) {
     // FINANCEIRO
 
     {
-      label: "Faturamento",
+      label: "faturamento bruto",
       value: formatCurrency(summary.gross_revenue),
       caption: referenceLabel || "Mês selecionado",
     },
 
     {
-      label: "OTA",
+      label: "ota",
       value: formatCurrency(summary.ota_amount),
       caption: "taxas plataformas",
     },
 
     {
-      label: "Faturamento Líquido",
+      label: "faturamento líquido",
       value: formatCurrency(summary.net_revenue_amount),
       caption: "Bruto - OTA",
     },
 
     {
-      label: "Total Limpeza",
+      label: "total limpeza",
       value: formatCurrency(summary.cleaning_total_amount),
       caption: "taxa de limpeza",
     },
 
     {
-      label: "Gestão Kizzo",
+      label: "gestão kizzo",
       value: formatCurrency(summary.management_fee_amount),
       caption: "comissão gestão",
     },
 
     {
-      label: "Despesas",
+      label: "despesas",
       value: formatCurrency(displayedExpenses),
       caption: "inclui OTA",
     },
 
     {
-      label: "Repasse",
+      label: "repasse",
       value: formatCurrency(summary.payout_amount),
       caption: isAllPropertiesSelected
         ? "Todos apartamentos"
         : "No imóvel selecionado",
     },
   ];
+
+  return cards.map((card) => ({
+    ...card,
+    label: capitalize(card.label),
+    caption: capitalize(card.caption),
+  }));
 }

+ 1 - 1
src/pages/dashboard/components/DashboardRevenuePanel.vue

@@ -1,6 +1,6 @@
 <template>
   <q-card class="panel-card panel-card--soft" flat>
-    <div class="panel-title">Evolução do Faturamento</div>
+    <div class="panel-title">Evolução do Faturamento Bruto</div>
 
     <div class="line-chart-wrap">
       <Line :data="chartData" :options="chartOptions" />