Commit Graph
4 Commits
Author SHA1 Message Date
petriandClaude Opus 5.5 b4f2f1cfaa Add the task calendar, holidays, workflow templates and customer removal
Task calendar (/jobs/calendar) replaces per-unit task Kanban columns
(K34): a two-week Gantt of tasks per person. Bars move, resize and
change person by dragging or through a keyboard dialog. Each task's
estimate is booked evenly over working days into task_bookings, and
what exceeds the daily maximum (jobs.daily_capacity_hours, 8 h) moves
to the next working day. Tasks get planned_from/planned_to on the form.

Holidays (/settings/holidays): Finnish public holidays calculated per
year, which the admin can take out of use, plus company days off.

Also includes the earlier uncommitted work: workflow templates with
adding tasks from a template, and removing customers no module refers to.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 18:13:11 +02:00
petriandClaude Opus 5.5 e0b8f4970f Add customer contacts, billing units and consumer personal identity codes
Customer page and contacts/billing units (phase 1, item 2):
- New customer page (customers.show) with details, contacts and billing
  units; add and edit on their own pages, delete after confirmation.
  Creating or editing a customer now leads to this page.
- Contacts: name, title, phone, email, note. Billing units: name,
  billing address, e-invoice address (12-35 letters/digits), operator
  (required with an e-invoice address) and reference.
- Use cases check that the row belongs to the customer, so ids in the
  URL can't reach another customer's rows.
- EmailAddress moves from Users to Shared so both modules can use it.
- <x-confirm-dialog> (native <dialog>) replaces <x-modal>, whose title,
  close button and focus handling are not accessible; solid red buttons
  use red-700 via published NormalButtonColors for 4.5:1 contrast.

Personal identity code (henkilötunnus) for consumers who are invoiced:
- Validated (date, century sign, check character), stored encrypted
  with an HMAC blind index for duplicate checks; never in
  CustomerSummary, search, logs or Livewire state.
- Admins and management see it in full and may remove it; others enter
  it and see only the masked form. The form never shows the stored code.

Spec, architecture doc and CLAUDE.md updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 18:11:06 +02:00
petriandClaude Opus 5.5 8c7cb9e3b4 Add login, password reset and user management (Users module)
New Users module with the four layers:
- Domain: Role enum, UserAccount entity (intern needs end date and
  supervisor, login allowed until the end of the last day), email and
  name value objects, SupervisorRule, last-admin protection.
- Application: CreateUserAccount (emails a set-password link),
  UpdateUserAccount, SendPasswordSetupLink, CheckLoginAllowed, query
  contract and Clock (business time zone Europe/Helsinki).
- Infrastructure: users table gets role, is_active, employment_ends_on
  and supervisor_id; Eloquent repository and queries; Password broker
  link sender with a Finnish email; Gate users.manage.
- Presentation: Livewire login (rate limited), forgot and reset
  password pages, logout, EnsureAccountIsUsable middleware that ends
  sessions of deactivated users, admin-only user list and form, and
  users:create-admin command.

Also:
- Layout gets a labelled main menu, the signed-in user and logout.
- Remove the local /dev/login; guests are redirected to /login.
- Customers: customers.use ability (no subcontractors), authorization
  in mount and save, locked customerId, 404 for a missing customer,
  empty-state check uses the total count.
- Architecture test lets module providers register their own
  Presentation classes; docs and CLAUDE.md updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-22 11:03:00 +02:00
petriandClaude Opus 5.5 a3fb09bbf6 Add modular layered architecture with Customers module
Introduce a modular monolith under app/Modules with Domain, Application,
Infrastructure and Presentation layers.

- Shared module: DomainException base, TransactionManager and an
  EventDispatcher that publishes events after commit.
- Customers module: Customer entity, CustomerName and BusinessId
  (Y-tunnus checksum) value objects, RegisterCustomer/UpdateCustomer
  use cases, CustomerQueries read contract, Eloquent repository, and
  Livewire list and form pages with Finnish translations.
- Pest arch tests enforce layer and module dependency rules for every
  module; Larastan (level 6) added as a dev dependency.
- Raise Flux error text contrast to meet WCAG 2.2 AA.
- Document the architecture in docs/architecture.md and CLAUDE.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-22 10:23:33 +02:00