Annotation: unit_tests.check_party_null_account_id

CREATE OR REPLACE FUNCTION unit_tests.check_party_null_account_id()
RETURNS test_result

Information: unit_tests.check_party_null_account_id

Schema unit_tests
Function Name check_party_null_account_id
Arguments
Owner postgres
Result Type test_result
Description

Implementation: unit_tests.check_party_null_account_id

CREATE OR REPLACE FUNCTION unit_tests.check_party_null_account_id()
 RETURNS test_result
 LANGUAGE plpgsql
AS $function$
    DECLARE message test_result;
BEGIN
    IF EXISTS
    (
        SELECT party_code FROM core.parties
        WHERE core.parties.account_id IS NULL
        LIMIT 1
    ) THEN
        SELECT assert.fail('Some party accounts don''t have mapped GL heads.') INTO message;
        RETURN message;
    END IF;

    SELECT assert.ok('End of test.') INTO message;  
    RETURN message;
END
$function$