Consolida o trabalho desta branch de abril/2026 em um bloco pronto pra testar em staging antes do merge pra main. ## Correções de memória semântica - ExtractionService: Princípio Zero + Regra de Ouro (ação consumada vs intenção). - Cenário Daniela_Reservas: Passo 0 de classificação (consulta/intenção/fora). ## Roleta da Sorte (end-to-end) - Schema Supabase + 7 RPCs atômicas (server-side, idempotentes). - Services: Offer, Redeem, WeeklyReport. - Jobs: OfferRouletteJob (hook em ConfirmationService após Pix pago), NotifyRevealed + Scheduler de fallback. - Tool manual GenerateRoletaLinkTool + endpoint público /roleta/notify. - Dashboard /captain/roleta com Resgate + Relatório + anomaly detection. ## Cenário Reclamacoes_Ouvidoria - Triagem P1-P4, framework LAST, Three-level listening, Self-check. - Sem compensação material, detecção de cliente frustrado eleva prioridade. ## Analytics - Funil de conversão /captain/funnel: 5 etapas via regex, zero LLM. - Detector de churn via ChurnOutreach* (cron dias úteis 10h-17h BRT). ## Trabalho pré-existente incluído - Captain Executive Reports (ceo_digest, mattermost_delivery). - get_reserva_preco_tool, Lifecycle ajustes, Reservations UI polimentos. ## Outros - .gitignore: patterns pra credenciais. - Migrations de scenarios idempotentes. - i18n completa pt_BR+en pra roleta/funnel. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
62 lines
1.9 KiB
JavaScript
62 lines
1.9 KiB
JavaScript
import CaptainReservationsAPI from 'dashboard/api/captain/reservations';
|
|
import { createStore } from '../storeFactory';
|
|
import { throwErrorMessage } from 'dashboard/store/utils/api';
|
|
|
|
export default createStore({
|
|
name: 'CaptainReservation',
|
|
API: CaptainReservationsAPI,
|
|
actions: mutations => ({
|
|
fetchRevenue: async function fetchRevenue(_, params = {}) {
|
|
try {
|
|
const response = await CaptainReservationsAPI.revenue(params);
|
|
return response.data;
|
|
} catch (error) {
|
|
return throwErrorMessage(error);
|
|
}
|
|
},
|
|
create: async function create(_, data) {
|
|
try {
|
|
const response = await CaptainReservationsAPI.create(data);
|
|
return response.data;
|
|
} catch (error) {
|
|
return throwErrorMessage(error);
|
|
}
|
|
},
|
|
fetchPix: async function fetchPix({ commit }, reservationId) {
|
|
commit(mutations.SET_UI_FLAG, { fetchingItem: true });
|
|
try {
|
|
const response = await CaptainReservationsAPI.pix(reservationId);
|
|
return response.data;
|
|
} catch (error) {
|
|
return throwErrorMessage(error);
|
|
} finally {
|
|
commit(mutations.SET_UI_FLAG, { fetchingItem: false });
|
|
}
|
|
},
|
|
cancel: async function cancel(_, { id, reason = '' }) {
|
|
try {
|
|
const response = await CaptainReservationsAPI.cancel(id, reason);
|
|
return response.data;
|
|
} catch (error) {
|
|
return throwErrorMessage(error);
|
|
}
|
|
},
|
|
markAsPaid: async function markAsPaid(_, { id, note = '' }) {
|
|
try {
|
|
const response = await CaptainReservationsAPI.markAsPaid(id, note);
|
|
return response.data;
|
|
} catch (error) {
|
|
return throwErrorMessage(error);
|
|
}
|
|
},
|
|
regeneratePix: async function regeneratePix(_, id) {
|
|
try {
|
|
const response = await CaptainReservationsAPI.regeneratePix(id);
|
|
return response.data;
|
|
} catch (error) {
|
|
return throwErrorMessage(error);
|
|
}
|
|
},
|
|
}),
|
|
});
|