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 440e645 on 2026-09-13. Licensed under the Functional Source License (FSL-1.1-ALv2).
This commit is contained in:
ThreadCount
2026-09-13 12:12:58 +10:00
commit cbf533d90b
275 changed files with 43340 additions and 0 deletions
@@ -0,0 +1,22 @@
-- A garment can be for several staff groups.
--
-- A catalogue item carried one group name, or "All", so a scrub top worn by four nursing groups had
-- to be marked for everybody or entered four times. It now carries a list, and an EMPTY list means
-- every group — what "All" meant.
--
-- Every garment keeps exactly the group it has: "All" or blank becomes the empty list, any other
-- name a list of that one name. Only then does the old column go.
ALTER TABLE "CatalogItem" ADD COLUMN "groups" TEXT[] DEFAULT ARRAY[]::TEXT[];
UPDATE "CatalogItem"
SET "groups" = CASE
WHEN lower(btrim("group")) IN ('', 'all') THEN ARRAY[]::TEXT[]
ELSE ARRAY[btrim("group")]
END;
ALTER TABLE "CatalogItem" DROP COLUMN "group";
-- A garment issued outside the person's own staff group on the coordinator's override. Its own flag
-- rather than "override", which is the six-set ceiling's, so the record tells the two apart. Every
-- existing issue predates the rule and is not one.
ALTER TABLE "Issue" ADD COLUMN "offGroup" BOOLEAN NOT NULL DEFAULT false;