import './assert_dev_env.js';
/** Create a test `Account` with sensible defaults. */
export const create_test_account = (overrides) => ({
    id: 'acct-test',
    username: 'test_user',
    email: null,
    email_verified: false,
    password_hash: 'hash',
    created_at: '2024-01-01T00:00:00Z',
    created_by: null,
    updated_at: '2024-01-01T00:00:00Z',
    updated_by: null,
    deleted_at: null,
    deleted_by: null,
    ...overrides,
});
/** Create a test `Actor` with sensible defaults. */
export const create_test_actor = (overrides) => ({
    id: 'actor-test',
    account_id: 'acct-test',
    name: 'test_user',
    created_at: '2024-01-01T00:00:00Z',
    updated_at: null,
    updated_by: null,
    deleted_at: null,
    deleted_by: null,
    ...overrides,
});
/** Create a test `RoleGrant` with sensible defaults. */
export const create_test_role_grant = (overrides) => {
    const base = {
        id: 'role-grant-test',
        actor_id: 'actor-test',
        role: 'admin',
        scope_kind: null,
        scope_id: null,
        created_at: '2024-01-01T00:00:00Z',
        expires_at: null,
        revoked_at: null,
        revoked_by: null,
        revoked_reason: null,
        granted_by: null,
        source_offer_id: null,
    };
    return overrides ? { ...base, ...overrides } : base;
};
/** Create a test `RequestContext` with role_grants from partial overrides. */
export const create_test_context = (role_grants = [{}]) => ({
    account: create_test_account(),
    actor: create_test_actor(),
    role_grants: role_grants.map((p) => create_test_role_grant(p)),
});
/** Create a test `AuditLogEvent` with sensible defaults. */
export const create_test_audit_event = (overrides) => ({
    id: 'evt-test',
    seq: 1,
    event_type: 'login',
    outcome: 'success',
    actor_id: 'actor-test',
    account_id: 'acct-test',
    target_account_id: null,
    target_actor_id: null,
    ip: '127.0.0.1',
    created_at: '2024-01-01T00:00:00Z',
    metadata: null,
    ...overrides,
});
