from typing import List, Dict, Any
from .auth_manager import AuthManager

class AttachmentManager:
    def __init__(self, auth: AuthManager):
        self.auth = auth

    def get_ticket_attachments(self, ticket_id: int) -> List[Dict[str, Any]]:
        params = {
            "model": "ir.attachment",
            "method": "search_read",
            "args": [[[ "res_id", "=", ticket_id], ["res_model", "=", "project.task"]]],
            "kwargs": {"fields": ["id", "name", "datas"]}
        }
        return self.auth._rpc_call("/web/dataset/call_kw", params)
