Skip to content

fix(wake): faturamento defaults its comparison; document dashboard buckets and order sort - #604

Merged
thalesvf merged 1 commit into
mainfrom
fix/wake-dashboard-comparison
Nov 26, 2026
Merged

thalesvf merged 1 commit into
mainfrom
fix/wake-dashboard-comparison

Conversation

@thalesvf

@thalesvf thalesvf commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Why

I tested #600 against a live store right after its deploy (1.1.0). Every new tool answered, but three things needed a fix or a word in the docs:

  1. WAKE_DASHBOARD faturamento failed with HTTP 422 whenever the caller gave no comparison period: Wake requires dataInicialComparativo and dataFinalComparativo.
  2. The dashboard buckets don't all mean the same thing, and nothing said so:
    • captados is by order date. For one day it matched WAKE_LIST_ORDERS exactly, in count and in revenue, also when summed across the 24 hourly buckets.
    • cancelados matched the orders that moved to a canceled status that day (enumTipoFiltroData=DataModificacaoStatus, statuses 3–8), whenever they were placed. So pagos, enviados and cancelados are event-dated.
    • carrinhoAbandonado leaves out dataFinal: a range that starts and ends on the same day returns 0.
  3. /pedidos sorts by the order date (data) whatever enumTipoFiltroData says. The tool description implied it sorted by the filter date.

What

  • faturamento now compares with the same number of days just before (previousPeriod) when no comparison dates are given. Explicit dates still win.
  • WAKE_DASHBOARD's description, the field descriptions and the README say which buckets are by order date and which are event-dated, and note the carrinhoAbandonado end-date behaviour.
  • WAKE_LIST_ORDERS describes the sort order correctly.
  • Version bumped to 1.1.1.

Verified

  • bun test (wake): 24 pass. That includes previousPeriod, for a single day and for a range that crosses a month.
  • scripts/check.ts wake, oxfmt --check, oxlint (the only wake warning predates this) and check:registry are clean.
  • The bucket behaviour above was measured live on 1.1.0. After deploy I'll call faturamento without comparison dates on the same connection.

🤖 Generated with Claude Code


Summary by cubic

Fixes the Wake WAKE_DASHBOARD faturamento tool failing with HTTP 422 when no comparison period is given, and documents the actual semantics of dashboard buckets and list ordering.

  • faturamento now defaults to the period of equal length immediately before; explicit comparison dates still win.
  • Documents that only captados counts by order date; pagos, enviados, and cancelados count orders that reached that state in the bucket, and that carrinhoAbandonado ignores dataFinal.
  • WAKE_LIST_ORDERS now states that rows always sort by the order date, regardless of the date filter.

Written for commit d71bcd3. Summary will update on new commits.

View guided diff Turn on auto-fix

…ckets and order sort

Tested against a live store after #600:
- /dashboard/faturamento answers 422 without a comparison period, so
  WAKE_DASHBOARD now compares with the same number of days just before
  unless dataInicialComparativo/dataFinalComparativo are given.
- Only `captados` is by order date (it matched WAKE_LIST_ORDERS for a day,
  count and revenue). `cancelados` matched the orders moved to a canceled
  status that day, so pagos/enviados/cancelados are event-dated.
- carrinhoAbandonado leaves dataFinal out (same day → 0).
- /pedidos sorts by the order date whatever enumTipoFiltroData.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@deco-hosting
deco-hosting Bot temporarily deployed to preview/pr-604/wake November 26, 2026 21:34 Destroyed
@thalesvf
thalesvf merged commit 76690ea into main Nov 26, 2026
2 of 3 checks passed

This branch was successfully deployed

No deployments
preview/pr-604/wake — d71bcd3c Deployed Nov 26, 2026 by deco-hosting[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants