# Codebase Audit — REVIEW.md

**Date:** 2026-06-08
**Scope:** entire repository (tracked source/config files via `git ls-files`)
**Method:** file-by-file review. Source of truth for progress — re-read before continuing after any compaction.

**Total files to review:** 277

---


## .claude/hooks/

- [x] .claude/hooks/block-env.js
- [x] .claude/hooks/format-on-save.js

## .claude/

- [x] .claude/settings.json
- [x] .claude/settings.local.json

## ./

- [x] .env.example
- [x] CLAUDE.md
- [x] boneyard.config.json
- [x] index.html
- [x] package.json

## prisma/

- [x] prisma/schema.prisma
- [x] prisma/seed.ts

## scripts/

- [x] scripts/migrate-received-invoices-to-nas.ts
- [x] scripts/rotate-totp-key.ts

## src/

- [x] src/App.tsx

## src/__tests__/

- [x] src/__tests__/ai.test.ts
- [x] src/__tests__/auth.service.test.ts
- [x] src/__tests__/auth.test.ts
- [x] src/__tests__/customers.schema.test.ts
- [x] src/__tests__/env.test.ts
- [x] src/__tests__/exchange-rates.test.ts
- [x] src/__tests__/helpers.ts
- [x] src/__tests__/invoices.service.test.ts
- [x] src/__tests__/manual-create.test.ts
- [x] src/__tests__/nas-file-manager.test.ts
- [x] src/__tests__/nas-project-folder.test.ts
- [x] src/__tests__/numbering.test.ts
- [x] src/__tests__/plan.test.ts
- [x] src/__tests__/planAuditDescription.test.ts
- [x] src/__tests__/planCategory.test.ts
- [x] src/__tests__/received-invoices-vat.test.ts
- [x] src/__tests__/schema-nan.test.ts
- [x] src/__tests__/setup.ts
- [x] src/__tests__/warehouse.test.ts

## src/admin/

- [x] src/admin/AdminApp.tsx
- [x] src/admin/GlobalStyles.tsx

## src/admin/components/

- [x] src/admin/components/AlertContainer.tsx
- [x] src/admin/components/AttendanceShiftTable.tsx
- [x] src/admin/components/BulkAttendanceModal.tsx
- [x] src/admin/components/BulkPlanModal.tsx
- [x] src/admin/components/ErrorBoundary.tsx
- [x] src/admin/components/Forbidden.tsx
- [x] src/admin/components/OrderConfirmationModal.tsx
- [x] src/admin/components/PlanCategoriesModal.tsx
- [x] src/admin/components/PlanCellModal.tsx
- [x] src/admin/components/PlanGrid.tsx
- [x] src/admin/components/PlanRangeChips.tsx
- [x] src/admin/components/ProjectFileManager.tsx
- [x] src/admin/components/RichEditor.tsx
- [x] src/admin/components/ShiftFormModal.tsx
- [x] src/admin/components/ShortcutsHelp.tsx

## src/admin/components/dashboard/

- [x] src/admin/components/dashboard/DashActivityFeed.tsx
- [x] src/admin/components/dashboard/DashAttendanceToday.tsx
- [x] src/admin/components/dashboard/DashKpiCards.tsx
- [x] src/admin/components/dashboard/DashProfile.tsx
- [x] src/admin/components/dashboard/DashQuickActions.tsx
- [x] src/admin/components/dashboard/DashSessions.tsx
- [x] src/admin/components/dashboard/DashTodayPlan.tsx

## src/admin/components/odin/

- [x] src/admin/components/odin/InvoiceReviewCard.tsx
- [x] src/admin/components/odin/OdinChat.tsx
- [x] src/admin/components/odin/OdinComposer.tsx
- [x] src/admin/components/odin/OdinMark.tsx
- [x] src/admin/components/odin/OdinSidebar.tsx
- [x] src/admin/components/odin/OdinThread.tsx
- [x] src/admin/components/odin/types.ts

## src/admin/components/warehouse/

- [x] src/admin/components/warehouse/ItemPicker.tsx
- [x] src/admin/components/warehouse/ReservationPicker.tsx

## src/admin/context/

- [x] src/admin/context/AlertContext.tsx
- [x] src/admin/context/AuthContext.tsx

## src/admin/hooks/

- [x] src/admin/hooks/useAttendanceAdmin.ts
- [x] src/admin/hooks/useDebounce.ts
- [x] src/admin/hooks/useModalLock.ts
- [x] src/admin/hooks/usePaginatedQuery.ts
- [x] src/admin/hooks/usePlanWork.ts
- [x] src/admin/hooks/useReducedMotion.ts
- [x] src/admin/hooks/useTableSort.ts

## src/admin/lib/

- [x] src/admin/lib/apiAdapter.ts
- [x] src/admin/lib/entityTypeLabels.ts

## src/admin/lib/queries/

