57 Commits

Author SHA1 Message Date
Najjar\NajjarV02
a1c647a7b3 fix(dashboard): widen generate-invoice dialog so details sidebar fits
min-w-2xl pinned the dialog to ~672px while the default sm:max-w-md cap left the col-span-3 details sidebar too narrow, clipping the date pickers and customer/vehicle selects. Switch to sm:max-w-5xl so the two-column layout has room; mobile width unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 14:40:56 +04:00
Najjar\NajjarV02
16fd7dd423 feat(shop-timings): day-of-week select and closed toggle in form
Add day_of_week dropdown and is_closed checkbox to the shop timing form.
In/out times become optional and disabled when the day is marked closed;
required otherwise via schema superRefine.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 14:39:55 +04:00
Najjar\NajjarV02
baa716b8ff feat(dashboard): allow both vendor and employee on payment made
Remove the mutual-exclusion validation and update the field descriptions so a payment-made can be linked to a vendor and an employee at the same time. Previously selecting both raised a validation error.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 14:36:34 +04:00
97ad275588 feat(dashboard): add onboarding gate forcing company setup before app use
After login/activation, show a full-screen loader while company settings
resolve, then force the user onto /settings/company and block navigation to
any other route until the company info is filled in. The gate releases once the
company record has a name; fails open on API error so a transient failure can
never lock the user out.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 14:58:37 +04:00
fdce301495 fix(dashboard): resolve tutorial QA notes (clips 2–6)
- settings/company: show success toast on save (2.1)
- inspection templates: add explicit Save button (2.6)
- parts: label price fields with AED currency (3.1)
- service groups: add parts/services picker to packages (3.3)
- vehicles: add insurance (has_insurance + insurance type) field (4.2)
- appointments: add calendar view with list/calendar toggle (5.1)
- job card check-in: require department (5.4)
- job card payments: refresh job card/invoice queries so PAID shows (5.6)
- vendors: add phone + address fields (6.1)
- bill payments: surface real vendor/employee validation errors (6.4)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 11:39:07 +04:00
Najjar\NajjarV02
c71b5a19ed ui(login): remove last-email display under submit button 2026-05-22 13:55:18 +04:00
Najjar\NajjarV02
3e229d0de1 feat(middleware): resolve workspace from Host on tenant subdomain
When a visitor lands on <subdomain>.reparee.com without prior
handoff, edge middleware HMAC-signs the subdomain and calls SaaS
/api/saas/workspaces/by-subdomain/<sub> to resolve workspace_uuid
and api_base_url, sets them as HttpOnly cookies. Direct login
(skipping handoff) now works because /api/proxy/* has workspace
context from the first request.

Skips on:
- workspace_uuid cookie already present
- non-tenant hosts (apex, localhost, www, "tenant" fallback)
- SAAS_SHARED_SECRET env missing (degraded: returns to 412)

Requires SaaS endpoint /api/saas/workspaces/by-subdomain/{sub}
(new WorkspaceBySubdomainController) and SAAS_SHARED_SECRET env
in Coolify (server-side only, not NEXT_PUBLIC_).
2026-05-22 12:37:11 +04:00
Najjar\NajjarV02
a888157d33 fix(api): correct typo in comments regarding workspace API installation 2026-05-22 11:38:21 +04:00
Najjar\NajjarV02
6d6059330a fix(deploy): add curl to runner stage for Coolify healthcheck 2026-05-22 11:22:05 +04:00
Najjar\NajjarV02
cd66daa6b1 fix(deploy): force dev deps in Docker deps stage; commit prod NEXT_PUBLIC_*
Coolify injects NODE_ENV=production at build time, causing
`pnpm install --frozen-lockfile` to skip devDependencies. Next.js
build then fails on missing @tailwindcss/postcss.

Override NODE_ENV=development and pass --prod=false for the install
step only. Builder stage still runs `next build` with
NODE_ENV=production, which is the intended runtime mode.

Also commits apps/dashboard/.env.production with public URLs so
Next.js bakes NEXT_PUBLIC_* into the bundle at build time (Coolify
API rejects the is_build_time flag, so we can't mark them runtime).
2026-05-22 11:16:29 +04:00
Najjar\NajjarV02
2505fccd5f feat: add Dockerfile, .dockerignore, and deployment documentation for Coolify integration 2026-05-21 11:08:48 +04:00
Najjar\NajjarV02
019ea56e6f fix(activate): move handoff handler to /activate/handoff/[token]/route.ts
Next.js disallows cookie writes inside Server Components, so the handoff
exchange had to move to a Route Handler. But a route.ts cannot coexist
with a sibling page.tsx in the same segment, so the handler now lives at
/activate/handoff/[token]/route.ts and the page.tsx at /activate/[token]
becomes a stale-link error page.

Additional fixes:

- Use an explicit relative Location header (Location: /) on the success
  redirect instead of NextResponse.redirect(new URL("/", req.url)). In
  dev, req.url resolves to the canonical host and can differ from the
  host the user came in on (127.0.0.1 vs localhost), causing cookies set
  on the response to drop on cross-host follow.

- Same fix for the error redirect to /activate/error.

- New /activate/error/page.tsx renders the failure UI from the ?reason=
  query string.

- /activate/[token]/route.ts (the original location) is preserved as
  route.ts.disabled so Next does not register it and the prior segment's
  page.tsx can take over the error UI for stale links.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 17:22:25 +04:00
Najjar\NajjarV02
ccb9eacd86 feat: implement workspace session management and enhance API proxy handling 2026-05-20 16:23:19 +04:00
4f0a2f790f feat: add logo field to settings schema and update settings client to handle file uploads
feat: integrate dialog close context in vendor select field and CRUD dialog components

feat: enhance vendor general info to format status using utility function

feat: implement form dialog context for managing dialog close actions

feat: add async select field dialog close context for better form handling

fix: update form mutation hook to close dialog on successful submission

feat: extend document print types to include expense and credit note

feat: add settings update payload type to include logo and other fields

feat: create employee attendance and work history pages with resource management

feat: implement payment made and received detail pages with actions

feat: add quick shortcuts component for easy navigation in the dashboard

feat: create actions for payment made and received with print and delete options

feat: implement dialog close context for better dialog management

feat: add error parsing utility for improved error handling in API responses
2026-05-19 17:56:39 +04:00
2d6e3c5734 feat: add API endpoints for creating inspections from templates and sharing documents 2026-05-18 14:43:11 +04:00
5570527e69 Merge branch 'fix/back-front-validation-alignment' into dev 2026-05-18 13:31:05 +04:00
4bfd8c84a9 feat: add template checkpoint edit dialog and vendor management components
- Implemented TemplateCheckpointEditDialog for creating and editing inspection checkpoints.
- Added VendorActions component for managing vendor actions including edit, activate/deactivate, and delete.
- Created VendorContext for managing vendor state across components.
- Developed VendorGeneralInfo component to display detailed vendor information.
- Introduced AedSymbol and Money components for consistent currency representation.
- Added PromptDialog for user input prompts throughout the application.
- Implemented RelationLink component for unified related-data display in CRUD tables.
- Created InspectionTemplatesClient for API interactions related to inspection templates.
2026-05-18 12:08:42 +04:00
54d11f01b4 feat: enhance import/export functionality with detailed results dialog and improved data handling 2026-05-15 11:34:23 +04:00
fcbba6247d feat: add document sharing functionality across various modules
- Introduced ShareDocumentButton component for sharing documents.
- Added ShareDocumentDialog for email and WhatsApp sharing options.
- Integrated document sharing in estimates, invoices, inspections, job cards, bills, and purchase orders.
- Implemented useDocumentShare hook for handling share logic.
- Created DocumentShareClient for API interactions related to document sharing.
- Updated layouts and actions to include sharing options for relevant entities.
2026-05-14 12:21:01 +04:00
05b55b5721 fix: add staleTime to job card expense, parts, and services queries; update job card general info and payments received components 2026-05-13 17:20:59 +04:00
6b356d2855 fix estimate table and expense items 2026-05-13 15:55:40 +04:00
Najjar\NajjarV02
464402f4d6 Merge fix/back-front-validation-alignment into dev 2026-05-12 17:34:16 +04:00
Najjar\NajjarV02
cc7dc1bd17 fix: align frontend zod schemas with backend validation rules
Tightened frontend zod schemas where backend required fields the frontend marked optional, and matched enum/format constraints.

Schemas:
- vehicle-document: document_type required
- parts: shop_type, category, unit_type, department, sku required
- inspections: customer, vehicle, department, inspection_category, employee, order_number, date, time required
- appointments: service_writer required, cross-field to_time > from_time
- vendor-credits: vendor + vendor_credit_date required
- job-cards: documents[].document_type_id required
- expense-items: category, unit_type, department, sku required
- inventory-adjustments: reference_number, date required
- tasks: task_type, task_section required
- shop-timings: in_time, out_time enforce HH:MM:SS regex
- vendor-credit: subject + vendor + vendor_credit_date required

Settings:
- shop-type: shop_type + note required
- insurance-types: description field added, required
- make-and-models: shop_type required, year 1900..2100
- departments: assignment_type required enum (AssignmentType)
- company: website URL validation, latitude/longitude range, first_day_of_work enum, string max lengths
- configurations: 4 fields enum-typed (was raw strings)

Inline forms:
- job-card service/part/expense-item: relations required (part/service/expense_item/department)
- job-card recommendation: max 255
- vehicles/inline-forms/shop-type: shop_type + note required
- vehicles/inline-forms/body-type: shop_type_id pulled from parent form context, guard on submit
- vehicles/inline-forms/color: code field added, required
- services/inline-forms/department: assignment_type required enum
- tasks/task-section: arrangement required integer
- invoices/invoice-edit: status + discount enum-typed

Auth:
- login: password min 6 (was 8; backend allows 6)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 16:22:26 +04:00
349a458c3c feat: enhance invoice and job card forms with new fields, validation, and print functionality
Co-authored-by: Copilot <copilot@github.com>
2026-05-09 02:51:19 +03:00
25c3125894 fix: update default values in service form and enhance validation for required fields 2026-05-08 16:02:51 +03:00
4b51ffe457 refactor: enhance employee and service forms with new fields and validation
Co-authored-by: Copilot <copilot@github.com>
2026-05-08 15:55:33 +03:00
b0361fcbfb fix build errors 2026-05-08 12:15:40 +03:00
38565298fc update forms
Co-authored-by: Copilot <copilot@github.com>
2026-05-07 21:02:15 +03:00
dd32658500 fix bugs
Co-authored-by: Copilot <copilot@github.com>
2026-05-07 15:04:05 +03:00
c7eb23dd3f fix bugs
Co-authored-by: Copilot <copilot@github.com>
2026-05-07 13:32:35 +03:00
4faafe6667 hide company for non company users
Co-authored-by: Copilot <copilot@github.com>
2026-05-07 11:34:07 +03:00
1fda8d8d7b fixes
Co-authored-by: Copilot <copilot@github.com>
2026-05-07 11:30:23 +03:00
cdd1cbc31a fix validation issues 2026-05-07 10:35:57 +03:00
c5d406792f add ignoreDeprecations option to tsconfig files 2026-05-01 11:23:23 +03:00
97364f4734 fix bugs phase 2 (excel ) , download sample feature
Co-authored-by: Copilot <copilot@github.com>
2026-05-01 11:04:38 +03:00
e1ef6fa2ea fix many bugs
Co-authored-by: Copilot <copilot@github.com>
2026-04-30 19:03:31 +03:00
0c43c8edd2 add customer_id prop to RhfVehicleSelectField and update vehicle query
Co-authored-by: Copilot <copilot@github.com>
2026-04-27 11:32:35 +03:00
615a0fda59 fix build 2026-04-24 12:28:30 +03:00
65964605e1 updates
Co-authored-by: Copilot <copilot@github.com>
2026-04-24 12:20:10 +03:00
564e9e510f fix build 2026-04-23 15:15:21 +03:00
c0f78c6e18 updates 2026-04-23 14:38:41 +03:00
f17dd1486c fix invoice informations 2026-04-16 11:42:11 +03:00
973149e974 fix build 2026-04-15 04:59:05 +03:00
020ffccfd6 finish bills , po , jobcards relational fields creation 2026-04-13 18:48:15 +03:00
3eb471a604 fix build errors 2026-04-09 15:23:36 +03:00
29cc9c6f4e updates 2026-04-09 15:17:07 +03:00
c5f6d2f596 make and models 2026-04-09 11:06:56 +03:00
17d8e1c90d fix build error 2026-04-08 15:04:01 +03:00
bb02b77be2 filters , order inspections , inventory items , credit notes 2026-04-08 14:38:16 +03:00
90c84a0bda update 2026-04-07 15:05:03 +03:00