feat(dashboard): painel Rafael — meta, comissão, inativos, pedidos recentes (C7)
GET /dashboard/rep retorna meta mensal, comissão (fixa + FLEX), clientes inativos >30 dias e pedidos dos últimos 7 dias. RepTarget model com migration. RafaelPainel conectado à API real via useRepDashboard(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "RepTarget" (
|
||||
"repId" TEXT NOT NULL,
|
||||
"year" INTEGER NOT NULL,
|
||||
"month" INTEGER NOT NULL,
|
||||
"targetAmount" DECIMAL(15,2) NOT NULL,
|
||||
"commissionRate" DECIMAL(5,2) NOT NULL DEFAULT 3,
|
||||
"flexRate" DECIMAL(5,2) NOT NULL DEFAULT 1,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "RepTarget_pkey" PRIMARY KEY ("repId","year","month")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "RepTarget_repId_idx" ON "RepTarget"("repId");
|
||||
Reference in New Issue
Block a user