- [x] src/admin/lib/queries/ai.ts
- [x] src/admin/lib/queries/attendance.ts
- [x] src/admin/lib/queries/auditLog.ts
- [x] src/admin/lib/queries/common.ts
- [x] src/admin/lib/queries/dashboard.ts
- [x] src/admin/lib/queries/invoices.ts
- [x] src/admin/lib/queries/leave.ts
- [x] src/admin/lib/queries/mutations.ts
- [x] src/admin/lib/queries/offers.ts
- [x] src/admin/lib/queries/orders.ts
- [x] src/admin/lib/queries/plan.ts
- [x] src/admin/lib/queries/projects.ts
- [x] src/admin/lib/queries/settings.ts
- [x] src/admin/lib/queries/trips.ts
- [x] src/admin/lib/queries/users.ts
- [x] src/admin/lib/queries/vehicles.ts
- [x] src/admin/lib/queries/warehouse.ts

## src/admin/lib/

- [x] src/admin/lib/queryClient.ts

## src/admin/pages/

- [x] src/admin/pages/Attendance.tsx
- [x] src/admin/pages/AttendanceAdmin.tsx
- [x] src/admin/pages/AttendanceBalances.tsx
- [x] src/admin/pages/AttendanceCreate.tsx
- [x] src/admin/pages/AttendanceHistory.tsx
- [x] src/admin/pages/AttendanceLocation.tsx
- [x] src/admin/pages/AuditLog.tsx
- [x] src/admin/pages/CompanySettings.tsx
- [x] src/admin/pages/Dashboard.tsx
- [x] src/admin/pages/InvoiceDetail.tsx
- [x] src/admin/pages/Invoices.tsx
- [x] src/admin/pages/LeaveApproval.tsx
- [x] src/admin/pages/LeaveRequests.tsx
- [x] src/admin/pages/Login.tsx
- [x] src/admin/pages/NotFound.tsx
- [x] src/admin/pages/Odin.tsx
- [x] src/admin/pages/OfferDetail.tsx
- [x] src/admin/pages/Offers.tsx
- [x] src/admin/pages/OffersCustomers.tsx
- [x] src/admin/pages/OffersTemplates.tsx
- [x] src/admin/pages/OrderDetail.tsx
- [x] src/admin/pages/Orders.tsx
- [x] src/admin/pages/PlanWork.tsx
- [x] src/admin/pages/ProjectDetail.tsx
- [x] src/admin/pages/Projects.tsx
- [x] src/admin/pages/ReceivedInvoices.tsx
- [x] src/admin/pages/Settings.tsx
- [x] src/admin/pages/Trips.tsx
- [x] src/admin/pages/TripsAdmin.tsx
- [x] src/admin/pages/TripsHistory.tsx
- [x] src/admin/pages/UiKit.tsx
- [x] src/admin/pages/Users.tsx
- [x] src/admin/pages/Vehicles.tsx
- [x] src/admin/pages/Warehouse.tsx
- [x] src/admin/pages/WarehouseCategories.tsx
- [x] src/admin/pages/WarehouseInventory.tsx
- [x] src/admin/pages/WarehouseInventoryDetail.tsx
- [x] src/admin/pages/WarehouseInventoryForm.tsx
- [x] src/admin/pages/WarehouseIssueDetail.tsx
- [x] src/admin/pages/WarehouseIssueForm.tsx
- [x] src/admin/pages/WarehouseIssues.tsx
- [x] src/admin/pages/WarehouseItemDetail.tsx
- [x] src/admin/pages/WarehouseItems.tsx
- [x] src/admin/pages/WarehouseLocations.tsx
- [x] src/admin/pages/WarehouseReceiptDetail.tsx
- [x] src/admin/pages/WarehouseReceiptForm.tsx
- [x] src/admin/pages/WarehouseReceipts.tsx
- [x] src/admin/pages/WarehouseReports.tsx
- [x] src/admin/pages/WarehouseReservations.tsx
- [x] src/admin/pages/WarehouseSuppliers.tsx

## src/admin/

- [x] src/admin/theme.test.ts
- [x] src/admin/theme.ts

## src/admin/ui/

- [x] src/admin/ui/Alert.tsx
- [x] src/admin/ui/AppShell.tsx
- [x] src/admin/ui/Button.tsx
- [x] src/admin/ui/Card.tsx
- [x] src/admin/ui/Checkbox.tsx
- [x] src/admin/ui/ConfirmDialog.tsx
- [x] src/admin/ui/DataTable.tsx
- [x] src/admin/ui/DateField.tsx
- [x] src/admin/ui/EmptyState.tsx
- [x] src/admin/ui/Field.tsx
- [x] src/admin/ui/FileUpload.tsx
- [x] src/admin/ui/FilterBar.tsx
- [x] src/admin/ui/LoadingState.tsx
- [x] src/admin/ui/Modal.tsx
- [x] src/admin/ui/MonthField.tsx
- [x] src/admin/ui/MuiProvider.tsx
- [x] src/admin/ui/PageEnter.tsx
- [x] src/admin/ui/PageHeader.tsx
- [x] src/admin/ui/Pagination.tsx
- [x] src/admin/ui/ProgressBar.tsx
- [x] src/admin/ui/RichText.tsx
- [x] src/admin/ui/Select.tsx
- [x] src/admin/ui/SidebarNav.tsx
- [x] src/admin/ui/StatCard.tsx
- [x] src/admin/ui/StatusChip.tsx
- [x] src/admin/ui/Tabs.tsx
- [x] src/admin/ui/TextField.tsx
- [x] src/admin/ui/ThemeToggle.tsx
- [x] src/admin/ui/TimeField.tsx
- [x] src/admin/ui/index.ts
- [x] src/admin/ui/navData.tsx
- [x] src/admin/ui/useDialogScrollLock.ts

