feat(supabase): add draft_last_save to the sheet admin read (M8, sandbox only)

This commit is contained in:
bchanot committed 2026-11-04 11:40:22 +01:00
1 parent 2571978780
commit 2f824a947c
7 files changed
+269 -2

No files matched your search

@@ -95,6 +95,7 @@ const summary = {
const overview = {
...summary,
working_copy_source: null,
draft_last_save: { revision: 3, saved_at: '2026-11-02T11:00:00Z', saved_by: person },
versions: [{
version_id: VERSION, version_number: 1, status: 'published', revision: 1, change_note: null,
created_at: '2026-11-01T09:00:00Z', published_at: '2026-11-01T10:00:00Z', deprecated_at: null,
@@ -172,6 +173,11 @@ describe('sheet admin wrappers: answers', () => {
expect(rpcCalls).toEqual([['get_official_sheet_admin', { sheet_id: SHEET }]])
})
it('accepts a draft nobody saved: draft_last_save is null', async () => {
const { client } = stubClient({ rpc: { data: { ...overview, draft_last_save: null } } })
expect((await getOfficialSheetAdmin(client, SHEET)).draft_last_save).toBeNull()
})
it('parses grants, the account lookup and the species', async () => {
expect(await listCatalogGrants(stubClient({ rpc: { data: [grant] } }).client)).toEqual([grant])
const account = {