Download Latest Version OpenEstate v0.9.1 -- Cheque Queue Validation Fix source code.zip (2.5 MB)
Home / v0.9.0
Name Modified Size InfoDownloads / Week
Parent folder
OpenEstate v0.9.0 -- Delayed-payment Interest source code.tar.gz 2026-11-03 1.9 MB
OpenEstate v0.9.0 -- Delayed-payment Interest source code.zip 2026-11-03 2.5 MB
README.md 2026-11-03 12.8 kB
Totals: 3 Items   4.5 MB 0

The v0.9.0 tag identifies the released commit. The code came in through PR [#78], merged as 713067cd1423a8602fc12ce27c4d45f164d3041e; the release commit after it only finalizes these notes. This release is v0.9 item 1, delayed-payment interest, plus a backup-security fix. It is not the whole v0.9 "pilot readiness" plan: the other v0.9 items (see docs/todo.md) are not in it.

Delayed-payment interest can now be switched on

Until now, interest rules could be set up under Masters, but nothing could attach one to a booking, so no delay interest was ever charged. Now:

  • When booking, the last step of the booking wizard asks for the delay interest: choose a rule, or "No delay interest". Nothing is preselected, and the booking can't be confirmed until one is chosen. (Staff who can't manage interest book as before; the wizard tells them Accounts sets it.)
  • Later, the booking's installment schedule has a "Delay interest" panel: attach a rule, change it, or remove it, and "Accrue interest now".
  • Interest runs only from the day the rule is attached. Attaching a rule to an older booking charges nothing for the time before that day.
  • Changing or removing a rule takes effect from that day. Interest up to that day is charged under the old rule first; interest already charged is never recalculated.
  • Only simple-interest rules can be attached in this version. A rule's compounding setting isn't applied yet, so attaching a compound rule is refused with a message.
  • A rule attached to an active booking keeps its rate. Editing its rate type or rate is refused with a message (create a new rule and change the bookings to it), and it can't be deleted while a booking uses it. Renaming it, or marking it inactive, still works; an inactive rule stays on the bookings that have it but can't be attached to new ones.
  • A transfer carries the rule to the new booking, with interest running from the transfer date.
  • New permission: "postsales.interest.manage" (attach, change or remove a rule). Accounts and Company Admin get it. "Accrue interest now" works with either this permission or the existing waive permission.

