سامانه صدور فاکتور و حسابداری
test: align source autopost fixture with strict header contract
davoodmehraban89 committed
Nov 17, 2026 at 23:34 UTC
ed7354864679dad256a74890aa9963adf92242fe
1 file changed
+2
-2
supabase/tests/wp1_phase1a_stage1_sql_behavior.sql
+2
-2
@@ -176,13 +176,13 @@ END $test$;
176
SELECT set_config('request.jwt.claim.sub','cccc3333-3333-4333-8333-333333333333',true);
177
DO $test$
178
DECLARE org_a uuid:=current_setting('finora_test.org_a')::uuid;
179
- header jsonb:='{"companyId":"COMP_STAGE_1","fiscalYearId":"FY_STAGE_1","date":"1405/07/24","sourceType":"sale","sourceId":"SOURCE_C_1"}'::jsonb;
179
+ header jsonb:='{"companyId":"COMP_STAGE_1","fiscalYearId":"FY_STAGE_1","date":"1405/07/24","voucherType":"sale","sourceType":"sale","sourceId":"SOURCE_C_1","sourceVersion":"1"}'::jsonb;
180
lines jsonb:='[{"accountId":"ACC_STAGE_1","debit":100,"credit":0},{"accountId":"ACC_STAGE_2","debit":0,"credit":100}]'::jsonb;
181
r jsonb;
182
BEGIN
183
BEGIN
184
PERFORM public.finora_journal_create_draft(org_a,'C_MANUAL_DENY',
185
- header-'sourceType'-'sourceId',lines);
185
+ header-'sourceType'-'sourceId'-'voucherType'-'sourceVersion',lines);
186
RAISE EXCEPTION 'FINORA_STAGE1_C_ACCOUNTING_CREATE_ALLOWED';
187
EXCEPTION WHEN insufficient_privilege THEN NULL;END;
188
-- Negative tests must fail BEFORE creating an orphan draft or audit entry.