Align the app with rails_rules: REST, per-element Turbo forms, receipts PDF #1

Merged
whysthatso merged 5 commits from development into main 2026-10-08 09:52:34 +00:00
Owner

Brings main up to date with the rails_rules refactor merged into development.

What changes

  • Nested attributes removed. rondo_form and every accepts_nested_attributes_for are gone. Invoice elements have their own Invoices::ElementsController answering with Turbo Streams. Creating an invoice lands on its edit page, where elements are added, edited and removed one form at a time. Totals are written when an element is saved.
  • Invoice PDF on receipts 3.x. The Prawn generator raised on every call because prawn was no longer bundled. Invoice::Pdf now builds the PDF with the receipts gem, in the invoice's language, on A4.
  • REST-only routes. Sending an invoice is POST /invoices/:id/delivery, a reminder is POST /invoices/:id/reminder. The bank statement import is bank_statements#new/create plus statement_entries#create.
  • Tailwind 4 integration fixed. The CLI builds the CSS, the Tailwind source is excluded from propshaft, and the layout links one stylesheet.
  • Baseline defects fixed. Thirteen defects are fixed, among them flashes that never displayed, redirects to missing show actions, a statement review that could never register an invoice payment, and a locale leaking between requests. The full list is in documentation/history/01-rails-rules-refactor.md.
  • Tooling. The Gemfile is cleaned up and aws-sdk-s3 is bumped for GHSA-2xgq-q749-89fq. mise.toml declares the required secrets. Development mail goes to letter_opener_web at /letter_opener.

Deploy notes

  • One data migration, NormalizeClientVatIdCountryCodes, maps clients.vat_id_country from country names to ISO codes. It runs on db:prepare at container start.
  • The Dockerfile has drifted from the development toolchain (Ruby 3.3 image, lockfile resolved under Ruby 4.0). Read documentation/issues/dockerfile-toolchain-drift-2026-10-07.md before tagging a release.

Verification

Check Result
bin/rails test 147 tests, 602 assertions, 0 failures
bin/rails test:system 1 test, 0 failures
standardrb, herb, brakeman, bundle-audit, i18n-tasks clean

Documentation for this milestone is under documentation/ (plan, history, features, user manual, issues).

🤖 Generated with Claude Code

Brings `main` up to date with the rails_rules refactor merged into `development`. ## What changes - **Nested attributes removed.** `rondo_form` and every `accepts_nested_attributes_for` are gone. Invoice elements have their own `Invoices::ElementsController` answering with Turbo Streams. Creating an invoice lands on its edit page, where elements are added, edited and removed one form at a time. Totals are written when an element is saved. - **Invoice PDF on receipts 3.x.** The Prawn generator raised on every call because `prawn` was no longer bundled. `Invoice::Pdf` now builds the PDF with the receipts gem, in the invoice's language, on A4. - **REST-only routes.** Sending an invoice is `POST /invoices/:id/delivery`, a reminder is `POST /invoices/:id/reminder`. The bank statement import is `bank_statements#new/create` plus `statement_entries#create`. - **Tailwind 4 integration fixed.** The CLI builds the CSS, the Tailwind source is excluded from propshaft, and the layout links one stylesheet. - **Baseline defects fixed.** Thirteen defects are fixed, among them flashes that never displayed, redirects to missing `show` actions, a statement review that could never register an invoice payment, and a locale leaking between requests. The full list is in `documentation/history/01-rails-rules-refactor.md`. - **Tooling.** The Gemfile is cleaned up and `aws-sdk-s3` is bumped for GHSA-2xgq-q749-89fq. `mise.toml` declares the required secrets. Development mail goes to letter_opener_web at `/letter_opener`. ## Deploy notes - One data migration, `NormalizeClientVatIdCountryCodes`, maps `clients.vat_id_country` from country names to ISO codes. It runs on `db:prepare` at container start. - The Dockerfile has drifted from the development toolchain (Ruby 3.3 image, lockfile resolved under Ruby 4.0). Read `documentation/issues/dockerfile-toolchain-drift-2026-10-07.md` before tagging a release. ## Verification | Check | Result | | --- | --- | | `bin/rails test` | 147 tests, 602 assertions, 0 failures | | `bin/rails test:system` | 1 test, 0 failures | | standardrb, herb, brakeman, bundle-audit, i18n-tasks | clean | Documentation for this milestone is under `documentation/` (plan, history, features, user manual, issues). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Records the working tree as handed over: Rails 8.1, Tailwind 4 via
@tailwindcss/cli, receipts gem replacing prawn, playwright test driver,
annotaterb and herb configuration. No application code changes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Fixtures for every table with a non-neutral tax rate, model tests for
totals, netto derivation, statement parsing and registration, integration
tests for every controller action and both mailers, a PDF test, a
Playwright system test for the invoice element flow, the i18n-tasks
template and a documentation integrity test. Written before the
implementation; the loadable subset failed on the baseline for every
behaviour the plan introduces.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Remove rondo_form and every accepts_nested_attributes_for; invoice
  elements get Invoices::ElementsController with Turbo Streams keyed on
  dom_id, totals written at save time, inline project creation through
  Project.named with autosave.
- Replace the Prawn generator (prawn was no longer bundled) with
  Invoice::Pdf on receipts 3.x, A4, localized through the invoice language,
  logo converted to PNG once; rails-i18n for German number formats.
- REST-only routes: POST /invoices/:id/delivery and /reminder,
  bank_statements new/create plus statement_entries create with strong
  params; add_flash_types success/error; restrict_with_error on every
  has_many behind a foreign key; i18n for all view strings.
- Fix baseline defects: missing set_account, redirects to absent show
  actions, flashes that never displayed, statement review that could not
  validate invoice entries, locale leaking between requests, double
  stylesheet link, propshaft shadowing of the Tailwind source, mail
  template bugs; VAT-id country stored as ISO code with a data migration.
- Tooling: Gemfile cleanup (rondo_form, httparty, annotate, sqlite3 out;
  csv, rails-i18n in; receipts ~> 3; aws-sdk-s3 ~> 1.208 for a CVE),
  mise.toml with required secret placeholders, i18n-tasks config, herb
  0.11, standardrb clean, letter_opener_web in development.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Plan archive, history entry, feature and user-manual pages, issues for
the out-of-scope findings, references tier, project CLAUDE.md importing
the shared rules, and .claude/project_rules.md with project-specific
facts and accepted exceptions.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Merge REFACTOR-rails-rules-2026-10-07 into development
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
b9740a5a6a
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
whysthatso deleted branch development 2026-10-08 09:52:34 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
whyservices/accounting!1
No description provided.