diff --git a/frontend/ARCHITECTURE.md b/frontend/ARCHITECTURE.md index 5bbecec0..f9ed1f8a 100644 --- a/frontend/ARCHITECTURE.md +++ b/frontend/ARCHITECTURE.md @@ -1,25 +1,29 @@ # Arquitetura do Frontend -O frontend é organizado por domínios de negócio, não por tipos técnicos de arquivo. +O frontend usa Feature-Based Architecture. Cada funcionalidade mantém seus componentes, contratos e integrações; camadas internas existem somente quando necessárias. -## Camadas +## Organização -- `src/app`: composição da aplicação, providers, rotas e páginas de nível global. -- `src/domains//domain`: tipos de negócio e regras puras, sem React ou HTTP. -- `src/domains//application`: hooks React e casos de uso que orquestram regras de domínio. -- `src/domains//infrastructure`: gateways de API e código específico de transporte. -- `src/domains//presentation`: páginas e componentes pertencentes ao domínio. -- `src/shared`: primitivas de UI, assets, hooks e utilitários técnicos reutilizáveis. +- `src/app/routes`: definição das rotas e página de rota não encontrada. +- `src/app/providers`: composição dos providers globais. +- `src/app/layouts`: layout autenticado e seus componentes de navegação. +- `src/app/dashboard`: composição, navegação, providers e tema do painel atual. +- `src/features`: applications, auth, dashboard, help, home, jobs, marketing, mentoring, notifications e profile. +- `src/shared/api`: cliente HTTP compartilhado e tratamento de erros de API. +- `src/shared/utils`, `hooks`, `ui`, `assets` e `feedback`: utilitários, hooks, componentes, recursos e contexto de feedback reutilizáveis. +- `src/styles`: estilos globais. -> Exceção: o domínio `new_dashboard` ainda não segue integralmente essas 4 camadas. Hoje ele usa uma organização própria (`components/`, `context/`, `hooks/`, `infrastructure/`, `types/`, `utils/`, `layout.tsx`, `page.tsx`), sem pastas `domain/`, `application/` ou `presentation/` separadas. `auth`, `jobs` e `marketing` seguem o padrão de 4 camadas descrito acima. +## Convenções das funcionalidades -## Domínios +- `api/`: integrações HTTP; clientes e contratos existentes são preservados. +- `hooks/`: hooks de carregamento, persistência e estado. +- `components/` e `pages/`: componentes e páginas específicos da funcionalidade. +- `domain/` e `types/`: regras puras, schemas e contratos, quando necessários. +- `application/`: contextos e providers com responsabilidade de aplicação; não são hooks. +- Arquivos pequenos de contratos, eventos ou dados podem permanecer na raiz da funcionalidade. Não criar diretórios vazios. -- `auth`: estado de sessão, acesso à API de credenciais/OAuth e telas de login, registro e callback. -- `jobs`: entidades de vagas, filtros, deduplicação, paginação, acesso à API de vagas/scraper e UI de vagas. -- `marketing`: seções da landing page pública. -- `new_dashboard`: nova estrutura de painel do frontend. Contribuidores que procuram a experiência atual de dashboard devem começar por aqui. +O catálogo anterior mantém seu contrato em `features/jobs/types/job.types.ts`, distinto do contrato do painel em `features/jobs/domain/job.ts`. O contexto e os dados demonstrativos legados permanecem em `features/jobs/legacy`. Candidaturas, notas e Kanban pertencem a `features/applications`. -## Política de imports +## Imports -O código deve importar a partir de `@/app`, `@/domains` ou `@/shared`. Pastas técnicas antigas como `src/components`, `src/pages`, `src/hooks`, `src/services`, `src/context`, `src/lib` e `src/types` foram removidas para manter uma estrutura única orientada por domínio. +Preferir imports canônicos com `@/app`, `@/features` e `@/shared`. Preservar imports relativos locais quando claros. Código específico permanece na funcionalidade; somente recursos reutilizáveis pertencem a shared. Evitar dependências circulares. Rotas, exports, providers, APIs e modelos distintos são preservados pela organização. diff --git a/frontend/README.md b/frontend/README.md index 846ae4f1..d21c27cd 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -50,13 +50,13 @@ Variáveis usadas: ## Organização -O frontend segue uma estrutura orientada por domínio: +O frontend segue uma arquitetura Feature-Based, com domínio separado quando necessário: - `src/app`: composição da aplicação, providers, rotas e layouts autenticados. -- `src/domains/auth`: login, registro, callback OAuth e estado de sessão. -- `src/domains/jobs`: busca, filtros, paginação e interface de vagas. -- `src/domains/marketing`: landing page pública. -- `src/domains/new_dashboard`: nova estrutura de painel do frontend. É aqui que contribuidores devem procurar a experiência nova de dashboard, com abas de home, vagas, mentoring, perfil e ajuda. +- `src/features/auth`: login, registro, callback OAuth e estado de sessão. +- `src/features/jobs`: busca, filtros, paginação e interface de vagas, preservando os contratos distintos dos catálogos. +- `src/features/marketing`: landing page pública. +- `src/app/dashboard`: composição, providers, tema e navegação do painel. As funcionalidades de home, vagas, candidaturas, mentoria, perfil, ajuda e notificações estão em `src/features/`. - `src/shared`: componentes de UI, assets, hooks e utilitários reutilizáveis. Veja também [ARCHITECTURE.md](ARCHITECTURE.md). diff --git a/frontend/src/app/App.tsx b/frontend/src/app/App.tsx index 5e495095..99efb9f4 100644 --- a/frontend/src/app/App.tsx +++ b/frontend/src/app/App.tsx @@ -1,5 +1,5 @@ import { useState, useEffect } from "react"; -import { AppRoutes } from "@/app/AppRoutes"; +import { AppRoutes } from "@/app/routes/AppRoutes"; import Loading from "@/shared/ui/Loading"; function App() { diff --git a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx b/frontend/src/app/dashboard/DashboardPage.tsx similarity index 92% rename from frontend/src/domains/new_dashboard/NewDashboardPage.tsx rename to frontend/src/app/dashboard/DashboardPage.tsx index 48c4b8c7..1e2fc942 100644 --- a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx +++ b/frontend/src/app/dashboard/DashboardPage.tsx @@ -1,46 +1,37 @@ -import { useAuth } from "@/domains/auth/application/AuthContext"; +import { useAuth } from "@/features/auth/application/AuthContext"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { useLocation, useNavigate, useSearchParams } from "react-router-dom"; -import { DashboardTab } from "./components/dashboard/DashboardTab"; -import { HelpTab } from "./components/help/HelpTab"; -import { HomeTab } from "./components/home/HomeTab"; -import { AddJobModal } from "./components/jobs/AddJobModal"; -import { JobDetailModal } from "./components/jobs/JobDetailModal"; -import { JobTab } from "./components/jobs/JobTab"; -import { Header } from "./components/layout/Header"; -import { MobileTabBar } from "./components/layout/MobileTabBar"; -import { Sidebar } from "./components/layout/Sidebar"; -import { MentoringTab } from "./components/mentoring/MentoringTab"; -import { ProfileTab } from "./components/profile/ProfileTab"; -import { Toast } from "./components/shared/Toast"; -import { jobStatuses } from "./constants"; -import { useDashboardJobs } from "./hooks/useDashboardJobs"; -import { useUserDashboardData } from "./hooks/useUserDashboardData"; +import { DashboardTab } from "@/features/dashboard/components/DashboardTab"; +import { HelpTab } from "@/features/help/components/HelpTab"; +import { HomeTab } from "@/features/home/components/HomeTab"; +import { AddJobModal } from "@/features/applications/components/AddJobModal"; +import { JobDetailModal } from "@/features/jobs/components/JobDetailModal"; +import { JobTab } from "@/features/jobs/components/JobTab"; +import { Header } from "@/app/dashboard/components/Header"; +import { MobileTabBar } from "@/app/dashboard/components/MobileTabBar"; +import { Sidebar } from "@/app/dashboard/components/Sidebar"; +import { MentoringTab } from "@/features/mentoring/components/MentoringTab"; +import { ProfileTab } from "@/features/profile/components/ProfileTab"; +import { Toast } from "@/shared/ui/Toast"; +import { jobStatuses } from "@/features/jobs/constants"; +import { useDashboardJobs } from "@/features/jobs/hooks/useDashboardJobs"; +import { useUserDashboardData } from "@/features/profile/hooks/useUserDashboardData"; import { getJobFilterOptions, FALLBACK_JOB_FAMILIES, type JobFamilyOption, -} from "./infrastructure/dashboardJobsApi"; -import type { - CareerChecklist, - Job, - JobModelFilter, - JobStatus, - MatchSort, - NewJob, - SearchPreferences, - TechnologyExperience, - UserProfile, -} from "./types"; +} from "@/features/jobs/api/dashboardJobsApi"; +import type { CareerChecklist, SearchPreferences, TechnologyExperience, UserProfile } from "@/features/profile/domain/user"; +import type { Job, JobModelFilter, JobStatus, MatchSort, NewJob } from "@/features/jobs/domain/job"; import { type ContinentFilter, type CountryFilter, -} from "./utils/locationFilters"; +} from "@/features/jobs/domain/locationFilters"; import { getModelFilterFromJobTypes, modelFilterToApiFilter, -} from "./utils/jobModelFilters"; -import { parseSearchKeywords } from "./utils/searchKeywords"; +} from "@/features/jobs/domain/jobModelFilters"; +import { parseSearchKeywords } from "@/features/jobs/domain/searchKeywords"; function getSection(pathname: string) { if (pathname.startsWith("/dashboard")) return "dashboard"; diff --git a/frontend/src/domains/new_dashboard/layout.tsx b/frontend/src/app/dashboard/DashboardProviders.tsx similarity index 59% rename from frontend/src/domains/new_dashboard/layout.tsx rename to frontend/src/app/dashboard/DashboardProviders.tsx index 96e97f98..d4dc080b 100644 --- a/frontend/src/domains/new_dashboard/layout.tsx +++ b/frontend/src/app/dashboard/DashboardProviders.tsx @@ -1,7 +1,7 @@ import type { ReactNode } from "react"; -import { JobsProvider } from "./context/JobsContext"; -import { ThemeProvider } from "./context/ThemeContext"; -import { ToastProvider } from "./context/ToastContext"; +import { JobsProvider } from "@/features/jobs/legacy/application/JobsContext"; +import { ThemeProvider } from "@/app/dashboard/theme/ThemeContext"; +import { ToastProvider } from "@/shared/feedback/ToastContext"; export function NewDashboardLayout({ children }: { children: ReactNode }) { return ( diff --git a/frontend/src/domains/new_dashboard/components/shared/CandidateLogo.tsx b/frontend/src/app/dashboard/components/CandidateLogo.tsx similarity index 100% rename from frontend/src/domains/new_dashboard/components/shared/CandidateLogo.tsx rename to frontend/src/app/dashboard/components/CandidateLogo.tsx diff --git a/frontend/src/domains/new_dashboard/components/layout/Header.tsx b/frontend/src/app/dashboard/components/Header.tsx similarity index 97% rename from frontend/src/domains/new_dashboard/components/layout/Header.tsx rename to frontend/src/app/dashboard/components/Header.tsx index 0ecb2cc5..ae15f0b7 100644 --- a/frontend/src/domains/new_dashboard/components/layout/Header.tsx +++ b/frontend/src/app/dashboard/components/Header.tsx @@ -1,4 +1,4 @@ -import { useAuth } from "@/domains/auth/application/AuthContext"; +import { useAuth } from "@/features/auth/application/AuthContext"; import { Bell, ChevronDown, Mail } from "lucide-react"; import { useCallback, useEffect, useRef, useState } from "react"; import { useLocation, useNavigate } from "react-router-dom"; @@ -7,14 +7,15 @@ import { getDashboardNotificationFeed, markDashboardNotificationsRead, markSingleNotificationRead, -} from "../../infrastructure/notificationsApi"; -import type { Message, Notification, UserProfile } from "../../types"; +} from "@/features/notifications/api"; +import type { Message, Notification } from "@/features/notifications/types"; +import type { UserProfile } from "@/features/profile/domain/user"; import { DASHBOARD_NOTIFICATIONS_REFRESH_EVENT, type DashboardNotificationsRefreshDetail, -} from "../../utils/notificationEvents"; -import { MessageDetailModal } from "./MessageDetailModal"; -import { ThemeToggle } from "./ThemeToggle"; +} from "@/features/notifications/events"; +import { MessageDetailModal } from "@/features/notifications/components/MessageDetailModal"; +import { ThemeToggle } from "@/app/dashboard/components/ThemeToggle"; interface HeaderProps { title?: string; diff --git a/frontend/src/domains/new_dashboard/components/shared/Icons.tsx b/frontend/src/app/dashboard/components/Icons.tsx similarity index 100% rename from frontend/src/domains/new_dashboard/components/shared/Icons.tsx rename to frontend/src/app/dashboard/components/Icons.tsx diff --git a/frontend/src/domains/new_dashboard/components/layout/MobileTabBar.tsx b/frontend/src/app/dashboard/components/MobileTabBar.tsx similarity index 94% rename from frontend/src/domains/new_dashboard/components/layout/MobileTabBar.tsx rename to frontend/src/app/dashboard/components/MobileTabBar.tsx index b4fbd262..faad388a 100644 --- a/frontend/src/domains/new_dashboard/components/layout/MobileTabBar.tsx +++ b/frontend/src/app/dashboard/components/MobileTabBar.tsx @@ -1,6 +1,6 @@ -import { cn } from "@/shared/lib/utils"; +import { cn } from "@/shared/utils/utils"; import { Link, useLocation } from "react-router-dom"; -import { Icons } from "../shared/Icons"; +import { Icons } from "@/app/dashboard/components/Icons"; const tabs = [ { label: "Início", to: "/home", icon: Icons.Home }, diff --git a/frontend/src/domains/new_dashboard/components/layout/Sidebar.tsx b/frontend/src/app/dashboard/components/Sidebar.tsx similarity index 92% rename from frontend/src/domains/new_dashboard/components/layout/Sidebar.tsx rename to frontend/src/app/dashboard/components/Sidebar.tsx index fab6bb8d..b8bddbac 100644 --- a/frontend/src/domains/new_dashboard/components/layout/Sidebar.tsx +++ b/frontend/src/app/dashboard/components/Sidebar.tsx @@ -1,9 +1,9 @@ -import { cn } from "@/shared/lib/utils"; +import { cn } from "@/shared/utils/utils"; import { LogOut } from "lucide-react"; import { Link, useLocation } from "react-router-dom"; -import { useAuth } from "@/domains/auth/application/AuthContext"; -import { CandidateLogo } from "../shared/CandidateLogo"; -import { Icons } from "../shared/Icons"; +import { useAuth } from "@/features/auth/application/AuthContext"; +import { CandidateLogo } from "@/app/dashboard/components/CandidateLogo"; +import { Icons } from "@/app/dashboard/components/Icons"; const items = [ { label: "Início", to: "/home", icon: Icons.Home }, diff --git a/frontend/src/domains/new_dashboard/components/layout/ThemeToggle.tsx b/frontend/src/app/dashboard/components/ThemeToggle.tsx similarity index 100% rename from frontend/src/domains/new_dashboard/components/layout/ThemeToggle.tsx rename to frontend/src/app/dashboard/components/ThemeToggle.tsx diff --git a/frontend/src/domains/new_dashboard/context/ThemeContext.tsx b/frontend/src/app/dashboard/theme/ThemeContext.tsx similarity index 91% rename from frontend/src/domains/new_dashboard/context/ThemeContext.tsx rename to frontend/src/app/dashboard/theme/ThemeContext.tsx index a7d6bd66..8ea42d18 100644 --- a/frontend/src/domains/new_dashboard/context/ThemeContext.tsx +++ b/frontend/src/app/dashboard/theme/ThemeContext.tsx @@ -1,6 +1,6 @@ import { createContext, useContext, type ReactNode } from "react"; import { useTheme as useSharedTheme } from "@/shared/hooks/useTheme"; -import { darkColors, lightColors } from "../constants"; +import { darkColors, lightColors } from "@/app/dashboard/theme/colors"; type ThemeContextValue = ReturnType & { colors: typeof lightColors; diff --git a/frontend/src/domains/new_dashboard/constants/colors.ts b/frontend/src/app/dashboard/theme/colors.ts similarity index 100% rename from frontend/src/domains/new_dashboard/constants/colors.ts rename to frontend/src/app/dashboard/theme/colors.ts diff --git a/frontend/src/domains/new_dashboard/constants/tokens.ts b/frontend/src/app/dashboard/theme/tokens.ts similarity index 100% rename from frontend/src/domains/new_dashboard/constants/tokens.ts rename to frontend/src/app/dashboard/theme/tokens.ts diff --git a/frontend/src/app/dashboard/theme/useTheme.ts b/frontend/src/app/dashboard/theme/useTheme.ts new file mode 100644 index 00000000..03a69cae --- /dev/null +++ b/frontend/src/app/dashboard/theme/useTheme.ts @@ -0,0 +1 @@ +export { useDashboardTheme as useTheme } from "@/app/dashboard/theme/ThemeContext"; diff --git a/frontend/src/app/AuthenticatedHeader.tsx b/frontend/src/app/layouts/AuthenticatedHeader.tsx similarity index 97% rename from frontend/src/app/AuthenticatedHeader.tsx rename to frontend/src/app/layouts/AuthenticatedHeader.tsx index 59618b1e..419e6152 100644 --- a/frontend/src/app/AuthenticatedHeader.tsx +++ b/frontend/src/app/layouts/AuthenticatedHeader.tsx @@ -1,4 +1,4 @@ -import { useAuth } from "@/domains/auth/application/AuthContext"; +import { useAuth } from "@/features/auth/application/AuthContext"; import { useTheme } from "@/shared/hooks/useTheme"; import { ThemeToggle } from "@/shared/ui/theme-toggle"; import { Bell, Mail } from "lucide-react"; diff --git a/frontend/src/app/AuthenticatedLayout.tsx b/frontend/src/app/layouts/AuthenticatedLayout.tsx similarity index 75% rename from frontend/src/app/AuthenticatedLayout.tsx rename to frontend/src/app/layouts/AuthenticatedLayout.tsx index 98ed115a..49f87e8b 100644 --- a/frontend/src/app/AuthenticatedLayout.tsx +++ b/frontend/src/app/layouts/AuthenticatedLayout.tsx @@ -1,5 +1,5 @@ -import { AuthenticatedHeader } from "@/app/AuthenticatedHeader"; -import { AuthenticatedSidebar } from "@/app/AuthenticatedSidebar"; +import { AuthenticatedHeader } from "@/app/layouts/AuthenticatedHeader"; +import { AuthenticatedSidebar } from "@/app/layouts/AuthenticatedSidebar"; import { Outlet } from "react-router-dom"; export function AuthenticatedLayout() { diff --git a/frontend/src/app/AuthenticatedSidebar.tsx b/frontend/src/app/layouts/AuthenticatedSidebar.tsx similarity index 97% rename from frontend/src/app/AuthenticatedSidebar.tsx rename to frontend/src/app/layouts/AuthenticatedSidebar.tsx index 1a8d8224..09ab9cde 100644 --- a/frontend/src/app/AuthenticatedSidebar.tsx +++ b/frontend/src/app/layouts/AuthenticatedSidebar.tsx @@ -1,5 +1,5 @@ -import { useAuth } from "@/domains/auth/application/AuthContext"; -import { cn } from "@/shared/lib/utils"; +import { useAuth } from "@/features/auth/application/AuthContext"; +import { cn } from "@/shared/utils/utils"; import { BriefcaseBusiness, ChartNoAxesColumn, diff --git a/frontend/src/app/AppProviders.tsx b/frontend/src/app/providers/AppProviders.tsx similarity index 78% rename from frontend/src/app/AppProviders.tsx rename to frontend/src/app/providers/AppProviders.tsx index 263295e2..1a8cc4f5 100644 --- a/frontend/src/app/AppProviders.tsx +++ b/frontend/src/app/providers/AppProviders.tsx @@ -1,4 +1,4 @@ -import { AuthProvider } from "@/domains/auth/application/AuthContext"; +import { AuthProvider } from "@/features/auth/application/AuthContext"; import type { ReactNode } from "react"; import { BrowserRouter } from "react-router-dom"; diff --git a/frontend/src/app/AppRoutes.tsx b/frontend/src/app/routes/AppRoutes.tsx similarity index 73% rename from frontend/src/app/AppRoutes.tsx rename to frontend/src/app/routes/AppRoutes.tsx index 23d0db0e..bd6fa3c0 100644 --- a/frontend/src/app/AppRoutes.tsx +++ b/frontend/src/app/routes/AppRoutes.tsx @@ -1,13 +1,13 @@ -import NotFound from "@/app/NotFound"; -import { useAuth } from "@/domains/auth/application/AuthContext"; -import AuthCallbackPage from "@/domains/auth/presentation/pages/AuthCallbackPage"; -import LoginPage from "@/domains/auth/presentation/pages/LoginPage"; -import RegisterPage from "@/domains/auth/presentation/pages/RegisterPage"; -import LandingPage from "@/domains/marketing/presentation/pages/LandingPage"; -import PrivacyPolicyPage from "@/domains/marketing/presentation/pages/PrivacyPolicyPage"; -import TermsOfUsePage from "@/domains/marketing/presentation/pages/TermsOfUsePage"; -import NewDashboardPage from "@/domains/new_dashboard/NewDashboardPage"; -import NewDashboardLayout from "@/domains/new_dashboard/layout"; +import NotFound from "@/app/routes/NotFound"; +import { useAuth } from "@/features/auth/application/AuthContext"; +import AuthCallbackPage from "@/features/auth/pages/AuthCallbackPage"; +import LoginPage from "@/features/auth/pages/LoginPage"; +import RegisterPage from "@/features/auth/pages/RegisterPage"; +import LandingPage from "@/features/marketing/pages/LandingPage"; +import PrivacyPolicyPage from "@/features/marketing/pages/PrivacyPolicyPage"; +import TermsOfUsePage from "@/features/marketing/pages/TermsOfUsePage"; +import NewDashboardPage from "@/app/dashboard/DashboardPage"; +import NewDashboardLayout from "@/app/dashboard/DashboardProviders"; import Loading from "@/shared/ui/Loading"; import { Navigate, Route, Routes } from "react-router-dom"; diff --git a/frontend/src/app/NotFound.tsx b/frontend/src/app/routes/NotFound.tsx similarity index 100% rename from frontend/src/app/NotFound.tsx rename to frontend/src/app/routes/NotFound.tsx diff --git a/frontend/src/domains/marketing/presentation/pages/LandingPage.tsx b/frontend/src/domains/marketing/presentation/pages/LandingPage.tsx deleted file mode 100644 index eb987f60..00000000 --- a/frontend/src/domains/marketing/presentation/pages/LandingPage.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { CTASection } from "@/domains/marketing/presentation/components/CTASection"; -import { FeaturesSection } from "@/domains/marketing/presentation/components/FeaturesSection"; -import { Footer } from "@/domains/marketing/presentation/components/Footer"; -import { HeroSection } from "@/domains/marketing/presentation/components/HeroSection"; -import { HowItWorks } from "@/domains/marketing/presentation/components/HowItWorks"; -import { Navbar } from "@/domains/marketing/presentation/components/Navbar"; -import TeamSection from "@/domains/marketing/presentation/components/TeamSection"; - -export default function LandingPage() { - return ( -
- -
- - - - - -
-
-
- ); -} diff --git a/frontend/src/domains/new_dashboard/constants.ts b/frontend/src/domains/new_dashboard/constants.ts deleted file mode 100644 index 83379989..00000000 --- a/frontend/src/domains/new_dashboard/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./constants/index"; diff --git a/frontend/src/domains/new_dashboard/constants/index.ts b/frontend/src/domains/new_dashboard/constants/index.ts deleted file mode 100644 index 8c7479eb..00000000 --- a/frontend/src/domains/new_dashboard/constants/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./colors"; -export * from "./tokens"; -export * from "./initialData"; - diff --git a/frontend/src/domains/new_dashboard/constants/initialData.ts b/frontend/src/domains/new_dashboard/constants/initialData.ts deleted file mode 100644 index 38789860..00000000 --- a/frontend/src/domains/new_dashboard/constants/initialData.ts +++ /dev/null @@ -1,176 +0,0 @@ -import type { - Job, - JobLevel, - JobStatus, - JobType, - Mentor, - SearchPreferences, - UserProfile, -} from "../types"; - -export const jobStatuses: Record = { - saved: "Salva", - applied: "Candidatura enviada", - interviewing: "Em entrevista", - rejected: "Arquivada", - accepted: "Proposta aceita", -}; - -export const jobStatusClasses: Record = { - saved: "border-amber-300 bg-amber-50 text-amber-700 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-300", - applied: "border-sky-300 bg-sky-50 text-sky-700 dark:border-sky-500/40 dark:bg-sky-500/10 dark:text-sky-300", - interviewing: "border-violet-300 bg-violet-50 text-violet-700 dark:border-violet-500/40 dark:bg-violet-500/10 dark:text-violet-300", - rejected: "border-rose-300 bg-rose-50 text-rose-700 dark:border-rose-500/40 dark:bg-rose-500/10 dark:text-rose-300", - accepted: "border-emerald-300 bg-emerald-50 text-emerald-700 dark:border-emerald-500/40 dark:bg-emerald-500/10 dark:text-emerald-300", -}; - -export const jobTypes: JobType[] = ["Remoto", "Híbrido", "Presencial"]; -export const jobLevels: JobLevel[] = [ - "Estágio/Trainee", - "Júnior", - "Pleno", - "Sênior", -]; - -export const initialJobs: Job[] = [ - { - id: "f81d4fae-7dec-11d0-a765-00a0c91e6bf6", - jobTitle: "Desenvolvedor Frontend Sênior React", - company: "Fintech Hub Brasil", - location: "São Paulo, SP (Híbrido)", - salary: "R$ 14.000 - R$ 17.500", - type: "Híbrido", - level: "Sênior", - matchScore: 94, - tags: ["React", "TypeScript", "Tailwind CSS", "Next.js"], - posted: "Há 2 dias", - status: "saved", - jobLink: "https://fintechhub.com/vagas/react-senior", - source: "Gupy", - notes: "Preparar portfólio de fintech antes de submeter.", - }, - { - id: "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b", - jobTitle: "Engenheiro de Software Fullstack Pleno", - company: "Stellar Tech", - location: "Remoto", - salary: "R$ 8.500 - R$ 11.000", - type: "Remoto", - level: "Pleno", - matchScore: 89, - tags: ["React", "Node.js", "PostgreSQL", "Docker"], - posted: "Há 5 dias", - status: "applied", - jobLink: "https://stellartech.solides.jobs/vaga/fullstack-pleno", - source: "Solides", - notes: "Inscrito na vaga. Aguardando retorno do RH no e-mail.", - }, - { - id: "a3a1b894-3a5f-4a0b-9ffb-3b8d4e9c71bc", - jobTitle: "Designer de Produto UI/UX Júnior", - company: "Agência Criativa Digital", - location: "Rio de Janeiro, RJ (Presencial)", - salary: "R$ 4.500 - R$ 5.800", - type: "Presencial", - level: "Júnior", - matchScore: 78, - tags: ["Figma", "Prototipação", "Design Systems", "User Research"], - posted: "Há 1 dia", - status: "saved", - jobLink: "https://agenciacriativa.com/carreiras/uiux", - source: "LinkedIn", - notes: "Necessário enviar portfólio via formulário próprio.", - }, - { - id: "d9b2c374-e861-46da-b39f-7bcda238510a", - jobTitle: "Product Owner & Product Manager", - company: "Unicórnio Delivery", - location: "Remoto", - salary: "R$ 12.000 - R$ 15.000", - type: "Remoto", - level: "Sênior", - matchScore: 82, - tags: ["Agile", "Scrum", "Product Metrics", "Jira"], - posted: "Há 1 semana", - status: "interviewing", - jobLink: "https://unicorndelivery.gupy.io/jobs/19902", - source: "Gupy", - notes: "Entrevista marcada para terça-feira com a Product Lead Carolina.", - }, -]; - -export const initialMentors: Mentor[] = [ - { - id: "mentor-1", - name: "Julio Silva", - rating: 3, - completed: 33, - days: "Seg, Qua, Sex", - hours: "10:00 - 13:00", - nextSessionDate: "Próxima mentoria: quarta-feira, 24 jul", - specialty: "Frontend React, Design de Componentes e Otimização de Performance", - avatarColor: "from-teal-500 to-emerald-600", - platform: "Google Meet", - platformUrl: "https://meet.google.com/react-mentor-demo", - agenda: - "Revisão de componentes React, organização de estados, renderização eficiente e próximos passos para um portfólio frontend mais forte.", - }, - { - id: "mentor-2", - name: "Silvia Maria", - rating: 4, - completed: 103, - days: "Seg, Ter, Qua, Sex", - hours: "10:00 - 13:00", - nextSessionDate: "Próxima mentoria: terça-feira, 23 jul", - specialty: "Arquitetura Fullstack, Bancos de Dados Relacionais e APIs seguras", - avatarColor: "from-blue-500 to-indigo-600", - platform: "Zoom", - platformUrl: "https://zoom.us/j/1234567890", - agenda: - "Mapeamento de arquitetura fullstack, desenho de APIs, decisões de banco de dados e checklist de segurança para aplicações em produção.", - }, - { - id: "mentor-3", - name: "Bia Costa", - rating: 1, - completed: 3, - days: "Seg, Qua, Sex", - hours: "10:00 - 13:00", - nextSessionDate: "Próxima mentoria: sexta-feira, 26 jul", - specialty: "Design de Produto, Figma Avançado, Prototipação e Testes com Usuários", - avatarColor: "from-pink-500 to-purple-600", - platform: "Discord", - platformUrl: "https://discord.gg/product-design-demo", - agenda: - "Análise de fluxo de produto, refinamento de protótipos no Figma, narrativa de case e preparação para entrevistas de UX/UI.", - }, -]; - -export const initialUser: UserProfile = { - firstName: "Bruna", - lastName: "Silva", - displayName: "Bruna Silva", - username: "brunasilva", - email: "bruna.silva@exemplo.com", - avatarUrl: "", - phone: "(11) 98765-4321", - level: "Pleno", - technologies: ["React", "TypeScript", "Tailwind CSS", "Next.js", "Node.js"], - technologyExperiences: [ - { name: "React", years: 5 }, - { name: "TypeScript", years: 4 }, - { name: "Tailwind CSS", years: 3 }, - { name: "Next.js", years: 3 }, - { name: "Node.js", years: 2 }, - ], -}; - -export const initialPreferences: SearchPreferences = { - keywords: ["React", "Frontend", "Fullstack"], - searchLocation: "São Paulo, SP", - remoteOnly: false, - jobTypes: [], - emailNotifications: true, - careerChecklist: [], -}; diff --git a/frontend/src/domains/new_dashboard/hooks/useJobs.ts b/frontend/src/domains/new_dashboard/hooks/useJobs.ts deleted file mode 100644 index d2c7497d..00000000 --- a/frontend/src/domains/new_dashboard/hooks/useJobs.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { useJobsContext as useJobs } from "../context/JobsContext"; - diff --git a/frontend/src/domains/new_dashboard/hooks/useTheme.ts b/frontend/src/domains/new_dashboard/hooks/useTheme.ts deleted file mode 100644 index 42185eaf..00000000 --- a/frontend/src/domains/new_dashboard/hooks/useTheme.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { useDashboardTheme as useTheme } from "../context/ThemeContext"; - diff --git a/frontend/src/domains/new_dashboard/hooks/useToast.ts b/frontend/src/domains/new_dashboard/hooks/useToast.ts deleted file mode 100644 index eac84d5a..00000000 --- a/frontend/src/domains/new_dashboard/hooks/useToast.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { useToastContext as useToast } from "../context/ToastContext"; - diff --git a/frontend/src/domains/new_dashboard/page.tsx b/frontend/src/domains/new_dashboard/page.tsx deleted file mode 100644 index eca1fe43..00000000 --- a/frontend/src/domains/new_dashboard/page.tsx +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from "./NewDashboardPage"; - diff --git a/frontend/src/domains/new_dashboard/types.ts b/frontend/src/domains/new_dashboard/types.ts deleted file mode 100644 index 4ca1e578..00000000 --- a/frontend/src/domains/new_dashboard/types.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./types/index"; diff --git a/frontend/src/domains/new_dashboard/types/index.ts b/frontend/src/domains/new_dashboard/types/index.ts deleted file mode 100644 index 3d97258b..00000000 --- a/frontend/src/domains/new_dashboard/types/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./job"; -export * from "./mentor"; -export * from "./user"; diff --git a/frontend/src/domains/new_dashboard/components/jobs/AddJobModal.tsx b/frontend/src/features/applications/components/AddJobModal.tsx similarity index 97% rename from frontend/src/domains/new_dashboard/components/jobs/AddJobModal.tsx rename to frontend/src/features/applications/components/AddJobModal.tsx index c899b304..0d7c41bd 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/AddJobModal.tsx +++ b/frontend/src/features/applications/components/AddJobModal.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; -import { jobLevels, jobTypes } from "../../constants"; -import type { NewJob } from "../../types"; -import { Modal } from "../shared/Modal"; +import { jobLevels, jobTypes } from "@/features/jobs/constants"; +import type { NewJob } from "@/features/jobs/domain/job"; +import { Modal } from "@/shared/ui/Modal"; const initialForm: NewJob = { jobTitle: "", diff --git a/frontend/src/domains/new_dashboard/components/jobs/ApplicationNotesSection.tsx b/frontend/src/features/applications/components/ApplicationNotesSection.tsx similarity index 98% rename from frontend/src/domains/new_dashboard/components/jobs/ApplicationNotesSection.tsx rename to frontend/src/features/applications/components/ApplicationNotesSection.tsx index 61a63137..b69adca7 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/ApplicationNotesSection.tsx +++ b/frontend/src/features/applications/components/ApplicationNotesSection.tsx @@ -5,7 +5,7 @@ import { deleteDashboardApplicationNote, getDashboardApplicationNotes, updateDashboardApplicationNote, -} from "../../infrastructure/dashboardJobsApi"; +} from "@/features/jobs/api/dashboardJobsApi"; export function ApplicationNotesSection({ savedJobId }: { savedJobId: string }) { const [notes, setNotes] = useState([]); diff --git a/frontend/src/domains/new_dashboard/components/dashboard/KanbanBoard.tsx b/frontend/src/features/applications/components/KanbanBoard.tsx similarity index 94% rename from frontend/src/domains/new_dashboard/components/dashboard/KanbanBoard.tsx rename to frontend/src/features/applications/components/KanbanBoard.tsx index e1e42efa..e05fc0bd 100644 --- a/frontend/src/domains/new_dashboard/components/dashboard/KanbanBoard.tsx +++ b/frontend/src/features/applications/components/KanbanBoard.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import type { Job, JobStatus } from "../../types"; +import type { Job, JobStatus } from "@/features/jobs/domain/job"; import { KanbanColumn } from "./KanbanColumn"; interface KanbanBoardProps { diff --git a/frontend/src/domains/new_dashboard/components/dashboard/KanbanColumn.tsx b/frontend/src/features/applications/components/KanbanColumn.tsx similarity index 98% rename from frontend/src/domains/new_dashboard/components/dashboard/KanbanColumn.tsx rename to frontend/src/features/applications/components/KanbanColumn.tsx index 0c36b256..0004a8d3 100644 --- a/frontend/src/domains/new_dashboard/components/dashboard/KanbanColumn.tsx +++ b/frontend/src/features/applications/components/KanbanColumn.tsx @@ -1,4 +1,4 @@ -import type { Job, JobStatus } from "../../types"; +import type { Job, JobStatus } from "@/features/jobs/domain/job"; interface KanbanColumnProps { status: JobStatus; diff --git a/frontend/src/domains/auth/infrastructure/authApi.ts b/frontend/src/features/auth/api/authApi.ts similarity index 97% rename from frontend/src/domains/auth/infrastructure/authApi.ts rename to frontend/src/features/auth/api/authApi.ts index 1d463818..d8ce1a88 100644 --- a/frontend/src/domains/auth/infrastructure/authApi.ts +++ b/frontend/src/features/auth/api/authApi.ts @@ -1,8 +1,8 @@ import type { LoginCredentials, RegisterData, -} from "@/domains/auth/domain/auth.types"; -import { parseApiError } from "@/shared/lib/apiError"; +} from "@/features/auth/domain/auth.types"; +import { parseApiError } from "@/shared/api/apiError"; function getBaseUrl(): string { const base = import.meta.env.VITE_API_BASE_URL; diff --git a/frontend/src/domains/auth/infrastructure/connectionsApi.ts b/frontend/src/features/auth/api/connectionsApi.ts similarity index 100% rename from frontend/src/domains/auth/infrastructure/connectionsApi.ts rename to frontend/src/features/auth/api/connectionsApi.ts diff --git a/frontend/src/domains/auth/application/AuthContext.tsx b/frontend/src/features/auth/application/AuthContext.tsx similarity index 92% rename from frontend/src/domains/auth/application/AuthContext.tsx rename to frontend/src/features/auth/application/AuthContext.tsx index abefd7b5..0850b468 100644 --- a/frontend/src/domains/auth/application/AuthContext.tsx +++ b/frontend/src/features/auth/application/AuthContext.tsx @@ -5,8 +5,8 @@ import { useState, ReactNode, } from "react"; -import type { LoginCredentials, User } from "@/domains/auth/domain/auth.types"; -import { api } from "@/shared/lib/apiClient"; +import type { LoginCredentials, User } from "@/features/auth/domain/auth.types"; +import { api } from "@/shared/api/apiClient"; interface AuthContextData { user: User | null; diff --git a/frontend/src/domains/auth/presentation/components/AuthVisualPanel.tsx b/frontend/src/features/auth/components/AuthVisualPanel.tsx similarity index 100% rename from frontend/src/domains/auth/presentation/components/AuthVisualPanel.tsx rename to frontend/src/features/auth/components/AuthVisualPanel.tsx diff --git a/frontend/src/domains/auth/presentation/components/LoginFormPanel.tsx b/frontend/src/features/auth/components/LoginFormPanel.tsx similarity index 99% rename from frontend/src/domains/auth/presentation/components/LoginFormPanel.tsx rename to frontend/src/features/auth/components/LoginFormPanel.tsx index 0726b4ab..5b563495 100644 --- a/frontend/src/domains/auth/presentation/components/LoginFormPanel.tsx +++ b/frontend/src/features/auth/components/LoginFormPanel.tsx @@ -3,8 +3,8 @@ import { getGoogleAuthUrl, getGithubAuthUrl, getLinkedinAuthUrl, -} from "@/domains/auth/infrastructure/authApi"; -import { useAuth } from "@/domains/auth/application/AuthContext"; +} from "@/features/auth/api/authApi"; +import { useAuth } from "@/features/auth/application/AuthContext"; import { Image } from "@unpic/react"; import { motion } from "framer-motion"; import { ArrowLeft, Eye, EyeOff } from "lucide-react"; diff --git a/frontend/src/domains/auth/presentation/components/RegisterFormPanel.tsx b/frontend/src/features/auth/components/RegisterFormPanel.tsx similarity index 99% rename from frontend/src/domains/auth/presentation/components/RegisterFormPanel.tsx rename to frontend/src/features/auth/components/RegisterFormPanel.tsx index 3f2245ad..56f1bfc0 100644 --- a/frontend/src/domains/auth/presentation/components/RegisterFormPanel.tsx +++ b/frontend/src/features/auth/components/RegisterFormPanel.tsx @@ -10,7 +10,7 @@ import { getGoogleAuthUrl, getLinkedinAuthUrl, register, -} from "../../infrastructure/authApi"; +} from "@/features/auth/api/authApi"; const STATIC_STARS = Array.from({ length: 40 }).map((_, i) => { const random = (min: number, max: number) => diff --git a/frontend/src/domains/auth/domain/auth.types.ts b/frontend/src/features/auth/domain/auth.types.ts similarity index 100% rename from frontend/src/domains/auth/domain/auth.types.ts rename to frontend/src/features/auth/domain/auth.types.ts diff --git a/frontend/src/domains/auth/presentation/pages/AuthCallbackPage.tsx b/frontend/src/features/auth/pages/AuthCallbackPage.tsx similarity index 91% rename from frontend/src/domains/auth/presentation/pages/AuthCallbackPage.tsx rename to frontend/src/features/auth/pages/AuthCallbackPage.tsx index bbc82865..3bde6558 100644 --- a/frontend/src/domains/auth/presentation/pages/AuthCallbackPage.tsx +++ b/frontend/src/features/auth/pages/AuthCallbackPage.tsx @@ -1,6 +1,6 @@ import { useEffect, useRef } from "react"; import { useNavigate } from "react-router-dom"; -import { useAuth } from "@/domains/auth/application/AuthContext"; +import { useAuth } from "@/features/auth/application/AuthContext"; import Loading from "@/shared/ui/Loading"; export default function AuthCallback() { diff --git a/frontend/src/domains/auth/presentation/pages/LoginPage.tsx b/frontend/src/features/auth/pages/LoginPage.tsx similarity index 58% rename from frontend/src/domains/auth/presentation/pages/LoginPage.tsx rename to frontend/src/features/auth/pages/LoginPage.tsx index 3413264c..2aae843c 100644 --- a/frontend/src/domains/auth/presentation/pages/LoginPage.tsx +++ b/frontend/src/features/auth/pages/LoginPage.tsx @@ -1,5 +1,5 @@ -import LeftSide from "@/domains/auth/presentation/components/AuthVisualPanel"; -import RightSide from "@/domains/auth/presentation/components/LoginFormPanel"; +import LeftSide from "@/features/auth/components/AuthVisualPanel"; +import RightSide from "@/features/auth/components/LoginFormPanel"; export default function LoginPage() { return ( diff --git a/frontend/src/domains/auth/presentation/pages/RegisterPage.tsx b/frontend/src/features/auth/pages/RegisterPage.tsx similarity index 59% rename from frontend/src/domains/auth/presentation/pages/RegisterPage.tsx rename to frontend/src/features/auth/pages/RegisterPage.tsx index 2c646cf8..6d178c3b 100644 --- a/frontend/src/domains/auth/presentation/pages/RegisterPage.tsx +++ b/frontend/src/features/auth/pages/RegisterPage.tsx @@ -1,5 +1,5 @@ -import LeftSide from "@/domains/auth/presentation/components/AuthVisualPanel"; -import RegisterSide from "@/domains/auth/presentation/components/RegisterFormPanel"; +import LeftSide from "@/features/auth/components/AuthVisualPanel"; +import RegisterSide from "@/features/auth/components/RegisterFormPanel"; export default function RegisterPage() { diff --git a/frontend/src/domains/new_dashboard/components/dashboard/DashboardTab.tsx b/frontend/src/features/dashboard/components/DashboardTab.tsx similarity index 96% rename from frontend/src/domains/new_dashboard/components/dashboard/DashboardTab.tsx rename to frontend/src/features/dashboard/components/DashboardTab.tsx index 640303f1..e2d59d86 100644 --- a/frontend/src/domains/new_dashboard/components/dashboard/DashboardTab.tsx +++ b/frontend/src/features/dashboard/components/DashboardTab.tsx @@ -1,6 +1,7 @@ import { BriefcaseBusiness, Plus } from "lucide-react"; -import type { Job, JobStatus, TechnologyExperience } from "../../types"; -import { KanbanBoard } from "./KanbanBoard"; +import type { Job, JobStatus } from "@/features/jobs/domain/job"; +import type { TechnologyExperience } from "@/features/profile/domain/user"; +import { KanbanBoard } from "@/features/applications/components/KanbanBoard"; interface DashboardTabProps { jobs: Job[]; diff --git a/frontend/src/domains/new_dashboard/components/help/HelpTab.tsx b/frontend/src/features/help/components/HelpTab.tsx similarity index 100% rename from frontend/src/domains/new_dashboard/components/help/HelpTab.tsx rename to frontend/src/features/help/components/HelpTab.tsx diff --git a/frontend/src/domains/new_dashboard/components/home/CareerChecklist.tsx b/frontend/src/features/home/components/CareerChecklist.tsx similarity index 99% rename from frontend/src/domains/new_dashboard/components/home/CareerChecklist.tsx rename to frontend/src/features/home/components/CareerChecklist.tsx index a1155d13..b54c9a87 100644 --- a/frontend/src/domains/new_dashboard/components/home/CareerChecklist.tsx +++ b/frontend/src/features/home/components/CareerChecklist.tsx @@ -1,6 +1,6 @@ import { ListChecks, Plus, Trash2 } from "lucide-react"; import { useEffect, useMemo, useState } from "react"; -import type { CareerChecklist as CareerChecklistList } from "../../types"; +import type { CareerChecklist as CareerChecklistList } from "@/features/profile/domain/user"; type ChecklistItem = { id: string; diff --git a/frontend/src/domains/new_dashboard/components/home/HomeTab.tsx b/frontend/src/features/home/components/HomeTab.tsx similarity index 93% rename from frontend/src/domains/new_dashboard/components/home/HomeTab.tsx rename to frontend/src/features/home/components/HomeTab.tsx index f4dbeb87..8d222223 100644 --- a/frontend/src/domains/new_dashboard/components/home/HomeTab.tsx +++ b/frontend/src/features/home/components/HomeTab.tsx @@ -1,6 +1,7 @@ import { ClipboardList } from "lucide-react"; -import { jobStatuses } from "../../constants"; -import type { CareerChecklist as CareerChecklistList, Job, UserProfile } from "../../types"; +import { jobStatuses } from "@/features/jobs/constants"; +import type { CareerChecklist as CareerChecklistList, UserProfile } from "@/features/profile/domain/user"; +import type { Job } from "@/features/jobs/domain/job"; import { CareerChecklist } from "./CareerChecklist"; import { StatusCounters } from "./StatusCounters"; import { WelcomeBanner } from "./WelcomeBanner"; diff --git a/frontend/src/domains/new_dashboard/components/home/StatusConters.tsx b/frontend/src/features/home/components/StatusConters.tsx similarity index 100% rename from frontend/src/domains/new_dashboard/components/home/StatusConters.tsx rename to frontend/src/features/home/components/StatusConters.tsx diff --git a/frontend/src/domains/new_dashboard/components/home/StatusCounters.tsx b/frontend/src/features/home/components/StatusCounters.tsx similarity index 96% rename from frontend/src/domains/new_dashboard/components/home/StatusCounters.tsx rename to frontend/src/features/home/components/StatusCounters.tsx index 8e472fe4..e8b1d622 100644 --- a/frontend/src/domains/new_dashboard/components/home/StatusCounters.tsx +++ b/frontend/src/features/home/components/StatusCounters.tsx @@ -1,4 +1,4 @@ -import type { Job } from "../../types"; +import type { Job } from "@/features/jobs/domain/job"; interface StatusCountersProps { jobs: Job[]; diff --git a/frontend/src/domains/new_dashboard/components/home/WelcomeBanner.tsx b/frontend/src/features/home/components/WelcomeBanner.tsx similarity index 96% rename from frontend/src/domains/new_dashboard/components/home/WelcomeBanner.tsx rename to frontend/src/features/home/components/WelcomeBanner.tsx index 31c61001..3bbaa915 100644 --- a/frontend/src/domains/new_dashboard/components/home/WelcomeBanner.tsx +++ b/frontend/src/features/home/components/WelcomeBanner.tsx @@ -1,5 +1,5 @@ import { BriefcaseBusiness, Sparkles } from "lucide-react"; -import type { UserProfile } from "../../types"; +import type { UserProfile } from "@/features/profile/domain/user"; interface WelcomeBannerProps { userProfile: UserProfile; diff --git a/frontend/src/domains/new_dashboard/infrastructure/dashboardJobsApi.ts b/frontend/src/features/jobs/api/dashboardJobsApi.ts similarity index 99% rename from frontend/src/domains/new_dashboard/infrastructure/dashboardJobsApi.ts rename to frontend/src/features/jobs/api/dashboardJobsApi.ts index d3ce88d7..b14b306c 100644 --- a/frontend/src/domains/new_dashboard/infrastructure/dashboardJobsApi.ts +++ b/frontend/src/features/jobs/api/dashboardJobsApi.ts @@ -1,4 +1,4 @@ -import { api } from "@/shared/lib/apiClient"; +import { api } from "@/shared/api/apiClient"; import { z } from "zod"; import type { Job, @@ -8,7 +8,7 @@ import type { JobType, MatchSort, NewJob, -} from "../types"; +} from "@/features/jobs/domain/job"; const ApiSearchJobSchema = z .object({ diff --git a/frontend/src/domains/jobs/infrastructure/jobsApi.ts b/frontend/src/features/jobs/api/jobsApi.ts similarity index 98% rename from frontend/src/domains/jobs/infrastructure/jobsApi.ts rename to frontend/src/features/jobs/api/jobsApi.ts index 28e0351f..47f7931d 100644 --- a/frontend/src/domains/jobs/infrastructure/jobsApi.ts +++ b/frontend/src/features/jobs/api/jobsApi.ts @@ -1,4 +1,4 @@ -import type { JobsResponse } from "@/domains/jobs/domain/job.types"; +import type { JobsResponse } from "@/features/jobs/types/job.types"; function normalizeBaseUrl(value: string | undefined): string { return typeof value === "string" ? value.trim().replace(/\/+$/, "") : ""; diff --git a/frontend/src/domains/new_dashboard/components/jobs/FormattedJobDescription.tsx b/frontend/src/features/jobs/components/FormattedJobDescription.tsx similarity index 100% rename from frontend/src/domains/new_dashboard/components/jobs/FormattedJobDescription.tsx rename to frontend/src/features/jobs/components/FormattedJobDescription.tsx diff --git a/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx b/frontend/src/features/jobs/components/JobDetailModal.tsx similarity index 96% rename from frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx rename to frontend/src/features/jobs/components/JobDetailModal.tsx index a0707757..735c3dab 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx +++ b/frontend/src/features/jobs/components/JobDetailModal.tsx @@ -1,14 +1,14 @@ import { ExternalLink } from "lucide-react"; import { useEffect, useState } from "react"; -import { jobStatusClasses, jobStatuses } from "../../constants"; +import { jobStatusClasses, jobStatuses } from "../constants"; import { getDashboardSavedJobEvents, getFamilyLabel, -} from "../../infrastructure/dashboardJobsApi"; -import type { Job, JobStatus, JobTimelineEvent } from "../../types"; -import { Modal } from "../shared/Modal"; -import { ApplicationNotesSection } from "./ApplicationNotesSection"; -import { FormattedJobDescription } from "./FormattedJobDescription"; +} from "@/features/jobs/api/dashboardJobsApi"; +import type { Job, JobStatus, JobTimelineEvent } from "../domain/job"; +import { Modal } from "@/shared/ui/Modal"; +import { ApplicationNotesSection } from "@/features/applications/components/ApplicationNotesSection"; +import { FormattedJobDescription } from "@/features/jobs/components/FormattedJobDescription"; interface JobDetailModalProps { job: Job; diff --git a/frontend/src/domains/new_dashboard/components/jobs/JobFilter.tsx b/frontend/src/features/jobs/components/JobFilter.tsx similarity index 97% rename from frontend/src/domains/new_dashboard/components/jobs/JobFilter.tsx rename to frontend/src/features/jobs/components/JobFilter.tsx index a8039576..ce466787 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobFilter.tsx +++ b/frontend/src/features/jobs/components/JobFilter.tsx @@ -1,14 +1,14 @@ import { Search, ChevronDown } from "lucide-react"; import { useState, useRef, useEffect, useMemo } from "react"; -import { jobLevels } from "../../constants"; -import type { JobModelFilter, MatchSort } from "../../types"; -import { jobModelFilterOptions } from "../../utils/jobModelFilters"; +import { jobLevels } from "../constants"; +import type { JobModelFilter, MatchSort } from "../domain/job"; +import { jobModelFilterOptions } from "@/features/jobs/domain/jobModelFilters"; import { continentOptions, countryOptions, type ContinentFilter, type CountryFilter, -} from "../../utils/locationFilters"; +} from "@/features/jobs/domain/locationFilters"; interface JobFilterProps { searchQuery: string; diff --git a/frontend/src/domains/new_dashboard/components/jobs/JobFilters.tsx b/frontend/src/features/jobs/components/JobFilters.tsx similarity index 100% rename from frontend/src/domains/new_dashboard/components/jobs/JobFilters.tsx rename to frontend/src/features/jobs/components/JobFilters.tsx diff --git a/frontend/src/domains/new_dashboard/components/jobs/JobRow.tsx b/frontend/src/features/jobs/components/JobRow.tsx similarity index 95% rename from frontend/src/domains/new_dashboard/components/jobs/JobRow.tsx rename to frontend/src/features/jobs/components/JobRow.tsx index 43dc9329..a0538686 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobRow.tsx +++ b/frontend/src/features/jobs/components/JobRow.tsx @@ -1,6 +1,6 @@ -import { jobStatuses } from "../../constants"; -import type { Job, JobStatus } from "../../types"; -import { getFamilyLabel } from "../../infrastructure/dashboardJobsApi"; +import { jobStatuses } from "../constants"; +import type { Job, JobStatus } from "../domain/job"; +import { getFamilyLabel } from "@/features/jobs/api/dashboardJobsApi"; interface JobRowProps { job: Job; diff --git a/frontend/src/domains/new_dashboard/components/jobs/JobTab.tsx b/frontend/src/features/jobs/components/JobTab.tsx similarity index 95% rename from frontend/src/domains/new_dashboard/components/jobs/JobTab.tsx rename to frontend/src/features/jobs/components/JobTab.tsx index 04cd2598..9f01be0d 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobTab.tsx +++ b/frontend/src/features/jobs/components/JobTab.tsx @@ -4,16 +4,16 @@ import type { JobModelFilter, JobStatus, MatchSort, - SearchPreferences, -} from "../../types"; +} from "../domain/job"; +import type { SearchPreferences } from "@/features/profile/domain/user"; import { type ContinentFilter, type CountryFilter, -} from "../../utils/locationFilters"; +} from "@/features/jobs/domain/locationFilters"; import { getModelFilterFromJobTypes, jobModelFilterOptions, -} from "../../utils/jobModelFilters"; +} from "@/features/jobs/domain/jobModelFilters"; import { JobFilter } from "./JobFilter"; import { JobTable } from "./JobTable"; diff --git a/frontend/src/domains/new_dashboard/components/jobs/JobTable.tsx b/frontend/src/features/jobs/components/JobTable.tsx similarity index 99% rename from frontend/src/domains/new_dashboard/components/jobs/JobTable.tsx rename to frontend/src/features/jobs/components/JobTable.tsx index c7563520..ead1b716 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobTable.tsx +++ b/frontend/src/features/jobs/components/JobTable.tsx @@ -6,7 +6,7 @@ import { ChevronRight, } from "lucide-react"; import { useMemo, useState } from "react"; -import type { Job, JobStatus } from "../../types"; +import type { Job, JobStatus } from "../domain/job"; import { JobRow } from "./JobRow"; type SortColumn = "source" | "level" | "posted"; diff --git a/frontend/src/domains/jobs/presentation/components/JobsFiltersCard.tsx b/frontend/src/features/jobs/components/JobsFiltersCard.tsx similarity index 98% rename from frontend/src/domains/jobs/presentation/components/JobsFiltersCard.tsx rename to frontend/src/features/jobs/components/JobsFiltersCard.tsx index 6b781e33..84b3145b 100644 --- a/frontend/src/domains/jobs/presentation/components/JobsFiltersCard.tsx +++ b/frontend/src/features/jobs/components/JobsFiltersCard.tsx @@ -1,7 +1,7 @@ import { Badge } from "@/shared/ui/badge"; import { Card, CardContent } from "@/shared/ui/card"; import { Input } from "@/shared/ui/input"; -import type { JobsPaginationMeta } from "@/domains/jobs/application/useJobsData"; +import type { JobsPaginationMeta } from "@/features/jobs/hooks/useJobsData"; import { useMemo, useState, @@ -19,7 +19,7 @@ import { FiSlash, FiTag, } from "react-icons/fi"; -import { KeywordsModal } from "./KeywordsModal"; +import { KeywordsModal } from "@/features/jobs/components/KeywordsModal"; import { Button } from "@/shared/ui/button"; interface JobsFiltersCardProps { search: string; diff --git a/frontend/src/domains/jobs/presentation/components/JobsHeaderCard.tsx b/frontend/src/features/jobs/components/JobsHeaderCard.tsx similarity index 100% rename from frontend/src/domains/jobs/presentation/components/JobsHeaderCard.tsx rename to frontend/src/features/jobs/components/JobsHeaderCard.tsx diff --git a/frontend/src/domains/jobs/presentation/components/JobsTableCard.tsx b/frontend/src/features/jobs/components/JobsTableCard.tsx similarity index 98% rename from frontend/src/domains/jobs/presentation/components/JobsTableCard.tsx rename to frontend/src/features/jobs/components/JobsTableCard.tsx index 98c3f9ed..0d007c08 100644 --- a/frontend/src/domains/jobs/presentation/components/JobsTableCard.tsx +++ b/frontend/src/features/jobs/components/JobsTableCard.tsx @@ -14,9 +14,9 @@ import { TableHeader, TableRow, } from "@/shared/ui/table"; -import { cn } from "@/shared/lib/utils"; -import type { Job } from "@/domains/jobs/domain/job.types"; -import type { JobsPaginationMeta } from "@/domains/jobs/application/useJobsData"; +import { cn } from "@/shared/utils/utils"; +import type { Job } from "@/features/jobs/types/job.types"; +import type { JobsPaginationMeta } from "@/features/jobs/hooks/useJobsData"; import { useState } from "react"; import { FiCheckSquare, diff --git a/frontend/src/domains/jobs/presentation/components/KeywordsModal.tsx b/frontend/src/features/jobs/components/KeywordsModal.tsx similarity index 98% rename from frontend/src/domains/jobs/presentation/components/KeywordsModal.tsx rename to frontend/src/features/jobs/components/KeywordsModal.tsx index 995c3495..4b532967 100644 --- a/frontend/src/domains/jobs/presentation/components/KeywordsModal.tsx +++ b/frontend/src/features/jobs/components/KeywordsModal.tsx @@ -1,7 +1,7 @@ import { fetchKeywords, saveKeywords, -} from "@/domains/jobs/infrastructure/jobsApi"; +} from "@/features/jobs/api/jobsApi"; import { X } from "lucide-react"; import { useEffect, useState } from "react"; import { Badge } from "@/shared/ui/badge"; diff --git a/frontend/src/features/jobs/constants.ts b/frontend/src/features/jobs/constants.ts new file mode 100644 index 00000000..c6a93034 --- /dev/null +++ b/frontend/src/features/jobs/constants.ts @@ -0,0 +1,25 @@ +import type { JobLevel, JobStatus, JobType } from "./domain/job"; + +export const jobStatuses: Record = { + saved: "Salva", + applied: "Candidatura enviada", + interviewing: "Em entrevista", + rejected: "Arquivada", + accepted: "Proposta aceita", +}; + +export const jobStatusClasses: Record = { + saved: "border-amber-300 bg-amber-50 text-amber-700 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-300", + applied: "border-sky-300 bg-sky-50 text-sky-700 dark:border-sky-500/40 dark:bg-sky-500/10 dark:text-sky-300", + interviewing: "border-violet-300 bg-violet-50 text-violet-700 dark:border-violet-500/40 dark:bg-violet-500/10 dark:text-violet-300", + rejected: "border-rose-300 bg-rose-50 text-rose-700 dark:border-rose-500/40 dark:bg-rose-500/10 dark:text-rose-300", + accepted: "border-emerald-300 bg-emerald-50 text-emerald-700 dark:border-emerald-500/40 dark:bg-emerald-500/10 dark:text-emerald-300", +}; + +export const jobTypes: JobType[] = ["Remoto", "Híbrido", "Presencial"]; +export const jobLevels: JobLevel[] = [ + "Estágio/Trainee", + "Júnior", + "Pleno", + "Sênior", +]; diff --git a/frontend/src/domains/new_dashboard/types/job.ts b/frontend/src/features/jobs/domain/job.ts similarity index 100% rename from frontend/src/domains/new_dashboard/types/job.ts rename to frontend/src/features/jobs/domain/job.ts diff --git a/frontend/src/domains/jobs/domain/jobFilters.ts b/frontend/src/features/jobs/domain/jobFilters.ts similarity index 98% rename from frontend/src/domains/jobs/domain/jobFilters.ts rename to frontend/src/features/jobs/domain/jobFilters.ts index a52e25e8..93840b5e 100644 --- a/frontend/src/domains/jobs/domain/jobFilters.ts +++ b/frontend/src/features/jobs/domain/jobFilters.ts @@ -1,4 +1,4 @@ -import type { Job } from "@/domains/jobs/domain/job.types"; +import type { Job } from "@/features/jobs/types/job.types"; export function normalizeComparableText(value?: string | null) { return String(value || "") diff --git a/frontend/src/domains/new_dashboard/utils/jobModelFilters.ts b/frontend/src/features/jobs/domain/jobModelFilters.ts similarity index 96% rename from frontend/src/domains/new_dashboard/utils/jobModelFilters.ts rename to frontend/src/features/jobs/domain/jobModelFilters.ts index 1dd837b4..e2dd1ff9 100644 --- a/frontend/src/domains/new_dashboard/utils/jobModelFilters.ts +++ b/frontend/src/features/jobs/domain/jobModelFilters.ts @@ -1,4 +1,4 @@ -import type { Job, JobModelFilter, JobType } from "../types"; +import type { Job, JobModelFilter, JobType } from "./job"; export const jobModelFilterOptions: Array<{ value: JobModelFilter; diff --git a/frontend/src/domains/jobs/domain/jobPagination.ts b/frontend/src/features/jobs/domain/jobPagination.ts similarity index 100% rename from frontend/src/domains/jobs/domain/jobPagination.ts rename to frontend/src/features/jobs/domain/jobPagination.ts diff --git a/frontend/src/domains/new_dashboard/utils/locationFilters.ts b/frontend/src/features/jobs/domain/locationFilters.ts similarity index 98% rename from frontend/src/domains/new_dashboard/utils/locationFilters.ts rename to frontend/src/features/jobs/domain/locationFilters.ts index 1e1a4c89..cacb78b0 100644 --- a/frontend/src/domains/new_dashboard/utils/locationFilters.ts +++ b/frontend/src/features/jobs/domain/locationFilters.ts @@ -1,4 +1,4 @@ -import type { Job } from "../types"; +import type { Job } from "./job"; export const continentOptions = [ "Todos", diff --git a/frontend/src/domains/new_dashboard/utils/searchKeywords.ts b/frontend/src/features/jobs/domain/searchKeywords.ts similarity index 100% rename from frontend/src/domains/new_dashboard/utils/searchKeywords.ts rename to frontend/src/features/jobs/domain/searchKeywords.ts diff --git a/frontend/src/domains/new_dashboard/hooks/useDashboardJobs.ts b/frontend/src/features/jobs/hooks/useDashboardJobs.ts similarity index 97% rename from frontend/src/domains/new_dashboard/hooks/useDashboardJobs.ts rename to frontend/src/features/jobs/hooks/useDashboardJobs.ts index ac0e7bf9..dea0256c 100644 --- a/frontend/src/domains/new_dashboard/hooks/useDashboardJobs.ts +++ b/frontend/src/features/jobs/hooks/useDashboardJobs.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useRef, useState } from "react"; -import type { User } from "@/domains/auth/domain/auth.types"; -import { isApiError } from "@/shared/lib/apiError"; -import type { Job, JobStatus, NewJob } from "../types"; +import type { User } from "@/features/auth/domain/auth.types"; +import { isApiError } from "@/shared/api/apiError"; +import type { Job, JobStatus, NewJob } from "@/features/jobs/domain/job"; import { createDashboardSavedJob, getDashboardSavedJobs, @@ -9,8 +9,8 @@ import { type SearchJobFilters, type SearchJobsResult, updateDashboardSavedJob, -} from "../infrastructure/dashboardJobsApi"; -import { requestDashboardNotificationsRefresh } from "../utils/notificationEvents"; +} from "@/features/jobs/api/dashboardJobsApi"; +import { requestDashboardNotificationsRefresh } from "@/features/notifications/events"; interface UseDashboardJobsOptions { onError?: (message: string) => void; diff --git a/frontend/src/domains/jobs/application/useJobsData.ts b/frontend/src/features/jobs/hooks/useJobsData.ts similarity index 95% rename from frontend/src/domains/jobs/application/useJobsData.ts rename to frontend/src/features/jobs/hooks/useJobsData.ts index 077ce39e..bea81378 100644 --- a/frontend/src/domains/jobs/application/useJobsData.ts +++ b/frontend/src/features/jobs/hooks/useJobsData.ts @@ -1,8 +1,8 @@ import { fetchJobsByAPI, runScraperRequest, -} from "@/domains/jobs/infrastructure/jobsApi"; -import type { Job, JobsResponse } from "@/domains/jobs/domain/job.types"; +} from "@/features/jobs/api/jobsApi"; +import type { Job, JobsResponse } from "@/features/jobs/types/job.types"; import { useCallback, useEffect, useRef, useState } from "react"; export type JobsPaginationMeta = Omit; diff --git a/frontend/src/domains/jobs/application/useJobsFiltering.ts b/frontend/src/features/jobs/hooks/useJobsFiltering.ts similarity index 84% rename from frontend/src/domains/jobs/application/useJobsFiltering.ts rename to frontend/src/features/jobs/hooks/useJobsFiltering.ts index 15fd736e..0e0fe66c 100644 --- a/frontend/src/domains/jobs/application/useJobsFiltering.ts +++ b/frontend/src/features/jobs/hooks/useJobsFiltering.ts @@ -1,9 +1,9 @@ -import type { Job } from "@/domains/jobs/domain/job.types"; +import type { Job } from "@/features/jobs/types/job.types"; import { dedupeJobs, filterJobs, getAvailableKeywords, -} from "@/domains/jobs/domain/jobFilters"; +} from "@/features/jobs/domain/jobFilters"; import { useMemo } from "react"; export function useJobsFiltering( diff --git a/frontend/src/domains/jobs/application/useJobsPagination.ts b/frontend/src/features/jobs/hooks/useJobsPagination.ts similarity index 93% rename from frontend/src/domains/jobs/application/useJobsPagination.ts rename to frontend/src/features/jobs/hooks/useJobsPagination.ts index 52fb0797..cb8e2d7e 100644 --- a/frontend/src/domains/jobs/application/useJobsPagination.ts +++ b/frontend/src/features/jobs/hooks/useJobsPagination.ts @@ -1,10 +1,10 @@ -import type { Job } from "@/domains/jobs/domain/job.types"; +import type { Job } from "@/features/jobs/types/job.types"; import { clampPageSize, getCurrentPage, getTotalPages, paginateItems, -} from "@/domains/jobs/domain/jobPagination"; +} from "@/features/jobs/domain/jobPagination"; import { useMemo, useState } from "react"; interface UseJobsPaginationParams { diff --git a/frontend/src/domains/new_dashboard/context/JobsContext.tsx b/frontend/src/features/jobs/legacy/application/JobsContext.tsx similarity index 82% rename from frontend/src/domains/new_dashboard/context/JobsContext.tsx rename to frontend/src/features/jobs/legacy/application/JobsContext.tsx index c3645b1c..05de106c 100644 --- a/frontend/src/domains/new_dashboard/context/JobsContext.tsx +++ b/frontend/src/features/jobs/legacy/application/JobsContext.tsx @@ -1,8 +1,9 @@ import { createContext, useContext, useState, type ReactNode } from "react"; -import { initialJobs, jobStatuses } from "../constants"; -import type { Job, JobStatus, NewJob } from "../types"; -import { createJobFromForm } from "../utils/helpers"; -import { useToastContext } from "./ToastContext"; +import { initialJobs } from "@/features/jobs/legacy/initialJobs"; +import { jobStatuses } from "@/features/jobs/constants"; +import type { Job, JobStatus, NewJob } from "@/features/jobs/domain/job"; +import { createJobFromForm } from "@/features/jobs/legacy/domain/helpers"; +import { useToastContext } from "@/shared/feedback/ToastContext"; interface JobsContextValue { jobs: Job[]; diff --git a/frontend/src/domains/new_dashboard/utils/helpers.ts b/frontend/src/features/jobs/legacy/domain/helpers.ts similarity index 94% rename from frontend/src/domains/new_dashboard/utils/helpers.ts rename to frontend/src/features/jobs/legacy/domain/helpers.ts index 5717207f..7428c480 100644 --- a/frontend/src/domains/new_dashboard/utils/helpers.ts +++ b/frontend/src/features/jobs/legacy/domain/helpers.ts @@ -1,4 +1,4 @@ -import type { Job, NewJob } from "../types"; +import type { Job, NewJob } from "@/features/jobs/domain/job"; export function splitTags(tags: string): string[] { return tags diff --git a/frontend/src/features/jobs/legacy/hooks/useJobs.ts b/frontend/src/features/jobs/legacy/hooks/useJobs.ts new file mode 100644 index 00000000..e4780255 --- /dev/null +++ b/frontend/src/features/jobs/legacy/hooks/useJobs.ts @@ -0,0 +1 @@ +export { useJobsContext as useJobs } from "@/features/jobs/legacy/application/JobsContext"; diff --git a/frontend/src/features/jobs/legacy/initialJobs.ts b/frontend/src/features/jobs/legacy/initialJobs.ts new file mode 100644 index 00000000..50d5b66f --- /dev/null +++ b/frontend/src/features/jobs/legacy/initialJobs.ts @@ -0,0 +1,68 @@ +import type { Job } from "../domain/job"; + +export const initialJobs: Job[] = [ + { + id: "f81d4fae-7dec-11d0-a765-00a0c91e6bf6", + jobTitle: "Desenvolvedor Frontend Sênior React", + company: "Fintech Hub Brasil", + location: "São Paulo, SP (Híbrido)", + salary: "R$ 14.000 - R$ 17.500", + type: "Híbrido", + level: "Sênior", + matchScore: 94, + tags: ["React", "TypeScript", "Tailwind CSS", "Next.js"], + posted: "Há 2 dias", + status: "saved", + jobLink: "https://fintechhub.com/vagas/react-senior", + source: "Gupy", + notes: "Preparar portfólio de fintech antes de submeter.", + }, + { + id: "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b", + jobTitle: "Engenheiro de Software Fullstack Pleno", + company: "Stellar Tech", + location: "Remoto", + salary: "R$ 8.500 - R$ 11.000", + type: "Remoto", + level: "Pleno", + matchScore: 89, + tags: ["React", "Node.js", "PostgreSQL", "Docker"], + posted: "Há 5 dias", + status: "applied", + jobLink: "https://stellartech.solides.jobs/vaga/fullstack-pleno", + source: "Solides", + notes: "Inscrito na vaga. Aguardando retorno do RH no e-mail.", + }, + { + id: "a3a1b894-3a5f-4a0b-9ffb-3b8d4e9c71bc", + jobTitle: "Designer de Produto UI/UX Júnior", + company: "Agência Criativa Digital", + location: "Rio de Janeiro, RJ (Presencial)", + salary: "R$ 4.500 - R$ 5.800", + type: "Presencial", + level: "Júnior", + matchScore: 78, + tags: ["Figma", "Prototipação", "Design Systems", "User Research"], + posted: "Há 1 dia", + status: "saved", + jobLink: "https://agenciacriativa.com/carreiras/uiux", + source: "LinkedIn", + notes: "Necessário enviar portfólio via formulário próprio.", + }, + { + id: "d9b2c374-e861-46da-b39f-7bcda238510a", + jobTitle: "Product Owner & Product Manager", + company: "Unicórnio Delivery", + location: "Remoto", + salary: "R$ 12.000 - R$ 15.000", + type: "Remoto", + level: "Sênior", + matchScore: 82, + tags: ["Agile", "Scrum", "Product Metrics", "Jira"], + posted: "Há 1 semana", + status: "interviewing", + jobLink: "https://unicorndelivery.gupy.io/jobs/19902", + source: "Gupy", + notes: "Entrevista marcada para terça-feira com a Product Lead Carolina.", + }, +]; diff --git a/frontend/src/domains/jobs/presentation/pages/JobsPage.tsx b/frontend/src/features/jobs/pages/JobsPage.tsx similarity index 95% rename from frontend/src/domains/jobs/presentation/pages/JobsPage.tsx rename to frontend/src/features/jobs/pages/JobsPage.tsx index 76a8d050..564c83df 100644 --- a/frontend/src/domains/jobs/presentation/pages/JobsPage.tsx +++ b/frontend/src/features/jobs/pages/JobsPage.tsx @@ -1,6 +1,6 @@ -import { JobsFiltersCard } from "@/domains/jobs/presentation/components/JobsFiltersCard"; -import { JobsTableCard } from "@/domains/jobs/presentation/components/JobsTableCard"; -import { useJobsData } from "@/domains/jobs/application/useJobsData"; +import { JobsFiltersCard } from "@/features/jobs/components/JobsFiltersCard"; +import { JobsTableCard } from "@/features/jobs/components/JobsTableCard"; +import { useJobsData } from "@/features/jobs/hooks/useJobsData"; import { useCallback, useEffect, useMemo, type SetStateAction } from "react"; import { useSearchParams } from "react-router-dom"; diff --git a/frontend/src/domains/jobs/domain/job.types.ts b/frontend/src/features/jobs/types/job.types.ts similarity index 100% rename from frontend/src/domains/jobs/domain/job.types.ts rename to frontend/src/features/jobs/types/job.types.ts diff --git a/frontend/src/domains/marketing/presentation/components/CTASection.tsx b/frontend/src/features/marketing/components/CTASection.tsx similarity index 100% rename from frontend/src/domains/marketing/presentation/components/CTASection.tsx rename to frontend/src/features/marketing/components/CTASection.tsx diff --git a/frontend/src/domains/marketing/presentation/components/FeaturesSection.tsx b/frontend/src/features/marketing/components/FeaturesSection.tsx similarity index 100% rename from frontend/src/domains/marketing/presentation/components/FeaturesSection.tsx rename to frontend/src/features/marketing/components/FeaturesSection.tsx diff --git a/frontend/src/domains/marketing/presentation/components/Footer.tsx b/frontend/src/features/marketing/components/Footer.tsx similarity index 100% rename from frontend/src/domains/marketing/presentation/components/Footer.tsx rename to frontend/src/features/marketing/components/Footer.tsx diff --git a/frontend/src/domains/marketing/presentation/components/HeroSection.tsx b/frontend/src/features/marketing/components/HeroSection.tsx similarity index 100% rename from frontend/src/domains/marketing/presentation/components/HeroSection.tsx rename to frontend/src/features/marketing/components/HeroSection.tsx diff --git a/frontend/src/domains/marketing/presentation/components/HowItWorks.tsx b/frontend/src/features/marketing/components/HowItWorks.tsx similarity index 100% rename from frontend/src/domains/marketing/presentation/components/HowItWorks.tsx rename to frontend/src/features/marketing/components/HowItWorks.tsx diff --git a/frontend/src/domains/marketing/presentation/components/LegalDocumentPage.tsx b/frontend/src/features/marketing/components/LegalDocumentPage.tsx similarity index 100% rename from frontend/src/domains/marketing/presentation/components/LegalDocumentPage.tsx rename to frontend/src/features/marketing/components/LegalDocumentPage.tsx diff --git a/frontend/src/domains/marketing/presentation/components/Navbar.tsx b/frontend/src/features/marketing/components/Navbar.tsx similarity index 100% rename from frontend/src/domains/marketing/presentation/components/Navbar.tsx rename to frontend/src/features/marketing/components/Navbar.tsx diff --git a/frontend/src/domains/marketing/presentation/components/TeamSection.tsx b/frontend/src/features/marketing/components/TeamSection.tsx similarity index 100% rename from frontend/src/domains/marketing/presentation/components/TeamSection.tsx rename to frontend/src/features/marketing/components/TeamSection.tsx diff --git a/frontend/src/features/marketing/pages/LandingPage.tsx b/frontend/src/features/marketing/pages/LandingPage.tsx new file mode 100644 index 00000000..858dcb89 --- /dev/null +++ b/frontend/src/features/marketing/pages/LandingPage.tsx @@ -0,0 +1,23 @@ +import { CTASection } from "@/features/marketing/components/CTASection"; +import { FeaturesSection } from "@/features/marketing/components/FeaturesSection"; +import { Footer } from "@/features/marketing/components/Footer"; +import { HeroSection } from "@/features/marketing/components/HeroSection"; +import { HowItWorks } from "@/features/marketing/components/HowItWorks"; +import { Navbar } from "@/features/marketing/components/Navbar"; +import TeamSection from "@/features/marketing/components/TeamSection"; + +export default function LandingPage() { + return ( +
+ +
+ + + + + +
+
+
+ ); +} diff --git a/frontend/src/domains/marketing/presentation/pages/PrivacyPolicyPage.tsx b/frontend/src/features/marketing/pages/PrivacyPolicyPage.tsx similarity index 76% rename from frontend/src/domains/marketing/presentation/pages/PrivacyPolicyPage.tsx rename to frontend/src/features/marketing/pages/PrivacyPolicyPage.tsx index 68e7fd2d..41296831 100644 --- a/frontend/src/domains/marketing/presentation/pages/PrivacyPolicyPage.tsx +++ b/frontend/src/features/marketing/pages/PrivacyPolicyPage.tsx @@ -1,4 +1,4 @@ -import { LegalDocumentPage } from "@/domains/marketing/presentation/components/LegalDocumentPage"; +import { LegalDocumentPage } from "@/features/marketing/components/LegalDocumentPage"; const privacyPolicyUrl = "/politica-de-privacidade-candidate.pdf"; diff --git a/frontend/src/domains/marketing/presentation/pages/TermsOfUsePage.tsx b/frontend/src/features/marketing/pages/TermsOfUsePage.tsx similarity index 74% rename from frontend/src/domains/marketing/presentation/pages/TermsOfUsePage.tsx rename to frontend/src/features/marketing/pages/TermsOfUsePage.tsx index d8304a48..d0145cc6 100644 --- a/frontend/src/domains/marketing/presentation/pages/TermsOfUsePage.tsx +++ b/frontend/src/features/marketing/pages/TermsOfUsePage.tsx @@ -1,4 +1,4 @@ -import { LegalDocumentPage } from "@/domains/marketing/presentation/components/LegalDocumentPage"; +import { LegalDocumentPage } from "@/features/marketing/components/LegalDocumentPage"; const termsOfUseUrl = "/termos-de-uso-candidate.pdf"; diff --git a/frontend/src/domains/new_dashboard/components/mentoring/MentorCard.tsx b/frontend/src/features/mentoring/components/MentorCard.tsx similarity index 98% rename from frontend/src/domains/new_dashboard/components/mentoring/MentorCard.tsx rename to frontend/src/features/mentoring/components/MentorCard.tsx index eadc89ef..32caa3af 100644 --- a/frontend/src/domains/new_dashboard/components/mentoring/MentorCard.tsx +++ b/frontend/src/features/mentoring/components/MentorCard.tsx @@ -1,5 +1,5 @@ import { CalendarDays, ChevronRight, Clock3, Star } from "lucide-react"; -import type { Mentor } from "../../types"; +import type { Mentor } from "../types"; interface MentorCardProps { mentor: Mentor; diff --git a/frontend/src/domains/new_dashboard/components/mentoring/MentorDetailModal.tsx b/frontend/src/features/mentoring/components/MentorDetailModal.tsx similarity index 97% rename from frontend/src/domains/new_dashboard/components/mentoring/MentorDetailModal.tsx rename to frontend/src/features/mentoring/components/MentorDetailModal.tsx index 13aa7fc8..4d636120 100644 --- a/frontend/src/domains/new_dashboard/components/mentoring/MentorDetailModal.tsx +++ b/frontend/src/features/mentoring/components/MentorDetailModal.tsx @@ -1,7 +1,7 @@ import { CheckCircle2, ExternalLink } from "lucide-react"; import { useState } from "react"; -import type { Mentor } from "../../types"; -import { Modal } from "../shared/Modal"; +import type { Mentor } from "../types"; +import { Modal } from "@/shared/ui/Modal"; interface MentorDetailModalProps { mentor: Mentor; diff --git a/frontend/src/domains/new_dashboard/components/mentoring/MentoringTab.tsx b/frontend/src/features/mentoring/components/MentoringTab.tsx similarity index 90% rename from frontend/src/domains/new_dashboard/components/mentoring/MentoringTab.tsx rename to frontend/src/features/mentoring/components/MentoringTab.tsx index 15db99db..5548ddda 100644 --- a/frontend/src/domains/new_dashboard/components/mentoring/MentoringTab.tsx +++ b/frontend/src/features/mentoring/components/MentoringTab.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; -import { initialMentors } from "../../constants"; -import type { Mentor } from "../../types"; +import { initialMentors } from "../demoMentors"; +import type { Mentor } from "../types"; import { MentorCard } from "./MentorCard"; import { MentorDetailModal } from "./MentorDetailModal"; diff --git a/frontend/src/features/mentoring/demoMentors.ts b/frontend/src/features/mentoring/demoMentors.ts new file mode 100644 index 00000000..ed285aa6 --- /dev/null +++ b/frontend/src/features/mentoring/demoMentors.ts @@ -0,0 +1,49 @@ +import type { Mentor } from "@/features/mentoring/types"; + +export const initialMentors: Mentor[] = [ + { + id: "mentor-1", + name: "Julio Silva", + rating: 3, + completed: 33, + days: "Seg, Qua, Sex", + hours: "10:00 - 13:00", + nextSessionDate: "Próxima mentoria: quarta-feira, 24 jul", + specialty: "Frontend React, Design de Componentes e Otimização de Performance", + avatarColor: "from-teal-500 to-emerald-600", + platform: "Google Meet", + platformUrl: "https://meet.google.com/react-mentor-demo", + agenda: + "Revisão de componentes React, organização de estados, renderização eficiente e próximos passos para um portfólio frontend mais forte.", + }, + { + id: "mentor-2", + name: "Silvia Maria", + rating: 4, + completed: 103, + days: "Seg, Ter, Qua, Sex", + hours: "10:00 - 13:00", + nextSessionDate: "Próxima mentoria: terça-feira, 23 jul", + specialty: "Arquitetura Fullstack, Bancos de Dados Relacionais e APIs seguras", + avatarColor: "from-blue-500 to-indigo-600", + platform: "Zoom", + platformUrl: "https://zoom.us/j/1234567890", + agenda: + "Mapeamento de arquitetura fullstack, desenho de APIs, decisões de banco de dados e checklist de segurança para aplicações em produção.", + }, + { + id: "mentor-3", + name: "Bia Costa", + rating: 1, + completed: 3, + days: "Seg, Qua, Sex", + hours: "10:00 - 13:00", + nextSessionDate: "Próxima mentoria: sexta-feira, 26 jul", + specialty: "Design de Produto, Figma Avançado, Prototipação e Testes com Usuários", + avatarColor: "from-pink-500 to-purple-600", + platform: "Discord", + platformUrl: "https://discord.gg/product-design-demo", + agenda: + "Análise de fluxo de produto, refinamento de protótipos no Figma, narrativa de case e preparação para entrevistas de UX/UI.", + }, +]; diff --git a/frontend/src/domains/new_dashboard/types/mentor.ts b/frontend/src/features/mentoring/types.ts similarity index 100% rename from frontend/src/domains/new_dashboard/types/mentor.ts rename to frontend/src/features/mentoring/types.ts diff --git a/frontend/src/domains/new_dashboard/infrastructure/notificationsApi.ts b/frontend/src/features/notifications/api.ts similarity index 96% rename from frontend/src/domains/new_dashboard/infrastructure/notificationsApi.ts rename to frontend/src/features/notifications/api.ts index ecf9fa85..2604164e 100644 --- a/frontend/src/domains/new_dashboard/infrastructure/notificationsApi.ts +++ b/frontend/src/features/notifications/api.ts @@ -1,6 +1,6 @@ -import { api } from "@/shared/lib/apiClient"; +import { api } from "@/shared/api/apiClient"; import { z } from "zod"; -import type { Message, MessageOrigin, Notification } from "../types"; +import type { Message, MessageOrigin, Notification } from "@/features/notifications/types"; const ApiNotificationSchema = z.object({ id: z.string(), diff --git a/frontend/src/domains/new_dashboard/components/layout/MessageDetailModal.tsx b/frontend/src/features/notifications/components/MessageDetailModal.tsx similarity index 93% rename from frontend/src/domains/new_dashboard/components/layout/MessageDetailModal.tsx rename to frontend/src/features/notifications/components/MessageDetailModal.tsx index f32137e5..6356a9be 100644 --- a/frontend/src/domains/new_dashboard/components/layout/MessageDetailModal.tsx +++ b/frontend/src/features/notifications/components/MessageDetailModal.tsx @@ -1,6 +1,6 @@ import { Bot, BriefcaseBusiness, UserRound } from "lucide-react"; -import type { Message, MessageOrigin } from "../../types"; -import { Modal } from "../shared/Modal"; +import type { Message, MessageOrigin } from "@/features/notifications/types"; +import { Modal } from "@/shared/ui/Modal"; interface MessageDetailModalProps { message: Message; diff --git a/frontend/src/domains/new_dashboard/utils/notificationEvents.ts b/frontend/src/features/notifications/events.ts similarity index 100% rename from frontend/src/domains/new_dashboard/utils/notificationEvents.ts rename to frontend/src/features/notifications/events.ts diff --git a/frontend/src/features/notifications/types.ts b/frontend/src/features/notifications/types.ts new file mode 100644 index 00000000..c6e280ed --- /dev/null +++ b/frontend/src/features/notifications/types.ts @@ -0,0 +1,22 @@ +import { z } from "zod"; + +export const NotificationSchema = z.object({ + id: z.union([z.number().int(), z.string()]), + text: z.string().min(1), + type: z.enum(["info", "success", "match"]), + date: z.string().min(1), + jobId: z.string().optional(), + isRead: z.boolean().optional(), +}); + +export const MessageSchema = z.object({ + id: z.union([z.number().int(), z.string()]), + sender: z.string().min(1), + text: z.string().min(1), + date: z.string().min(1), + origin: z.enum(["recruiter", "mentor", "system"]).optional(), +}); + +export type Notification = z.infer; +export type Message = z.infer; +export type MessageOrigin = NonNullable; diff --git a/frontend/src/domains/new_dashboard/infrastructure/userDashboardApi.ts b/frontend/src/features/profile/api/userDashboardApi.ts similarity index 95% rename from frontend/src/domains/new_dashboard/infrastructure/userDashboardApi.ts rename to frontend/src/features/profile/api/userDashboardApi.ts index 8bef0e42..92afd441 100644 --- a/frontend/src/domains/new_dashboard/infrastructure/userDashboardApi.ts +++ b/frontend/src/features/profile/api/userDashboardApi.ts @@ -1,7 +1,8 @@ import { z } from "zod"; -import { api } from "@/shared/lib/apiClient"; -import type { JobType, SearchPreferences, UserProfile } from "../types"; -import { initialPreferences, initialUser } from "../constants"; +import { api } from "@/shared/api/apiClient"; +import type { JobType } from "@/features/jobs/domain/job"; +import type { SearchPreferences, UserProfile } from "@/features/profile/domain/user"; +import { initialPreferences, initialUser } from "@/features/profile/defaults"; const ApiUserProfileSchema = z.object({ id: z.string().optional(), diff --git a/frontend/src/domains/new_dashboard/components/profile/ConnectionsForm.tsx b/frontend/src/features/profile/components/ConnectionsForm.tsx similarity index 99% rename from frontend/src/domains/new_dashboard/components/profile/ConnectionsForm.tsx rename to frontend/src/features/profile/components/ConnectionsForm.tsx index 3fad02b1..e11c21dd 100644 --- a/frontend/src/domains/new_dashboard/components/profile/ConnectionsForm.tsx +++ b/frontend/src/features/profile/components/ConnectionsForm.tsx @@ -6,7 +6,7 @@ import { getConnections, type SupportedProvider, type UserConnections, -} from "@/domains/auth/infrastructure/connectionsApi"; +} from "@/features/auth/api/connectionsApi"; const PROVIDER_LABELS: Record = { google: "Google", diff --git a/frontend/src/domains/new_dashboard/components/profile/PreferencesForm.tsx b/frontend/src/features/profile/components/PreferencesForm.tsx similarity index 96% rename from frontend/src/domains/new_dashboard/components/profile/PreferencesForm.tsx rename to frontend/src/features/profile/components/PreferencesForm.tsx index 112eff9f..85bac4b1 100644 --- a/frontend/src/domains/new_dashboard/components/profile/PreferencesForm.tsx +++ b/frontend/src/features/profile/components/PreferencesForm.tsx @@ -1,9 +1,10 @@ -import type { JobModelFilter, SearchPreferences } from "../../types"; +import type { SearchPreferences } from "../domain/user"; +import type { JobModelFilter } from "@/features/jobs/domain/job"; import { getJobTypesFromModelFilter, getModelFilterFromJobTypes, jobModelFilterOptions, -} from "../../utils/jobModelFilters"; +} from "@/features/jobs/domain/jobModelFilters"; interface PreferencesFormProps { searchPreferences: SearchPreferences; diff --git a/frontend/src/domains/new_dashboard/components/profile/ProfileForm.tsx b/frontend/src/features/profile/components/ProfileForm.tsx similarity index 99% rename from frontend/src/domains/new_dashboard/components/profile/ProfileForm.tsx rename to frontend/src/features/profile/components/ProfileForm.tsx index ca7b0ffe..79c584c3 100644 --- a/frontend/src/domains/new_dashboard/components/profile/ProfileForm.tsx +++ b/frontend/src/features/profile/components/ProfileForm.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import type { UserProfile } from "../../types"; +import type { UserProfile } from "../domain/user"; interface ProfileFormProps { userProfile: UserProfile; diff --git a/frontend/src/domains/new_dashboard/components/profile/ProfileTab.tsx b/frontend/src/features/profile/components/ProfileTab.tsx similarity index 94% rename from frontend/src/domains/new_dashboard/components/profile/ProfileTab.tsx rename to frontend/src/features/profile/components/ProfileTab.tsx index 4b9fe5b8..bbd5b105 100644 --- a/frontend/src/domains/new_dashboard/components/profile/ProfileTab.tsx +++ b/frontend/src/features/profile/components/ProfileTab.tsx @@ -1,4 +1,4 @@ -import type { SearchPreferences, UserProfile } from "../../types"; +import type { SearchPreferences, UserProfile } from "../domain/user"; import { ConnectionsForm } from "./ConnectionsForm"; import { PreferencesForm } from "./PreferencesForm"; import { ProfileForm } from "./ProfileForm"; diff --git a/frontend/src/features/profile/defaults.ts b/frontend/src/features/profile/defaults.ts new file mode 100644 index 00000000..e47b8c56 --- /dev/null +++ b/frontend/src/features/profile/defaults.ts @@ -0,0 +1,29 @@ +import type { SearchPreferences, UserProfile } from "@/features/profile/domain/user"; + +export const initialUser: UserProfile = { + firstName: "Bruna", + lastName: "Silva", + displayName: "Bruna Silva", + username: "brunasilva", + email: "bruna.silva@exemplo.com", + avatarUrl: "", + phone: "(11) 98765-4321", + level: "Pleno", + technologies: ["React", "TypeScript", "Tailwind CSS", "Next.js", "Node.js"], + technologyExperiences: [ + { name: "React", years: 5 }, + { name: "TypeScript", years: 4 }, + { name: "Tailwind CSS", years: 3 }, + { name: "Next.js", years: 3 }, + { name: "Node.js", years: 2 }, + ], +}; + +export const initialPreferences: SearchPreferences = { + keywords: ["React", "Frontend", "Fullstack"], + searchLocation: "São Paulo, SP", + remoteOnly: false, + jobTypes: [], + emailNotifications: true, + careerChecklist: [], +}; diff --git a/frontend/src/domains/new_dashboard/types/user.ts b/frontend/src/features/profile/domain/user.ts similarity index 66% rename from frontend/src/domains/new_dashboard/types/user.ts rename to frontend/src/features/profile/domain/user.ts index a47792d7..86e471d5 100644 --- a/frontend/src/domains/new_dashboard/types/user.ts +++ b/frontend/src/features/profile/domain/user.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { JobTypeSchema } from "./job"; +import { JobTypeSchema } from "@/features/jobs/domain/job"; export const TechnologyExperienceSchema = z.object({ name: z.string().min(1), @@ -41,27 +41,7 @@ export const SearchPreferencesSchema = z.object({ careerChecklist: z.array(CareerChecklistSchema), }); -export const NotificationSchema = z.object({ - id: z.union([z.number().int(), z.string()]), - text: z.string().min(1), - type: z.enum(["info", "success", "match"]), - date: z.string().min(1), - jobId: z.string().optional(), - isRead: z.boolean().optional(), -}); - -export const MessageSchema = z.object({ - id: z.union([z.number().int(), z.string()]), - sender: z.string().min(1), - text: z.string().min(1), - date: z.string().min(1), - origin: z.enum(["recruiter", "mentor", "system"]).optional(), -}); - export type UserProfile = z.infer; export type SearchPreferences = z.infer; export type TechnologyExperience = z.infer; export type CareerChecklist = z.infer; -export type Notification = z.infer; -export type Message = z.infer; -export type MessageOrigin = NonNullable; diff --git a/frontend/src/domains/new_dashboard/hooks/useUserDashboardData.ts b/frontend/src/features/profile/hooks/useUserDashboardData.ts similarity index 92% rename from frontend/src/domains/new_dashboard/hooks/useUserDashboardData.ts rename to frontend/src/features/profile/hooks/useUserDashboardData.ts index 1201fe6f..2c5028f2 100644 --- a/frontend/src/domains/new_dashboard/hooks/useUserDashboardData.ts +++ b/frontend/src/features/profile/hooks/useUserDashboardData.ts @@ -1,15 +1,15 @@ import { useCallback, useEffect, useState } from "react"; -import { isApiError } from "@/shared/lib/apiError"; -import type { User } from "@/domains/auth/domain/auth.types"; -import { initialPreferences, initialUser } from "../constants"; -import type { SearchPreferences, UserProfile } from "../types"; +import { isApiError } from "@/shared/api/apiError"; +import type { User } from "@/features/auth/domain/auth.types"; +import { initialPreferences, initialUser } from "@/features/profile/defaults"; +import type { SearchPreferences, UserProfile } from "@/features/profile/domain/user"; import { createUserPreferences, getUserPreferences, getUserProfile, updateUserPreferences, updateUserProfile, -} from "../infrastructure/userDashboardApi"; +} from "@/features/profile/api/userDashboardApi"; function profileFromAuthUser(user: User | null): UserProfile { const displayName = diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 538706bd..5cfd738a 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -1,7 +1,7 @@ import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; import App from "@/app/App"; -import { AppProviders } from "@/app/AppProviders"; +import { AppProviders } from "@/app/providers/AppProviders"; import "./styles/globals.css"; const rootElement = document.getElementById("root"); diff --git a/frontend/src/shared/lib/apiClient.ts b/frontend/src/shared/api/apiClient.ts similarity index 92% rename from frontend/src/shared/lib/apiClient.ts rename to frontend/src/shared/api/apiClient.ts index d55eeb6d..47ebb583 100644 --- a/frontend/src/shared/lib/apiClient.ts +++ b/frontend/src/shared/api/apiClient.ts @@ -1,5 +1,5 @@ import axios from "axios"; -import { parseApiError } from "./apiError"; +import { parseApiError } from "@/shared/api/apiError"; const API_URL = import.meta.env.VITE_API_BASE_URL ?? diff --git a/frontend/src/shared/lib/apiError.ts b/frontend/src/shared/api/apiError.ts similarity index 100% rename from frontend/src/shared/lib/apiError.ts rename to frontend/src/shared/api/apiError.ts diff --git a/frontend/src/domains/new_dashboard/context/ToastContext.tsx b/frontend/src/shared/feedback/ToastContext.tsx similarity index 100% rename from frontend/src/domains/new_dashboard/context/ToastContext.tsx rename to frontend/src/shared/feedback/ToastContext.tsx diff --git a/frontend/src/shared/hooks/useToast.ts b/frontend/src/shared/hooks/useToast.ts new file mode 100644 index 00000000..fe828436 --- /dev/null +++ b/frontend/src/shared/hooks/useToast.ts @@ -0,0 +1 @@ +export { useToastContext as useToast } from "@/shared/feedback/ToastContext"; diff --git a/frontend/src/domains/new_dashboard/components/shared/Modal.tsx b/frontend/src/shared/ui/Modal.tsx similarity index 100% rename from frontend/src/domains/new_dashboard/components/shared/Modal.tsx rename to frontend/src/shared/ui/Modal.tsx diff --git a/frontend/src/domains/new_dashboard/components/shared/Toast.tsx b/frontend/src/shared/ui/Toast.tsx similarity index 100% rename from frontend/src/domains/new_dashboard/components/shared/Toast.tsx rename to frontend/src/shared/ui/Toast.tsx diff --git a/frontend/src/shared/ui/badge.tsx b/frontend/src/shared/ui/badge.tsx index 3b0a99f6..6eaaef88 100644 --- a/frontend/src/shared/ui/badge.tsx +++ b/frontend/src/shared/ui/badge.tsx @@ -1,6 +1,6 @@ import type { HTMLAttributes } from "react"; import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@/shared/lib/utils"; +import { cn } from "@/shared/utils/utils"; const badgeVariants = cva( "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors", diff --git a/frontend/src/shared/ui/button.tsx b/frontend/src/shared/ui/button.tsx index 0993ca7b..967f1367 100644 --- a/frontend/src/shared/ui/button.tsx +++ b/frontend/src/shared/ui/button.tsx @@ -1,6 +1,6 @@ import type { ButtonHTMLAttributes } from "react"; import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@/shared/lib/utils"; +import { cn } from "@/shared/utils/utils"; const buttonVariants = cva( "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", diff --git a/frontend/src/shared/ui/card.tsx b/frontend/src/shared/ui/card.tsx index 2751eaf8..c6e03eb4 100644 --- a/frontend/src/shared/ui/card.tsx +++ b/frontend/src/shared/ui/card.tsx @@ -1,5 +1,5 @@ import type { HTMLAttributes } from "react"; -import { cn } from "@/shared/lib/utils"; +import { cn } from "@/shared/utils/utils"; function Card({ className, ...props }: HTMLAttributes) { return
; diff --git a/frontend/src/shared/ui/input.tsx b/frontend/src/shared/ui/input.tsx index fbf421d3..ee26fd7a 100644 --- a/frontend/src/shared/ui/input.tsx +++ b/frontend/src/shared/ui/input.tsx @@ -1,5 +1,5 @@ import type { InputHTMLAttributes } from "react"; -import { cn } from "@/shared/lib/utils"; +import { cn } from "@/shared/utils/utils"; function Input({ className, type = "text", ...props }: InputHTMLAttributes) { return ( diff --git a/frontend/src/shared/ui/table.tsx b/frontend/src/shared/ui/table.tsx index d874de83..029759c2 100644 --- a/frontend/src/shared/ui/table.tsx +++ b/frontend/src/shared/ui/table.tsx @@ -1,5 +1,5 @@ import type { HTMLAttributes, TableHTMLAttributes, ThHTMLAttributes, TdHTMLAttributes } from "react"; -import { cn } from "@/shared/lib/utils"; +import { cn } from "@/shared/utils/utils"; function Table({ className, ...props }: TableHTMLAttributes) { return ( diff --git a/frontend/src/shared/lib/utils.ts b/frontend/src/shared/utils/utils.ts similarity index 100% rename from frontend/src/shared/lib/utils.ts rename to frontend/src/shared/utils/utils.ts diff --git a/frontend/tests/integration/useJobsData.test.tsx b/frontend/tests/integration/useJobsData.test.tsx index 4f6778cc..d3ad6a8c 100644 --- a/frontend/tests/integration/useJobsData.test.tsx +++ b/frontend/tests/integration/useJobsData.test.tsx @@ -6,12 +6,12 @@ const mocks = vi.hoisted(() => ({ runScraperRequestMock: vi.fn(), })); -vi.mock("@/domains/jobs/infrastructure/jobsApi", () => ({ +vi.mock("@/features/jobs/api/jobsApi", () => ({ fetchJobsByAPI: mocks.fetchJobsByAPIMock, runScraperRequest: mocks.runScraperRequestMock, })); -import { useJobsData } from "@/domains/jobs/application/useJobsData"; +import { useJobsData } from "@/features/jobs/hooks/useJobsData"; describe("useJobsData", () => { it("carrega jobs iniciais", async () => { diff --git a/frontend/tests/unit/app/AppRoutes.test.tsx b/frontend/tests/unit/app/AppRoutes.test.tsx index 55ae8559..375e01e2 100644 --- a/frontend/tests/unit/app/AppRoutes.test.tsx +++ b/frontend/tests/unit/app/AppRoutes.test.tsx @@ -1,4 +1,4 @@ -import { AppRoutes } from "@/app/AppRoutes"; +import { AppRoutes } from "@/app/routes/AppRoutes"; import { render, screen } from "@testing-library/react"; import { MemoryRouter } from "react-router-dom"; import { beforeEach, describe, expect, it, vi } from "vitest"; @@ -10,7 +10,7 @@ const authState = vi.hoisted(() => ({ }, })); -vi.mock("@/domains/auth/application/AuthContext", () => ({ +vi.mock("@/features/auth/application/AuthContext", () => ({ useAuth: () => authState.value, })); @@ -18,7 +18,7 @@ vi.mock("@/shared/ui/Loading", () => ({ default: () =>
Carregando...
, })); -vi.mock("@/domains/new_dashboard/layout", () => ({ +vi.mock("@/app/dashboard/DashboardProviders", () => ({ default: ({ children }: { children: React.ReactNode }) => (
Dashboard shell @@ -27,27 +27,27 @@ vi.mock("@/domains/new_dashboard/layout", () => ({ ), })); -vi.mock("@/domains/new_dashboard/NewDashboardPage", () => ({ +vi.mock("@/app/dashboard/DashboardPage", () => ({ default: () =>
New dashboard route
, })); -vi.mock("@/domains/marketing/presentation/pages/LandingPage", () => ({ +vi.mock("@/features/marketing/pages/LandingPage", () => ({ default: () =>
Landing route
, })); -vi.mock("@/domains/auth/presentation/pages/LoginPage", () => ({ +vi.mock("@/features/auth/pages/LoginPage", () => ({ default: () =>
Login route
, })); -vi.mock("@/domains/auth/presentation/pages/RegisterPage", () => ({ +vi.mock("@/features/auth/pages/RegisterPage", () => ({ default: () =>
Register route
, })); -vi.mock("@/domains/auth/presentation/pages/AuthCallbackPage", () => ({ +vi.mock("@/features/auth/pages/AuthCallbackPage", () => ({ default: () =>
Callback route
, })); -vi.mock("@/app/NotFound", () => ({ +vi.mock("@/app/routes/NotFound", () => ({ default: () =>
Not found route
, })); diff --git a/frontend/tests/unit/app/AuthenticatedHeader.test.tsx b/frontend/tests/unit/app/AuthenticatedHeader.test.tsx index d0c888df..133f6713 100644 --- a/frontend/tests/unit/app/AuthenticatedHeader.test.tsx +++ b/frontend/tests/unit/app/AuthenticatedHeader.test.tsx @@ -2,7 +2,7 @@ import "@testing-library/jest-dom/vitest"; import { fireEvent, render, screen } from "@testing-library/react"; import { beforeEach, describe, expect, it, vi } from "vitest"; -import { AuthenticatedHeader } from "../../../src/app/AuthenticatedHeader"; +import { AuthenticatedHeader } from "@/app/layouts/AuthenticatedHeader"; const mockUseAuth = vi.fn(); const mockUseTheme = vi.fn(); @@ -13,7 +13,7 @@ vi.mock("react-router-dom", () => ({ useLocation: () => mockUseLocation(), })); -vi.mock("@/domains/auth/application/AuthContext", () => ({ +vi.mock("@/features/auth/application/AuthContext", () => ({ useAuth: () => mockUseAuth(), })); diff --git a/frontend/tests/unit/app/AuthenticatedLayout.test.tsx b/frontend/tests/unit/app/AuthenticatedLayout.test.tsx index 4e7de41e..af231893 100644 --- a/frontend/tests/unit/app/AuthenticatedLayout.test.tsx +++ b/frontend/tests/unit/app/AuthenticatedLayout.test.tsx @@ -1,4 +1,4 @@ -import { AuthenticatedLayout } from "@/app/AuthenticatedLayout"; +import { AuthenticatedLayout } from "@/app/layouts/AuthenticatedLayout"; import { render, screen } from "@testing-library/react"; import { MemoryRouter, Route, Routes } from "react-router-dom"; import { describe, expect, it, vi } from "vitest"; @@ -7,7 +7,7 @@ const authMocks = vi.hoisted(() => ({ logout: vi.fn(async () => {}), })); -vi.mock("@/domains/auth/application/AuthContext", () => ({ +vi.mock("@/features/auth/application/AuthContext", () => ({ useAuth: () => ({ user: { id: "1", name: "Otávio", email: "otavio@example.com" }, logout: authMocks.logout, diff --git a/frontend/tests/unit/components/Footer.test.tsx b/frontend/tests/unit/components/Footer.test.tsx index e10ce7ed..9e345f9d 100644 --- a/frontend/tests/unit/components/Footer.test.tsx +++ b/frontend/tests/unit/components/Footer.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from "@testing-library/react"; import { MemoryRouter } from "react-router-dom"; import { describe, expect, it } from "vitest"; -import { Footer } from "../../../src/domains/marketing/presentation/components/Footer"; +import { Footer } from "../../../src/features/marketing/components/Footer"; describe("Footer", () => { function renderFooter() { diff --git a/frontend/tests/unit/components/JobsFiltersCard.extended.test.tsx b/frontend/tests/unit/components/JobsFiltersCard.extended.test.tsx index 1ab0a6ae..d82e2722 100644 --- a/frontend/tests/unit/components/JobsFiltersCard.extended.test.tsx +++ b/frontend/tests/unit/components/JobsFiltersCard.extended.test.tsx @@ -1,8 +1,8 @@ -import { JobsFiltersCard } from "@/domains/jobs/presentation/components/JobsFiltersCard"; +import { JobsFiltersCard } from "@/features/jobs/components/JobsFiltersCard"; import { fireEvent, render, screen } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; -vi.mock("@/domains/jobs/presentation/components/KeywordsModal", () => ({ +vi.mock("@/features/jobs/components/KeywordsModal", () => ({ KeywordsModal: () =>
Gerenciar filtros
, })); diff --git a/frontend/tests/unit/components/JobsFiltersCard.test.tsx b/frontend/tests/unit/components/JobsFiltersCard.test.tsx index fe1af3f7..23a23d8a 100644 --- a/frontend/tests/unit/components/JobsFiltersCard.test.tsx +++ b/frontend/tests/unit/components/JobsFiltersCard.test.tsx @@ -1,8 +1,8 @@ -import { JobsFiltersCard } from "@/domains/jobs/presentation/components/JobsFiltersCard"; +import { JobsFiltersCard } from "@/features/jobs/components/JobsFiltersCard"; import { fireEvent, render, screen } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; -vi.mock("@/domains/jobs/presentation/components/KeywordsModal", () => ({ +vi.mock("@/features/jobs/components/KeywordsModal", () => ({ KeywordsModal: () =>
Gerenciar filtros
, })); diff --git a/frontend/tests/unit/components/JobsHeaderCard.test.tsx b/frontend/tests/unit/components/JobsHeaderCard.test.tsx index 9411ae64..8c5f0c1f 100644 --- a/frontend/tests/unit/components/JobsHeaderCard.test.tsx +++ b/frontend/tests/unit/components/JobsHeaderCard.test.tsx @@ -1,4 +1,4 @@ -import { JobsHeaderCard } from "@/domains/jobs/presentation/components/JobsHeaderCard"; +import { JobsHeaderCard } from "@/features/jobs/components/JobsHeaderCard"; import { render, screen } from "@testing-library/react"; import { describe, expect, it } from "vitest"; diff --git a/frontend/tests/unit/components/JobsTableCard.test.tsx b/frontend/tests/unit/components/JobsTableCard.test.tsx index 405b8c5a..b3962e97 100644 --- a/frontend/tests/unit/components/JobsTableCard.test.tsx +++ b/frontend/tests/unit/components/JobsTableCard.test.tsx @@ -1,4 +1,4 @@ -import { JobsTableCard } from "@/domains/jobs/presentation/components/JobsTableCard"; +import { JobsTableCard } from "@/features/jobs/components/JobsTableCard"; import { fireEvent, render, screen } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; diff --git a/frontend/tests/unit/components/KeywordsModal.test.tsx b/frontend/tests/unit/components/KeywordsModal.test.tsx index 23876820..240e3777 100644 --- a/frontend/tests/unit/components/KeywordsModal.test.tsx +++ b/frontend/tests/unit/components/KeywordsModal.test.tsx @@ -1,4 +1,4 @@ -import { KeywordsModal } from "@/domains/jobs/presentation/components/KeywordsModal"; +import { KeywordsModal } from "@/features/jobs/components/KeywordsModal"; import { fireEvent, render, screen, waitFor } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; @@ -7,7 +7,7 @@ const mocks = vi.hoisted(() => ({ saveKeywordsMock: vi.fn(async () => {}), })); -vi.mock("@/domains/jobs/infrastructure/jobsApi", () => ({ +vi.mock("@/features/jobs/api/jobsApi", () => ({ fetchKeywords: mocks.fetchKeywordsMock, saveKeywords: mocks.saveKeywordsMock, })); diff --git a/frontend/tests/unit/components/landing/CTASection.test.tsx b/frontend/tests/unit/components/landing/CTASection.test.tsx index 0584df51..ca205303 100644 --- a/frontend/tests/unit/components/landing/CTASection.test.tsx +++ b/frontend/tests/unit/components/landing/CTASection.test.tsx @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { CTASection } from "@/domains/marketing/presentation/components/CTASection"; +import { CTASection } from "@/features/marketing/components/CTASection"; import { render, screen } from "@testing-library/react"; import { MemoryRouter } from "react-router-dom"; import { describe, expect, it, vi } from "vitest"; diff --git a/frontend/tests/unit/components/landing/FeaturesSection.test.tsx b/frontend/tests/unit/components/landing/FeaturesSection.test.tsx index 07f450da..3b5fe10e 100644 --- a/frontend/tests/unit/components/landing/FeaturesSection.test.tsx +++ b/frontend/tests/unit/components/landing/FeaturesSection.test.tsx @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { FeaturesSection } from "@/domains/marketing/presentation/components/FeaturesSection"; +import { FeaturesSection } from "@/features/marketing/components/FeaturesSection"; import { render, screen } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; vi.mock("framer-motion", () => ({ diff --git a/frontend/tests/unit/components/landing/LandinPage.test.tsx b/frontend/tests/unit/components/landing/LandinPage.test.tsx index 8db8a730..fb82a141 100644 --- a/frontend/tests/unit/components/landing/LandinPage.test.tsx +++ b/frontend/tests/unit/components/landing/LandinPage.test.tsx @@ -1,33 +1,33 @@ -import LandingPage from "@/domains/marketing/presentation/pages/LandingPage"; +import LandingPage from "@/features/marketing/pages/LandingPage"; import { render, screen } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; -vi.mock("@/domains/marketing/presentation/components/Navbar", () => ({ +vi.mock("@/features/marketing/components/Navbar", () => ({ Navbar: () =>
, })); -vi.mock("@/domains/marketing/presentation/components/HeroSection", () => ({ +vi.mock("@/features/marketing/components/HeroSection", () => ({ HeroSection: () =>
, })); -vi.mock("@/domains/marketing/presentation/components/FeaturesSection", () => ({ +vi.mock("@/features/marketing/components/FeaturesSection", () => ({ FeaturesSection: () =>
, })); -vi.mock("@/domains/marketing/presentation/components/TeamSection", () => ({ +vi.mock("@/features/marketing/components/TeamSection", () => ({ default: () =>
, })); -vi.mock("@/domains/marketing/presentation/components/HowItWorks", () => ({ +vi.mock("@/features/marketing/components/HowItWorks", () => ({ HowItWorks: () =>
, })); -vi.mock("@/domains/marketing/presentation/components/CTASection", () => ({ +vi.mock("@/features/marketing/components/CTASection", () => ({ CTASection: () =>
, })); -vi.mock("@/domains/marketing/presentation/components/Footer", () => ({ +vi.mock("@/features/marketing/components/Footer", () => ({ Footer: () =>
, })); diff --git a/frontend/tests/unit/components/landing/Navbar.test.tsx b/frontend/tests/unit/components/landing/Navbar.test.tsx index 47bbbcc2..b54f0688 100644 --- a/frontend/tests/unit/components/landing/Navbar.test.tsx +++ b/frontend/tests/unit/components/landing/Navbar.test.tsx @@ -26,7 +26,7 @@ vi.mock("@/shared/hooks/useTheme", () => ({ }), })); -import { Navbar } from "@/domains/marketing/presentation/components/Navbar"; +import { Navbar } from "@/features/marketing/components/Navbar"; describe("Navbar", () => { beforeEach(() => { diff --git a/frontend/tests/unit/components/landing/TeamSection.test.tsx b/frontend/tests/unit/components/landing/TeamSection.test.tsx index f1dbd1e6..046a8721 100644 --- a/frontend/tests/unit/components/landing/TeamSection.test.tsx +++ b/frontend/tests/unit/components/landing/TeamSection.test.tsx @@ -14,7 +14,7 @@ vi.mock("swiper/modules", () => ({ Autoplay: {}, })); -import TeamSection from "@/domains/marketing/presentation/components/TeamSection"; +import TeamSection from "@/features/marketing/components/TeamSection"; describe("TeamSection", () => { afterEach(() => { diff --git a/frontend/tests/unit/components/login/LeftSide.test.tsx b/frontend/tests/unit/components/login/LeftSide.test.tsx index 187eec42..2a48b782 100644 --- a/frontend/tests/unit/components/login/LeftSide.test.tsx +++ b/frontend/tests/unit/components/login/LeftSide.test.tsx @@ -11,7 +11,7 @@ vi.mock("react-router-dom", () => ({ useNavigate: () => vi.fn(), })); -import LeftSide from "@/domains/auth/presentation/components/AuthVisualPanel"; +import LeftSide from "@/features/auth/components/AuthVisualPanel"; describe("LeftSide", () => { it("renderiza conteúdo principal e links sociais", () => { diff --git a/frontend/tests/unit/components/login/RegisterSide.test.tsx b/frontend/tests/unit/components/login/RegisterSide.test.tsx index ab875942..f0efed43 100644 --- a/frontend/tests/unit/components/login/RegisterSide.test.tsx +++ b/frontend/tests/unit/components/login/RegisterSide.test.tsx @@ -41,7 +41,7 @@ function fillRequiredRegisterFieldsWithoutPhone() { }); } -vi.mock("@/domains/auth/infrastructure/authApi", () => ({ +vi.mock("@/features/auth/api/authApi", () => ({ register: (...args: any[]) => mockRegister(...args), getGoogleAuthUrl: (...args: any[]) => mockGetGoogleAuthUrl(...args), getGithubAuthUrl: (...args: any[]) => mockGetGithubAuthUrl(...args), @@ -84,7 +84,7 @@ vi.mock("react-router-dom", () => ({ useNavigate: () => mockNavigate, })); -import RegisterSide from "@/domains/auth/presentation/components/RegisterFormPanel"; +import RegisterSide from "@/features/auth/components/RegisterFormPanel"; describe("RegisterSide", () => { const originalLocation = window.location; diff --git a/frontend/tests/unit/components/login/RigthSide.test.tsx b/frontend/tests/unit/components/login/RigthSide.test.tsx index b068b8bd..c31d4447 100644 --- a/frontend/tests/unit/components/login/RigthSide.test.tsx +++ b/frontend/tests/unit/components/login/RigthSide.test.tsx @@ -9,13 +9,13 @@ const mockGetGithubAuthUrl = vi.fn(); const mockGetLinkedinAuthUrl = vi.fn(); const mockNavigate = vi.fn(); -vi.mock("@/domains/auth/infrastructure/authApi", () => ({ +vi.mock("@/features/auth/api/authApi", () => ({ getGoogleAuthUrl: (...args: any[]) => mockGetGoogleAuthUrl(...args), getGithubAuthUrl: (...args: any[]) => mockGetGithubAuthUrl(...args), getLinkedinAuthUrl: (...args: any[]) => mockGetLinkedinAuthUrl(...args), })); -vi.mock("@/domains/auth/application/AuthContext", () => ({ +vi.mock("@/features/auth/application/AuthContext", () => ({ useAuth: () => ({ login: (...args: any[]) => mockLogin(...args), }), @@ -36,7 +36,7 @@ vi.mock("react-router-dom", () => ({ useNavigate: () => mockNavigate, })); -import RigthSide from "@/domains/auth/presentation/components/LoginFormPanel"; +import RigthSide from "@/features/auth/components/LoginFormPanel"; describe("RigthSide", () => { const originalLocation = window.location; diff --git a/frontend/tests/unit/context/AuthContext.test.tsx b/frontend/tests/unit/context/AuthContext.test.tsx index a706f6c9..90b23315 100644 --- a/frontend/tests/unit/context/AuthContext.test.tsx +++ b/frontend/tests/unit/context/AuthContext.test.tsx @@ -6,14 +6,14 @@ import "@testing-library/jest-dom/vitest"; const mockApiGet = vi.fn(); const mockApiPost = vi.fn(); -vi.mock("@/shared/lib/apiClient", () => ({ +vi.mock("@/shared/api/apiClient", () => ({ api: { get: (...args: any[]) => mockApiGet(...args), post: (...args: any[]) => mockApiPost(...args), }, })); -import { AuthProvider, useAuth } from "@/domains/auth/application/AuthContext"; +import { AuthProvider, useAuth } from "@/features/auth/application/AuthContext"; function TestConsumer() { const { user, isLoading, login, logout, refreshUser } = useAuth(); diff --git a/frontend/tests/unit/domain/jobFilters.test.ts b/frontend/tests/unit/domain/jobFilters.test.ts index 017a4f08..d350935e 100644 --- a/frontend/tests/unit/domain/jobFilters.test.ts +++ b/frontend/tests/unit/domain/jobFilters.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { normalizeComparableText, normalizeComparableLink } from "@/domains/jobs/domain/jobFilters"; +import { normalizeComparableText, normalizeComparableLink } from "@/features/jobs/domain/jobFilters"; describe("jobFilters domain utilities", () => { describe("normalizeComparableText", () => { diff --git a/frontend/tests/unit/factories/jobsFactory.ts b/frontend/tests/unit/factories/jobsFactory.ts index 87b9c584..de710f3c 100644 --- a/frontend/tests/unit/factories/jobsFactory.ts +++ b/frontend/tests/unit/factories/jobsFactory.ts @@ -1,4 +1,4 @@ -import type { Job, JobsMeta } from "@/domains/jobs/domain/job.types"; +import type { Job, JobsMeta } from "@/features/jobs/types/job.types"; export function makeJob(overrides: Partial = {}): Job { return { diff --git a/frontend/tests/unit/hooks/useJobsData.extended.test.tsx b/frontend/tests/unit/hooks/useJobsData.extended.test.tsx index 8ec20369..72b60a05 100644 --- a/frontend/tests/unit/hooks/useJobsData.extended.test.tsx +++ b/frontend/tests/unit/hooks/useJobsData.extended.test.tsx @@ -6,12 +6,12 @@ const mocks = vi.hoisted(() => ({ runScraperRequestMock: vi.fn(), })); -vi.mock("@/domains/jobs/infrastructure/jobsApi", () => ({ +vi.mock("@/features/jobs/api/jobsApi", () => ({ fetchJobsByAPI: mocks.fetchJobsByAPIMock, runScraperRequest: mocks.runScraperRequestMock, })); -import { useJobsData } from "@/domains/jobs/application/useJobsData"; +import { useJobsData } from "@/features/jobs/hooks/useJobsData"; describe("useJobsData extended", () => { beforeEach(() => { diff --git a/frontend/tests/unit/hooks/useJobsFiltering.extended.test.ts b/frontend/tests/unit/hooks/useJobsFiltering.extended.test.ts index 7b7bcc61..548fedf3 100644 --- a/frontend/tests/unit/hooks/useJobsFiltering.extended.test.ts +++ b/frontend/tests/unit/hooks/useJobsFiltering.extended.test.ts @@ -1,7 +1,7 @@ import { renderHook } from "@testing-library/react"; import { describe, expect, it } from "vitest"; -import { useJobsFiltering } from "@/domains/jobs/application/useJobsFiltering"; +import { useJobsFiltering } from "@/features/jobs/hooks/useJobsFiltering"; describe("useJobsFiltering extended", () => { it("normaliza acentuação e sinais na busca", () => { diff --git a/frontend/tests/unit/new_dashboard/HeaderUserMenu.test.tsx b/frontend/tests/unit/new_dashboard/HeaderUserMenu.test.tsx index 8226b509..497efffc 100644 --- a/frontend/tests/unit/new_dashboard/HeaderUserMenu.test.tsx +++ b/frontend/tests/unit/new_dashboard/HeaderUserMenu.test.tsx @@ -1,7 +1,7 @@ import "@testing-library/jest-dom/vitest"; import { fireEvent, render, screen } from "@testing-library/react"; import { beforeEach, describe, expect, it, vi } from "vitest"; -import { Header } from "@/domains/new_dashboard/components/layout/Header"; +import { Header } from "@/app/dashboard/components/Header"; const mockNavigate = vi.fn(); @@ -10,14 +10,14 @@ vi.mock("react-router-dom", () => ({ useNavigate: () => mockNavigate, })); -vi.mock("@/domains/auth/application/AuthContext", () => ({ +vi.mock("@/features/auth/application/AuthContext", () => ({ useAuth: () => ({ user: { id: "1", name: "Joao Silva", email: "joao@teste.com" }, logout: vi.fn(), }), })); -vi.mock("@/domains/new_dashboard/infrastructure/notificationsApi", () => ({ +vi.mock("@/features/notifications/api", () => ({ getDashboardNotificationFeed: vi.fn().mockResolvedValue({ messages: [], notifications: [], @@ -27,11 +27,11 @@ vi.mock("@/domains/new_dashboard/infrastructure/notificationsApi", () => ({ clearDashboardNotifications: vi.fn().mockResolvedValue(undefined), })); -vi.mock("@/domains/new_dashboard/components/layout/ThemeToggle", () => ({ +vi.mock("@/app/dashboard/components/ThemeToggle", () => ({ ThemeToggle: () => , })); -vi.mock("@/domains/new_dashboard/components/layout/MessageDetailModal", () => ({ +vi.mock("@/features/notifications/components/MessageDetailModal", () => ({ MessageDetailModal: () => null, })); diff --git a/frontend/tests/unit/new_dashboard/HelpTab.test.tsx b/frontend/tests/unit/new_dashboard/HelpTab.test.tsx index ba2e8296..62c657dd 100644 --- a/frontend/tests/unit/new_dashboard/HelpTab.test.tsx +++ b/frontend/tests/unit/new_dashboard/HelpTab.test.tsx @@ -1,4 +1,4 @@ -import { HelpTab } from "@/domains/new_dashboard/components/help/HelpTab"; +import { HelpTab } from "@/features/help/components/HelpTab"; import { render, screen, within } from "@testing-library/react"; import { describe, expect, it } from "vitest"; diff --git a/frontend/tests/unit/new_dashboard/api.test.ts b/frontend/tests/unit/new_dashboard/api.test.ts index 4d9d0351..67a4960a 100644 --- a/frontend/tests/unit/new_dashboard/api.test.ts +++ b/frontend/tests/unit/new_dashboard/api.test.ts @@ -7,7 +7,7 @@ const apiMock = vi.hoisted(() => ({ delete: vi.fn(), })); -vi.mock("@/shared/lib/apiClient", () => ({ +vi.mock("@/shared/api/apiClient", () => ({ api: apiMock, })); @@ -19,13 +19,13 @@ import { searchDashboardJobs, toRecommendedJob, updateDashboardSavedJob, -} from "@/domains/new_dashboard/infrastructure/dashboardJobsApi"; +} from "@/features/jobs/api/dashboardJobsApi"; import { clearDashboardNotifications, getDashboardNotificationFeed as getNotificationFeed, markDashboardNotificationsRead as markNotificationsRead, markSingleNotificationRead, -} from "@/domains/new_dashboard/infrastructure/notificationsApi"; +} from "@/features/notifications/api"; import { getUserPreferences, getUserProfile, @@ -33,7 +33,7 @@ import { toUserProfile, updateUserPreferences, updateUserProfile, -} from "@/domains/new_dashboard/infrastructure/userDashboardApi"; +} from "@/features/profile/api/userDashboardApi"; describe("new_dashboard api adapters", () => { beforeEach(() => { diff --git a/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx index 20e529b7..9df91bd8 100644 --- a/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx +++ b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx @@ -1,19 +1,20 @@ -import { CareerChecklist } from "@/domains/new_dashboard/components/home/CareerChecklist"; -import { JobDetailModal } from "@/domains/new_dashboard/components/jobs/JobDetailModal"; -import { JobRow } from "@/domains/new_dashboard/components/jobs/JobRow"; -import { Header } from "@/domains/new_dashboard/components/layout/Header"; -import { MessageDetailModal } from "@/domains/new_dashboard/components/layout/MessageDetailModal"; -import { MentoringTab } from "@/domains/new_dashboard/components/mentoring/MentoringTab"; -import { ProfileForm } from "@/domains/new_dashboard/components/profile/ProfileForm"; -import { Modal } from "@/domains/new_dashboard/components/shared/Modal"; +import { CareerChecklist } from "@/features/home/components/CareerChecklist"; +import { JobDetailModal } from "@/features/jobs/components/JobDetailModal"; +import { JobRow } from "@/features/jobs/components/JobRow"; +import { Header } from "@/app/dashboard/components/Header"; +import { MessageDetailModal } from "@/features/notifications/components/MessageDetailModal"; +import { MentoringTab } from "@/features/mentoring/components/MentoringTab"; +import { ProfileForm } from "@/features/profile/components/ProfileForm"; +import { Modal } from "@/shared/ui/Modal"; import { clearDashboardNotifications, getDashboardNotificationFeed, markDashboardNotificationsRead, markSingleNotificationRead, -} from "@/domains/new_dashboard/infrastructure/notificationsApi"; -import type { Job, UserProfile } from "@/domains/new_dashboard/types"; -import { DASHBOARD_NOTIFICATIONS_REFRESH_EVENT } from "@/domains/new_dashboard/utils/notificationEvents"; +} from "@/features/notifications/api"; +import type { Job } from "@/features/jobs/domain/job"; +import type { UserProfile } from "@/features/profile/domain/user"; +import { DASHBOARD_NOTIFICATIONS_REFRESH_EVENT } from "@/features/notifications/events"; import { fireEvent, render, screen, waitFor } from "@testing-library/react"; import { MemoryRouter } from "react-router-dom"; import { beforeEach, describe, expect, it, vi } from "vitest"; @@ -21,7 +22,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; const mockUseAuth = vi.fn(); const mockUseTheme = vi.fn(); -vi.mock("@/domains/auth/application/AuthContext", () => ({ +vi.mock("@/features/auth/application/AuthContext", () => ({ useAuth: () => mockUseAuth(), })); @@ -41,7 +42,7 @@ vi.mock("react-router-dom", async () => { }; }); -vi.mock("@/domains/new_dashboard/infrastructure/notificationsApi", () => ({ +vi.mock("@/features/notifications/api", () => ({ getDashboardNotificationFeed: vi.fn().mockResolvedValue({ messages: [], notifications: [], diff --git a/frontend/tests/unit/new_dashboard/connectionsForm.test.tsx b/frontend/tests/unit/new_dashboard/connectionsForm.test.tsx index ae6c7916..70724439 100644 --- a/frontend/tests/unit/new_dashboard/connectionsForm.test.tsx +++ b/frontend/tests/unit/new_dashboard/connectionsForm.test.tsx @@ -1,4 +1,4 @@ -import { ConnectionsForm } from "@/domains/new_dashboard/components/profile/ConnectionsForm"; +import { ConnectionsForm } from "@/features/profile/components/ConnectionsForm"; import { fireEvent, render, screen, waitFor } from "@testing-library/react"; import { MemoryRouter } from "react-router-dom"; import { beforeEach, describe, expect, it, vi } from "vitest"; @@ -9,7 +9,7 @@ const mocks = vi.hoisted(() => ({ disconnectProvider: vi.fn(), })); -vi.mock("@/domains/auth/infrastructure/connectionsApi", () => ({ +vi.mock("@/features/auth/api/connectionsApi", () => ({ getConnections: mocks.getConnections, connectProvider: mocks.connectProvider, disconnectProvider: mocks.disconnectProvider, diff --git a/frontend/tests/unit/new_dashboard/context.test.tsx b/frontend/tests/unit/new_dashboard/context.test.tsx index bed0f376..15f760ef 100644 --- a/frontend/tests/unit/new_dashboard/context.test.tsx +++ b/frontend/tests/unit/new_dashboard/context.test.tsx @@ -1,7 +1,7 @@ import { fireEvent, render, screen } from "@testing-library/react"; import { describe, expect, it } from "vitest"; -import { JobsProvider, useJobsContext } from "@/domains/new_dashboard/context/JobsContext"; -import { ToastProvider } from "@/domains/new_dashboard/context/ToastContext"; +import { JobsProvider, useJobsContext } from "@/features/jobs/legacy/application/JobsContext"; +import { ToastProvider } from "@/shared/feedback/ToastContext"; function JobsConsumer() { const { jobs, addNewJob, updateJobStatus, updateJobNotes } = useJobsContext(); diff --git a/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx b/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx index 20edd026..5ba8a570 100644 --- a/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx +++ b/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx @@ -1,19 +1,19 @@ import { fireEvent, render, screen, within } from "@testing-library/react"; import { MemoryRouter } from "react-router-dom"; import { beforeEach, describe, expect, it, vi } from "vitest"; -import { DashboardTab } from "@/domains/new_dashboard/components/dashboard/DashboardTab"; -import { KanbanBoard } from "@/domains/new_dashboard/components/dashboard/KanbanBoard"; -import { CandidateLogo } from "@/domains/new_dashboard/components/shared/CandidateLogo"; -import { Header } from "@/domains/new_dashboard/components/layout/Header"; -import { MobileTabBar } from "@/domains/new_dashboard/components/layout/MobileTabBar"; -import { Sidebar } from "@/domains/new_dashboard/components/layout/Sidebar"; -import { ThemeToggle } from "@/domains/new_dashboard/components/layout/ThemeToggle"; -import type { Job } from "@/domains/new_dashboard/types"; +import { DashboardTab } from "@/features/dashboard/components/DashboardTab"; +import { KanbanBoard } from "@/features/applications/components/KanbanBoard"; +import { CandidateLogo } from "@/app/dashboard/components/CandidateLogo"; +import { Header } from "@/app/dashboard/components/Header"; +import { MobileTabBar } from "@/app/dashboard/components/MobileTabBar"; +import { Sidebar } from "@/app/dashboard/components/Sidebar"; +import { ThemeToggle } from "@/app/dashboard/components/ThemeToggle"; +import type { Job } from "@/features/jobs/domain/job"; const mockUseAuth = vi.fn(); const mockUseTheme = vi.fn(); -vi.mock("@/domains/auth/application/AuthContext", () => ({ +vi.mock("@/features/auth/application/AuthContext", () => ({ useAuth: () => mockUseAuth(), })); @@ -21,7 +21,7 @@ vi.mock("@/shared/hooks/useTheme", () => ({ useTheme: () => mockUseTheme(), })); -vi.mock("@/domains/new_dashboard/infrastructure/notificationsApi", () => ({ +vi.mock("@/features/notifications/api", () => ({ getDashboardNotificationFeed: vi.fn().mockResolvedValue({ messages: [], notifications: [], diff --git a/frontend/tests/unit/new_dashboard/home.profile.test.tsx b/frontend/tests/unit/new_dashboard/home.profile.test.tsx index b08707d5..d4486ec2 100644 --- a/frontend/tests/unit/new_dashboard/home.profile.test.tsx +++ b/frontend/tests/unit/new_dashboard/home.profile.test.tsx @@ -1,15 +1,9 @@ -import { CareerChecklist } from "@/domains/new_dashboard/components/home/CareerChecklist"; -import { HomeTab } from "@/domains/new_dashboard/components/home/HomeTab"; -import { PreferencesForm } from "@/domains/new_dashboard/components/profile/PreferencesForm"; -import { ProfileForm } from "@/domains/new_dashboard/components/profile/ProfileForm"; -import { - initialPreferences, - initialUser, -} from "@/domains/new_dashboard/constants"; -import type { - SearchPreferences, - UserProfile, -} from "@/domains/new_dashboard/types"; +import { CareerChecklist } from "@/features/home/components/CareerChecklist"; +import { HomeTab } from "@/features/home/components/HomeTab"; +import { PreferencesForm } from "@/features/profile/components/PreferencesForm"; +import { ProfileForm } from "@/features/profile/components/ProfileForm"; +import { initialPreferences, initialUser } from "@/features/profile/defaults"; +import type { SearchPreferences, UserProfile } from "@/features/profile/domain/user"; import { fireEvent, render, screen } from "@testing-library/react"; import type { ReactElement } from "react"; import { useState } from "react"; diff --git a/frontend/tests/unit/new_dashboard/hooks.test.tsx b/frontend/tests/unit/new_dashboard/hooks.test.tsx index c324eecd..f9b89d93 100644 --- a/frontend/tests/unit/new_dashboard/hooks.test.tsx +++ b/frontend/tests/unit/new_dashboard/hooks.test.tsx @@ -1,6 +1,6 @@ import { act, renderHook, waitFor } from "@testing-library/react"; import { beforeEach, describe, expect, it, vi } from "vitest"; -import { ApiError } from "@/shared/lib/apiError"; +import { ApiError } from "@/shared/api/apiError"; const dashboardApiMock = vi.hoisted(() => ({ getDashboardSavedJobs: vi.fn(), @@ -9,16 +9,16 @@ const dashboardApiMock = vi.hoisted(() => ({ updateDashboardSavedJob: vi.fn(), })); -vi.mock("@/domains/new_dashboard/infrastructure/dashboardJobsApi", () => ({ +vi.mock("@/features/jobs/api/dashboardJobsApi", () => ({ getDashboardSavedJobs: dashboardApiMock.getDashboardSavedJobs, searchDashboardJobs: dashboardApiMock.searchDashboardJobs, createDashboardSavedJob: dashboardApiMock.createDashboardSavedJob, updateDashboardSavedJob: dashboardApiMock.updateDashboardSavedJob, })); -import { useDashboardJobs } from "@/domains/new_dashboard/hooks/useDashboardJobs"; -import type { User } from "@/domains/auth/domain/auth.types"; -import type { Job } from "@/domains/new_dashboard/types"; +import { useDashboardJobs } from "@/features/jobs/hooks/useDashboardJobs"; +import type { User } from "@/features/auth/domain/auth.types"; +import type { Job } from "@/features/jobs/domain/job"; const user: User = { id: "user-1", diff --git a/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx b/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx index d6941730..5a909657 100644 --- a/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx +++ b/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx @@ -1,12 +1,12 @@ import { render, screen } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; -vi.mock("@/domains/new_dashboard/infrastructure/dashboardJobsApi", () => ({ +vi.mock("@/features/jobs/api/dashboardJobsApi", () => ({ getDashboardSavedJobEvents: vi.fn().mockResolvedValue([]), })); -import { JobDetailModal } from "@/domains/new_dashboard/components/jobs/JobDetailModal"; -import type { Job } from "@/domains/new_dashboard/types"; +import { JobDetailModal } from "@/features/jobs/components/JobDetailModal"; +import type { Job } from "@/features/jobs/domain/job"; function job(overrides: Partial = {}): Job { return { diff --git a/frontend/tests/unit/new_dashboard/jobs.test.tsx b/frontend/tests/unit/new_dashboard/jobs.test.tsx index d8532a1b..aa3d3d8f 100644 --- a/frontend/tests/unit/new_dashboard/jobs.test.tsx +++ b/frontend/tests/unit/new_dashboard/jobs.test.tsx @@ -1,19 +1,19 @@ import { fireEvent, render, screen, waitFor, within } from "@testing-library/react"; import { useState } from "react"; import { beforeEach, describe, expect, it, vi } from "vitest"; -import { AddJobModal } from "@/domains/new_dashboard/components/jobs/AddJobModal"; -import { JobDetailModal } from "@/domains/new_dashboard/components/jobs/JobDetailModal"; -import { JobFilter } from "@/domains/new_dashboard/components/jobs/JobFilter"; -import { FormattedJobDescription } from "@/domains/new_dashboard/components/jobs/FormattedJobDescription"; -import { JobRow } from "@/domains/new_dashboard/components/jobs/JobRow"; -import { JobTab } from "@/domains/new_dashboard/components/jobs/JobTab"; -import { JobTable } from "@/domains/new_dashboard/components/jobs/JobTable"; -import { initialPreferences } from "@/domains/new_dashboard/constants"; -import type { Job, JobModelFilter } from "@/domains/new_dashboard/types"; +import { AddJobModal } from "@/features/applications/components/AddJobModal"; +import { JobDetailModal } from "@/features/jobs/components/JobDetailModal"; +import { JobFilter } from "@/features/jobs/components/JobFilter"; +import { FormattedJobDescription } from "@/features/jobs/components/FormattedJobDescription"; +import { JobRow } from "@/features/jobs/components/JobRow"; +import { JobTab } from "@/features/jobs/components/JobTab"; +import { JobTable } from "@/features/jobs/components/JobTable"; +import { initialPreferences } from "@/features/profile/defaults"; +import type { Job, JobModelFilter } from "@/features/jobs/domain/job"; import type { ContinentFilter, CountryFilter, -} from "@/domains/new_dashboard/utils/locationFilters"; +} from "@/features/jobs/domain/locationFilters"; const dashboardApiMock = vi.hoisted(() => ({ getDashboardSavedJobEvents: vi.fn(), @@ -23,7 +23,7 @@ const dashboardApiMock = vi.hoisted(() => ({ deleteDashboardApplicationNote: vi.fn(), })); -vi.mock("@/domains/new_dashboard/infrastructure/dashboardJobsApi", () => ({ +vi.mock("@/features/jobs/api/dashboardJobsApi", () => ({ getDashboardSavedJobEvents: dashboardApiMock.getDashboardSavedJobEvents, getDashboardApplicationNotes: dashboardApiMock.getDashboardApplicationNotes, createDashboardApplicationNote: dashboardApiMock.createDashboardApplicationNote, @@ -676,6 +676,9 @@ describe("new_dashboard job components", () => { setCountryFilter={setCountryFilter} matchSort={matchSort} setMatchSort={setMatchSort} + selectedFamilies={[]} + setSelectedFamilies={vi.fn()} + familyOptions={[]} searchPreferences={{ ...initialPreferences, remoteOnly: false }} onSearchJobs={onSearchJobs} onOpenJob={onOpenJob} diff --git a/frontend/tests/unit/new_dashboard/page.test.tsx b/frontend/tests/unit/new_dashboard/page.test.tsx index b4bd8ed6..0eeb2c85 100644 --- a/frontend/tests/unit/new_dashboard/page.test.tsx +++ b/frontend/tests/unit/new_dashboard/page.test.tsx @@ -1,11 +1,11 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import NewDashboardPage from "@/domains/new_dashboard/NewDashboardPage"; +import NewDashboardPage from "@/app/dashboard/DashboardPage"; import { act, fireEvent, render, screen, waitFor } from "@testing-library/react"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; /* -------------------------------------------------------------------------- */ /* MOCKS DE MÓDULOS */ -/* ⚠️ caminhos SEMPRE com alias @/domains/new_dashboard/... */ +/* ⚠️ caminhos SEMPRE com aliases canônicos de app/ e features/ */ /* porque vi.mock resolve relativo ao ARQUIVO DE TESTE. */ /* -------------------------------------------------------------------------- */ @@ -25,7 +25,7 @@ vi.mock("react-router-dom", async (importOriginal) => { }); const mockRefreshUser = vi.fn().mockResolvedValue(undefined); -vi.mock("@/domains/auth/application/AuthContext", () => ({ +vi.mock("@/features/auth/application/AuthContext", () => ({ useAuth: () => ({ user: { id: "u1", name: "Tester" }, refreshUser: mockRefreshUser, @@ -33,7 +33,7 @@ vi.mock("@/domains/auth/application/AuthContext", () => ({ })); // ---------- Child components (paths com alias!) ---------- -vi.mock("@/domains/new_dashboard/components/dashboard/DashboardTab", () => ({ +vi.mock("@/features/dashboard/components/DashboardTab", () => ({ DashboardTab: (props: any) => (
@@ -45,11 +45,11 @@ vi.mock("@/domains/new_dashboard/components/dashboard/DashboardTab", () => ({ ), })); -vi.mock("@/domains/new_dashboard/components/help/HelpTab", () => ({ +vi.mock("@/features/help/components/HelpTab", () => ({ HelpTab: () =>
Help
, })); -vi.mock("@/domains/new_dashboard/components/home/HomeTab", () => ({ +vi.mock("@/features/home/components/HomeTab", () => ({ HomeTab: (props: any) => (
@@ -69,7 +69,7 @@ vi.mock("@/domains/new_dashboard/components/jobs/AddJobModal", () => ({ ), })); -vi.mock("@/domains/new_dashboard/components/jobs/JobDetailModal", () => ({ +vi.mock("@/features/jobs/components/JobDetailModal", () => ({ JobDetailModal: (props: any) => (
{props.job.id} @@ -84,7 +84,7 @@ vi.mock("@/domains/new_dashboard/components/jobs/JobDetailModal", () => ({ ), })); -vi.mock("@/domains/new_dashboard/components/jobs/JobTab", () => ({ +vi.mock("@/features/jobs/components/JobTab", () => ({ JobTab: (props: any) => (
@@ -106,11 +106,11 @@ vi.mock("@/domains/new_dashboard/components/jobs/JobTab", () => ({ ), })); -vi.mock("@/domains/new_dashboard/components/mentoring/MentoringTab", () => ({ +vi.mock("@/features/mentoring/components/MentoringTab", () => ({ MentoringTab: () =>
, })); -vi.mock("@/domains/new_dashboard/components/profile/ProfileTab", () => ({ +vi.mock("@/features/profile/components/ProfileTab", () => ({ ProfileTab: (props: any) => (
@@ -121,37 +121,37 @@ vi.mock("@/domains/new_dashboard/components/profile/ProfileTab", () => ({ ), })); -vi.mock("@/domains/new_dashboard/components/layout/Header", () => ({ +vi.mock("@/app/dashboard/components/Header", () => ({ Header: () =>
, })); -vi.mock("@/domains/new_dashboard/components/layout/MobileTabBar", () => ({ +vi.mock("@/app/dashboard/components/MobileTabBar", () => ({ MobileTabBar: () =>
, })); -vi.mock("@/domains/new_dashboard/components/layout/Sidebar", () => ({ +vi.mock("@/app/dashboard/components/Sidebar", () => ({ Sidebar: () =>
, })); -vi.mock("@/domains/new_dashboard/components/shared/Toast", () => ({ +vi.mock("@/shared/ui/Toast", () => ({ Toast: ({ message }: any) => message ?
{message}
: null, })); -vi.mock("@/domains/new_dashboard/constants", () => ({ +vi.mock("@/features/jobs/constants", () => ({ jobStatuses: { applied: "Aplicada", interview: "Entrevista" }, })); -vi.mock("@/domains/new_dashboard/utils/searchKeywords", () => ({ +vi.mock("@/features/jobs/domain/searchKeywords", () => ({ parseSearchKeywords: (s: string) => s ? s.split(",").map((x) => x.trim()) : [], })); -vi.mock("@/domains/new_dashboard/utils/jobModelFilters", () => ({ +vi.mock("@/features/jobs/domain/jobModelFilters", () => ({ getModelFilterFromJobTypes: (types: string[]) => types.includes("Remoto") ? "Remoto" : "Todos", modelFilterToApiFilter: (f: string) => (f === "Todos" ? {} : { model: f }), })); -vi.mock("@/domains/new_dashboard/utils/locationFilters", () => ({})); +vi.mock("@/features/jobs/domain/locationFilters", () => ({})); // ---------- Hooks ---------- const mockSetUserProfile = vi.fn(); @@ -161,7 +161,7 @@ const mockSaveSearchPreferences = vi.fn().mockResolvedValue(undefined); let mockUserData: any = {}; -vi.mock("@/domains/new_dashboard/hooks/useUserDashboardData", () => ({ +vi.mock("@/features/profile/hooks/useUserDashboardData", () => ({ useUserDashboardData: () => mockUserData, })); @@ -177,7 +177,7 @@ const mockSaveJobNotes = vi.fn().mockResolvedValue(undefined); let mockJobs: any = {}; -vi.mock("@/domains/new_dashboard/hooks/useDashboardJobs", () => ({ +vi.mock("@/features/jobs/hooks/useDashboardJobs", () => ({ useDashboardJobs: () => mockJobs, })); diff --git a/frontend/tests/unit/new_dashboard/theme.toast.test.tsx b/frontend/tests/unit/new_dashboard/theme.toast.test.tsx index 312d26eb..51493400 100644 --- a/frontend/tests/unit/new_dashboard/theme.toast.test.tsx +++ b/frontend/tests/unit/new_dashboard/theme.toast.test.tsx @@ -1,9 +1,9 @@ import { act, fireEvent, render, screen } from "@testing-library/react"; import { useEffect } from "react"; import { beforeEach, describe, expect, it, vi } from "vitest"; -import { ThemeProvider, useDashboardTheme } from "@/domains/new_dashboard/context/ThemeContext"; -import { ToastProvider, useToastContext } from "@/domains/new_dashboard/context/ToastContext"; -import { Toast } from "@/domains/new_dashboard/components/shared/Toast"; +import { ThemeProvider, useDashboardTheme } from "@/app/dashboard/theme/ThemeContext"; +import { ToastProvider, useToastContext } from "@/shared/feedback/ToastContext"; +import { Toast } from "@/shared/ui/Toast"; import { ThemeToggle } from "@/shared/ui/theme-toggle"; const mockUseTheme = vi.fn(); diff --git a/frontend/tests/unit/new_dashboard/types.test.ts b/frontend/tests/unit/new_dashboard/types.test.ts index 3bf7f20e..49fda29a 100644 --- a/frontend/tests/unit/new_dashboard/types.test.ts +++ b/frontend/tests/unit/new_dashboard/types.test.ts @@ -1,20 +1,13 @@ -import * as dashboardTypes from "@/domains/new_dashboard/types"; import { JobLevelSchema, JobSchema, JobStatusSchema, JobTypeSchema, NewJobSchema, -} from "@/domains/new_dashboard/types/job"; -import { MentorSchema } from "@/domains/new_dashboard/types/mentor"; -import { - CareerChecklistSchema, - MessageSchema, - NotificationSchema, - SearchPreferencesSchema, - TechnologyExperienceSchema, - UserProfileSchema, -} from "@/domains/new_dashboard/types/user"; +} from "@/features/jobs/domain/job"; +import { MentorSchema } from "@/features/mentoring/types"; +import { CareerChecklistSchema, SearchPreferencesSchema, TechnologyExperienceSchema, UserProfileSchema } from "@/features/profile/domain/user"; +import { MessageSchema, NotificationSchema } from "@/features/notifications/types"; import { describe, expect, it } from "vitest"; const validJob = { @@ -50,21 +43,11 @@ const validMentor = { }; describe("new_dashboard runtime types", () => { - it("re-exports public schemas from the types barrel", () => { - expect(dashboardTypes.JobSchema).toBe(JobSchema); - expect(dashboardTypes.JobStatusSchema).toBe(JobStatusSchema); - expect(dashboardTypes.JobTypeSchema).toBe(JobTypeSchema); - expect(dashboardTypes.JobLevelSchema).toBe(JobLevelSchema); - expect(dashboardTypes.NewJobSchema).toBe(NewJobSchema); - expect(dashboardTypes.MentorSchema).toBe(MentorSchema); - expect(dashboardTypes.UserProfileSchema).toBe(UserProfileSchema); - expect(dashboardTypes.SearchPreferencesSchema).toBe(SearchPreferencesSchema); - expect(dashboardTypes.TechnologyExperienceSchema).toBe( - TechnologyExperienceSchema, - ); - expect(dashboardTypes.CareerChecklistSchema).toBe(CareerChecklistSchema); - expect(dashboardTypes.NotificationSchema).toBe(NotificationSchema); - expect(dashboardTypes.MessageSchema).toBe(MessageSchema); + it("exposes parsers from the canonical feature contracts", () => { + for (const schema of [JobSchema, JobStatusSchema, JobTypeSchema, JobLevelSchema, NewJobSchema, MentorSchema, UserProfileSchema, SearchPreferencesSchema, TechnologyExperienceSchema, CareerChecklistSchema, NotificationSchema, MessageSchema]) { + expect(schema.parse).toBeTypeOf("function"); + expect(schema.safeParse).toBeTypeOf("function"); + } }); it("validates jobs, form input, enums, score bounds, and optional payload", () => { diff --git a/frontend/tests/unit/new_dashboard/userDashboardData.test.tsx b/frontend/tests/unit/new_dashboard/userDashboardData.test.tsx index ba796aa0..a4ff6b93 100644 --- a/frontend/tests/unit/new_dashboard/userDashboardData.test.tsx +++ b/frontend/tests/unit/new_dashboard/userDashboardData.test.tsx @@ -1,6 +1,6 @@ import { act, renderHook, waitFor } from "@testing-library/react"; import { beforeEach, describe, expect, it, vi } from "vitest"; -import { ApiError } from "@/shared/lib/apiError"; +import { ApiError } from "@/shared/api/apiError"; const userApiMock = vi.hoisted(() => ({ getUserProfile: vi.fn(), @@ -10,7 +10,7 @@ const userApiMock = vi.hoisted(() => ({ createUserPreferences: vi.fn(), })); -vi.mock("@/domains/new_dashboard/infrastructure/userDashboardApi", () => ({ +vi.mock("@/features/profile/api/userDashboardApi", () => ({ getUserProfile: userApiMock.getUserProfile, getUserPreferences: userApiMock.getUserPreferences, updateUserProfile: userApiMock.updateUserProfile, @@ -18,9 +18,9 @@ vi.mock("@/domains/new_dashboard/infrastructure/userDashboardApi", () => ({ createUserPreferences: userApiMock.createUserPreferences, })); -import { initialPreferences, initialUser } from "@/domains/new_dashboard/constants"; -import { useUserDashboardData } from "@/domains/new_dashboard/hooks/useUserDashboardData"; -import type { User } from "@/domains/auth/domain/auth.types"; +import { initialPreferences, initialUser } from "@/features/profile/defaults"; +import { useUserDashboardData } from "@/features/profile/hooks/useUserDashboardData"; +import type { User } from "@/features/auth/domain/auth.types"; const user: User = { id: "user-1", diff --git a/frontend/tests/unit/new_dashboard/utils.test.ts b/frontend/tests/unit/new_dashboard/utils.test.ts index 12c08c43..187f8517 100644 --- a/frontend/tests/unit/new_dashboard/utils.test.ts +++ b/frontend/tests/unit/new_dashboard/utils.test.ts @@ -1,22 +1,22 @@ -import type { Job, JobModelFilter, JobType } from "@/domains/new_dashboard/types"; +import type { Job, JobModelFilter, JobType } from "@/features/jobs/domain/job"; import { createJobFromForm, getInitials, splitTags, -} from "@/domains/new_dashboard/utils/helpers"; +} from "@/features/jobs/legacy/domain/helpers"; import { getJobTypesFromModelFilter, getModelFilterFromJobTypes, modelFilterMatchesJob, modelFilterToApiFilter, -} from "@/domains/new_dashboard/utils/jobModelFilters"; +} from "@/features/jobs/domain/jobModelFilters"; import { getContinentFromLocation, matchesContinent, matchesCountry, matchesLocationFilters, -} from "@/domains/new_dashboard/utils/locationFilters"; -import { parseSearchKeywords } from "@/domains/new_dashboard/utils/searchKeywords"; +} from "@/features/jobs/domain/locationFilters"; +import { parseSearchKeywords } from "@/features/jobs/domain/searchKeywords"; import { beforeEach, describe, expect, it, vi } from "vitest"; describe("new_dashboard utils", () => { diff --git a/frontend/tests/unit/pages/App.test.tsx b/frontend/tests/unit/pages/App.test.tsx index c52046ff..7640bef2 100644 --- a/frontend/tests/unit/pages/App.test.tsx +++ b/frontend/tests/unit/pages/App.test.tsx @@ -14,11 +14,11 @@ vi.mock("@/shared/hooks/useTheme", () => ({ useTheme: () => ({ resolvedTheme: "light", toggleTheme: vi.fn() }), })); -vi.mock("@/domains/marketing/presentation/pages/LandingPage", () => ({ +vi.mock("@/features/marketing/pages/LandingPage", () => ({ default: () =>
Funcionalidades
, })); -vi.mock("@/domains/jobs/application/useJobsData", () => ({ +vi.mock("@/features/jobs/hooks/useJobsData", () => ({ useJobsData: () => ({ files: [{ file: "vagas.xlsx" }], selectedFile: "vagas.xlsx", @@ -33,7 +33,7 @@ vi.mock("@/domains/jobs/application/useJobsData", () => ({ }), })); -vi.mock("@/domains/jobs/application/useJobsFiltering", () => ({ +vi.mock("@/features/jobs/hooks/useJobsFiltering", () => ({ useJobsFiltering: () => ({ search: "", setSearch: vi.fn(), @@ -44,7 +44,7 @@ vi.mock("@/domains/jobs/application/useJobsFiltering", () => ({ }), })); -vi.mock("@/domains/jobs/application/useJobsPagination", () => ({ +vi.mock("@/features/jobs/hooks/useJobsPagination", () => ({ useJobsPagination: () => ({ currentPage: 1, setCurrentPage: vi.fn(), diff --git a/frontend/tests/unit/pages/auth/AuthCallback.test.tsx b/frontend/tests/unit/pages/auth/AuthCallback.test.tsx index 2965adbd..e6593a9b 100644 --- a/frontend/tests/unit/pages/auth/AuthCallback.test.tsx +++ b/frontend/tests/unit/pages/auth/AuthCallback.test.tsx @@ -8,7 +8,7 @@ vi.mock("react-router-dom", () => ({ })); const mockUseAuth = vi.fn(); -vi.mock("@/domains/auth/application/AuthContext", () => ({ +vi.mock("@/features/auth/application/AuthContext", () => ({ useAuth: () => mockUseAuth(), })); @@ -16,7 +16,7 @@ vi.mock("@/shared/ui/Loading", () => ({ default: () =>
Loading...
, })); -import AuthCallback from "@/domains/auth/presentation/pages/AuthCallbackPage"; +import AuthCallback from "@/features/auth/pages/AuthCallbackPage"; describe("AuthCallback", () => { beforeEach(() => { diff --git a/frontend/tests/unit/pages/jobs/JobsPage.test.tsx b/frontend/tests/unit/pages/jobs/JobsPage.test.tsx index 299cd42e..aa03fc14 100644 --- a/frontend/tests/unit/pages/jobs/JobsPage.test.tsx +++ b/frontend/tests/unit/pages/jobs/JobsPage.test.tsx @@ -43,15 +43,15 @@ const hookState = vi.hoisted(() => ({ capturedTableProps: null as any, })); -vi.mock("@/domains/jobs/application/useJobsData", () => ({ +vi.mock("@/features/jobs/hooks/useJobsData", () => ({ useJobsData: () => hookState.useJobsDataValue, })); -vi.mock("@/domains/jobs/application/useJobsFiltering", () => ({ +vi.mock("@/features/jobs/hooks/useJobsFiltering", () => ({ useJobsFiltering: () => hookState.useJobsFilteringValue, })); -vi.mock("@/domains/jobs/presentation/components/JobsFiltersCard", () => ({ +vi.mock("@/features/jobs/components/JobsFiltersCard", () => ({ JobsFiltersCard: (props: any) => { hookState.capturedFiltersProps = props; @@ -89,7 +89,7 @@ vi.mock("@/domains/jobs/presentation/components/JobsFiltersCard", () => ({ }, })); -vi.mock("@/domains/jobs/presentation/components/JobsTableCard", () => ({ +vi.mock("@/features/jobs/components/JobsTableCard", () => ({ JobsTableCard: (props: any) => { hookState.capturedTableProps = props; @@ -122,7 +122,7 @@ function renderPage(initialEntry = "/vagas") { ); } -import JobsPage from "@/domains/jobs/presentation/pages/JobsPage"; +import JobsPage from "@/features/jobs/pages/JobsPage"; describe("JobsPage", () => { beforeEach(() => { diff --git a/frontend/tests/unit/pages/login/LoginPage.test.tsx b/frontend/tests/unit/pages/login/LoginPage.test.tsx index 1fed0cc9..575698e3 100644 --- a/frontend/tests/unit/pages/login/LoginPage.test.tsx +++ b/frontend/tests/unit/pages/login/LoginPage.test.tsx @@ -2,15 +2,15 @@ import "@testing-library/jest-dom/vitest"; import { render, screen } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; -vi.mock("@/domains/auth/presentation/components/AuthVisualPanel", () => ({ +vi.mock("@/features/auth/components/AuthVisualPanel", () => ({ default: () =>
Left Side Mock
, })); -vi.mock("@/domains/auth/presentation/components/LoginFormPanel", () => ({ +vi.mock("@/features/auth/components/LoginFormPanel", () => ({ default: () =>
Right Side Mock
, })); -import LoginPage from "@/domains/auth/presentation/pages/LoginPage"; +import LoginPage from "@/features/auth/pages/LoginPage"; describe("LoginPage", () => { it("renderiza os dois lados da tela de login", () => { diff --git a/frontend/tests/unit/pages/not_found.test.tsx b/frontend/tests/unit/pages/not_found.test.tsx index 516836ac..296ade27 100644 --- a/frontend/tests/unit/pages/not_found.test.tsx +++ b/frontend/tests/unit/pages/not_found.test.tsx @@ -15,7 +15,7 @@ vi.mock("@lottiefiles/dotlottie-react", () => ({ DotLottieReact: () =>
, })); -import NotFound from "@/app/NotFound"; +import NotFound from "@/app/routes/NotFound"; describe("NotFound", () => { it("renderiza mensagem e link para voltar ao inicio", () => { diff --git a/frontend/tests/unit/pages/register/RegisterPage.test.tsx b/frontend/tests/unit/pages/register/RegisterPage.test.tsx index 14a75d23..73e57280 100644 --- a/frontend/tests/unit/pages/register/RegisterPage.test.tsx +++ b/frontend/tests/unit/pages/register/RegisterPage.test.tsx @@ -1,15 +1,15 @@ import { render, screen } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; -vi.mock("@/domains/auth/presentation/components/AuthVisualPanel", () => ({ +vi.mock("@/features/auth/components/AuthVisualPanel", () => ({ default: () =>
Left Side Mock
, })); -vi.mock("@/domains/auth/presentation/components/RegisterFormPanel", () => ({ +vi.mock("@/features/auth/components/RegisterFormPanel", () => ({ default: () =>
Register Side Mock
, })); -import RegisterPage from "@/domains/auth/presentation/pages/RegisterPage"; +import RegisterPage from "@/features/auth/pages/RegisterPage"; describe("RegisterPage", () => { it("renderiza os dois lados da tela de cadastro", () => { diff --git a/frontend/tests/unit/services/auth.service.test.tsx b/frontend/tests/unit/services/auth.service.test.tsx index ae0773aa..a6577971 100644 --- a/frontend/tests/unit/services/auth.service.test.tsx +++ b/frontend/tests/unit/services/auth.service.test.tsx @@ -4,7 +4,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; const fetchMock = vi.fn(); globalThis.fetch = fetchMock as any; -import * as auth from "@/domains/auth/infrastructure/authApi"; +import * as auth from "@/features/auth/api/authApi"; function mockResponse({ ok = true, diff --git a/frontend/tests/unit/services/connectionsApi.test.ts b/frontend/tests/unit/services/connectionsApi.test.ts index 24d77c4e..f8240b7e 100644 --- a/frontend/tests/unit/services/connectionsApi.test.ts +++ b/frontend/tests/unit/services/connectionsApi.test.ts @@ -4,7 +4,7 @@ import { connectProvider, disconnectProvider, getConnections, -} from "@/domains/auth/infrastructure/connectionsApi"; +} from "@/features/auth/api/connectionsApi"; const fetchMock = vi.fn(); globalThis.fetch = fetchMock as any; diff --git a/frontend/tests/unit/shared/apiClient.test.ts b/frontend/tests/unit/shared/apiClient.test.ts index ade5c32c..c541b006 100644 --- a/frontend/tests/unit/shared/apiClient.test.ts +++ b/frontend/tests/unit/shared/apiClient.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; -import { ApiError } from "@/shared/lib/apiError"; +import { ApiError } from "@/shared/api/apiError"; const axiosMock = vi.hoisted(() => { let fulfilledHandler: ((value: unknown) => unknown) | undefined; @@ -31,7 +31,7 @@ vi.mock("axios", () => ({ }, })); -import { api } from "@/shared/lib/apiClient"; +import { api } from "@/shared/api/apiClient"; describe("apiClient", () => { beforeEach(() => { diff --git a/frontend/tests/unit/utils/apiError.test.ts b/frontend/tests/unit/utils/apiError.test.ts index 9d85a508..c302da55 100644 --- a/frontend/tests/unit/utils/apiError.test.ts +++ b/frontend/tests/unit/utils/apiError.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { ApiError, parseApiError } from "@/shared/lib/apiError"; +import { ApiError, parseApiError } from "@/shared/api/apiError"; describe("parseApiError", () => { it("lê o envelope padronizado code/message/details", () => { diff --git a/frontend/tests/unit/utils/cn.test.ts b/frontend/tests/unit/utils/cn.test.ts index c94322d6..e1607b1b 100644 --- a/frontend/tests/unit/utils/cn.test.ts +++ b/frontend/tests/unit/utils/cn.test.ts @@ -1,4 +1,4 @@ -import { cn } from "@/shared/lib/utils"; +import { cn } from "@/shared/utils/utils"; import { describe, expect, it } from "vitest"; describe("cn", () => { diff --git a/frontend/tests/unit/utils/jobsService.test.ts b/frontend/tests/unit/utils/jobsService.test.ts index f02a9ee3..2a6644b5 100644 --- a/frontend/tests/unit/utils/jobsService.test.ts +++ b/frontend/tests/unit/utils/jobsService.test.ts @@ -1,4 +1,4 @@ -import { fetchJobsByAPI, fetchKeywords, saveKeywords, runScraperRequest } from "@/domains/jobs/infrastructure/jobsApi"; +import { fetchJobsByAPI, fetchKeywords, saveKeywords, runScraperRequest } from "@/features/jobs/api/jobsApi"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; describe("jobsService", () => { diff --git a/frontend/tests/unit/utils/useJobsFiltering.test.ts b/frontend/tests/unit/utils/useJobsFiltering.test.ts index 1a933c1e..4ead1692 100644 --- a/frontend/tests/unit/utils/useJobsFiltering.test.ts +++ b/frontend/tests/unit/utils/useJobsFiltering.test.ts @@ -1,4 +1,4 @@ -import { useJobsFiltering } from "@/domains/jobs/application/useJobsFiltering"; +import { useJobsFiltering } from "@/features/jobs/hooks/useJobsFiltering"; import { renderHook } from "@testing-library/react"; import { describe, expect, it } from "vitest"; diff --git a/frontend/tests/unit/utils/useJobsPagination.test.ts b/frontend/tests/unit/utils/useJobsPagination.test.ts index ed3170ca..4ef7dd74 100644 --- a/frontend/tests/unit/utils/useJobsPagination.test.ts +++ b/frontend/tests/unit/utils/useJobsPagination.test.ts @@ -1,4 +1,4 @@ -import { useJobsPagination } from "@/domains/jobs/application/useJobsPagination"; +import { useJobsPagination } from "@/features/jobs/hooks/useJobsPagination"; import { act, renderHook } from "@testing-library/react"; import { describe, expect, it } from "vitest";