# WDS Project Outline — SAR
# Generated by skill:wds-0-project-setup on 2026-05-26
# DO NOT MODIFY — source of truth for project configuration

project:
  name: SAR
  full_name: "SAR — Força de Vendas"
  company: JCS Sistemas
  type: greenfield
  product_complexity: complex
  product_kind: web-application
  created: 2026-05-26
  language: pt-BR

tech:
  stack: react
  stack_reference: STACK.md  # canon JCS v2.2 (2026-05-24)
  details:
    runtime: Node 24 LTS · pnpm 11.1 · TypeScript 5.9
    monorepo: Nx 22.7
    backend: NestJS 11.1 (Express 5) · Prisma 7 · PostgreSQL 18
    frontend: React 19.2 + Compiler · Vite 8 (Rolldown) · TanStack Query/Router · Zustand
    api: REST + OpenAPI 3.1 + Zod 4 + nestjs-zod + react-hook-form
    auth: master-login (IdP OAuth2/OIDC próprio) · jose · argon2id
    multi_tenancy: BD-por-workspace (ADR 0006) — cluster PG por workspace
    infra: Proxmox on-prem BR · Docker Compose · MinIO · Vault · Valkey
  component_library: ant-design
  component_library_version: "6.4"
  skip_design_system: false  # AntD não cobre tokens/variações JCS — Phase 7 mantida

phases:
  enabled:
    - phase-1-project-brief
    - phase-2-trigger-mapping  # strategic_analysis: full
    - phase-3-prd
    - phase-4-ux-design
    - phase-5-agentic-development
    - phase-6-design-system  # mantida apesar de AntD — overrides JCS
    - phase-7-go-live
  brief_level: complete
  strategic_analysis: full

structure:
  root_folder: design-artifacts
  folders:
    - design-artifacts/A-Product-Brief/
    - design-artifacts/B-Trigger-Map/
    - design-artifacts/C-UX-Scenarios/
    - design-artifacts/D-Design-System/
    - design-artifacts/E-Development/
    - design-artifacts/_progress/
    - design-artifacts/_progress/agent-experiences/

existing_materials:
  has_materials: true
  items:
    - path: brand.md
      type: brand-identity
      summary: "Paleta JCS (#004a99 primária), Plus Jakarta Sans, Font Awesome 6.4, Chart.js, layout topbar 80px + sidebar 260px, radius 12/20px, sombra suave. Tom Apple-inspired."
    - path: STACK.md
      type: tech-canon
      version: "2.2"
      summary: "Stack canônica JCS — Node 24 + Nest 11 + Prisma 7 + Postgres 18 + React 19.2 + AntD 6.4. Multi-tenancy BD-por-workspace. Self-host Proxmox sa-east-1 → on-prem BR."
    - path: CODING-RULES.md
      type: invariants
      version: "2.0"
      summary: "Invariantes (Zod contrato, RFC 9457 422, Vault, BullMQ, Idempotency-Key, argon2id) + pegadinhas 🔥 PGD-SEC/PGD-DB."
    - path: frontend/img/SAR_logo_fundo_transparente.png
      type: asset-logo
    - path: frontend/img/SAR_icone_fundo_transparente.png
      type: asset-icon
    - path: design-artifacts/_references/legacy-screens-html/index.html
      type: legacy-mockup
      summary: |
        SPA mockup do SAR (2251 linhas) com 9 telas: indicadores, pedidos,
        funil, agenda, novo-pedido, analise-cliente, clientes, cadastro-cliente,
        produtos. Login excluído. Usa variáveis CSS de brand.md.
        Revela 7ª tela "Painel de Desempenho" (BI) não listada nos módulos do brand.md.

product_context:
  description: |
    SAR é um sistema web de força de vendas SaaS B2B para representantes comerciais
    e empresas. Substitui app Android/Desktop legado. Centraliza pedidos, clientes,
    financeiro, comissões/FLEX e CRM, sincronizado com ERP.
  modules:
    - vendas       # Pedidos (Orçamento→Faturado), catálogo, pautas
    - fiscal       # ICMS-ST, IPI, grupos tributários por UF
    - financeiro   # Títulos, recebimentos, limite de crédito
    - comissao-flex # Cálculo por rep e produto, rateio supervisor, saldo FLEX
    - crm          # Funil Kanban, agenda, check-in GPS, timeline 360°
    - administrativo # Multi-empresa, configs, gestão de reps
  initial_personas_hypothesis:
    - representante-externo  # Pedidos, CRM, agenda, comissão
    - supervisor-vendas      # Acompanha equipe, libera descontos
    - administrador          # Configurações, pautas, relatórios

project_context:
  stakes: small-business
  domain: b2b-saas / sales-force-automation
  market: representantes comerciais e empresas B2B (Brasil)
  competing_with: app Android/Desktop legado proprietário + planilhas + ferramentas fragmentadas

working_relationship:
  involvement: balanced
  role: product-owner
  presentation: recommend-with-rationale
  communication_language: pt-BR

agents:
  active:
    - saga    # Strategy: Brief, Trigger Map, Scenarios outline
    - freya   # Design: UX, Page Specs, Design System
  triggers:
    PB: saga  # Project Brief
    TM: saga  # Trigger Map
    SC: saga  # Scenarios outline
    UX: freya # Page specs
    SA: freya # Spec audit
    DS: freya # Design System

next_phase: wds-1-project-brief