## src/admin/utils/

- [x] src/admin/utils/api.ts
- [x] src/admin/utils/attendanceHelpers.ts
- [x] src/admin/utils/dashboardHelpers.ts
- [x] src/admin/utils/formatters.ts

## src/config/

- [x] src/config/database.ts
- [x] src/config/env.ts

## src/context/

- [x] src/context/ThemeContext.tsx

## src/

- [x] src/main.tsx

## src/middleware/

- [x] src/middleware/auth.ts
- [x] src/middleware/security.ts

## src/routes/admin/

- [x] src/routes/admin/ai.ts
- [x] src/routes/admin/attendance.ts
- [x] src/routes/admin/audit-log.ts
- [x] src/routes/admin/auth.ts
- [x] src/routes/admin/bank-accounts.ts
- [x] src/routes/admin/company-settings.ts
- [x] src/routes/admin/customers.ts
- [x] src/routes/admin/dashboard.ts
- [x] src/routes/admin/invoices-pdf.ts
- [x] src/routes/admin/invoices.ts
- [x] src/routes/admin/leave-requests.ts
- [x] src/routes/admin/offers-pdf.ts
- [x] src/routes/admin/orders-pdf.ts
- [x] src/routes/admin/orders.ts
- [x] src/routes/admin/plan.ts
- [x] src/routes/admin/profile.ts
- [x] src/routes/admin/project-files.ts
- [x] src/routes/admin/projects.ts
- [x] src/routes/admin/quotations.ts
- [x] src/routes/admin/received-invoices.ts
- [x] src/routes/admin/roles.ts
- [x] src/routes/admin/scope-templates.ts
- [x] src/routes/admin/sessions.ts
- [x] src/routes/admin/totp.ts
- [x] src/routes/admin/trips.ts
- [x] src/routes/admin/users.ts
- [x] src/routes/admin/vehicles.ts
- [x] src/routes/admin/warehouse.ts

## src/schemas/

- [x] src/schemas/ai.schema.ts
- [x] src/schemas/attendance.schema.ts
- [x] src/schemas/auth.schema.ts
- [x] src/schemas/bank-accounts.schema.ts
- [x] src/schemas/common.ts
- [x] src/schemas/customers.schema.ts
- [x] src/schemas/invoices.schema.ts
- [x] src/schemas/leave-requests.schema.ts
- [x] src/schemas/offers.schema.ts
- [x] src/schemas/orders.schema.ts
- [x] src/schemas/plan.schema.ts
- [x] src/schemas/planCategory.schema.ts
- [x] src/schemas/profile.schema.ts
- [x] src/schemas/projects.schema.ts
- [x] src/schemas/received-invoices.schema.ts
- [x] src/schemas/roles.schema.ts
- [x] src/schemas/scope-templates.schema.ts
- [x] src/schemas/settings.schema.ts
- [x] src/schemas/trips.schema.ts
- [x] src/schemas/users.schema.ts
- [x] src/schemas/vehicles.schema.ts
- [x] src/schemas/warehouse.schema.ts

## src/

- [x] src/server.ts

## src/services/

- [x] src/services/ai.service.ts
- [x] src/services/attendance.service.ts
- [x] src/services/audit.ts
- [x] src/services/auth.ts
- [x] src/services/exchange-rates.ts
- [x] src/services/invoice-alerts.ts
- [x] src/services/invoices.service.ts
- [x] src/services/leave-notification.ts
- [x] src/services/mailer.ts
- [x] src/services/nas-file-manager.ts
- [x] src/services/nas-financials-manager.ts
- [x] src/services/nas-offers-manager.ts
- [x] src/services/numbering.service.ts
- [x] src/services/offers.service.ts
- [x] src/services/orders.service.ts
- [x] src/services/plan.service.ts
- [x] src/services/planCategory.service.ts
- [x] src/services/projects.service.ts
- [x] src/services/system-settings.ts
- [x] src/services/users.service.ts
- [x] src/services/warehouse.service.ts

## src/types/

- [x] src/types/fastify.d.ts
- [x] src/types/index.ts

## src/utils/

- [x] src/utils/czech-holidays.ts
- [x] src/utils/date.ts
- [x] src/utils/encryption.ts
- [x] src/utils/html-to-pdf.ts
- [x] src/utils/pagination.ts
- [x] src/utils/planAuditDescription.ts
- [x] src/utils/response.ts
- [x] src/utils/totp.ts

## src/

- [x] src/vite-env.d.ts

## ./

- [x] tsconfig.app.json
- [x] tsconfig.json
- [x] tsconfig.server.json
- [x] vite.config.ts
- [x] vitest.config.ts
