From 05536c08fa3f42972bb0b0a3185b51f3bb9f862a Mon Sep 17 00:00:00 2001 From: hltav Date: Sun, 1 Nov 2026 14:09:47 -0300 Subject: [PATCH 01/15] refactor(PAV-181): reorganiza arquitetura modular do frontend (cherry picked from commit 4088b91c7a8930420222734fbb1f5329c07f915b) --- frontend/README.md | 4 +- frontend/src/app/AppProviders.tsx | 2 +- frontend/src/app/AppRoutes.tsx | 14 +- frontend/src/app/AuthenticatedHeader.tsx | 2 +- frontend/src/app/AuthenticatedSidebar.tsx | 2 +- .../dashboard/theme}/ThemeContext.tsx | 2 +- frontend/src/app/dashboard/theme/useTheme.ts | 1 + .../presentation/pages/LandingPage.tsx | 23 --- .../new_dashboard/NewDashboardPage.tsx | 10 +- .../components/jobs/AddJobModal.tsx | 2 +- .../components/jobs/JobDetailModal.tsx | 2 +- .../components/jobs/JobFilter.tsx | 4 +- .../new_dashboard/components/jobs/JobTab.tsx | 4 +- .../components/layout/Header.tsx | 2 +- .../components/layout/MessageDetailModal.tsx | 2 +- .../components/layout/Sidebar.tsx | 2 +- .../mentoring/MentorDetailModal.tsx | 2 +- .../components/profile/ConnectionsForm.tsx | 2 +- .../components/profile/PreferencesForm.tsx | 2 +- .../new_dashboard/constants/initialData.ts | 180 +----------------- .../new_dashboard/hooks/useDashboardJobs.ts | 2 +- .../domains/new_dashboard/hooks/useJobs.ts | 2 - .../domains/new_dashboard/hooks/useTheme.ts | 2 - .../domains/new_dashboard/hooks/useToast.ts | 2 - .../hooks/useUserDashboardData.ts | 2 +- frontend/src/domains/new_dashboard/layout.tsx | 6 +- .../src/domains/new_dashboard/types/index.ts | 2 +- .../src/domains/new_dashboard/types/mentor.ts | 20 +- .../src/domains/new_dashboard/types/user.ts | 83 ++------ .../auth/application/AuthContext.tsx | 2 +- .../auth/domain/auth.types.ts | 0 .../auth/infrastructure/authApi.ts | 2 +- .../auth/infrastructure/connectionsApi.ts | 0 .../components/AuthVisualPanel.tsx | 0 .../components/LoginFormPanel.tsx | 4 +- .../components/RegisterFormPanel.tsx | 0 .../presentation/pages/AuthCallbackPage.tsx | 2 +- .../auth/presentation/pages/LoginPage.tsx | 4 +- .../auth/presentation/pages/RegisterPage.tsx | 4 +- frontend/src/features/jobs/constants.ts | 25 +++ .../types => features/jobs/domain}/job.ts | 0 .../jobs/domain}/jobModelFilters.ts | 2 +- .../jobs/domain}/locationFilters.ts | 2 +- .../jobs/domain}/searchKeywords.ts | 0 .../jobs/legacy/application}/JobsContext.tsx | 9 +- .../jobs/legacy/application/useJobs.ts | 1 + .../src/features/jobs/legacy/initialJobs.ts | 68 +++++++ .../marketing}/components/CTASection.tsx | 0 .../marketing}/components/FeaturesSection.tsx | 0 .../marketing}/components/Footer.tsx | 0 .../marketing}/components/HeroSection.tsx | 0 .../marketing}/components/HowItWorks.tsx | 0 .../components/LegalDocumentPage.tsx | 0 .../marketing}/components/Navbar.tsx | 0 .../marketing}/components/TeamSection.tsx | 0 .../features/marketing/pages/LandingPage.tsx | 23 +++ .../marketing}/pages/PrivacyPolicyPage.tsx | 2 +- .../marketing}/pages/TermsOfUsePage.tsx | 2 +- .../src/features/mentoring/demoMentors.ts | 49 +++++ frontend/src/features/mentoring/types.ts | 18 ++ frontend/src/features/notifications/types.ts | 22 +++ frontend/src/features/profile/defaults.ts | 29 +++ frontend/src/features/profile/domain/user.ts | 47 +++++ .../feedback}/ToastContext.tsx | 0 frontend/src/shared/feedback/useToast.ts | 1 + .../components/shared => shared/ui}/Modal.tsx | 0 .../components/shared => shared/ui}/Toast.tsx | 0 frontend/tests/unit/app/AppRoutes.test.tsx | 10 +- .../unit/app/AuthenticatedHeader.test.tsx | 2 +- .../unit/app/AuthenticatedLayout.test.tsx | 2 +- .../tests/unit/components/Footer.test.tsx | 2 +- .../components/landing/CTASection.test.tsx | 2 +- .../landing/FeaturesSection.test.tsx | 2 +- .../components/landing/LandinPage.test.tsx | 16 +- .../unit/components/landing/Navbar.test.tsx | 2 +- .../components/landing/TeamSection.test.tsx | 2 +- .../unit/components/login/LeftSide.test.tsx | 2 +- .../components/login/RegisterSide.test.tsx | 4 +- .../unit/components/login/RigthSide.test.tsx | 6 +- .../tests/unit/context/AuthContext.test.tsx | 2 +- .../new_dashboard/HeaderUserMenu.test.tsx | 2 +- .../new_dashboard/branch-coverage.test.tsx | 4 +- .../new_dashboard/connectionsForm.test.tsx | 2 +- .../tests/unit/new_dashboard/context.test.tsx | 4 +- .../new_dashboard/dashboard.layout.test.tsx | 2 +- .../tests/unit/new_dashboard/hooks.test.tsx | 2 +- .../tests/unit/new_dashboard/jobs.test.tsx | 2 +- .../tests/unit/new_dashboard/page.test.tsx | 10 +- .../unit/new_dashboard/theme.toast.test.tsx | 6 +- .../tests/unit/new_dashboard/types.test.ts | 2 +- .../new_dashboard/userDashboardData.test.tsx | 2 +- .../tests/unit/new_dashboard/utils.test.ts | 6 +- frontend/tests/unit/pages/App.test.tsx | 2 +- .../unit/pages/auth/AuthCallback.test.tsx | 4 +- .../tests/unit/pages/login/LoginPage.test.tsx | 6 +- .../unit/pages/register/RegisterPage.test.tsx | 6 +- .../tests/unit/services/auth.service.test.tsx | 2 +- .../unit/services/connectionsApi.test.ts | 2 +- 98 files changed, 420 insertions(+), 403 deletions(-) rename frontend/src/{domains/new_dashboard/context => app/dashboard/theme}/ThemeContext.tsx (90%) create mode 100644 frontend/src/app/dashboard/theme/useTheme.ts delete mode 100644 frontend/src/domains/marketing/presentation/pages/LandingPage.tsx delete mode 100644 frontend/src/domains/new_dashboard/hooks/useJobs.ts delete mode 100644 frontend/src/domains/new_dashboard/hooks/useTheme.ts delete mode 100644 frontend/src/domains/new_dashboard/hooks/useToast.ts rename frontend/src/{domains => features}/auth/application/AuthContext.tsx (95%) rename frontend/src/{domains => features}/auth/domain/auth.types.ts (100%) rename frontend/src/{domains => features}/auth/infrastructure/authApi.ts (98%) rename frontend/src/{domains => features}/auth/infrastructure/connectionsApi.ts (100%) rename frontend/src/{domains => features}/auth/presentation/components/AuthVisualPanel.tsx (100%) rename frontend/src/{domains => features}/auth/presentation/components/LoginFormPanel.tsx (99%) rename frontend/src/{domains => features}/auth/presentation/components/RegisterFormPanel.tsx (100%) rename frontend/src/{domains => features}/auth/presentation/pages/AuthCallbackPage.tsx (91%) rename frontend/src/{domains => features}/auth/presentation/pages/LoginPage.tsx (57%) rename frontend/src/{domains => features}/auth/presentation/pages/RegisterPage.tsx (58%) create mode 100644 frontend/src/features/jobs/constants.ts rename frontend/src/{domains/new_dashboard/types => features/jobs/domain}/job.ts (100%) rename frontend/src/{domains/new_dashboard/utils => features/jobs/domain}/jobModelFilters.ts (96%) rename frontend/src/{domains/new_dashboard/utils => features/jobs/domain}/locationFilters.ts (98%) rename frontend/src/{domains/new_dashboard/utils => features/jobs/domain}/searchKeywords.ts (100%) rename frontend/src/{domains/new_dashboard/context => features/jobs/legacy/application}/JobsContext.tsx (82%) create mode 100644 frontend/src/features/jobs/legacy/application/useJobs.ts create mode 100644 frontend/src/features/jobs/legacy/initialJobs.ts rename frontend/src/{domains/marketing/presentation => features/marketing}/components/CTASection.tsx (100%) rename frontend/src/{domains/marketing/presentation => features/marketing}/components/FeaturesSection.tsx (100%) rename frontend/src/{domains/marketing/presentation => features/marketing}/components/Footer.tsx (100%) rename frontend/src/{domains/marketing/presentation => features/marketing}/components/HeroSection.tsx (100%) rename frontend/src/{domains/marketing/presentation => features/marketing}/components/HowItWorks.tsx (100%) rename frontend/src/{domains/marketing/presentation => features/marketing}/components/LegalDocumentPage.tsx (100%) rename frontend/src/{domains/marketing/presentation => features/marketing}/components/Navbar.tsx (100%) rename frontend/src/{domains/marketing/presentation => features/marketing}/components/TeamSection.tsx (100%) create mode 100644 frontend/src/features/marketing/pages/LandingPage.tsx rename frontend/src/{domains/marketing/presentation => features/marketing}/pages/PrivacyPolicyPage.tsx (76%) rename frontend/src/{domains/marketing/presentation => features/marketing}/pages/TermsOfUsePage.tsx (74%) create mode 100644 frontend/src/features/mentoring/demoMentors.ts create mode 100644 frontend/src/features/mentoring/types.ts create mode 100644 frontend/src/features/notifications/types.ts create mode 100644 frontend/src/features/profile/defaults.ts create mode 100644 frontend/src/features/profile/domain/user.ts rename frontend/src/{domains/new_dashboard/context => shared/feedback}/ToastContext.tsx (100%) create mode 100644 frontend/src/shared/feedback/useToast.ts rename frontend/src/{domains/new_dashboard/components/shared => shared/ui}/Modal.tsx (100%) rename frontend/src/{domains/new_dashboard/components/shared => shared/ui}/Toast.tsx (100%) diff --git a/frontend/README.md b/frontend/README.md index 846ae4f1..f0bd883e 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -53,9 +53,9 @@ Variáveis usadas: O frontend segue uma estrutura orientada por domínio: - `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/features/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/features/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/shared`: componentes de UI, assets, hooks e utilitários reutilizáveis. diff --git a/frontend/src/app/AppProviders.tsx b/frontend/src/app/AppProviders.tsx index 263295e2..1a8cc4f5 100644 --- a/frontend/src/app/AppProviders.tsx +++ b/frontend/src/app/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/AppRoutes.tsx index 23d0db0e..40037e8e 100644 --- a/frontend/src/app/AppRoutes.tsx +++ b/frontend/src/app/AppRoutes.tsx @@ -1,11 +1,11 @@ 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 { useAuth } from "@/features/auth/application/AuthContext"; +import AuthCallbackPage from "@/features/auth/presentation/pages/AuthCallbackPage"; +import LoginPage from "@/features/auth/presentation/pages/LoginPage"; +import RegisterPage from "@/features/auth/presentation/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 "@/domains/new_dashboard/NewDashboardPage"; import NewDashboardLayout from "@/domains/new_dashboard/layout"; import Loading from "@/shared/ui/Loading"; diff --git a/frontend/src/app/AuthenticatedHeader.tsx b/frontend/src/app/AuthenticatedHeader.tsx index 59618b1e..419e6152 100644 --- a/frontend/src/app/AuthenticatedHeader.tsx +++ b/frontend/src/app/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/AuthenticatedSidebar.tsx b/frontend/src/app/AuthenticatedSidebar.tsx index 1a8d8224..838f78df 100644 --- a/frontend/src/app/AuthenticatedSidebar.tsx +++ b/frontend/src/app/AuthenticatedSidebar.tsx @@ -1,4 +1,4 @@ -import { useAuth } from "@/domains/auth/application/AuthContext"; +import { useAuth } from "@/features/auth/application/AuthContext"; import { cn } from "@/shared/lib/utils"; import { BriefcaseBusiness, diff --git a/frontend/src/domains/new_dashboard/context/ThemeContext.tsx b/frontend/src/app/dashboard/theme/ThemeContext.tsx similarity index 90% rename from frontend/src/domains/new_dashboard/context/ThemeContext.tsx rename to frontend/src/app/dashboard/theme/ThemeContext.tsx index a7d6bd66..0aebbc8b 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 "@/domains/new_dashboard/constants/colors"; type ThemeContextValue = ReturnType & { colors: typeof lightColors; 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/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/NewDashboardPage.tsx b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx index 48c4b8c7..d2b2ef57 100644 --- a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx +++ b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx @@ -1,4 +1,4 @@ -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"; @@ -12,7 +12,7 @@ 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 { Toast } from "@/shared/ui/Toast"; import { jobStatuses } from "./constants"; import { useDashboardJobs } from "./hooks/useDashboardJobs"; import { useUserDashboardData } from "./hooks/useUserDashboardData"; @@ -35,12 +35,12 @@ import type { 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/components/jobs/AddJobModal.tsx b/frontend/src/domains/new_dashboard/components/jobs/AddJobModal.tsx index c899b304..2966e818 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/AddJobModal.tsx +++ b/frontend/src/domains/new_dashboard/components/jobs/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 { Modal } from "@/shared/ui/Modal"; const initialForm: NewJob = { jobTitle: "", diff --git a/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx b/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx index a0707757..029befda 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx +++ b/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx @@ -6,7 +6,7 @@ import { getFamilyLabel, } from "../../infrastructure/dashboardJobsApi"; import type { Job, JobStatus, JobTimelineEvent } from "../../types"; -import { Modal } from "../shared/Modal"; +import { Modal } from "@/shared/ui/Modal"; import { ApplicationNotesSection } from "./ApplicationNotesSection"; import { FormattedJobDescription } from "./FormattedJobDescription"; diff --git a/frontend/src/domains/new_dashboard/components/jobs/JobFilter.tsx b/frontend/src/domains/new_dashboard/components/jobs/JobFilter.tsx index a8039576..9972589c 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobFilter.tsx +++ b/frontend/src/domains/new_dashboard/components/jobs/JobFilter.tsx @@ -2,13 +2,13 @@ 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 { 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/JobTab.tsx b/frontend/src/domains/new_dashboard/components/jobs/JobTab.tsx index 04cd2598..238062dc 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobTab.tsx +++ b/frontend/src/domains/new_dashboard/components/jobs/JobTab.tsx @@ -9,11 +9,11 @@ import type { 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/layout/Header.tsx b/frontend/src/domains/new_dashboard/components/layout/Header.tsx index 0ecb2cc5..4d39820d 100644 --- a/frontend/src/domains/new_dashboard/components/layout/Header.tsx +++ b/frontend/src/domains/new_dashboard/components/layout/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"; diff --git a/frontend/src/domains/new_dashboard/components/layout/MessageDetailModal.tsx b/frontend/src/domains/new_dashboard/components/layout/MessageDetailModal.tsx index f32137e5..17a0b48d 100644 --- a/frontend/src/domains/new_dashboard/components/layout/MessageDetailModal.tsx +++ b/frontend/src/domains/new_dashboard/components/layout/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 { Modal } from "@/shared/ui/Modal"; interface MessageDetailModalProps { message: Message; diff --git a/frontend/src/domains/new_dashboard/components/layout/Sidebar.tsx b/frontend/src/domains/new_dashboard/components/layout/Sidebar.tsx index fab6bb8d..9d81720a 100644 --- a/frontend/src/domains/new_dashboard/components/layout/Sidebar.tsx +++ b/frontend/src/domains/new_dashboard/components/layout/Sidebar.tsx @@ -1,7 +1,7 @@ import { cn } from "@/shared/lib/utils"; import { LogOut } from "lucide-react"; import { Link, useLocation } from "react-router-dom"; -import { useAuth } from "@/domains/auth/application/AuthContext"; +import { useAuth } from "@/features/auth/application/AuthContext"; import { CandidateLogo } from "../shared/CandidateLogo"; import { Icons } from "../shared/Icons"; diff --git a/frontend/src/domains/new_dashboard/components/mentoring/MentorDetailModal.tsx b/frontend/src/domains/new_dashboard/components/mentoring/MentorDetailModal.tsx index 13aa7fc8..b250bdf9 100644 --- a/frontend/src/domains/new_dashboard/components/mentoring/MentorDetailModal.tsx +++ b/frontend/src/domains/new_dashboard/components/mentoring/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 { Modal } from "@/shared/ui/Modal"; interface MentorDetailModalProps { mentor: Mentor; diff --git a/frontend/src/domains/new_dashboard/components/profile/ConnectionsForm.tsx b/frontend/src/domains/new_dashboard/components/profile/ConnectionsForm.tsx index 3fad02b1..9cd30ce4 100644 --- a/frontend/src/domains/new_dashboard/components/profile/ConnectionsForm.tsx +++ b/frontend/src/domains/new_dashboard/components/profile/ConnectionsForm.tsx @@ -6,7 +6,7 @@ import { getConnections, type SupportedProvider, type UserConnections, -} from "@/domains/auth/infrastructure/connectionsApi"; +} from "@/features/auth/infrastructure/connectionsApi"; const PROVIDER_LABELS: Record = { google: "Google", diff --git a/frontend/src/domains/new_dashboard/components/profile/PreferencesForm.tsx b/frontend/src/domains/new_dashboard/components/profile/PreferencesForm.tsx index 112eff9f..2a8979e8 100644 --- a/frontend/src/domains/new_dashboard/components/profile/PreferencesForm.tsx +++ b/frontend/src/domains/new_dashboard/components/profile/PreferencesForm.tsx @@ -3,7 +3,7 @@ import { getJobTypesFromModelFilter, getModelFilterFromJobTypes, jobModelFilterOptions, -} from "../../utils/jobModelFilters"; +} from "@/features/jobs/domain/jobModelFilters"; interface PreferencesFormProps { searchPreferences: SearchPreferences; diff --git a/frontend/src/domains/new_dashboard/constants/initialData.ts b/frontend/src/domains/new_dashboard/constants/initialData.ts index 38789860..7cc6a921 100644 --- a/frontend/src/domains/new_dashboard/constants/initialData.ts +++ b/frontend/src/domains/new_dashboard/constants/initialData.ts @@ -1,176 +1,4 @@ -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: [], -}; +export { jobStatuses, jobStatusClasses, jobTypes, jobLevels } from "@/features/jobs/constants"; +export { initialJobs } from "@/features/jobs/legacy/initialJobs"; +export { initialMentors } from "@/features/mentoring/demoMentors"; +export { initialUser, initialPreferences } from "@/features/profile/defaults"; diff --git a/frontend/src/domains/new_dashboard/hooks/useDashboardJobs.ts b/frontend/src/domains/new_dashboard/hooks/useDashboardJobs.ts index ac0e7bf9..5d86b195 100644 --- a/frontend/src/domains/new_dashboard/hooks/useDashboardJobs.ts +++ b/frontend/src/domains/new_dashboard/hooks/useDashboardJobs.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect, useRef, useState } from "react"; -import type { User } from "@/domains/auth/domain/auth.types"; +import type { User } from "@/features/auth/domain/auth.types"; import { isApiError } from "@/shared/lib/apiError"; import type { Job, JobStatus, NewJob } from "../types"; import { 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/hooks/useUserDashboardData.ts b/frontend/src/domains/new_dashboard/hooks/useUserDashboardData.ts index 1201fe6f..7bda7e91 100644 --- a/frontend/src/domains/new_dashboard/hooks/useUserDashboardData.ts +++ b/frontend/src/domains/new_dashboard/hooks/useUserDashboardData.ts @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from "react"; import { isApiError } from "@/shared/lib/apiError"; -import type { User } from "@/domains/auth/domain/auth.types"; +import type { User } from "@/features/auth/domain/auth.types"; import { initialPreferences, initialUser } from "../constants"; import type { SearchPreferences, UserProfile } from "../types"; import { diff --git a/frontend/src/domains/new_dashboard/layout.tsx b/frontend/src/domains/new_dashboard/layout.tsx index 96e97f98..d4dc080b 100644 --- a/frontend/src/domains/new_dashboard/layout.tsx +++ b/frontend/src/domains/new_dashboard/layout.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/types/index.ts b/frontend/src/domains/new_dashboard/types/index.ts index 3d97258b..a2c89cbd 100644 --- a/frontend/src/domains/new_dashboard/types/index.ts +++ b/frontend/src/domains/new_dashboard/types/index.ts @@ -1,3 +1,3 @@ -export * from "./job"; +export * from "@/features/jobs/domain/job"; export * from "./mentor"; export * from "./user"; diff --git a/frontend/src/domains/new_dashboard/types/mentor.ts b/frontend/src/domains/new_dashboard/types/mentor.ts index 65f5bbd6..f710bf49 100644 --- a/frontend/src/domains/new_dashboard/types/mentor.ts +++ b/frontend/src/domains/new_dashboard/types/mentor.ts @@ -1,18 +1,2 @@ -import { z } from "zod"; - -export const MentorSchema = z.object({ - id: z.string(), - name: z.string().min(1), - rating: z.number().int().min(0).max(5), - completed: z.number().int().min(0), - days: z.string().min(1), - hours: z.string().min(1), - nextSessionDate: z.string().min(1), - specialty: z.string().min(1), - avatarColor: z.string().min(1), - platform: z.enum(["Zoom", "Google Meet", "Microsoft Teams", "Discord"]), - platformUrl: z.string().url(), - agenda: z.string().min(1), -}); - -export type Mentor = z.infer; +export { MentorSchema } from "@/features/mentoring/types"; +export type { Mentor } from "@/features/mentoring/types"; diff --git a/frontend/src/domains/new_dashboard/types/user.ts b/frontend/src/domains/new_dashboard/types/user.ts index a47792d7..8766dc1c 100644 --- a/frontend/src/domains/new_dashboard/types/user.ts +++ b/frontend/src/domains/new_dashboard/types/user.ts @@ -1,67 +1,16 @@ -import { z } from "zod"; -import { JobTypeSchema } from "./job"; - -export const TechnologyExperienceSchema = z.object({ - name: z.string().min(1), - years: z.number().min(0), -}); - -export const CareerChecklistItemSchema = z.object({ - id: z.string().min(1), - label: z.string().min(1), - checked: z.boolean(), -}); - -export const CareerChecklistSchema = z.object({ - id: z.string().min(1), - title: z.string().min(1), - month: z.string().min(1), - items: z.array(CareerChecklistItemSchema), -}); - -export const UserProfileSchema = z.object({ - firstName: z.string().min(1), - lastName: z.string().min(1), - displayName: z.string().min(1), - username: z.string().min(1), - email: z.string().email(), - avatarUrl: z.string().url().or(z.literal("")), - phone: z.string().min(1), - level: z.string().min(1), - technologies: z.array(z.string()), - technologyExperiences: z.array(TechnologyExperienceSchema), -}); - -export const SearchPreferencesSchema = z.object({ - keywords: z.array(z.string()), - searchLocation: z.string().min(1), - remoteOnly: z.boolean(), - jobTypes: z.array(JobTypeSchema), - emailNotifications: z.boolean(), - 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; +export { + TechnologyExperienceSchema, + CareerChecklistItemSchema, + CareerChecklistSchema, + UserProfileSchema, + SearchPreferencesSchema, +} from "@/features/profile/domain/user"; +export type { + UserProfile, + SearchPreferences, + TechnologyExperience, + CareerChecklist, +} from "@/features/profile/domain/user"; + +export { NotificationSchema, MessageSchema } from "@/features/notifications/types"; +export type { Notification, Message, MessageOrigin } from "@/features/notifications/types"; diff --git a/frontend/src/domains/auth/application/AuthContext.tsx b/frontend/src/features/auth/application/AuthContext.tsx similarity index 95% rename from frontend/src/domains/auth/application/AuthContext.tsx rename to frontend/src/features/auth/application/AuthContext.tsx index abefd7b5..a35f0b8b 100644 --- a/frontend/src/domains/auth/application/AuthContext.tsx +++ b/frontend/src/features/auth/application/AuthContext.tsx @@ -5,7 +5,7 @@ import { useState, ReactNode, } from "react"; -import type { LoginCredentials, User } from "@/domains/auth/domain/auth.types"; +import type { LoginCredentials, User } from "@/features/auth/domain/auth.types"; import { api } from "@/shared/lib/apiClient"; interface AuthContextData { 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/infrastructure/authApi.ts b/frontend/src/features/auth/infrastructure/authApi.ts similarity index 98% rename from frontend/src/domains/auth/infrastructure/authApi.ts rename to frontend/src/features/auth/infrastructure/authApi.ts index 1d463818..c1fc118a 100644 --- a/frontend/src/domains/auth/infrastructure/authApi.ts +++ b/frontend/src/features/auth/infrastructure/authApi.ts @@ -1,7 +1,7 @@ import type { LoginCredentials, RegisterData, -} from "@/domains/auth/domain/auth.types"; +} from "@/features/auth/domain/auth.types"; import { parseApiError } from "@/shared/lib/apiError"; function getBaseUrl(): string { diff --git a/frontend/src/domains/auth/infrastructure/connectionsApi.ts b/frontend/src/features/auth/infrastructure/connectionsApi.ts similarity index 100% rename from frontend/src/domains/auth/infrastructure/connectionsApi.ts rename to frontend/src/features/auth/infrastructure/connectionsApi.ts diff --git a/frontend/src/domains/auth/presentation/components/AuthVisualPanel.tsx b/frontend/src/features/auth/presentation/components/AuthVisualPanel.tsx similarity index 100% rename from frontend/src/domains/auth/presentation/components/AuthVisualPanel.tsx rename to frontend/src/features/auth/presentation/components/AuthVisualPanel.tsx diff --git a/frontend/src/domains/auth/presentation/components/LoginFormPanel.tsx b/frontend/src/features/auth/presentation/components/LoginFormPanel.tsx similarity index 99% rename from frontend/src/domains/auth/presentation/components/LoginFormPanel.tsx rename to frontend/src/features/auth/presentation/components/LoginFormPanel.tsx index 0726b4ab..d9a977e9 100644 --- a/frontend/src/domains/auth/presentation/components/LoginFormPanel.tsx +++ b/frontend/src/features/auth/presentation/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/infrastructure/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/presentation/components/RegisterFormPanel.tsx similarity index 100% rename from frontend/src/domains/auth/presentation/components/RegisterFormPanel.tsx rename to frontend/src/features/auth/presentation/components/RegisterFormPanel.tsx diff --git a/frontend/src/domains/auth/presentation/pages/AuthCallbackPage.tsx b/frontend/src/features/auth/presentation/pages/AuthCallbackPage.tsx similarity index 91% rename from frontend/src/domains/auth/presentation/pages/AuthCallbackPage.tsx rename to frontend/src/features/auth/presentation/pages/AuthCallbackPage.tsx index bbc82865..3bde6558 100644 --- a/frontend/src/domains/auth/presentation/pages/AuthCallbackPage.tsx +++ b/frontend/src/features/auth/presentation/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/presentation/pages/LoginPage.tsx similarity index 57% rename from frontend/src/domains/auth/presentation/pages/LoginPage.tsx rename to frontend/src/features/auth/presentation/pages/LoginPage.tsx index 3413264c..ec20eca1 100644 --- a/frontend/src/domains/auth/presentation/pages/LoginPage.tsx +++ b/frontend/src/features/auth/presentation/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/presentation/components/AuthVisualPanel"; +import RightSide from "@/features/auth/presentation/components/LoginFormPanel"; export default function LoginPage() { return ( diff --git a/frontend/src/domains/auth/presentation/pages/RegisterPage.tsx b/frontend/src/features/auth/presentation/pages/RegisterPage.tsx similarity index 58% rename from frontend/src/domains/auth/presentation/pages/RegisterPage.tsx rename to frontend/src/features/auth/presentation/pages/RegisterPage.tsx index 2c646cf8..61421a52 100644 --- a/frontend/src/domains/auth/presentation/pages/RegisterPage.tsx +++ b/frontend/src/features/auth/presentation/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/presentation/components/AuthVisualPanel"; +import RegisterSide from "@/features/auth/presentation/components/RegisterFormPanel"; export default function RegisterPage() { 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/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/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/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..d296f1f0 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 "@/domains/new_dashboard/utils/helpers"; +import { useToastContext } from "@/shared/feedback/ToastContext"; interface JobsContextValue { jobs: Job[]; diff --git a/frontend/src/features/jobs/legacy/application/useJobs.ts b/frontend/src/features/jobs/legacy/application/useJobs.ts new file mode 100644 index 00000000..e4780255 --- /dev/null +++ b/frontend/src/features/jobs/legacy/application/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/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/features/mentoring/demoMentors.ts b/frontend/src/features/mentoring/demoMentors.ts new file mode 100644 index 00000000..ae01c88b --- /dev/null +++ b/frontend/src/features/mentoring/demoMentors.ts @@ -0,0 +1,49 @@ +import type { Mentor } from "@/domains/new_dashboard/types/mentor"; + +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/features/mentoring/types.ts b/frontend/src/features/mentoring/types.ts new file mode 100644 index 00000000..65f5bbd6 --- /dev/null +++ b/frontend/src/features/mentoring/types.ts @@ -0,0 +1,18 @@ +import { z } from "zod"; + +export const MentorSchema = z.object({ + id: z.string(), + name: z.string().min(1), + rating: z.number().int().min(0).max(5), + completed: z.number().int().min(0), + days: z.string().min(1), + hours: z.string().min(1), + nextSessionDate: z.string().min(1), + specialty: z.string().min(1), + avatarColor: z.string().min(1), + platform: z.enum(["Zoom", "Google Meet", "Microsoft Teams", "Discord"]), + platformUrl: z.string().url(), + agenda: z.string().min(1), +}); + +export type Mentor = z.infer; 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/features/profile/defaults.ts b/frontend/src/features/profile/defaults.ts new file mode 100644 index 00000000..c4cac2fc --- /dev/null +++ b/frontend/src/features/profile/defaults.ts @@ -0,0 +1,29 @@ +import type { SearchPreferences, UserProfile } from "@/domains/new_dashboard/types/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/features/profile/domain/user.ts b/frontend/src/features/profile/domain/user.ts new file mode 100644 index 00000000..86e471d5 --- /dev/null +++ b/frontend/src/features/profile/domain/user.ts @@ -0,0 +1,47 @@ +import { z } from "zod"; +import { JobTypeSchema } from "@/features/jobs/domain/job"; + +export const TechnologyExperienceSchema = z.object({ + name: z.string().min(1), + years: z.number().min(0), +}); + +export const CareerChecklistItemSchema = z.object({ + id: z.string().min(1), + label: z.string().min(1), + checked: z.boolean(), +}); + +export const CareerChecklistSchema = z.object({ + id: z.string().min(1), + title: z.string().min(1), + month: z.string().min(1), + items: z.array(CareerChecklistItemSchema), +}); + +export const UserProfileSchema = z.object({ + firstName: z.string().min(1), + lastName: z.string().min(1), + displayName: z.string().min(1), + username: z.string().min(1), + email: z.string().email(), + avatarUrl: z.string().url().or(z.literal("")), + phone: z.string().min(1), + level: z.string().min(1), + technologies: z.array(z.string()), + technologyExperiences: z.array(TechnologyExperienceSchema), +}); + +export const SearchPreferencesSchema = z.object({ + keywords: z.array(z.string()), + searchLocation: z.string().min(1), + remoteOnly: z.boolean(), + jobTypes: z.array(JobTypeSchema), + emailNotifications: z.boolean(), + careerChecklist: z.array(CareerChecklistSchema), +}); + +export type UserProfile = z.infer; +export type SearchPreferences = z.infer; +export type TechnologyExperience = z.infer; +export type CareerChecklist = z.infer; 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/feedback/useToast.ts b/frontend/src/shared/feedback/useToast.ts new file mode 100644 index 00000000..fe828436 --- /dev/null +++ b/frontend/src/shared/feedback/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/tests/unit/app/AppRoutes.test.tsx b/frontend/tests/unit/app/AppRoutes.test.tsx index 55ae8559..4368def5 100644 --- a/frontend/tests/unit/app/AppRoutes.test.tsx +++ b/frontend/tests/unit/app/AppRoutes.test.tsx @@ -10,7 +10,7 @@ const authState = vi.hoisted(() => ({ }, })); -vi.mock("@/domains/auth/application/AuthContext", () => ({ +vi.mock("@/features/auth/application/AuthContext", () => ({ useAuth: () => authState.value, })); @@ -31,19 +31,19 @@ vi.mock("@/domains/new_dashboard/NewDashboardPage", () => ({ 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/presentation/pages/LoginPage", () => ({ default: () =>
Login route
, })); -vi.mock("@/domains/auth/presentation/pages/RegisterPage", () => ({ +vi.mock("@/features/auth/presentation/pages/RegisterPage", () => ({ default: () =>
Register route
, })); -vi.mock("@/domains/auth/presentation/pages/AuthCallbackPage", () => ({ +vi.mock("@/features/auth/presentation/pages/AuthCallbackPage", () => ({ default: () =>
Callback route
, })); diff --git a/frontend/tests/unit/app/AuthenticatedHeader.test.tsx b/frontend/tests/unit/app/AuthenticatedHeader.test.tsx index d0c888df..5a18c1d1 100644 --- a/frontend/tests/unit/app/AuthenticatedHeader.test.tsx +++ b/frontend/tests/unit/app/AuthenticatedHeader.test.tsx @@ -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..6f8e6808 100644 --- a/frontend/tests/unit/app/AuthenticatedLayout.test.tsx +++ b/frontend/tests/unit/app/AuthenticatedLayout.test.tsx @@ -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/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..a21b6cd4 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/presentation/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..9ed03270 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/infrastructure/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/presentation/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..ea8af474 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/infrastructure/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/presentation/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..db3e14a3 100644 --- a/frontend/tests/unit/context/AuthContext.test.tsx +++ b/frontend/tests/unit/context/AuthContext.test.tsx @@ -13,7 +13,7 @@ vi.mock("@/shared/lib/apiClient", () => ({ }, })); -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/new_dashboard/HeaderUserMenu.test.tsx b/frontend/tests/unit/new_dashboard/HeaderUserMenu.test.tsx index 8226b509..944a2cd6 100644 --- a/frontend/tests/unit/new_dashboard/HeaderUserMenu.test.tsx +++ b/frontend/tests/unit/new_dashboard/HeaderUserMenu.test.tsx @@ -10,7 +10,7 @@ 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(), diff --git a/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx index 20e529b7..93c06f9f 100644 --- a/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx +++ b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx @@ -5,7 +5,7 @@ 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 { Modal } from "@/shared/ui/Modal"; import { clearDashboardNotifications, getDashboardNotificationFeed, @@ -21,7 +21,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(), })); diff --git a/frontend/tests/unit/new_dashboard/connectionsForm.test.tsx b/frontend/tests/unit/new_dashboard/connectionsForm.test.tsx index ae6c7916..85f64595 100644 --- a/frontend/tests/unit/new_dashboard/connectionsForm.test.tsx +++ b/frontend/tests/unit/new_dashboard/connectionsForm.test.tsx @@ -9,7 +9,7 @@ const mocks = vi.hoisted(() => ({ disconnectProvider: vi.fn(), })); -vi.mock("@/domains/auth/infrastructure/connectionsApi", () => ({ +vi.mock("@/features/auth/infrastructure/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..2e35baa9 100644 --- a/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx +++ b/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx @@ -13,7 +13,7 @@ import type { Job } from "@/domains/new_dashboard/types"; const mockUseAuth = vi.fn(); const mockUseTheme = vi.fn(); -vi.mock("@/domains/auth/application/AuthContext", () => ({ +vi.mock("@/features/auth/application/AuthContext", () => ({ useAuth: () => mockUseAuth(), })); diff --git a/frontend/tests/unit/new_dashboard/hooks.test.tsx b/frontend/tests/unit/new_dashboard/hooks.test.tsx index c324eecd..954f2883 100644 --- a/frontend/tests/unit/new_dashboard/hooks.test.tsx +++ b/frontend/tests/unit/new_dashboard/hooks.test.tsx @@ -17,7 +17,7 @@ vi.mock("@/domains/new_dashboard/infrastructure/dashboardJobsApi", () => ({ })); import { useDashboardJobs } from "@/domains/new_dashboard/hooks/useDashboardJobs"; -import type { User } from "@/domains/auth/domain/auth.types"; +import type { User } from "@/features/auth/domain/auth.types"; import type { Job } from "@/domains/new_dashboard/types"; const user: User = { diff --git a/frontend/tests/unit/new_dashboard/jobs.test.tsx b/frontend/tests/unit/new_dashboard/jobs.test.tsx index d8532a1b..3f19be1d 100644 --- a/frontend/tests/unit/new_dashboard/jobs.test.tsx +++ b/frontend/tests/unit/new_dashboard/jobs.test.tsx @@ -13,7 +13,7 @@ import type { Job, JobModelFilter } from "@/domains/new_dashboard/types"; import type { ContinentFilter, CountryFilter, -} from "@/domains/new_dashboard/utils/locationFilters"; +} from "@/features/jobs/domain/locationFilters"; const dashboardApiMock = vi.hoisted(() => ({ getDashboardSavedJobEvents: vi.fn(), diff --git a/frontend/tests/unit/new_dashboard/page.test.tsx b/frontend/tests/unit/new_dashboard/page.test.tsx index b4bd8ed6..2b31557a 100644 --- a/frontend/tests/unit/new_dashboard/page.test.tsx +++ b/frontend/tests/unit/new_dashboard/page.test.tsx @@ -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, @@ -131,7 +131,7 @@ vi.mock("@/domains/new_dashboard/components/layout/Sidebar", () => ({ Sidebar: () =>
, })); -vi.mock("@/domains/new_dashboard/components/shared/Toast", () => ({ +vi.mock("@/shared/ui/Toast", () => ({ Toast: ({ message }: any) => message ?
{message}
: null, })); @@ -140,18 +140,18 @@ vi.mock("@/domains/new_dashboard/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(); 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..16ea3016 100644 --- a/frontend/tests/unit/new_dashboard/types.test.ts +++ b/frontend/tests/unit/new_dashboard/types.test.ts @@ -5,7 +5,7 @@ import { JobStatusSchema, JobTypeSchema, NewJobSchema, -} from "@/domains/new_dashboard/types/job"; +} from "@/features/jobs/domain/job"; import { MentorSchema } from "@/domains/new_dashboard/types/mentor"; import { CareerChecklistSchema, diff --git a/frontend/tests/unit/new_dashboard/userDashboardData.test.tsx b/frontend/tests/unit/new_dashboard/userDashboardData.test.tsx index ba796aa0..09a36589 100644 --- a/frontend/tests/unit/new_dashboard/userDashboardData.test.tsx +++ b/frontend/tests/unit/new_dashboard/userDashboardData.test.tsx @@ -20,7 +20,7 @@ vi.mock("@/domains/new_dashboard/infrastructure/userDashboardApi", () => ({ 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 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..efdf4955 100644 --- a/frontend/tests/unit/new_dashboard/utils.test.ts +++ b/frontend/tests/unit/new_dashboard/utils.test.ts @@ -9,14 +9,14 @@ import { 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..dd0b867e 100644 --- a/frontend/tests/unit/pages/App.test.tsx +++ b/frontend/tests/unit/pages/App.test.tsx @@ -14,7 +14,7 @@ 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
, })); diff --git a/frontend/tests/unit/pages/auth/AuthCallback.test.tsx b/frontend/tests/unit/pages/auth/AuthCallback.test.tsx index 2965adbd..df365229 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/presentation/pages/AuthCallbackPage"; describe("AuthCallback", () => { beforeEach(() => { diff --git a/frontend/tests/unit/pages/login/LoginPage.test.tsx b/frontend/tests/unit/pages/login/LoginPage.test.tsx index 1fed0cc9..ed2d2112 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/presentation/components/AuthVisualPanel", () => ({ default: () =>
Left Side Mock
, })); -vi.mock("@/domains/auth/presentation/components/LoginFormPanel", () => ({ +vi.mock("@/features/auth/presentation/components/LoginFormPanel", () => ({ default: () =>
Right Side Mock
, })); -import LoginPage from "@/domains/auth/presentation/pages/LoginPage"; +import LoginPage from "@/features/auth/presentation/pages/LoginPage"; describe("LoginPage", () => { it("renderiza os dois lados da tela de login", () => { diff --git a/frontend/tests/unit/pages/register/RegisterPage.test.tsx b/frontend/tests/unit/pages/register/RegisterPage.test.tsx index 14a75d23..942f00fc 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/presentation/components/AuthVisualPanel", () => ({ default: () =>
Left Side Mock
, })); -vi.mock("@/domains/auth/presentation/components/RegisterFormPanel", () => ({ +vi.mock("@/features/auth/presentation/components/RegisterFormPanel", () => ({ default: () =>
Register Side Mock
, })); -import RegisterPage from "@/domains/auth/presentation/pages/RegisterPage"; +import RegisterPage from "@/features/auth/presentation/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..30b9c7e6 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/infrastructure/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..e1509a08 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/infrastructure/connectionsApi"; const fetchMock = vi.fn(); globalThis.fetch = fetchMock as any; From 1c486a2e4cc223d79ea95057f4312c686d687a17 Mon Sep 17 00:00:00 2001 From: hltav Date: Sun, 1 Nov 2026 14:30:14 -0300 Subject: [PATCH 02/15] refactor(PAV-181): reorganiza modulo de ajuda do frontend (cherry picked from commit 4fa7a9f568c773931ef1f7733f2425098c0ebdca) --- frontend/src/domains/new_dashboard/NewDashboardPage.tsx | 2 +- .../components/help => features/help/components}/HelpTab.tsx | 0 frontend/tests/unit/new_dashboard/HelpTab.test.tsx | 2 +- frontend/tests/unit/new_dashboard/page.test.tsx | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename frontend/src/{domains/new_dashboard/components/help => features/help/components}/HelpTab.tsx (100%) diff --git a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx index d2b2ef57..b5de6120 100644 --- a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx +++ b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx @@ -2,7 +2,7 @@ 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 { HelpTab } from "@/features/help/components/HelpTab"; import { HomeTab } from "./components/home/HomeTab"; import { AddJobModal } from "./components/jobs/AddJobModal"; import { JobDetailModal } from "./components/jobs/JobDetailModal"; 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/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/page.test.tsx b/frontend/tests/unit/new_dashboard/page.test.tsx index 2b31557a..1d51da1e 100644 --- a/frontend/tests/unit/new_dashboard/page.test.tsx +++ b/frontend/tests/unit/new_dashboard/page.test.tsx @@ -45,7 +45,7 @@ vi.mock("@/domains/new_dashboard/components/dashboard/DashboardTab", () => ({ ), })); -vi.mock("@/domains/new_dashboard/components/help/HelpTab", () => ({ +vi.mock("@/features/help/components/HelpTab", () => ({ HelpTab: () =>
Help
, })); From 2c1a0d03b324771563e98167079e2850f567fdfd Mon Sep 17 00:00:00 2001 From: hltav Date: Sun, 1 Nov 2026 14:42:43 -0300 Subject: [PATCH 03/15] refactor(PAV-181): modulariza componentes de mentoria (cherry picked from commit 2b4c003a1be744a91a1cf0dc260c8f0f7eebcf44) --- frontend/src/domains/new_dashboard/NewDashboardPage.tsx | 2 +- .../mentoring/components}/MentorCard.tsx | 2 +- .../mentoring/components}/MentorDetailModal.tsx | 2 +- .../mentoring/components}/MentoringTab.tsx | 4 ++-- frontend/tests/unit/new_dashboard/branch-coverage.test.tsx | 2 +- frontend/tests/unit/new_dashboard/page.test.tsx | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename frontend/src/{domains/new_dashboard/components/mentoring => features/mentoring/components}/MentorCard.tsx (98%) rename frontend/src/{domains/new_dashboard/components/mentoring => features/mentoring/components}/MentorDetailModal.tsx (98%) rename frontend/src/{domains/new_dashboard/components/mentoring => features/mentoring/components}/MentoringTab.tsx (90%) diff --git a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx index b5de6120..7830b4c6 100644 --- a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx +++ b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx @@ -10,7 +10,7 @@ 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 { MentoringTab } from "@/features/mentoring/components/MentoringTab"; import { ProfileTab } from "./components/profile/ProfileTab"; import { Toast } from "@/shared/ui/Toast"; import { jobStatuses } from "./constants"; 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 98% rename from frontend/src/domains/new_dashboard/components/mentoring/MentorDetailModal.tsx rename to frontend/src/features/mentoring/components/MentorDetailModal.tsx index b250bdf9..4d636120 100644 --- a/frontend/src/domains/new_dashboard/components/mentoring/MentorDetailModal.tsx +++ b/frontend/src/features/mentoring/components/MentorDetailModal.tsx @@ -1,6 +1,6 @@ import { CheckCircle2, ExternalLink } from "lucide-react"; import { useState } from "react"; -import type { Mentor } from "../../types"; +import type { Mentor } from "../types"; import { Modal } from "@/shared/ui/Modal"; interface MentorDetailModalProps { 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/tests/unit/new_dashboard/branch-coverage.test.tsx b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx index 93c06f9f..37d5d21f 100644 --- a/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx +++ b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx @@ -3,7 +3,7 @@ import { JobDetailModal } from "@/domains/new_dashboard/components/jobs/JobDetai 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 { MentoringTab } from "@/features/mentoring/components/MentoringTab"; import { ProfileForm } from "@/domains/new_dashboard/components/profile/ProfileForm"; import { Modal } from "@/shared/ui/Modal"; import { diff --git a/frontend/tests/unit/new_dashboard/page.test.tsx b/frontend/tests/unit/new_dashboard/page.test.tsx index 1d51da1e..1658e276 100644 --- a/frontend/tests/unit/new_dashboard/page.test.tsx +++ b/frontend/tests/unit/new_dashboard/page.test.tsx @@ -106,7 +106,7 @@ vi.mock("@/domains/new_dashboard/components/jobs/JobTab", () => ({ ), })); -vi.mock("@/domains/new_dashboard/components/mentoring/MentoringTab", () => ({ +vi.mock("@/features/mentoring/components/MentoringTab", () => ({ MentoringTab: () =>
, })); From c49ef41af2b9d83f0e676864958579a47f34b17e Mon Sep 17 00:00:00 2001 From: hltav Date: Sun, 1 Nov 2026 14:53:32 -0300 Subject: [PATCH 04/15] refactor(PAV-181): modulariza componentes da home (cherry picked from commit 88e4ea7101557f183e4e54692189b2ae860dcff5) --- frontend/src/domains/new_dashboard/NewDashboardPage.tsx | 2 +- .../home => features/home/components}/CareerChecklist.tsx | 2 +- .../components/home => features/home/components}/HomeTab.tsx | 5 +++-- .../home => features/home/components}/StatusConters.tsx | 0 .../home => features/home/components}/StatusCounters.tsx | 2 +- .../home => features/home/components}/WelcomeBanner.tsx | 2 +- frontend/tests/unit/new_dashboard/branch-coverage.test.tsx | 2 +- frontend/tests/unit/new_dashboard/home.profile.test.tsx | 4 ++-- frontend/tests/unit/new_dashboard/page.test.tsx | 2 +- 9 files changed, 11 insertions(+), 10 deletions(-) rename frontend/src/{domains/new_dashboard/components/home => features/home/components}/CareerChecklist.tsx (99%) rename frontend/src/{domains/new_dashboard/components/home => features/home/components}/HomeTab.tsx (93%) rename frontend/src/{domains/new_dashboard/components/home => features/home/components}/StatusConters.tsx (100%) rename frontend/src/{domains/new_dashboard/components/home => features/home/components}/StatusCounters.tsx (96%) rename frontend/src/{domains/new_dashboard/components/home => features/home/components}/WelcomeBanner.tsx (96%) diff --git a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx index 7830b4c6..ffa4f2f3 100644 --- a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx +++ b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx @@ -3,7 +3,7 @@ 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 "@/features/help/components/HelpTab"; -import { HomeTab } from "./components/home/HomeTab"; +import { HomeTab } from "@/features/home/components/HomeTab"; import { AddJobModal } from "./components/jobs/AddJobModal"; import { JobDetailModal } from "./components/jobs/JobDetailModal"; import { JobTab } from "./components/jobs/JobTab"; 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/tests/unit/new_dashboard/branch-coverage.test.tsx b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx index 37d5d21f..bffab9c1 100644 --- a/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx +++ b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx @@ -1,4 +1,4 @@ -import { CareerChecklist } from "@/domains/new_dashboard/components/home/CareerChecklist"; +import { CareerChecklist } from "@/features/home/components/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"; diff --git a/frontend/tests/unit/new_dashboard/home.profile.test.tsx b/frontend/tests/unit/new_dashboard/home.profile.test.tsx index b08707d5..e7aeea3b 100644 --- a/frontend/tests/unit/new_dashboard/home.profile.test.tsx +++ b/frontend/tests/unit/new_dashboard/home.profile.test.tsx @@ -1,5 +1,5 @@ -import { CareerChecklist } from "@/domains/new_dashboard/components/home/CareerChecklist"; -import { HomeTab } from "@/domains/new_dashboard/components/home/HomeTab"; +import { CareerChecklist } from "@/features/home/components/CareerChecklist"; +import { HomeTab } from "@/features/home/components/HomeTab"; import { PreferencesForm } from "@/domains/new_dashboard/components/profile/PreferencesForm"; import { ProfileForm } from "@/domains/new_dashboard/components/profile/ProfileForm"; import { diff --git a/frontend/tests/unit/new_dashboard/page.test.tsx b/frontend/tests/unit/new_dashboard/page.test.tsx index 1658e276..afaafb52 100644 --- a/frontend/tests/unit/new_dashboard/page.test.tsx +++ b/frontend/tests/unit/new_dashboard/page.test.tsx @@ -49,7 +49,7 @@ 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) => (
From 71dc259df6bae0b785dddf7c9c7ed9da08baca80 Mon Sep 17 00:00:00 2001 From: hltav Date: Sun, 1 Nov 2026 20:29:37 -0300 Subject: [PATCH 07/15] refactor(PAV-181): modulariza hook e infraestrutura de vagas (cherry picked from commit 488d5a41ee99fd1bac42281c107406d466641ef2) --- frontend/src/domains/new_dashboard/NewDashboardPage.tsx | 4 ++-- .../new_dashboard/components/jobs/ApplicationNotesSection.tsx | 2 +- .../domains/new_dashboard/components/jobs/JobDetailModal.tsx | 2 +- frontend/src/domains/new_dashboard/components/jobs/JobRow.tsx | 2 +- .../hooks => features/jobs/application}/useDashboardJobs.ts | 4 ++-- .../jobs}/infrastructure/dashboardJobsApi.ts | 2 +- frontend/tests/unit/new_dashboard/api.test.ts | 2 +- frontend/tests/unit/new_dashboard/hooks.test.tsx | 4 ++-- frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx | 2 +- frontend/tests/unit/new_dashboard/jobs.test.tsx | 2 +- frontend/tests/unit/new_dashboard/page.test.tsx | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) rename frontend/src/{domains/new_dashboard/hooks => features/jobs/application}/useDashboardJobs.ts (98%) rename frontend/src/{domains/new_dashboard => features/jobs}/infrastructure/dashboardJobsApi.ts (99%) diff --git a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx index 62e29331..2aac9572 100644 --- a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx +++ b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx @@ -14,13 +14,13 @@ import { MentoringTab } from "@/features/mentoring/components/MentoringTab"; import { ProfileTab } from "@/features/profile/components/ProfileTab"; import { Toast } from "@/shared/ui/Toast"; import { jobStatuses } from "./constants"; -import { useDashboardJobs } from "./hooks/useDashboardJobs"; +import { useDashboardJobs } from "@/features/jobs/application/useDashboardJobs"; import { useUserDashboardData } from "@/features/profile/application/useUserDashboardData"; import { getJobFilterOptions, FALLBACK_JOB_FAMILIES, type JobFamilyOption, -} from "./infrastructure/dashboardJobsApi"; +} from "@/features/jobs/infrastructure/dashboardJobsApi"; import type { CareerChecklist, Job, diff --git a/frontend/src/domains/new_dashboard/components/jobs/ApplicationNotesSection.tsx b/frontend/src/domains/new_dashboard/components/jobs/ApplicationNotesSection.tsx index 61a63137..8d67d21c 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/ApplicationNotesSection.tsx +++ b/frontend/src/domains/new_dashboard/components/jobs/ApplicationNotesSection.tsx @@ -5,7 +5,7 @@ import { deleteDashboardApplicationNote, getDashboardApplicationNotes, updateDashboardApplicationNote, -} from "../../infrastructure/dashboardJobsApi"; +} from "@/features/jobs/infrastructure/dashboardJobsApi"; export function ApplicationNotesSection({ savedJobId }: { savedJobId: string }) { const [notes, setNotes] = useState([]); diff --git a/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx b/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx index 029befda..59da40c4 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx +++ b/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx @@ -4,7 +4,7 @@ import { jobStatusClasses, jobStatuses } from "../../constants"; import { getDashboardSavedJobEvents, getFamilyLabel, -} from "../../infrastructure/dashboardJobsApi"; +} from "@/features/jobs/infrastructure/dashboardJobsApi"; import type { Job, JobStatus, JobTimelineEvent } from "../../types"; import { Modal } from "@/shared/ui/Modal"; import { ApplicationNotesSection } from "./ApplicationNotesSection"; diff --git a/frontend/src/domains/new_dashboard/components/jobs/JobRow.tsx b/frontend/src/domains/new_dashboard/components/jobs/JobRow.tsx index 43dc9329..813b79b0 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobRow.tsx +++ b/frontend/src/domains/new_dashboard/components/jobs/JobRow.tsx @@ -1,6 +1,6 @@ import { jobStatuses } from "../../constants"; import type { Job, JobStatus } from "../../types"; -import { getFamilyLabel } from "../../infrastructure/dashboardJobsApi"; +import { getFamilyLabel } from "@/features/jobs/infrastructure/dashboardJobsApi"; interface JobRowProps { job: Job; diff --git a/frontend/src/domains/new_dashboard/hooks/useDashboardJobs.ts b/frontend/src/features/jobs/application/useDashboardJobs.ts similarity index 98% rename from frontend/src/domains/new_dashboard/hooks/useDashboardJobs.ts rename to frontend/src/features/jobs/application/useDashboardJobs.ts index 5d86b195..046ff22a 100644 --- a/frontend/src/domains/new_dashboard/hooks/useDashboardJobs.ts +++ b/frontend/src/features/jobs/application/useDashboardJobs.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useRef, useState } from "react"; import type { User } from "@/features/auth/domain/auth.types"; import { isApiError } from "@/shared/lib/apiError"; -import type { Job, JobStatus, NewJob } from "../types"; +import type { Job, JobStatus, NewJob } from "../domain/job"; import { createDashboardSavedJob, getDashboardSavedJobs, @@ -10,7 +10,7 @@ import { type SearchJobsResult, updateDashboardSavedJob, } from "../infrastructure/dashboardJobsApi"; -import { requestDashboardNotificationsRefresh } from "../utils/notificationEvents"; +import { requestDashboardNotificationsRefresh } from "@/domains/new_dashboard/utils/notificationEvents"; interface UseDashboardJobsOptions { onError?: (message: string) => void; diff --git a/frontend/src/domains/new_dashboard/infrastructure/dashboardJobsApi.ts b/frontend/src/features/jobs/infrastructure/dashboardJobsApi.ts similarity index 99% rename from frontend/src/domains/new_dashboard/infrastructure/dashboardJobsApi.ts rename to frontend/src/features/jobs/infrastructure/dashboardJobsApi.ts index d3ce88d7..0648ee43 100644 --- a/frontend/src/domains/new_dashboard/infrastructure/dashboardJobsApi.ts +++ b/frontend/src/features/jobs/infrastructure/dashboardJobsApi.ts @@ -8,7 +8,7 @@ import type { JobType, MatchSort, NewJob, -} from "../types"; +} from "../domain/job"; const ApiSearchJobSchema = z .object({ diff --git a/frontend/tests/unit/new_dashboard/api.test.ts b/frontend/tests/unit/new_dashboard/api.test.ts index edb29ccb..37236988 100644 --- a/frontend/tests/unit/new_dashboard/api.test.ts +++ b/frontend/tests/unit/new_dashboard/api.test.ts @@ -19,7 +19,7 @@ import { searchDashboardJobs, toRecommendedJob, updateDashboardSavedJob, -} from "@/domains/new_dashboard/infrastructure/dashboardJobsApi"; +} from "@/features/jobs/infrastructure/dashboardJobsApi"; import { clearDashboardNotifications, getDashboardNotificationFeed as getNotificationFeed, diff --git a/frontend/tests/unit/new_dashboard/hooks.test.tsx b/frontend/tests/unit/new_dashboard/hooks.test.tsx index 954f2883..5de6399f 100644 --- a/frontend/tests/unit/new_dashboard/hooks.test.tsx +++ b/frontend/tests/unit/new_dashboard/hooks.test.tsx @@ -9,14 +9,14 @@ const dashboardApiMock = vi.hoisted(() => ({ updateDashboardSavedJob: vi.fn(), })); -vi.mock("@/domains/new_dashboard/infrastructure/dashboardJobsApi", () => ({ +vi.mock("@/features/jobs/infrastructure/dashboardJobsApi", () => ({ getDashboardSavedJobs: dashboardApiMock.getDashboardSavedJobs, searchDashboardJobs: dashboardApiMock.searchDashboardJobs, createDashboardSavedJob: dashboardApiMock.createDashboardSavedJob, updateDashboardSavedJob: dashboardApiMock.updateDashboardSavedJob, })); -import { useDashboardJobs } from "@/domains/new_dashboard/hooks/useDashboardJobs"; +import { useDashboardJobs } from "@/features/jobs/application/useDashboardJobs"; import type { User } from "@/features/auth/domain/auth.types"; import type { Job } from "@/domains/new_dashboard/types"; diff --git a/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx b/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx index d6941730..b7c81c0d 100644 --- a/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx +++ b/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx @@ -1,7 +1,7 @@ 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/infrastructure/dashboardJobsApi", () => ({ getDashboardSavedJobEvents: vi.fn().mockResolvedValue([]), })); diff --git a/frontend/tests/unit/new_dashboard/jobs.test.tsx b/frontend/tests/unit/new_dashboard/jobs.test.tsx index 3f19be1d..59d10a08 100644 --- a/frontend/tests/unit/new_dashboard/jobs.test.tsx +++ b/frontend/tests/unit/new_dashboard/jobs.test.tsx @@ -23,7 +23,7 @@ const dashboardApiMock = vi.hoisted(() => ({ deleteDashboardApplicationNote: vi.fn(), })); -vi.mock("@/domains/new_dashboard/infrastructure/dashboardJobsApi", () => ({ +vi.mock("@/features/jobs/infrastructure/dashboardJobsApi", () => ({ getDashboardSavedJobEvents: dashboardApiMock.getDashboardSavedJobEvents, getDashboardApplicationNotes: dashboardApiMock.getDashboardApplicationNotes, createDashboardApplicationNote: dashboardApiMock.createDashboardApplicationNote, diff --git a/frontend/tests/unit/new_dashboard/page.test.tsx b/frontend/tests/unit/new_dashboard/page.test.tsx index ec66d313..3ed6e842 100644 --- a/frontend/tests/unit/new_dashboard/page.test.tsx +++ b/frontend/tests/unit/new_dashboard/page.test.tsx @@ -177,7 +177,7 @@ const mockSaveJobNotes = vi.fn().mockResolvedValue(undefined); let mockJobs: any = {}; -vi.mock("@/domains/new_dashboard/hooks/useDashboardJobs", () => ({ +vi.mock("@/features/jobs/application/useDashboardJobs", () => ({ useDashboardJobs: () => mockJobs, })); From 404c60d5e5ffca2fb453a3968b31b91e0e0ce28b Mon Sep 17 00:00:00 2001 From: hltav Date: Sun, 1 Nov 2026 20:36:56 -0300 Subject: [PATCH 08/15] refactor(PAV-181): modulariza componentes do catalogo de vagas (cherry picked from commit bb4a44dd062fdf21c7502ccfa5eeb0a43b1313f7) --- .../src/domains/new_dashboard/NewDashboardPage.tsx | 2 +- .../new_dashboard/components/jobs/JobDetailModal.tsx | 2 +- .../jobs/components}/FormattedJobDescription.tsx | 0 .../jobs => features/jobs/components}/JobFilter.tsx | 4 ++-- .../jobs => features/jobs/components}/JobFilters.tsx | 0 .../jobs => features/jobs/components}/JobRow.tsx | 4 ++-- .../jobs => features/jobs/components}/JobTab.tsx | 4 ++-- .../jobs => features/jobs/components}/JobTable.tsx | 2 +- .../tests/unit/new_dashboard/branch-coverage.test.tsx | 2 +- frontend/tests/unit/new_dashboard/jobs.test.tsx | 10 +++++----- frontend/tests/unit/new_dashboard/page.test.tsx | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) rename frontend/src/{domains/new_dashboard/components/jobs => features/jobs/components}/FormattedJobDescription.tsx (100%) rename frontend/src/{domains/new_dashboard/components/jobs => features/jobs/components}/JobFilter.tsx (98%) rename frontend/src/{domains/new_dashboard/components/jobs => features/jobs/components}/JobFilters.tsx (100%) rename frontend/src/{domains/new_dashboard/components/jobs => features/jobs/components}/JobRow.tsx (97%) rename frontend/src/{domains/new_dashboard/components/jobs => features/jobs/components}/JobTab.tsx (97%) rename frontend/src/{domains/new_dashboard/components/jobs => features/jobs/components}/JobTable.tsx (99%) diff --git a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx index 2aac9572..b5271256 100644 --- a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx +++ b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx @@ -6,7 +6,7 @@ import { HelpTab } from "@/features/help/components/HelpTab"; import { HomeTab } from "@/features/home/components/HomeTab"; import { AddJobModal } from "./components/jobs/AddJobModal"; import { JobDetailModal } from "./components/jobs/JobDetailModal"; -import { JobTab } from "./components/jobs/JobTab"; +import { JobTab } from "@/features/jobs/components/JobTab"; import { Header } from "./components/layout/Header"; import { MobileTabBar } from "./components/layout/MobileTabBar"; import { Sidebar } from "./components/layout/Sidebar"; diff --git a/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx b/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx index 59da40c4..b5798f58 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx +++ b/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx @@ -8,7 +8,7 @@ import { import type { Job, JobStatus, JobTimelineEvent } from "../../types"; import { Modal } from "@/shared/ui/Modal"; import { ApplicationNotesSection } from "./ApplicationNotesSection"; -import { FormattedJobDescription } from "./FormattedJobDescription"; +import { FormattedJobDescription } from "@/features/jobs/components/FormattedJobDescription"; interface JobDetailModalProps { job: Job; 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/JobFilter.tsx b/frontend/src/features/jobs/components/JobFilter.tsx similarity index 98% rename from frontend/src/domains/new_dashboard/components/jobs/JobFilter.tsx rename to frontend/src/features/jobs/components/JobFilter.tsx index 9972589c..ce466787 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobFilter.tsx +++ b/frontend/src/features/jobs/components/JobFilter.tsx @@ -1,7 +1,7 @@ import { Search, ChevronDown } from "lucide-react"; import { useState, useRef, useEffect, useMemo } from "react"; -import { jobLevels } from "../../constants"; -import type { JobModelFilter, MatchSort } from "../../types"; +import { jobLevels } from "../constants"; +import type { JobModelFilter, MatchSort } from "../domain/job"; import { jobModelFilterOptions } from "@/features/jobs/domain/jobModelFilters"; import { continentOptions, 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 97% rename from frontend/src/domains/new_dashboard/components/jobs/JobRow.tsx rename to frontend/src/features/jobs/components/JobRow.tsx index 813b79b0..629375f8 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobRow.tsx +++ b/frontend/src/features/jobs/components/JobRow.tsx @@ -1,5 +1,5 @@ -import { jobStatuses } from "../../constants"; -import type { Job, JobStatus } from "../../types"; +import { jobStatuses } from "../constants"; +import type { Job, JobStatus } from "../domain/job"; import { getFamilyLabel } from "@/features/jobs/infrastructure/dashboardJobsApi"; interface JobRowProps { diff --git a/frontend/src/domains/new_dashboard/components/jobs/JobTab.tsx b/frontend/src/features/jobs/components/JobTab.tsx similarity index 97% rename from frontend/src/domains/new_dashboard/components/jobs/JobTab.tsx rename to frontend/src/features/jobs/components/JobTab.tsx index 238062dc..9f01be0d 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobTab.tsx +++ b/frontend/src/features/jobs/components/JobTab.tsx @@ -4,8 +4,8 @@ import type { JobModelFilter, JobStatus, MatchSort, - SearchPreferences, -} from "../../types"; +} from "../domain/job"; +import type { SearchPreferences } from "@/features/profile/domain/user"; import { type ContinentFilter, type CountryFilter, 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/tests/unit/new_dashboard/branch-coverage.test.tsx b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx index a0f48dfb..15fc83be 100644 --- a/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx +++ b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx @@ -1,6 +1,6 @@ import { CareerChecklist } from "@/features/home/components/CareerChecklist"; import { JobDetailModal } from "@/domains/new_dashboard/components/jobs/JobDetailModal"; -import { JobRow } from "@/domains/new_dashboard/components/jobs/JobRow"; +import { JobRow } from "@/features/jobs/components/JobRow"; import { Header } from "@/domains/new_dashboard/components/layout/Header"; import { MessageDetailModal } from "@/domains/new_dashboard/components/layout/MessageDetailModal"; import { MentoringTab } from "@/features/mentoring/components/MentoringTab"; diff --git a/frontend/tests/unit/new_dashboard/jobs.test.tsx b/frontend/tests/unit/new_dashboard/jobs.test.tsx index 59d10a08..dd5503cb 100644 --- a/frontend/tests/unit/new_dashboard/jobs.test.tsx +++ b/frontend/tests/unit/new_dashboard/jobs.test.tsx @@ -3,11 +3,11 @@ 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 { 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 "@/domains/new_dashboard/constants"; import type { Job, JobModelFilter } from "@/domains/new_dashboard/types"; import type { diff --git a/frontend/tests/unit/new_dashboard/page.test.tsx b/frontend/tests/unit/new_dashboard/page.test.tsx index 3ed6e842..0464aa91 100644 --- a/frontend/tests/unit/new_dashboard/page.test.tsx +++ b/frontend/tests/unit/new_dashboard/page.test.tsx @@ -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) => (
From 039ebd56c7cf349ba14bfdb354edaaef774803b8 Mon Sep 17 00:00:00 2001 From: hltav Date: Sun, 1 Nov 2026 20:41:16 -0300 Subject: [PATCH 09/15] refactor(PAV-181): modulariza componentes de candidaturas (cherry picked from commit fcd4609efbfd8ffb9597ee7ab8a27fecf367cb86) --- frontend/src/domains/new_dashboard/NewDashboardPage.tsx | 2 +- .../new_dashboard/components/dashboard/DashboardTab.tsx | 2 +- .../domains/new_dashboard/components/jobs/JobDetailModal.tsx | 2 +- .../jobs => features/applications/components}/AddJobModal.tsx | 4 ++-- .../applications/components}/ApplicationNotesSection.tsx | 0 .../applications/components}/KanbanBoard.tsx | 2 +- .../applications/components}/KanbanColumn.tsx | 2 +- frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx | 2 +- frontend/tests/unit/new_dashboard/jobs.test.tsx | 2 +- frontend/tests/unit/new_dashboard/page.test.tsx | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) rename frontend/src/{domains/new_dashboard/components/jobs => features/applications/components}/AddJobModal.tsx (98%) rename frontend/src/{domains/new_dashboard/components/jobs => features/applications/components}/ApplicationNotesSection.tsx (100%) rename frontend/src/{domains/new_dashboard/components/dashboard => features/applications/components}/KanbanBoard.tsx (94%) rename frontend/src/{domains/new_dashboard/components/dashboard => features/applications/components}/KanbanColumn.tsx (98%) diff --git a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx index b5271256..3f46aa5b 100644 --- a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx +++ b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx @@ -4,7 +4,7 @@ import { useLocation, useNavigate, useSearchParams } from "react-router-dom"; import { DashboardTab } from "./components/dashboard/DashboardTab"; import { HelpTab } from "@/features/help/components/HelpTab"; import { HomeTab } from "@/features/home/components/HomeTab"; -import { AddJobModal } from "./components/jobs/AddJobModal"; +import { AddJobModal } from "@/features/applications/components/AddJobModal"; import { JobDetailModal } from "./components/jobs/JobDetailModal"; import { JobTab } from "@/features/jobs/components/JobTab"; import { Header } from "./components/layout/Header"; diff --git a/frontend/src/domains/new_dashboard/components/dashboard/DashboardTab.tsx b/frontend/src/domains/new_dashboard/components/dashboard/DashboardTab.tsx index 640303f1..30b351ec 100644 --- a/frontend/src/domains/new_dashboard/components/dashboard/DashboardTab.tsx +++ b/frontend/src/domains/new_dashboard/components/dashboard/DashboardTab.tsx @@ -1,6 +1,6 @@ import { BriefcaseBusiness, Plus } from "lucide-react"; import type { Job, JobStatus, TechnologyExperience } from "../../types"; -import { KanbanBoard } from "./KanbanBoard"; +import { KanbanBoard } from "@/features/applications/components/KanbanBoard"; interface DashboardTabProps { jobs: Job[]; diff --git a/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx b/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx index b5798f58..4a02960d 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx +++ b/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx @@ -7,7 +7,7 @@ import { } from "@/features/jobs/infrastructure/dashboardJobsApi"; import type { Job, JobStatus, JobTimelineEvent } from "../../types"; import { Modal } from "@/shared/ui/Modal"; -import { ApplicationNotesSection } from "./ApplicationNotesSection"; +import { ApplicationNotesSection } from "@/features/applications/components/ApplicationNotesSection"; import { FormattedJobDescription } from "@/features/jobs/components/FormattedJobDescription"; interface JobDetailModalProps { diff --git a/frontend/src/domains/new_dashboard/components/jobs/AddJobModal.tsx b/frontend/src/features/applications/components/AddJobModal.tsx similarity index 98% rename from frontend/src/domains/new_dashboard/components/jobs/AddJobModal.tsx rename to frontend/src/features/applications/components/AddJobModal.tsx index 2966e818..0d7c41bd 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/AddJobModal.tsx +++ b/frontend/src/features/applications/components/AddJobModal.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; -import { jobLevels, jobTypes } from "../../constants"; -import type { NewJob } from "../../types"; +import { jobLevels, jobTypes } from "@/features/jobs/constants"; +import type { NewJob } from "@/features/jobs/domain/job"; import { Modal } from "@/shared/ui/Modal"; const initialForm: NewJob = { diff --git a/frontend/src/domains/new_dashboard/components/jobs/ApplicationNotesSection.tsx b/frontend/src/features/applications/components/ApplicationNotesSection.tsx similarity index 100% rename from frontend/src/domains/new_dashboard/components/jobs/ApplicationNotesSection.tsx rename to frontend/src/features/applications/components/ApplicationNotesSection.tsx 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/tests/unit/new_dashboard/dashboard.layout.test.tsx b/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx index 2e35baa9..0f3ad12b 100644 --- a/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx +++ b/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx @@ -2,7 +2,7 @@ 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 { KanbanBoard } from "@/features/applications/components/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"; diff --git a/frontend/tests/unit/new_dashboard/jobs.test.tsx b/frontend/tests/unit/new_dashboard/jobs.test.tsx index dd5503cb..94e77c1d 100644 --- a/frontend/tests/unit/new_dashboard/jobs.test.tsx +++ b/frontend/tests/unit/new_dashboard/jobs.test.tsx @@ -1,7 +1,7 @@ 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 { AddJobModal } from "@/features/applications/components/AddJobModal"; import { JobDetailModal } from "@/domains/new_dashboard/components/jobs/JobDetailModal"; import { JobFilter } from "@/features/jobs/components/JobFilter"; import { FormattedJobDescription } from "@/features/jobs/components/FormattedJobDescription"; diff --git a/frontend/tests/unit/new_dashboard/page.test.tsx b/frontend/tests/unit/new_dashboard/page.test.tsx index 0464aa91..8d2f36c0 100644 --- a/frontend/tests/unit/new_dashboard/page.test.tsx +++ b/frontend/tests/unit/new_dashboard/page.test.tsx @@ -60,7 +60,7 @@ vi.mock("@/features/home/components/HomeTab", () => ({ ), })); -vi.mock("@/domains/new_dashboard/components/jobs/AddJobModal", () => ({ +vi.mock("@/features/applications/components/AddJobModal", () => ({ AddJobModal: (props: any) => (
From b1705e4cd82396292ae60eca28026e18d554d35d Mon Sep 17 00:00:00 2001 From: hltav Date: Sun, 1 Nov 2026 20:48:12 -0300 Subject: [PATCH 10/15] refactor(PAV-181): modulariza modal de detalhes de vagas (cherry picked from commit 590df90e1e029a2ffe8ce9909af7ec8fca3b98ec) --- frontend/src/domains/new_dashboard/NewDashboardPage.tsx | 2 +- .../jobs => features/jobs/components}/JobDetailModal.tsx | 4 ++-- frontend/tests/unit/new_dashboard/branch-coverage.test.tsx | 2 +- frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx | 2 +- frontend/tests/unit/new_dashboard/jobs.test.tsx | 2 +- frontend/tests/unit/new_dashboard/page.test.tsx | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename frontend/src/{domains/new_dashboard/components/jobs => features/jobs/components}/JobDetailModal.tsx (99%) diff --git a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx index 3f46aa5b..670c37e9 100644 --- a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx +++ b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx @@ -5,7 +5,7 @@ import { DashboardTab } from "./components/dashboard/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 "./components/jobs/JobDetailModal"; +import { JobDetailModal } from "@/features/jobs/components/JobDetailModal"; import { JobTab } from "@/features/jobs/components/JobTab"; import { Header } from "./components/layout/Header"; import { MobileTabBar } from "./components/layout/MobileTabBar"; diff --git a/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx b/frontend/src/features/jobs/components/JobDetailModal.tsx similarity index 99% rename from frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx rename to frontend/src/features/jobs/components/JobDetailModal.tsx index 4a02960d..a448d67e 100644 --- a/frontend/src/domains/new_dashboard/components/jobs/JobDetailModal.tsx +++ b/frontend/src/features/jobs/components/JobDetailModal.tsx @@ -1,11 +1,11 @@ import { ExternalLink } from "lucide-react"; import { useEffect, useState } from "react"; -import { jobStatusClasses, jobStatuses } from "../../constants"; +import { jobStatusClasses, jobStatuses } from "../constants"; import { getDashboardSavedJobEvents, getFamilyLabel, } from "@/features/jobs/infrastructure/dashboardJobsApi"; -import type { Job, JobStatus, JobTimelineEvent } from "../../types"; +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"; diff --git a/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx index 15fc83be..daa81ce6 100644 --- a/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx +++ b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx @@ -1,5 +1,5 @@ import { CareerChecklist } from "@/features/home/components/CareerChecklist"; -import { JobDetailModal } from "@/domains/new_dashboard/components/jobs/JobDetailModal"; +import { JobDetailModal } from "@/features/jobs/components/JobDetailModal"; import { JobRow } from "@/features/jobs/components/JobRow"; import { Header } from "@/domains/new_dashboard/components/layout/Header"; import { MessageDetailModal } from "@/domains/new_dashboard/components/layout/MessageDetailModal"; diff --git a/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx b/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx index b7c81c0d..f75eb6fa 100644 --- a/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx +++ b/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx @@ -5,7 +5,7 @@ vi.mock("@/features/jobs/infrastructure/dashboardJobsApi", () => ({ getDashboardSavedJobEvents: vi.fn().mockResolvedValue([]), })); -import { JobDetailModal } from "@/domains/new_dashboard/components/jobs/JobDetailModal"; +import { JobDetailModal } from "@/features/jobs/components/JobDetailModal"; import type { Job } from "@/domains/new_dashboard/types"; function job(overrides: Partial = {}): Job { diff --git a/frontend/tests/unit/new_dashboard/jobs.test.tsx b/frontend/tests/unit/new_dashboard/jobs.test.tsx index 94e77c1d..6a3692a3 100644 --- a/frontend/tests/unit/new_dashboard/jobs.test.tsx +++ b/frontend/tests/unit/new_dashboard/jobs.test.tsx @@ -2,7 +2,7 @@ import { fireEvent, render, screen, waitFor, within } from "@testing-library/rea import { useState } from "react"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { AddJobModal } from "@/features/applications/components/AddJobModal"; -import { JobDetailModal } from "@/domains/new_dashboard/components/jobs/JobDetailModal"; +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"; diff --git a/frontend/tests/unit/new_dashboard/page.test.tsx b/frontend/tests/unit/new_dashboard/page.test.tsx index 8d2f36c0..932a89ef 100644 --- a/frontend/tests/unit/new_dashboard/page.test.tsx +++ b/frontend/tests/unit/new_dashboard/page.test.tsx @@ -69,7 +69,7 @@ vi.mock("@/features/applications/components/AddJobModal", () => ({ ), })); -vi.mock("@/domains/new_dashboard/components/jobs/JobDetailModal", () => ({ +vi.mock("@/features/jobs/components/JobDetailModal", () => ({ JobDetailModal: (props: any) => (
{props.job.id} From 64abafd406621bdb73dd43188e89c39737ce1741 Mon Sep 17 00:00:00 2001 From: hltav Date: Sun, 1 Nov 2026 20:55:09 -0300 Subject: [PATCH 11/15] refactor(PAV-181): modulariza componentes do dashboard (cherry picked from commit 21a8624b9650cd004cda7ec7f1a6e829066346e1) --- frontend/src/domains/new_dashboard/NewDashboardPage.tsx | 2 +- .../dashboard/components}/DashboardTab.tsx | 3 ++- frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx | 2 +- frontend/tests/unit/new_dashboard/page.test.tsx | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) rename frontend/src/{domains/new_dashboard/components/dashboard => features/dashboard/components}/DashboardTab.tsx (97%) diff --git a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx index 670c37e9..0afcbab0 100644 --- a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx +++ b/frontend/src/domains/new_dashboard/NewDashboardPage.tsx @@ -1,7 +1,7 @@ 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 { 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"; diff --git a/frontend/src/domains/new_dashboard/components/dashboard/DashboardTab.tsx b/frontend/src/features/dashboard/components/DashboardTab.tsx similarity index 97% rename from frontend/src/domains/new_dashboard/components/dashboard/DashboardTab.tsx rename to frontend/src/features/dashboard/components/DashboardTab.tsx index 30b351ec..e2d59d86 100644 --- a/frontend/src/domains/new_dashboard/components/dashboard/DashboardTab.tsx +++ b/frontend/src/features/dashboard/components/DashboardTab.tsx @@ -1,5 +1,6 @@ import { BriefcaseBusiness, Plus } from "lucide-react"; -import type { Job, JobStatus, TechnologyExperience } from "../../types"; +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 { diff --git a/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx b/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx index 0f3ad12b..d6644067 100644 --- a/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx +++ b/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx @@ -1,7 +1,7 @@ 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 { DashboardTab } from "@/features/dashboard/components/DashboardTab"; import { KanbanBoard } from "@/features/applications/components/KanbanBoard"; import { CandidateLogo } from "@/domains/new_dashboard/components/shared/CandidateLogo"; import { Header } from "@/domains/new_dashboard/components/layout/Header"; diff --git a/frontend/tests/unit/new_dashboard/page.test.tsx b/frontend/tests/unit/new_dashboard/page.test.tsx index 932a89ef..819f47bb 100644 --- a/frontend/tests/unit/new_dashboard/page.test.tsx +++ b/frontend/tests/unit/new_dashboard/page.test.tsx @@ -33,7 +33,7 @@ vi.mock("@/features/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) => (
From add245ae3af7259cdc82d48843616d90319af76f Mon Sep 17 00:00:00 2001 From: hltav Date: Sun, 1 Nov 2026 21:12:18 -0300 Subject: [PATCH 12/15] refactor(PAV-181): reorganiza tema helpers e contratos (cherry picked from commit b675136d7e1188ca102c22009df2f3c7bf1bf298) --- frontend/src/app/dashboard/theme/ThemeContext.tsx | 2 +- .../constants => app/dashboard/theme}/colors.ts | 0 .../constants => app/dashboard/theme}/tokens.ts | 0 .../domains/new_dashboard/components/layout/Header.tsx | 6 +++--- frontend/src/domains/new_dashboard/constants/index.ts | 4 ++-- .../src/features/jobs/application/useDashboardJobs.ts | 2 +- .../src/features/jobs/legacy/application/JobsContext.tsx | 2 +- .../utils => features/jobs/legacy/domain}/helpers.ts | 2 +- frontend/src/features/mentoring/demoMentors.ts | 2 +- .../notificationsApi.ts => features/notifications/api.ts} | 2 +- .../notifications/components}/MessageDetailModal.tsx | 2 +- .../notifications/events.ts} | 0 frontend/src/features/profile/defaults.ts | 2 +- frontend/tests/unit/new_dashboard/HeaderUserMenu.test.tsx | 4 ++-- frontend/tests/unit/new_dashboard/api.test.ts | 2 +- .../tests/unit/new_dashboard/branch-coverage.test.tsx | 8 ++++---- .../tests/unit/new_dashboard/dashboard.layout.test.tsx | 2 +- frontend/tests/unit/new_dashboard/utils.test.ts | 2 +- 18 files changed, 22 insertions(+), 22 deletions(-) rename frontend/src/{domains/new_dashboard/constants => app/dashboard/theme}/colors.ts (100%) rename frontend/src/{domains/new_dashboard/constants => app/dashboard/theme}/tokens.ts (100%) rename frontend/src/{domains/new_dashboard/utils => features/jobs/legacy/domain}/helpers.ts (94%) rename frontend/src/{domains/new_dashboard/infrastructure/notificationsApi.ts => features/notifications/api.ts} (97%) rename frontend/src/{domains/new_dashboard/components/layout => features/notifications/components}/MessageDetailModal.tsx (95%) rename frontend/src/{domains/new_dashboard/utils/notificationEvents.ts => features/notifications/events.ts} (100%) diff --git a/frontend/src/app/dashboard/theme/ThemeContext.tsx b/frontend/src/app/dashboard/theme/ThemeContext.tsx index 0aebbc8b..8ea42d18 100644 --- a/frontend/src/app/dashboard/theme/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 "@/domains/new_dashboard/constants/colors"; +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/domains/new_dashboard/components/layout/Header.tsx b/frontend/src/domains/new_dashboard/components/layout/Header.tsx index 4d39820d..8eb3ff1c 100644 --- a/frontend/src/domains/new_dashboard/components/layout/Header.tsx +++ b/frontend/src/domains/new_dashboard/components/layout/Header.tsx @@ -7,13 +7,13 @@ import { getDashboardNotificationFeed, markDashboardNotificationsRead, markSingleNotificationRead, -} from "../../infrastructure/notificationsApi"; +} from "@/features/notifications/api"; import type { Message, Notification, UserProfile } from "../../types"; import { DASHBOARD_NOTIFICATIONS_REFRESH_EVENT, type DashboardNotificationsRefreshDetail, -} from "../../utils/notificationEvents"; -import { MessageDetailModal } from "./MessageDetailModal"; +} from "@/features/notifications/events"; +import { MessageDetailModal } from "@/features/notifications/components/MessageDetailModal"; import { ThemeToggle } from "./ThemeToggle"; interface HeaderProps { diff --git a/frontend/src/domains/new_dashboard/constants/index.ts b/frontend/src/domains/new_dashboard/constants/index.ts index 8c7479eb..5d608eed 100644 --- a/frontend/src/domains/new_dashboard/constants/index.ts +++ b/frontend/src/domains/new_dashboard/constants/index.ts @@ -1,4 +1,4 @@ -export * from "./colors"; -export * from "./tokens"; +export * from "@/app/dashboard/theme/colors"; +export * from "@/app/dashboard/theme/tokens"; export * from "./initialData"; diff --git a/frontend/src/features/jobs/application/useDashboardJobs.ts b/frontend/src/features/jobs/application/useDashboardJobs.ts index 046ff22a..a1dec96d 100644 --- a/frontend/src/features/jobs/application/useDashboardJobs.ts +++ b/frontend/src/features/jobs/application/useDashboardJobs.ts @@ -10,7 +10,7 @@ import { type SearchJobsResult, updateDashboardSavedJob, } from "../infrastructure/dashboardJobsApi"; -import { requestDashboardNotificationsRefresh } from "@/domains/new_dashboard/utils/notificationEvents"; +import { requestDashboardNotificationsRefresh } from "@/features/notifications/events"; interface UseDashboardJobsOptions { onError?: (message: string) => void; diff --git a/frontend/src/features/jobs/legacy/application/JobsContext.tsx b/frontend/src/features/jobs/legacy/application/JobsContext.tsx index d296f1f0..05de106c 100644 --- a/frontend/src/features/jobs/legacy/application/JobsContext.tsx +++ b/frontend/src/features/jobs/legacy/application/JobsContext.tsx @@ -2,7 +2,7 @@ import { createContext, useContext, useState, type ReactNode } from "react"; 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 "@/domains/new_dashboard/utils/helpers"; +import { createJobFromForm } from "@/features/jobs/legacy/domain/helpers"; import { useToastContext } from "@/shared/feedback/ToastContext"; interface JobsContextValue { 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/mentoring/demoMentors.ts b/frontend/src/features/mentoring/demoMentors.ts index ae01c88b..ed285aa6 100644 --- a/frontend/src/features/mentoring/demoMentors.ts +++ b/frontend/src/features/mentoring/demoMentors.ts @@ -1,4 +1,4 @@ -import type { Mentor } from "@/domains/new_dashboard/types/mentor"; +import type { Mentor } from "@/features/mentoring/types"; export const initialMentors: Mentor[] = [ { diff --git a/frontend/src/domains/new_dashboard/infrastructure/notificationsApi.ts b/frontend/src/features/notifications/api.ts similarity index 97% rename from frontend/src/domains/new_dashboard/infrastructure/notificationsApi.ts rename to frontend/src/features/notifications/api.ts index ecf9fa85..6b8381c4 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 { 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 95% rename from frontend/src/domains/new_dashboard/components/layout/MessageDetailModal.tsx rename to frontend/src/features/notifications/components/MessageDetailModal.tsx index 17a0b48d..6356a9be 100644 --- a/frontend/src/domains/new_dashboard/components/layout/MessageDetailModal.tsx +++ b/frontend/src/features/notifications/components/MessageDetailModal.tsx @@ -1,5 +1,5 @@ import { Bot, BriefcaseBusiness, UserRound } from "lucide-react"; -import type { Message, MessageOrigin } from "../../types"; +import type { Message, MessageOrigin } from "@/features/notifications/types"; import { Modal } from "@/shared/ui/Modal"; interface MessageDetailModalProps { 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/profile/defaults.ts b/frontend/src/features/profile/defaults.ts index c4cac2fc..e47b8c56 100644 --- a/frontend/src/features/profile/defaults.ts +++ b/frontend/src/features/profile/defaults.ts @@ -1,4 +1,4 @@ -import type { SearchPreferences, UserProfile } from "@/domains/new_dashboard/types/user"; +import type { SearchPreferences, UserProfile } from "@/features/profile/domain/user"; export const initialUser: UserProfile = { firstName: "Bruna", diff --git a/frontend/tests/unit/new_dashboard/HeaderUserMenu.test.tsx b/frontend/tests/unit/new_dashboard/HeaderUserMenu.test.tsx index 944a2cd6..bc314bfd 100644 --- a/frontend/tests/unit/new_dashboard/HeaderUserMenu.test.tsx +++ b/frontend/tests/unit/new_dashboard/HeaderUserMenu.test.tsx @@ -17,7 +17,7 @@ vi.mock("@/features/auth/application/AuthContext", () => ({ }), })); -vi.mock("@/domains/new_dashboard/infrastructure/notificationsApi", () => ({ +vi.mock("@/features/notifications/api", () => ({ getDashboardNotificationFeed: vi.fn().mockResolvedValue({ messages: [], notifications: [], @@ -31,7 +31,7 @@ vi.mock("@/domains/new_dashboard/components/layout/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/api.test.ts b/frontend/tests/unit/new_dashboard/api.test.ts index 37236988..2c6320ac 100644 --- a/frontend/tests/unit/new_dashboard/api.test.ts +++ b/frontend/tests/unit/new_dashboard/api.test.ts @@ -25,7 +25,7 @@ import { getDashboardNotificationFeed as getNotificationFeed, markDashboardNotificationsRead as markNotificationsRead, markSingleNotificationRead, -} from "@/domains/new_dashboard/infrastructure/notificationsApi"; +} from "@/features/notifications/api"; import { getUserPreferences, getUserProfile, diff --git a/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx index daa81ce6..43bc2976 100644 --- a/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx +++ b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx @@ -2,7 +2,7 @@ import { CareerChecklist } from "@/features/home/components/CareerChecklist"; import { JobDetailModal } from "@/features/jobs/components/JobDetailModal"; import { JobRow } from "@/features/jobs/components/JobRow"; import { Header } from "@/domains/new_dashboard/components/layout/Header"; -import { MessageDetailModal } from "@/domains/new_dashboard/components/layout/MessageDetailModal"; +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"; @@ -11,9 +11,9 @@ import { getDashboardNotificationFeed, markDashboardNotificationsRead, markSingleNotificationRead, -} from "@/domains/new_dashboard/infrastructure/notificationsApi"; +} from "@/features/notifications/api"; import type { Job, UserProfile } from "@/domains/new_dashboard/types"; -import { DASHBOARD_NOTIFICATIONS_REFRESH_EVENT } from "@/domains/new_dashboard/utils/notificationEvents"; +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"; @@ -41,7 +41,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/dashboard.layout.test.tsx b/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx index d6644067..668883f7 100644 --- a/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx +++ b/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx @@ -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/utils.test.ts b/frontend/tests/unit/new_dashboard/utils.test.ts index efdf4955..fc80d5db 100644 --- a/frontend/tests/unit/new_dashboard/utils.test.ts +++ b/frontend/tests/unit/new_dashboard/utils.test.ts @@ -3,7 +3,7 @@ import { createJobFromForm, getInitials, splitTags, -} from "@/domains/new_dashboard/utils/helpers"; +} from "@/features/jobs/legacy/domain/helpers"; import { getJobTypesFromModelFilter, getModelFilterFromJobTypes, From 53dcb5444cf66e786c89fcdf6a72c3611e79b53c Mon Sep 17 00:00:00 2001 From: hltav Date: Sun, 1 Nov 2026 21:14:34 -0300 Subject: [PATCH 13/15] refactor(PAV-181): remove compatibilidade legada do dashboard (cherry picked from commit 0db3070f89c81e416057dd5e4ce4512ea003ca02) --- frontend/README.md | 2 +- frontend/src/app/AppRoutes.tsx | 4 +-- .../dashboard/DashboardPage.tsx} | 21 ++++-------- .../dashboard/DashboardProviders.tsx} | 0 .../dashboard/components}/CandidateLogo.tsx | 0 .../dashboard/components}/Header.tsx | 5 +-- .../dashboard/components}/Icons.tsx | 0 .../dashboard/components}/MobileTabBar.tsx | 2 +- .../dashboard/components}/Sidebar.tsx | 4 +-- .../dashboard/components}/ThemeToggle.tsx | 0 .../src/domains/new_dashboard/constants.ts | 1 - .../domains/new_dashboard/constants/index.ts | 4 --- .../new_dashboard/constants/initialData.ts | 4 --- frontend/src/domains/new_dashboard/page.tsx | 2 -- frontend/src/domains/new_dashboard/types.ts | 1 - .../src/domains/new_dashboard/types/index.ts | 3 -- .../src/domains/new_dashboard/types/mentor.ts | 2 -- .../src/domains/new_dashboard/types/user.ts | 16 --------- frontend/tests/unit/app/AppRoutes.test.tsx | 4 +-- .../new_dashboard/HeaderUserMenu.test.tsx | 4 +-- .../new_dashboard/branch-coverage.test.tsx | 5 +-- .../new_dashboard/dashboard.layout.test.tsx | 12 +++---- .../unit/new_dashboard/home.profile.test.tsx | 10 ++---- .../tests/unit/new_dashboard/hooks.test.tsx | 2 +- .../new_dashboard/jobDetailModal.test.tsx | 2 +- .../tests/unit/new_dashboard/jobs.test.tsx | 4 +-- .../tests/unit/new_dashboard/page.test.tsx | 12 +++---- .../tests/unit/new_dashboard/types.test.ts | 33 +++++-------------- .../new_dashboard/userDashboardData.test.tsx | 2 +- .../tests/unit/new_dashboard/utils.test.ts | 2 +- 30 files changed, 50 insertions(+), 113 deletions(-) rename frontend/src/{domains/new_dashboard/NewDashboardPage.tsx => app/dashboard/DashboardPage.tsx} (97%) rename frontend/src/{domains/new_dashboard/layout.tsx => app/dashboard/DashboardProviders.tsx} (100%) rename frontend/src/{domains/new_dashboard/components/shared => app/dashboard/components}/CandidateLogo.tsx (100%) rename frontend/src/{domains/new_dashboard/components/layout => app/dashboard/components}/Header.tsx (98%) rename frontend/src/{domains/new_dashboard/components/shared => app/dashboard/components}/Icons.tsx (100%) rename frontend/src/{domains/new_dashboard/components/layout => app/dashboard/components}/MobileTabBar.tsx (96%) rename frontend/src/{domains/new_dashboard/components/layout => app/dashboard/components}/Sidebar.tsx (95%) rename frontend/src/{domains/new_dashboard/components/layout => app/dashboard/components}/ThemeToggle.tsx (100%) delete mode 100644 frontend/src/domains/new_dashboard/constants.ts delete mode 100644 frontend/src/domains/new_dashboard/constants/index.ts delete mode 100644 frontend/src/domains/new_dashboard/constants/initialData.ts delete mode 100644 frontend/src/domains/new_dashboard/page.tsx delete mode 100644 frontend/src/domains/new_dashboard/types.ts delete mode 100644 frontend/src/domains/new_dashboard/types/index.ts delete mode 100644 frontend/src/domains/new_dashboard/types/mentor.ts delete mode 100644 frontend/src/domains/new_dashboard/types/user.ts diff --git a/frontend/README.md b/frontend/README.md index f0bd883e..e23f26cf 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -56,7 +56,7 @@ O frontend segue uma estrutura orientada por domínio: - `src/features/auth`: login, registro, callback OAuth e estado de sessão. - `src/domains/jobs`: busca, filtros, paginação e interface de vagas. - `src/features/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/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/AppRoutes.tsx b/frontend/src/app/AppRoutes.tsx index 40037e8e..7561ac73 100644 --- a/frontend/src/app/AppRoutes.tsx +++ b/frontend/src/app/AppRoutes.tsx @@ -6,8 +6,8 @@ import RegisterPage from "@/features/auth/presentation/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 "@/domains/new_dashboard/NewDashboardPage"; -import NewDashboardLayout from "@/domains/new_dashboard/layout"; +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/domains/new_dashboard/NewDashboardPage.tsx b/frontend/src/app/dashboard/DashboardPage.tsx similarity index 97% rename from frontend/src/domains/new_dashboard/NewDashboardPage.tsx rename to frontend/src/app/dashboard/DashboardPage.tsx index 0afcbab0..18125e0d 100644 --- a/frontend/src/domains/new_dashboard/NewDashboardPage.tsx +++ b/frontend/src/app/dashboard/DashboardPage.tsx @@ -7,13 +7,13 @@ 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 "./components/layout/Header"; -import { MobileTabBar } from "./components/layout/MobileTabBar"; -import { Sidebar } from "./components/layout/Sidebar"; +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 "./constants"; +import { jobStatuses } from "@/features/jobs/constants"; import { useDashboardJobs } from "@/features/jobs/application/useDashboardJobs"; import { useUserDashboardData } from "@/features/profile/application/useUserDashboardData"; import { @@ -21,17 +21,8 @@ import { FALLBACK_JOB_FAMILIES, type JobFamilyOption, } from "@/features/jobs/infrastructure/dashboardJobsApi"; -import type { - CareerChecklist, - Job, - JobModelFilter, - JobStatus, - MatchSort, - NewJob, - SearchPreferences, - TechnologyExperience, - UserProfile, -} from "./types"; +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, diff --git a/frontend/src/domains/new_dashboard/layout.tsx b/frontend/src/app/dashboard/DashboardProviders.tsx similarity index 100% rename from frontend/src/domains/new_dashboard/layout.tsx rename to frontend/src/app/dashboard/DashboardProviders.tsx 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 98% rename from frontend/src/domains/new_dashboard/components/layout/Header.tsx rename to frontend/src/app/dashboard/components/Header.tsx index 8eb3ff1c..ae15f0b7 100644 --- a/frontend/src/domains/new_dashboard/components/layout/Header.tsx +++ b/frontend/src/app/dashboard/components/Header.tsx @@ -8,13 +8,14 @@ import { markDashboardNotificationsRead, markSingleNotificationRead, } from "@/features/notifications/api"; -import type { Message, Notification, UserProfile } from "../../types"; +import type { Message, Notification } from "@/features/notifications/types"; +import type { UserProfile } from "@/features/profile/domain/user"; import { DASHBOARD_NOTIFICATIONS_REFRESH_EVENT, type DashboardNotificationsRefreshDetail, } from "@/features/notifications/events"; import { MessageDetailModal } from "@/features/notifications/components/MessageDetailModal"; -import { ThemeToggle } from "./ThemeToggle"; +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 96% rename from frontend/src/domains/new_dashboard/components/layout/MobileTabBar.tsx rename to frontend/src/app/dashboard/components/MobileTabBar.tsx index b4fbd262..03d5aaf4 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 { 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 95% rename from frontend/src/domains/new_dashboard/components/layout/Sidebar.tsx rename to frontend/src/app/dashboard/components/Sidebar.tsx index 9d81720a..6a2410b3 100644 --- a/frontend/src/domains/new_dashboard/components/layout/Sidebar.tsx +++ b/frontend/src/app/dashboard/components/Sidebar.tsx @@ -2,8 +2,8 @@ import { cn } from "@/shared/lib/utils"; import { LogOut } from "lucide-react"; import { Link, useLocation } from "react-router-dom"; import { useAuth } from "@/features/auth/application/AuthContext"; -import { CandidateLogo } from "../shared/CandidateLogo"; -import { Icons } from "../shared/Icons"; +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/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 5d608eed..00000000 --- a/frontend/src/domains/new_dashboard/constants/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "@/app/dashboard/theme/colors"; -export * from "@/app/dashboard/theme/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 7cc6a921..00000000 --- a/frontend/src/domains/new_dashboard/constants/initialData.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { jobStatuses, jobStatusClasses, jobTypes, jobLevels } from "@/features/jobs/constants"; -export { initialJobs } from "@/features/jobs/legacy/initialJobs"; -export { initialMentors } from "@/features/mentoring/demoMentors"; -export { initialUser, initialPreferences } from "@/features/profile/defaults"; 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 a2c89cbd..00000000 --- a/frontend/src/domains/new_dashboard/types/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "@/features/jobs/domain/job"; -export * from "./mentor"; -export * from "./user"; diff --git a/frontend/src/domains/new_dashboard/types/mentor.ts b/frontend/src/domains/new_dashboard/types/mentor.ts deleted file mode 100644 index f710bf49..00000000 --- a/frontend/src/domains/new_dashboard/types/mentor.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { MentorSchema } from "@/features/mentoring/types"; -export type { Mentor } from "@/features/mentoring/types"; diff --git a/frontend/src/domains/new_dashboard/types/user.ts b/frontend/src/domains/new_dashboard/types/user.ts deleted file mode 100644 index 8766dc1c..00000000 --- a/frontend/src/domains/new_dashboard/types/user.ts +++ /dev/null @@ -1,16 +0,0 @@ -export { - TechnologyExperienceSchema, - CareerChecklistItemSchema, - CareerChecklistSchema, - UserProfileSchema, - SearchPreferencesSchema, -} from "@/features/profile/domain/user"; -export type { - UserProfile, - SearchPreferences, - TechnologyExperience, - CareerChecklist, -} from "@/features/profile/domain/user"; - -export { NotificationSchema, MessageSchema } from "@/features/notifications/types"; -export type { Notification, Message, MessageOrigin } from "@/features/notifications/types"; diff --git a/frontend/tests/unit/app/AppRoutes.test.tsx b/frontend/tests/unit/app/AppRoutes.test.tsx index 4368def5..479a5d14 100644 --- a/frontend/tests/unit/app/AppRoutes.test.tsx +++ b/frontend/tests/unit/app/AppRoutes.test.tsx @@ -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,7 +27,7 @@ vi.mock("@/domains/new_dashboard/layout", () => ({ ), })); -vi.mock("@/domains/new_dashboard/NewDashboardPage", () => ({ +vi.mock("@/app/dashboard/DashboardPage", () => ({ default: () =>
New dashboard route
, })); diff --git a/frontend/tests/unit/new_dashboard/HeaderUserMenu.test.tsx b/frontend/tests/unit/new_dashboard/HeaderUserMenu.test.tsx index bc314bfd..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(); @@ -27,7 +27,7 @@ vi.mock("@/features/notifications/api", () => ({ clearDashboardNotifications: vi.fn().mockResolvedValue(undefined), })); -vi.mock("@/domains/new_dashboard/components/layout/ThemeToggle", () => ({ +vi.mock("@/app/dashboard/components/ThemeToggle", () => ({ ThemeToggle: () => , })); diff --git a/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx index 43bc2976..9df91bd8 100644 --- a/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx +++ b/frontend/tests/unit/new_dashboard/branch-coverage.test.tsx @@ -1,7 +1,7 @@ import { CareerChecklist } from "@/features/home/components/CareerChecklist"; import { JobDetailModal } from "@/features/jobs/components/JobDetailModal"; import { JobRow } from "@/features/jobs/components/JobRow"; -import { Header } from "@/domains/new_dashboard/components/layout/Header"; +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"; @@ -12,7 +12,8 @@ import { markDashboardNotificationsRead, markSingleNotificationRead, } from "@/features/notifications/api"; -import type { Job, UserProfile } from "@/domains/new_dashboard/types"; +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"; diff --git a/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx b/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx index 668883f7..5ba8a570 100644 --- a/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx +++ b/frontend/tests/unit/new_dashboard/dashboard.layout.test.tsx @@ -3,12 +3,12 @@ import { MemoryRouter } from "react-router-dom"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { DashboardTab } from "@/features/dashboard/components/DashboardTab"; import { KanbanBoard } from "@/features/applications/components/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 { 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(); diff --git a/frontend/tests/unit/new_dashboard/home.profile.test.tsx b/frontend/tests/unit/new_dashboard/home.profile.test.tsx index 98334b52..d4486ec2 100644 --- a/frontend/tests/unit/new_dashboard/home.profile.test.tsx +++ b/frontend/tests/unit/new_dashboard/home.profile.test.tsx @@ -2,14 +2,8 @@ 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 "@/domains/new_dashboard/constants"; -import type { - SearchPreferences, - UserProfile, -} from "@/domains/new_dashboard/types"; +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 5de6399f..cef2068e 100644 --- a/frontend/tests/unit/new_dashboard/hooks.test.tsx +++ b/frontend/tests/unit/new_dashboard/hooks.test.tsx @@ -18,7 +18,7 @@ vi.mock("@/features/jobs/infrastructure/dashboardJobsApi", () => ({ import { useDashboardJobs } from "@/features/jobs/application/useDashboardJobs"; import type { User } from "@/features/auth/domain/auth.types"; -import type { Job } from "@/domains/new_dashboard/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 f75eb6fa..48c8e413 100644 --- a/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx +++ b/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx @@ -6,7 +6,7 @@ vi.mock("@/features/jobs/infrastructure/dashboardJobsApi", () => ({ })); import { JobDetailModal } from "@/features/jobs/components/JobDetailModal"; -import type { Job } from "@/domains/new_dashboard/types"; +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 6a3692a3..1ed87f05 100644 --- a/frontend/tests/unit/new_dashboard/jobs.test.tsx +++ b/frontend/tests/unit/new_dashboard/jobs.test.tsx @@ -8,8 +8,8 @@ import { FormattedJobDescription } from "@/features/jobs/components/FormattedJob import { JobRow } from "@/features/jobs/components/JobRow"; import { JobTab } from "@/features/jobs/components/JobTab"; import { JobTable } from "@/features/jobs/components/JobTable"; -import { initialPreferences } from "@/domains/new_dashboard/constants"; -import type { Job, JobModelFilter } from "@/domains/new_dashboard/types"; +import { initialPreferences } from "@/features/profile/defaults"; +import type { Job, JobModelFilter } from "@/features/jobs/domain/job"; import type { ContinentFilter, CountryFilter, diff --git a/frontend/tests/unit/new_dashboard/page.test.tsx b/frontend/tests/unit/new_dashboard/page.test.tsx index 819f47bb..11af88a3 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. */ /* -------------------------------------------------------------------------- */ @@ -121,13 +121,13 @@ vi.mock("@/features/profile/components/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: () =>
, })); @@ -136,7 +136,7 @@ vi.mock("@/shared/ui/Toast", () => ({ message ?
{message}
: null, })); -vi.mock("@/domains/new_dashboard/constants", () => ({ +vi.mock("@/features/jobs/constants", () => ({ jobStatuses: { applied: "Aplicada", interview: "Entrevista" }, })); diff --git a/frontend/tests/unit/new_dashboard/types.test.ts b/frontend/tests/unit/new_dashboard/types.test.ts index 16ea3016..49fda29a 100644 --- a/frontend/tests/unit/new_dashboard/types.test.ts +++ b/frontend/tests/unit/new_dashboard/types.test.ts @@ -1,4 +1,3 @@ -import * as dashboardTypes from "@/domains/new_dashboard/types"; import { JobLevelSchema, JobSchema, @@ -6,15 +5,9 @@ import { JobTypeSchema, NewJobSchema, } from "@/features/jobs/domain/job"; -import { MentorSchema } from "@/domains/new_dashboard/types/mentor"; -import { - CareerChecklistSchema, - MessageSchema, - NotificationSchema, - SearchPreferencesSchema, - TechnologyExperienceSchema, - UserProfileSchema, -} from "@/domains/new_dashboard/types/user"; +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 3fc7371c..d8192f64 100644 --- a/frontend/tests/unit/new_dashboard/userDashboardData.test.tsx +++ b/frontend/tests/unit/new_dashboard/userDashboardData.test.tsx @@ -18,7 +18,7 @@ vi.mock("@/features/profile/infrastructure/userDashboardApi", () => ({ createUserPreferences: userApiMock.createUserPreferences, })); -import { initialPreferences, initialUser } from "@/domains/new_dashboard/constants"; +import { initialPreferences, initialUser } from "@/features/profile/defaults"; import { useUserDashboardData } from "@/features/profile/application/useUserDashboardData"; import type { User } from "@/features/auth/domain/auth.types"; diff --git a/frontend/tests/unit/new_dashboard/utils.test.ts b/frontend/tests/unit/new_dashboard/utils.test.ts index fc80d5db..187f8517 100644 --- a/frontend/tests/unit/new_dashboard/utils.test.ts +++ b/frontend/tests/unit/new_dashboard/utils.test.ts @@ -1,4 +1,4 @@ -import type { Job, JobModelFilter, JobType } from "@/domains/new_dashboard/types"; +import type { Job, JobModelFilter, JobType } from "@/features/jobs/domain/job"; import { createJobFromForm, getInitials, From 16d04f6fe9c1cc5c4e7824894f362571cf6aa8c3 Mon Sep 17 00:00:00 2001 From: hltav Date: Sun, 1 Nov 2026 21:31:28 -0300 Subject: [PATCH 14/15] refactor(PAV-181): consolida domains na arquitetura features (cherry picked from commit 25c842401f00ed8530760661aab09e875e6e5eaa) --- frontend/README.md | 2 +- .../infrastructure => features/jobs/api}/jobsApi.ts | 2 +- .../jobs}/components/JobsFiltersCard.tsx | 4 ++-- .../jobs}/components/JobsHeaderCard.tsx | 0 .../jobs}/components/JobsTableCard.tsx | 4 ++-- .../jobs}/components/KeywordsModal.tsx | 2 +- .../{domains => features}/jobs/domain/jobFilters.ts | 2 +- .../{domains => features}/jobs/domain/jobPagination.ts | 0 .../application => features/jobs/hooks}/useJobsData.ts | 4 ++-- .../jobs/hooks}/useJobsFiltering.ts | 4 ++-- .../jobs/hooks}/useJobsPagination.ts | 4 ++-- .../presentation => features/jobs}/pages/JobsPage.tsx | 6 +++--- .../jobs/domain => features/jobs/types}/job.types.ts | 0 frontend/tests/integration/useJobsData.test.tsx | 4 ++-- .../unit/components/JobsFiltersCard.extended.test.tsx | 4 ++-- .../tests/unit/components/JobsFiltersCard.test.tsx | 4 ++-- frontend/tests/unit/components/JobsHeaderCard.test.tsx | 2 +- frontend/tests/unit/components/JobsTableCard.test.tsx | 2 +- frontend/tests/unit/components/KeywordsModal.test.tsx | 4 ++-- frontend/tests/unit/domain/jobFilters.test.ts | 2 +- frontend/tests/unit/factories/jobsFactory.ts | 2 +- .../tests/unit/hooks/useJobsData.extended.test.tsx | 4 ++-- .../tests/unit/hooks/useJobsFiltering.extended.test.ts | 2 +- frontend/tests/unit/pages/App.test.tsx | 6 +++--- frontend/tests/unit/pages/jobs/JobsPage.test.tsx | 10 +++++----- frontend/tests/unit/utils/jobsService.test.ts | 2 +- frontend/tests/unit/utils/useJobsFiltering.test.ts | 2 +- frontend/tests/unit/utils/useJobsPagination.test.ts | 2 +- 28 files changed, 43 insertions(+), 43 deletions(-) rename frontend/src/{domains/jobs/infrastructure => features/jobs/api}/jobsApi.ts (98%) rename frontend/src/{domains/jobs/presentation => features/jobs}/components/JobsFiltersCard.tsx (98%) rename frontend/src/{domains/jobs/presentation => features/jobs}/components/JobsHeaderCard.tsx (100%) rename frontend/src/{domains/jobs/presentation => features/jobs}/components/JobsTableCard.tsx (98%) rename frontend/src/{domains/jobs/presentation => features/jobs}/components/KeywordsModal.tsx (98%) rename frontend/src/{domains => features}/jobs/domain/jobFilters.ts (98%) rename frontend/src/{domains => features}/jobs/domain/jobPagination.ts (100%) rename frontend/src/{domains/jobs/application => features/jobs/hooks}/useJobsData.ts (95%) rename frontend/src/{domains/jobs/application => features/jobs/hooks}/useJobsFiltering.ts (84%) rename frontend/src/{domains/jobs/application => features/jobs/hooks}/useJobsPagination.ts (93%) rename frontend/src/{domains/jobs/presentation => features/jobs}/pages/JobsPage.tsx (95%) rename frontend/src/{domains/jobs/domain => features/jobs/types}/job.types.ts (100%) diff --git a/frontend/README.md b/frontend/README.md index e23f26cf..167d2f05 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -54,7 +54,7 @@ O frontend segue uma estrutura orientada por domínio: - `src/app`: composição da aplicação, providers, rotas e layouts autenticados. - `src/features/auth`: login, registro, callback OAuth e estado de sessão. -- `src/domains/jobs`: busca, filtros, paginação e interface de vagas. +- `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. 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/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..4fe98f04 100644 --- a/frontend/src/domains/jobs/presentation/components/JobsTableCard.tsx +++ b/frontend/src/features/jobs/components/JobsTableCard.tsx @@ -15,8 +15,8 @@ import { 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 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/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/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/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/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/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/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/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/pages/App.test.tsx b/frontend/tests/unit/pages/App.test.tsx index dd0b867e..7640bef2 100644 --- a/frontend/tests/unit/pages/App.test.tsx +++ b/frontend/tests/unit/pages/App.test.tsx @@ -18,7 +18,7 @@ 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/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/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"; From ada3a94ce56df635312713d2463a6e441ed3123c Mon Sep 17 00:00:00 2001 From: hltav Date: Sun, 1 Nov 2026 21:33:27 -0300 Subject: [PATCH 15/15] refactor(PAV-181): padroniza estrutura de app features e shared (cherry picked from commit 2155f5673786d29bc796aaba8955aa72d3df7e2f) --- frontend/ARCHITECTURE.md | 36 ++++++++++--------- frontend/README.md | 2 +- frontend/src/app/App.tsx | 2 +- frontend/src/app/dashboard/DashboardPage.tsx | 6 ++-- .../app/dashboard/components/MobileTabBar.tsx | 2 +- .../src/app/dashboard/components/Sidebar.tsx | 2 +- .../app/{ => layouts}/AuthenticatedHeader.tsx | 0 .../app/{ => layouts}/AuthenticatedLayout.tsx | 4 +-- .../{ => layouts}/AuthenticatedSidebar.tsx | 2 +- .../src/app/{ => providers}/AppProviders.tsx | 0 frontend/src/app/{ => routes}/AppRoutes.tsx | 8 ++--- frontend/src/app/{ => routes}/NotFound.tsx | 0 .../components/ApplicationNotesSection.tsx | 2 +- .../auth/{infrastructure => api}/authApi.ts | 2 +- .../{infrastructure => api}/connectionsApi.ts | 0 .../features/auth/application/AuthContext.tsx | 2 +- .../components/AuthVisualPanel.tsx | 0 .../components/LoginFormPanel.tsx | 2 +- .../components/RegisterFormPanel.tsx | 2 +- .../pages/AuthCallbackPage.tsx | 0 .../{presentation => }/pages/LoginPage.tsx | 4 +-- .../{presentation => }/pages/RegisterPage.tsx | 4 +-- .../dashboardJobsApi.ts | 4 +-- .../jobs/components/JobDetailModal.tsx | 2 +- .../src/features/jobs/components/JobRow.tsx | 2 +- .../jobs/components/JobsTableCard.tsx | 2 +- .../useDashboardJobs.ts | 6 ++-- .../legacy/{application => hooks}/useJobs.ts | 0 frontend/src/features/notifications/api.ts | 2 +- .../userDashboardApi.ts | 6 ++-- .../profile/components/ConnectionsForm.tsx | 2 +- .../useUserDashboardData.ts | 8 ++--- frontend/src/main.tsx | 2 +- frontend/src/shared/{lib => api}/apiClient.ts | 2 +- frontend/src/shared/{lib => api}/apiError.ts | 0 .../shared/{feedback => hooks}/useToast.ts | 0 frontend/src/shared/ui/badge.tsx | 2 +- frontend/src/shared/ui/button.tsx | 2 +- frontend/src/shared/ui/card.tsx | 2 +- frontend/src/shared/ui/input.tsx | 2 +- frontend/src/shared/ui/table.tsx | 2 +- frontend/src/shared/{lib => utils}/utils.ts | 0 frontend/tests/unit/app/AppRoutes.test.tsx | 10 +++--- .../unit/app/AuthenticatedHeader.test.tsx | 2 +- .../unit/app/AuthenticatedLayout.test.tsx | 2 +- .../unit/components/login/LeftSide.test.tsx | 2 +- .../components/login/RegisterSide.test.tsx | 4 +-- .../unit/components/login/RigthSide.test.tsx | 4 +-- .../tests/unit/context/AuthContext.test.tsx | 2 +- frontend/tests/unit/new_dashboard/api.test.ts | 6 ++-- .../new_dashboard/connectionsForm.test.tsx | 2 +- .../tests/unit/new_dashboard/hooks.test.tsx | 6 ++-- .../new_dashboard/jobDetailModal.test.tsx | 2 +- .../tests/unit/new_dashboard/jobs.test.tsx | 5 ++- .../tests/unit/new_dashboard/page.test.tsx | 4 +-- .../new_dashboard/userDashboardData.test.tsx | 6 ++-- .../unit/pages/auth/AuthCallback.test.tsx | 2 +- .../tests/unit/pages/login/LoginPage.test.tsx | 6 ++-- frontend/tests/unit/pages/not_found.test.tsx | 2 +- .../unit/pages/register/RegisterPage.test.tsx | 6 ++-- .../tests/unit/services/auth.service.test.tsx | 2 +- .../unit/services/connectionsApi.test.ts | 2 +- frontend/tests/unit/shared/apiClient.test.ts | 4 +-- frontend/tests/unit/utils/apiError.test.ts | 2 +- frontend/tests/unit/utils/cn.test.ts | 2 +- 65 files changed, 111 insertions(+), 104 deletions(-) rename frontend/src/app/{ => layouts}/AuthenticatedHeader.tsx (100%) rename frontend/src/app/{ => layouts}/AuthenticatedLayout.tsx (75%) rename frontend/src/app/{ => layouts}/AuthenticatedSidebar.tsx (99%) rename frontend/src/app/{ => providers}/AppProviders.tsx (100%) rename frontend/src/app/{ => routes}/AppRoutes.tsx (89%) rename frontend/src/app/{ => routes}/NotFound.tsx (100%) rename frontend/src/features/auth/{infrastructure => api}/authApi.ts (98%) rename frontend/src/features/auth/{infrastructure => api}/connectionsApi.ts (100%) rename frontend/src/features/auth/{presentation => }/components/AuthVisualPanel.tsx (100%) rename frontend/src/features/auth/{presentation => }/components/LoginFormPanel.tsx (99%) rename frontend/src/features/auth/{presentation => }/components/RegisterFormPanel.tsx (99%) rename frontend/src/features/auth/{presentation => }/pages/AuthCallbackPage.tsx (100%) rename frontend/src/features/auth/{presentation => }/pages/LoginPage.tsx (57%) rename frontend/src/features/auth/{presentation => }/pages/RegisterPage.tsx (58%) rename frontend/src/features/jobs/{infrastructure => api}/dashboardJobsApi.ts (99%) rename frontend/src/features/jobs/{application => hooks}/useDashboardJobs.ts (98%) rename frontend/src/features/jobs/legacy/{application => hooks}/useJobs.ts (100%) rename frontend/src/features/profile/{infrastructure => api}/userDashboardApi.ts (96%) rename frontend/src/features/profile/{application => hooks}/useUserDashboardData.ts (94%) rename frontend/src/shared/{lib => api}/apiClient.ts (92%) rename frontend/src/shared/{lib => api}/apiError.ts (100%) rename frontend/src/shared/{feedback => hooks}/useToast.ts (100%) rename frontend/src/shared/{lib => utils}/utils.ts (100%) 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 167d2f05..d21c27cd 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -50,7 +50,7 @@ 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/features/auth`: login, registro, callback OAuth e estado de sessão. 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/app/dashboard/DashboardPage.tsx b/frontend/src/app/dashboard/DashboardPage.tsx index 18125e0d..1e2fc942 100644 --- a/frontend/src/app/dashboard/DashboardPage.tsx +++ b/frontend/src/app/dashboard/DashboardPage.tsx @@ -14,13 +14,13 @@ 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/application/useDashboardJobs"; -import { useUserDashboardData } from "@/features/profile/application/useUserDashboardData"; +import { useDashboardJobs } from "@/features/jobs/hooks/useDashboardJobs"; +import { useUserDashboardData } from "@/features/profile/hooks/useUserDashboardData"; import { getJobFilterOptions, FALLBACK_JOB_FAMILIES, type JobFamilyOption, -} from "@/features/jobs/infrastructure/dashboardJobsApi"; +} 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 { diff --git a/frontend/src/app/dashboard/components/MobileTabBar.tsx b/frontend/src/app/dashboard/components/MobileTabBar.tsx index 03d5aaf4..faad388a 100644 --- a/frontend/src/app/dashboard/components/MobileTabBar.tsx +++ b/frontend/src/app/dashboard/components/MobileTabBar.tsx @@ -1,4 +1,4 @@ -import { cn } from "@/shared/lib/utils"; +import { cn } from "@/shared/utils/utils"; import { Link, useLocation } from "react-router-dom"; import { Icons } from "@/app/dashboard/components/Icons"; diff --git a/frontend/src/app/dashboard/components/Sidebar.tsx b/frontend/src/app/dashboard/components/Sidebar.tsx index 6a2410b3..b8bddbac 100644 --- a/frontend/src/app/dashboard/components/Sidebar.tsx +++ b/frontend/src/app/dashboard/components/Sidebar.tsx @@ -1,4 +1,4 @@ -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 "@/features/auth/application/AuthContext"; diff --git a/frontend/src/app/AuthenticatedHeader.tsx b/frontend/src/app/layouts/AuthenticatedHeader.tsx similarity index 100% rename from frontend/src/app/AuthenticatedHeader.tsx rename to frontend/src/app/layouts/AuthenticatedHeader.tsx 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 99% rename from frontend/src/app/AuthenticatedSidebar.tsx rename to frontend/src/app/layouts/AuthenticatedSidebar.tsx index 838f78df..09ab9cde 100644 --- a/frontend/src/app/AuthenticatedSidebar.tsx +++ b/frontend/src/app/layouts/AuthenticatedSidebar.tsx @@ -1,5 +1,5 @@ import { useAuth } from "@/features/auth/application/AuthContext"; -import { cn } from "@/shared/lib/utils"; +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 100% rename from frontend/src/app/AppProviders.tsx rename to frontend/src/app/providers/AppProviders.tsx diff --git a/frontend/src/app/AppRoutes.tsx b/frontend/src/app/routes/AppRoutes.tsx similarity index 89% rename from frontend/src/app/AppRoutes.tsx rename to frontend/src/app/routes/AppRoutes.tsx index 7561ac73..bd6fa3c0 100644 --- a/frontend/src/app/AppRoutes.tsx +++ b/frontend/src/app/routes/AppRoutes.tsx @@ -1,8 +1,8 @@ -import NotFound from "@/app/NotFound"; +import NotFound from "@/app/routes/NotFound"; import { useAuth } from "@/features/auth/application/AuthContext"; -import AuthCallbackPage from "@/features/auth/presentation/pages/AuthCallbackPage"; -import LoginPage from "@/features/auth/presentation/pages/LoginPage"; -import RegisterPage from "@/features/auth/presentation/pages/RegisterPage"; +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"; 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/features/applications/components/ApplicationNotesSection.tsx b/frontend/src/features/applications/components/ApplicationNotesSection.tsx index 8d67d21c..b69adca7 100644 --- a/frontend/src/features/applications/components/ApplicationNotesSection.tsx +++ b/frontend/src/features/applications/components/ApplicationNotesSection.tsx @@ -5,7 +5,7 @@ import { deleteDashboardApplicationNote, getDashboardApplicationNotes, updateDashboardApplicationNote, -} from "@/features/jobs/infrastructure/dashboardJobsApi"; +} from "@/features/jobs/api/dashboardJobsApi"; export function ApplicationNotesSection({ savedJobId }: { savedJobId: string }) { const [notes, setNotes] = useState([]); diff --git a/frontend/src/features/auth/infrastructure/authApi.ts b/frontend/src/features/auth/api/authApi.ts similarity index 98% rename from frontend/src/features/auth/infrastructure/authApi.ts rename to frontend/src/features/auth/api/authApi.ts index c1fc118a..d8ce1a88 100644 --- a/frontend/src/features/auth/infrastructure/authApi.ts +++ b/frontend/src/features/auth/api/authApi.ts @@ -2,7 +2,7 @@ import type { LoginCredentials, RegisterData, } from "@/features/auth/domain/auth.types"; -import { parseApiError } from "@/shared/lib/apiError"; +import { parseApiError } from "@/shared/api/apiError"; function getBaseUrl(): string { const base = import.meta.env.VITE_API_BASE_URL; diff --git a/frontend/src/features/auth/infrastructure/connectionsApi.ts b/frontend/src/features/auth/api/connectionsApi.ts similarity index 100% rename from frontend/src/features/auth/infrastructure/connectionsApi.ts rename to frontend/src/features/auth/api/connectionsApi.ts diff --git a/frontend/src/features/auth/application/AuthContext.tsx b/frontend/src/features/auth/application/AuthContext.tsx index a35f0b8b..0850b468 100644 --- a/frontend/src/features/auth/application/AuthContext.tsx +++ b/frontend/src/features/auth/application/AuthContext.tsx @@ -6,7 +6,7 @@ import { ReactNode, } from "react"; import type { LoginCredentials, User } from "@/features/auth/domain/auth.types"; -import { api } from "@/shared/lib/apiClient"; +import { api } from "@/shared/api/apiClient"; interface AuthContextData { user: User | null; diff --git a/frontend/src/features/auth/presentation/components/AuthVisualPanel.tsx b/frontend/src/features/auth/components/AuthVisualPanel.tsx similarity index 100% rename from frontend/src/features/auth/presentation/components/AuthVisualPanel.tsx rename to frontend/src/features/auth/components/AuthVisualPanel.tsx diff --git a/frontend/src/features/auth/presentation/components/LoginFormPanel.tsx b/frontend/src/features/auth/components/LoginFormPanel.tsx similarity index 99% rename from frontend/src/features/auth/presentation/components/LoginFormPanel.tsx rename to frontend/src/features/auth/components/LoginFormPanel.tsx index d9a977e9..5b563495 100644 --- a/frontend/src/features/auth/presentation/components/LoginFormPanel.tsx +++ b/frontend/src/features/auth/components/LoginFormPanel.tsx @@ -3,7 +3,7 @@ import { getGoogleAuthUrl, getGithubAuthUrl, getLinkedinAuthUrl, -} from "@/features/auth/infrastructure/authApi"; +} from "@/features/auth/api/authApi"; import { useAuth } from "@/features/auth/application/AuthContext"; import { Image } from "@unpic/react"; import { motion } from "framer-motion"; diff --git a/frontend/src/features/auth/presentation/components/RegisterFormPanel.tsx b/frontend/src/features/auth/components/RegisterFormPanel.tsx similarity index 99% rename from frontend/src/features/auth/presentation/components/RegisterFormPanel.tsx rename to frontend/src/features/auth/components/RegisterFormPanel.tsx index 3f2245ad..56f1bfc0 100644 --- a/frontend/src/features/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/features/auth/presentation/pages/AuthCallbackPage.tsx b/frontend/src/features/auth/pages/AuthCallbackPage.tsx similarity index 100% rename from frontend/src/features/auth/presentation/pages/AuthCallbackPage.tsx rename to frontend/src/features/auth/pages/AuthCallbackPage.tsx diff --git a/frontend/src/features/auth/presentation/pages/LoginPage.tsx b/frontend/src/features/auth/pages/LoginPage.tsx similarity index 57% rename from frontend/src/features/auth/presentation/pages/LoginPage.tsx rename to frontend/src/features/auth/pages/LoginPage.tsx index ec20eca1..2aae843c 100644 --- a/frontend/src/features/auth/presentation/pages/LoginPage.tsx +++ b/frontend/src/features/auth/pages/LoginPage.tsx @@ -1,5 +1,5 @@ -import LeftSide from "@/features/auth/presentation/components/AuthVisualPanel"; -import RightSide from "@/features/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/features/auth/presentation/pages/RegisterPage.tsx b/frontend/src/features/auth/pages/RegisterPage.tsx similarity index 58% rename from frontend/src/features/auth/presentation/pages/RegisterPage.tsx rename to frontend/src/features/auth/pages/RegisterPage.tsx index 61421a52..6d178c3b 100644 --- a/frontend/src/features/auth/presentation/pages/RegisterPage.tsx +++ b/frontend/src/features/auth/pages/RegisterPage.tsx @@ -1,5 +1,5 @@ -import LeftSide from "@/features/auth/presentation/components/AuthVisualPanel"; -import RegisterSide from "@/features/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/features/jobs/infrastructure/dashboardJobsApi.ts b/frontend/src/features/jobs/api/dashboardJobsApi.ts similarity index 99% rename from frontend/src/features/jobs/infrastructure/dashboardJobsApi.ts rename to frontend/src/features/jobs/api/dashboardJobsApi.ts index 0648ee43..b14b306c 100644 --- a/frontend/src/features/jobs/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 "../domain/job"; +} from "@/features/jobs/domain/job"; const ApiSearchJobSchema = z .object({ diff --git a/frontend/src/features/jobs/components/JobDetailModal.tsx b/frontend/src/features/jobs/components/JobDetailModal.tsx index a448d67e..735c3dab 100644 --- a/frontend/src/features/jobs/components/JobDetailModal.tsx +++ b/frontend/src/features/jobs/components/JobDetailModal.tsx @@ -4,7 +4,7 @@ import { jobStatusClasses, jobStatuses } from "../constants"; import { getDashboardSavedJobEvents, getFamilyLabel, -} from "@/features/jobs/infrastructure/dashboardJobsApi"; +} 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"; diff --git a/frontend/src/features/jobs/components/JobRow.tsx b/frontend/src/features/jobs/components/JobRow.tsx index 629375f8..a0538686 100644 --- a/frontend/src/features/jobs/components/JobRow.tsx +++ b/frontend/src/features/jobs/components/JobRow.tsx @@ -1,6 +1,6 @@ import { jobStatuses } from "../constants"; import type { Job, JobStatus } from "../domain/job"; -import { getFamilyLabel } from "@/features/jobs/infrastructure/dashboardJobsApi"; +import { getFamilyLabel } from "@/features/jobs/api/dashboardJobsApi"; interface JobRowProps { job: Job; diff --git a/frontend/src/features/jobs/components/JobsTableCard.tsx b/frontend/src/features/jobs/components/JobsTableCard.tsx index 4fe98f04..0d007c08 100644 --- a/frontend/src/features/jobs/components/JobsTableCard.tsx +++ b/frontend/src/features/jobs/components/JobsTableCard.tsx @@ -14,7 +14,7 @@ import { TableHeader, TableRow, } from "@/shared/ui/table"; -import { cn } from "@/shared/lib/utils"; +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"; diff --git a/frontend/src/features/jobs/application/useDashboardJobs.ts b/frontend/src/features/jobs/hooks/useDashboardJobs.ts similarity index 98% rename from frontend/src/features/jobs/application/useDashboardJobs.ts rename to frontend/src/features/jobs/hooks/useDashboardJobs.ts index a1dec96d..dea0256c 100644 --- a/frontend/src/features/jobs/application/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 "@/features/auth/domain/auth.types"; -import { isApiError } from "@/shared/lib/apiError"; -import type { Job, JobStatus, NewJob } from "../domain/job"; +import { isApiError } from "@/shared/api/apiError"; +import type { Job, JobStatus, NewJob } from "@/features/jobs/domain/job"; import { createDashboardSavedJob, getDashboardSavedJobs, @@ -9,7 +9,7 @@ import { type SearchJobFilters, type SearchJobsResult, updateDashboardSavedJob, -} from "../infrastructure/dashboardJobsApi"; +} from "@/features/jobs/api/dashboardJobsApi"; import { requestDashboardNotificationsRefresh } from "@/features/notifications/events"; interface UseDashboardJobsOptions { diff --git a/frontend/src/features/jobs/legacy/application/useJobs.ts b/frontend/src/features/jobs/legacy/hooks/useJobs.ts similarity index 100% rename from frontend/src/features/jobs/legacy/application/useJobs.ts rename to frontend/src/features/jobs/legacy/hooks/useJobs.ts diff --git a/frontend/src/features/notifications/api.ts b/frontend/src/features/notifications/api.ts index 6b8381c4..2604164e 100644 --- a/frontend/src/features/notifications/api.ts +++ b/frontend/src/features/notifications/api.ts @@ -1,4 +1,4 @@ -import { api } from "@/shared/lib/apiClient"; +import { api } from "@/shared/api/apiClient"; import { z } from "zod"; import type { Message, MessageOrigin, Notification } from "@/features/notifications/types"; diff --git a/frontend/src/features/profile/infrastructure/userDashboardApi.ts b/frontend/src/features/profile/api/userDashboardApi.ts similarity index 96% rename from frontend/src/features/profile/infrastructure/userDashboardApi.ts rename to frontend/src/features/profile/api/userDashboardApi.ts index d4044112..92afd441 100644 --- a/frontend/src/features/profile/infrastructure/userDashboardApi.ts +++ b/frontend/src/features/profile/api/userDashboardApi.ts @@ -1,8 +1,8 @@ import { z } from "zod"; -import { api } from "@/shared/lib/apiClient"; +import { api } from "@/shared/api/apiClient"; import type { JobType } from "@/features/jobs/domain/job"; -import type { SearchPreferences, UserProfile } from "../domain/user"; -import { initialPreferences, initialUser } from "../defaults"; +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/features/profile/components/ConnectionsForm.tsx b/frontend/src/features/profile/components/ConnectionsForm.tsx index 9cd30ce4..e11c21dd 100644 --- a/frontend/src/features/profile/components/ConnectionsForm.tsx +++ b/frontend/src/features/profile/components/ConnectionsForm.tsx @@ -6,7 +6,7 @@ import { getConnections, type SupportedProvider, type UserConnections, -} from "@/features/auth/infrastructure/connectionsApi"; +} from "@/features/auth/api/connectionsApi"; const PROVIDER_LABELS: Record = { google: "Google", diff --git a/frontend/src/features/profile/application/useUserDashboardData.ts b/frontend/src/features/profile/hooks/useUserDashboardData.ts similarity index 94% rename from frontend/src/features/profile/application/useUserDashboardData.ts rename to frontend/src/features/profile/hooks/useUserDashboardData.ts index 0d3f153d..2c5028f2 100644 --- a/frontend/src/features/profile/application/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 { isApiError } from "@/shared/api/apiError"; import type { User } from "@/features/auth/domain/auth.types"; -import { initialPreferences, initialUser } from "../defaults"; -import type { SearchPreferences, UserProfile } from "../domain/user"; +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/shared/feedback/useToast.ts b/frontend/src/shared/hooks/useToast.ts similarity index 100% rename from frontend/src/shared/feedback/useToast.ts rename to frontend/src/shared/hooks/useToast.ts 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/unit/app/AppRoutes.test.tsx b/frontend/tests/unit/app/AppRoutes.test.tsx index 479a5d14..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"; @@ -35,19 +35,19 @@ vi.mock("@/features/marketing/pages/LandingPage", () => ({ default: () =>
Landing route
, })); -vi.mock("@/features/auth/presentation/pages/LoginPage", () => ({ +vi.mock("@/features/auth/pages/LoginPage", () => ({ default: () =>
Login route
, })); -vi.mock("@/features/auth/presentation/pages/RegisterPage", () => ({ +vi.mock("@/features/auth/pages/RegisterPage", () => ({ default: () =>
Register route
, })); -vi.mock("@/features/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 5a18c1d1..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(); diff --git a/frontend/tests/unit/app/AuthenticatedLayout.test.tsx b/frontend/tests/unit/app/AuthenticatedLayout.test.tsx index 6f8e6808..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"; diff --git a/frontend/tests/unit/components/login/LeftSide.test.tsx b/frontend/tests/unit/components/login/LeftSide.test.tsx index a21b6cd4..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 "@/features/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 9ed03270..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("@/features/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 "@/features/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 ea8af474..c31d4447 100644 --- a/frontend/tests/unit/components/login/RigthSide.test.tsx +++ b/frontend/tests/unit/components/login/RigthSide.test.tsx @@ -9,7 +9,7 @@ const mockGetGithubAuthUrl = vi.fn(); const mockGetLinkedinAuthUrl = vi.fn(); const mockNavigate = vi.fn(); -vi.mock("@/features/auth/infrastructure/authApi", () => ({ +vi.mock("@/features/auth/api/authApi", () => ({ getGoogleAuthUrl: (...args: any[]) => mockGetGoogleAuthUrl(...args), getGithubAuthUrl: (...args: any[]) => mockGetGithubAuthUrl(...args), getLinkedinAuthUrl: (...args: any[]) => mockGetLinkedinAuthUrl(...args), @@ -36,7 +36,7 @@ vi.mock("react-router-dom", () => ({ useNavigate: () => mockNavigate, })); -import RigthSide from "@/features/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 db3e14a3..90b23315 100644 --- a/frontend/tests/unit/context/AuthContext.test.tsx +++ b/frontend/tests/unit/context/AuthContext.test.tsx @@ -6,7 +6,7 @@ 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), diff --git a/frontend/tests/unit/new_dashboard/api.test.ts b/frontend/tests/unit/new_dashboard/api.test.ts index 2c6320ac..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,7 +19,7 @@ import { searchDashboardJobs, toRecommendedJob, updateDashboardSavedJob, -} from "@/features/jobs/infrastructure/dashboardJobsApi"; +} from "@/features/jobs/api/dashboardJobsApi"; import { clearDashboardNotifications, getDashboardNotificationFeed as getNotificationFeed, @@ -33,7 +33,7 @@ import { toUserProfile, updateUserPreferences, updateUserProfile, -} from "@/features/profile/infrastructure/userDashboardApi"; +} from "@/features/profile/api/userDashboardApi"; describe("new_dashboard api adapters", () => { beforeEach(() => { diff --git a/frontend/tests/unit/new_dashboard/connectionsForm.test.tsx b/frontend/tests/unit/new_dashboard/connectionsForm.test.tsx index d130a8fa..70724439 100644 --- a/frontend/tests/unit/new_dashboard/connectionsForm.test.tsx +++ b/frontend/tests/unit/new_dashboard/connectionsForm.test.tsx @@ -9,7 +9,7 @@ const mocks = vi.hoisted(() => ({ disconnectProvider: vi.fn(), })); -vi.mock("@/features/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/hooks.test.tsx b/frontend/tests/unit/new_dashboard/hooks.test.tsx index cef2068e..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,14 +9,14 @@ const dashboardApiMock = vi.hoisted(() => ({ updateDashboardSavedJob: vi.fn(), })); -vi.mock("@/features/jobs/infrastructure/dashboardJobsApi", () => ({ +vi.mock("@/features/jobs/api/dashboardJobsApi", () => ({ getDashboardSavedJobs: dashboardApiMock.getDashboardSavedJobs, searchDashboardJobs: dashboardApiMock.searchDashboardJobs, createDashboardSavedJob: dashboardApiMock.createDashboardSavedJob, updateDashboardSavedJob: dashboardApiMock.updateDashboardSavedJob, })); -import { useDashboardJobs } from "@/features/jobs/application/useDashboardJobs"; +import { useDashboardJobs } from "@/features/jobs/hooks/useDashboardJobs"; import type { User } from "@/features/auth/domain/auth.types"; import type { Job } from "@/features/jobs/domain/job"; diff --git a/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx b/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx index 48c8e413..5a909657 100644 --- a/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx +++ b/frontend/tests/unit/new_dashboard/jobDetailModal.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; -vi.mock("@/features/jobs/infrastructure/dashboardJobsApi", () => ({ +vi.mock("@/features/jobs/api/dashboardJobsApi", () => ({ getDashboardSavedJobEvents: vi.fn().mockResolvedValue([]), })); diff --git a/frontend/tests/unit/new_dashboard/jobs.test.tsx b/frontend/tests/unit/new_dashboard/jobs.test.tsx index 1ed87f05..aa3d3d8f 100644 --- a/frontend/tests/unit/new_dashboard/jobs.test.tsx +++ b/frontend/tests/unit/new_dashboard/jobs.test.tsx @@ -23,7 +23,7 @@ const dashboardApiMock = vi.hoisted(() => ({ deleteDashboardApplicationNote: vi.fn(), })); -vi.mock("@/features/jobs/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 11af88a3..0eeb2c85 100644 --- a/frontend/tests/unit/new_dashboard/page.test.tsx +++ b/frontend/tests/unit/new_dashboard/page.test.tsx @@ -161,7 +161,7 @@ const mockSaveSearchPreferences = vi.fn().mockResolvedValue(undefined); let mockUserData: any = {}; -vi.mock("@/features/profile/application/useUserDashboardData", () => ({ +vi.mock("@/features/profile/hooks/useUserDashboardData", () => ({ useUserDashboardData: () => mockUserData, })); @@ -177,7 +177,7 @@ const mockSaveJobNotes = vi.fn().mockResolvedValue(undefined); let mockJobs: any = {}; -vi.mock("@/features/jobs/application/useDashboardJobs", () => ({ +vi.mock("@/features/jobs/hooks/useDashboardJobs", () => ({ useDashboardJobs: () => mockJobs, })); diff --git a/frontend/tests/unit/new_dashboard/userDashboardData.test.tsx b/frontend/tests/unit/new_dashboard/userDashboardData.test.tsx index d8192f64..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("@/features/profile/infrastructure/userDashboardApi", () => ({ +vi.mock("@/features/profile/api/userDashboardApi", () => ({ getUserProfile: userApiMock.getUserProfile, getUserPreferences: userApiMock.getUserPreferences, updateUserProfile: userApiMock.updateUserProfile, @@ -19,7 +19,7 @@ vi.mock("@/features/profile/infrastructure/userDashboardApi", () => ({ })); import { initialPreferences, initialUser } from "@/features/profile/defaults"; -import { useUserDashboardData } from "@/features/profile/application/useUserDashboardData"; +import { useUserDashboardData } from "@/features/profile/hooks/useUserDashboardData"; import type { User } from "@/features/auth/domain/auth.types"; const user: User = { diff --git a/frontend/tests/unit/pages/auth/AuthCallback.test.tsx b/frontend/tests/unit/pages/auth/AuthCallback.test.tsx index df365229..e6593a9b 100644 --- a/frontend/tests/unit/pages/auth/AuthCallback.test.tsx +++ b/frontend/tests/unit/pages/auth/AuthCallback.test.tsx @@ -16,7 +16,7 @@ vi.mock("@/shared/ui/Loading", () => ({ default: () =>
Loading...
, })); -import AuthCallback from "@/features/auth/presentation/pages/AuthCallbackPage"; +import AuthCallback from "@/features/auth/pages/AuthCallbackPage"; describe("AuthCallback", () => { beforeEach(() => { diff --git a/frontend/tests/unit/pages/login/LoginPage.test.tsx b/frontend/tests/unit/pages/login/LoginPage.test.tsx index ed2d2112..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("@/features/auth/presentation/components/AuthVisualPanel", () => ({ +vi.mock("@/features/auth/components/AuthVisualPanel", () => ({ default: () =>
Left Side Mock
, })); -vi.mock("@/features/auth/presentation/components/LoginFormPanel", () => ({ +vi.mock("@/features/auth/components/LoginFormPanel", () => ({ default: () =>
Right Side Mock
, })); -import LoginPage from "@/features/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 942f00fc..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("@/features/auth/presentation/components/AuthVisualPanel", () => ({ +vi.mock("@/features/auth/components/AuthVisualPanel", () => ({ default: () =>
Left Side Mock
, })); -vi.mock("@/features/auth/presentation/components/RegisterFormPanel", () => ({ +vi.mock("@/features/auth/components/RegisterFormPanel", () => ({ default: () =>
Register Side Mock
, })); -import RegisterPage from "@/features/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 30b9c7e6..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 "@/features/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 e1509a08..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 "@/features/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", () => {