export function toDatabase(entry) {
    return {
        id: entry.id,
        actor_id: entry.actorId,
        action: entry.action,
        target_id: entry.targetId ?? null,
        target_type: entry.targetType ?? null,
        metadata: entry.metadata ?? null,
        ip_address: entry.ipAddress ?? null,
        created_at: entry.createdAt instanceof Date ? entry.createdAt.getTime() : entry.createdAt,
        updated_at: entry.updatedAt instanceof Date ? entry.updatedAt.getTime() : entry.updatedAt,
    };
}
export function fromDatabase(row) {
    return {
        id: row.id,
        actorId: row.actor_id,
        action: row.action,
        targetId: row.target_id ?? undefined,
        targetType: row.target_type ?? undefined,
        metadata: row.metadata ?? undefined,
        ipAddress: row.ip_address ?? undefined,
        createdAt: new Date(row.created_at),
        updatedAt: new Date(row.updated_at),
    };
}
