ThreadCount Community edition

Uniform stock management for healthcare linen rooms: the coordinator app, the phone counter and the staff app, for your own server. Built from 38e16eb on 2026-09-15. Licensed under the Functional Source License (FSL-1.1-ALv2).
This commit is contained in:
ThreadCount
2026-09-16 07:57:54 +10:00
commit 0910bc32c1
457 changed files with 55952 additions and 0 deletions
@@ -0,0 +1,20 @@
-- Billing reminders sent (trial ending, trial ended, read-only), one row each, so the daily timer
-- is idempotent. The kind carries the period end it refers to.
CREATE TABLE "PlanMail" (
"id" TEXT NOT NULL,
"facilityId" TEXT NOT NULL,
"kind" TEXT NOT NULL,
"sentAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "PlanMail_pkey" PRIMARY KEY ("id")
);
CREATE UNIQUE INDEX "PlanMail_facilityId_kind_key" ON "PlanMail"("facilityId", "kind");
ALTER TABLE "PlanMail" ADD CONSTRAINT "PlanMail_facilityId_fkey" FOREIGN KEY ("facilityId") REFERENCES "Facility"("id") ON DELETE CASCADE ON UPDATE CASCADE;
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'ops_ro') THEN
RAISE NOTICE 'ops_ro does not exist — PlanMail grant skipped';
RETURN;
END IF;
GRANT SELECT ON "PlanMail" TO ops_ro;
END $$;