Before you upgrade

  • No rule is attached to any existing booking. After the upgrade, attach rules booking by booking from each installment schedule; interest runs from the day you attach. The upgrade output says how many active bookings have no rule ("Delay interest: N active booking(s) have no interest rule").
  • The new permission reaches Accounts and Company Admin automatically only on an install that has been on v0.8.4 or later (v0.8.4 or v0.8.5), which recorded each role's default permissions. super_admin always gets it. No other role gets it, and a role an admin has customised keeps its customisations: a permission you removed is not added back.
  • Upgrading straight from v0.8.3 or older, no role is widened. The upgrade records each role's defaults and lists the permission under "System roles that differ from their default permissions" for Accounts and Company Admin. To grant it by hand, for each role that should manage interest rules:
  • Sign in as a Super Admin and open Admin → Roles. (A Company Admin can't: nobody can grant a permission they don't hold, and on this upgrade path Company Admin doesn't hold it until it is granted.)
  • Open the role (for example Accounts), tick interest.manage under postsales, and save.
  • The role's users get the permission on their next request; nobody needs to sign in again.

The grant is recorded in the audit log, and later upgrades never remove it. To check: a user with the role sees Delay interest on an installment schedule and in the booking wizard.

  • Interest is charged as a plain ledger line, with no GST or TDS. How delay interest should be taxed, its rate, grace days and compounding are questions for your chartered accountant; set your rules accordingly. Nothing in this release is tax or legal advice.
  • Secure your existing backups (see "Backups were readable by every local account" below). You can do it before or after the upgrade.

Fixed

  • Two interest runs for the same booking at the same moment (the daily job and the "accrue" action, for example) could charge the same period twice.
  • The "accrue" action could charge interest on a cancelled booking.
  • Deleting an interest rule silently switched off interest on every booking that used it; it is now refused.
  • Backups were readable by every local account. Earlier versions wrote the database dump and the uploads archive world-readable, inside world-readable folders. New backups are root-only, and restore still works with them. Backups you already have stay exposed until you secure them once (it changes permissions only, never the files' contents):

bash sudo find -P /var/backups/openestate -mindepth 1 -maxdepth 2 \( -type d -exec chmod 700 {} + \) -o \( -type f \( -name db.sql -o -name uploads.tar.gz -o -name openestate.env \) -exec chmod 600 {} + \) sudo chmod 700 /var/backups/openestate

If you back up somewhere else with --output, run it on that folder instead. The upgrade's own backup is made by the new script, so it is private already. Any copies of older backups you made elsewhere keep their old permissions. Restore old and new bundles with this release's restore-native.sh; the old restore script can't load a root-only dump.

Upgrading

From the server's source folder, with the release tag:

:::bash
cd /opt/openestate-src/deploy/native && sudo ./upgrade-native.sh --ref v0.9.0

Use the tag or a full commit SHA, never a branch name. Keep the automatic pre-upgrade backup on (don't pass --no-backup). The upgrade:

  1. checks out the release and takes the backup (with the new, private backup script);
  2. builds the release, then applies two migrations (20261101000000_booking_interest_rule, 20261101000100_validate_booking_interest_rule_fk) while the previous version keeps serving;
  3. syncs permissions, prints the delay-interest report, switches over and waits for the health check.

Afterwards, curl -s http://127.0.0.1:3000/api/v1/health reports "version":"0.9.0".

If the upgrade stops at a migration

The first v0.9 migration changes the bookings table, so it needs a moment with nobody else using that table. On a busy install it can time out waiting. If the upgrade stops during the database migration, nothing from that migration was applied and the previous version keeps running. Prisma records the migration as failed, and the next attempt stops with "P3009 ... found failed migrations" until it is marked rolled back.

  1. Look first. List the migrations recorded as failed:

bash sudo -u postgres psql -d openestate -c "SELECT migration_name, started_at FROM _prisma_migrations WHERE finished_at IS NULL AND rolled_back_at IS NULL"

  1. If the only row is a v0.9 migration, mark exactly that one rolled back. For the first v0.9 migration (the one that can time out on a busy bookings table):

bash sudo -u postgres psql -d openestate -c "UPDATE _prisma_migrations SET rolled_back_at = now() WHERE migration_name = '20261101000000_booking_interest_rule' AND finished_at IS NULL AND rolled_back_at IS NULL"

For the second one, use the same command with 20261101000100_validate_booking_interest_rule_fk. The command should report UPDATE 1; UPDATE 0 means the name didn't match a failed row, so check step 1 again.

  1. If any other migration is listed, stop and don't mark anything: that is not a failure this release explains. Ask for help with the output of step 1.
  2. Run the upgrade again, preferably at a quieter time.

Your v0.8.5 upgrade script prints a shorter command when this happens; it marks every failed migration rolled back. Prefer the steps above, which only touch the migration you inspected.

The database is called openestate on every install made with install-native.sh. If your database runs on another server (you upgrade with --db-host), run the commands there, or add -h <host> -U <superuser> to psql instead of sudo -u postgres.

Rolling back

  • If the API fails its health check after the switch, the upgrade script puts the previous release back on its own and restarts it. The database stays on the v0.9 schema: migrations are never undone.
  • The v0.9 schema change is additive (one nullable column, and the interest rule link now refuses a delete instead of clearing it). Going back to v0.8.5 code on that schema has not been tested; if you have to, don't delete interest rules until you are on v0.9 again.
  • A full return to v0.8.5 means restoring the pre-upgrade backup the upgrade took (/var/backups/openestate/<timestamp>) with sudo ./restore-native.sh --force <bundle> from the v0.9 source folder, which replaces the database, or reverting a VM snapshot taken before the upgrade. The upgrade script refuses to install the older version over the newer database.

Known limitations

  • Only simple interest can be attached; compounding waits for your chartered accountant's guidance.
  • Bookings get a rule one at a time; there is no bulk attach.
  • A booking created by someone without postsales.interest.manage has no rule until Accounts attaches one.
  • The new launcher check in the upgrade build applies from the next upgrade onwards. An upgrade from v0.8.5 builds with v0.8.5's upgrade code, so its output has no "Deployed launchers verified" line.
  • Existing issue, not new in v0.9: asking the cheque queue for an unknown status (GET /api/v1/receipts/cheque-queue?status=<not a real status>) returns HTTP 500 instead of an error message. The screens only send valid statuses. Nothing is changed or exposed; a fix is planned.

How it was checked

  • Automated: GitHub Actions passed all 10 jobs on the rehearsed commit 349dcc3 (run 41664855406), on the final PR [#78] head f758a50 (run 41674757551, the first run of the migration-specific recovery command below) and on the merge commit 713067c on master (run 41676897359). The jobs: lint, typecheck, unit tests and build; integration tests; Playwright end to end; native install; native upgrade; and upgrades from earlier releases (clean from v0.8.5; a planted orphan row and a forced lock timeout for the v0.8.4 foreign keys from v0.8.3; the same two for the v0.9 interest-rule key from v0.8.5). The lock-timeout runs check that nothing is half-applied, that the next attempt stops with P3009, that the recovery command in these notes clears it, and that the retry succeeds.
  • Backup fix: a new test (32 checks, and two deliberate breakages that it must catch) runs in CI, and a full backup and restore against a real PostgreSQL 16 in a throwaway container passed 21 checks (private files, restored rows and uploads identical, failure paths safe).
  • Upgrade rehearsal on a real install (Ubuntu 24.04, PostgreSQL 16.15), from a verified v0.8.5 snapshot, with the installed v0.8.5 script and the full commit SHA 349dcc3770cb4f156a0ba441108cada5566749cc (everything committed after it changes documentation only):
  • existing backups secured: every folder 700, every file 600, contents unchanged, no access for other accounts;
  • 42 → 44 migrations, none failed, all 283 foreign keys validated;
  • every booking, ledger, receipt, allocation, installment and accrual record identical before and after (content checksums, not only counts);
  • the permission reached Accounts, Company Admin and Super Admin only;
  • the upgrade's own backup was private; health 0.9.0; no API errors since the switch; nginx valid; the deployed launchers run.
  • In a browser on that install, with test data: attaching a rule (effective from that day, nothing charged for earlier days), changing and removing it, "Accrue interest now", five simultaneous accruals (no errors), a compound rule refused, deleting an attached rule refused, a role without the permission refused, sign-out, and the customer and broker portals each seeing only their own data. Existing financial records were again identical afterwards.
  • Not shown on that install: a non-zero interest charge and the double-charge guard on a real amount (nothing there has been overdue since a rule was attached; the automated tests cover both with a fixed clock), and access across companies (the install has one company; the automated tests cover it). Restoring a backup or reverting a snapshot was not tried on it.
Source: README.md, updated 2026-11-03