feat: expand companion platform, device controls, and memoir workflows
ci / verify (push) Canceled after 0s

Add customer and operator login, BLE provisioning, device fleet controls, call memory, memoir generation, and refreshed family and maintenance portals. Include API contracts, migrations, firmware sources, tests, assets, and deployment documentation.
This commit is contained in:
Codex Local
2026-10-08 10:06:44 +08:00
parent 98fb2965d0
commit bf1233d5df
861 changed files with 94614 additions and 3209 deletions
+22
View File
@@ -0,0 +1,22 @@
BEGIN;
CREATE TABLE device_ble_binding (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
token_hash char(64) NOT NULL UNIQUE,
device_id uuid NOT NULL,
tenant_id uuid NOT NULL,
user_id uuid NOT NULL REFERENCES user_account(id),
household_id uuid NOT NULL,
subject_id uuid NOT NULL,
expected_generation bigint NOT NULL,
status text NOT NULL DEFAULT 'PENDING' CHECK(status IN ('PENDING','COMMITTED','CANCELLED')),
expires_at timestamptz NOT NULL,
binding_id uuid REFERENCES device_binding(id),
created_at timestamptz NOT NULL DEFAULT now(),
completed_at timestamptz,
FOREIGN KEY(device_id,tenant_id) REFERENCES device(id,tenant_id),
FOREIGN KEY(household_id,tenant_id) REFERENCES household(id,tenant_id),
FOREIGN KEY(subject_id,tenant_id) REFERENCES subject_profile(id,tenant_id)
);
CREATE INDEX device_ble_binding_device ON device_ble_binding(device_id,created_at DESC);
CREATE UNIQUE INDEX device_ble_binding_one_pending_actor ON device_ble_binding(device_id,user_id) WHERE status='PENDING';
COMMIT;