feat(domain): equine legacy importer (packages/anatomy) + generated official equine sheet seed as draft

This commit is contained in:
bchanot committed 2026-10-09 00:38:48 +02:00
1 parent f4682cdba5
commit 52bfc11553
43 files changed
+18466 -33

No files matched your search

+8 -4
View File
@@ -91,10 +91,14 @@ select throws_ok(
$$ insert into storage.objects (bucket_id, name) values ('anatomical-sheet-assets', 'x.svg') $$,
'42501', null, 'authenticated cannot upload into the bucket'
);
delete from storage.objects where bucket_id = 'anatomical-sheet-assets';
reset role;
select is((select count(*) from storage.objects where bucket_id = 'anatomical-sheet-assets'), 4::bigint, 'authenticated DELETE touches no bucket object');
set local role authenticated;
-- The real image also carries storage.protect_delete (statement trigger), so a
-- direct DELETE is asserted through the policy census, not by running it.
select is(
(select count(*) from pg_policies where schemaname = 'storage' and tablename = 'objects'
and cmd in ('INSERT', 'UPDATE', 'DELETE')
and (coalesce(qual, '') like '%anatomical-sheet-assets%' or coalesce(with_check, '') like '%anatomical-sheet-assets%')),
0::bigint, 'no API role has an insert/update/delete policy on the bucket objects'
);
-- 5. Archived sheet hides objects from others; anon sees nothing
select set_config('request.jwt.claims', '{"sub":"30000000-0000-0000-0000-00000000000a","role":"authenticated"}', true);