from dataclasses import dataclass from fansifter_common.auth.account import Account @dataclass class AuthRequest: identity_id: str @dataclass class AuthAccountRequest(AuthRequest): vendor_id: int subaccount_id: int @property def account(self) -> Account: return Account( vendor_id=self.vendor_id, subaccount_id=self.subaccount_id, ) @dataclass class AuthAccountFilterRequest(AuthRequest): vendor_id: int | None = None subaccount_id: int | None = None @property def account(self) -> Account | None: if self.vendor_id: return Account( vendor_id=self.vendor_id, subaccount_id=self.subaccount_id or 0, ) return None