from anydi import singleton from fansifter_common.auth.types import JointVentureParticipant from dmp.artists.cache import ArtistCache, cached_artist_data from dmp.artists.repositories import ArtistJointVentureRepository @singleton class ArtistJointVentureService: def __init__( self, artist_cache: ArtistCache, artist_joint_venture_repository: ArtistJointVentureRepository, ) -> None: self.artist_cache = artist_cache self.artist_joint_venture_repository = artist_joint_venture_repository @cached_artist_data("artist-joint-venture") def find_by_global_participant_id( self, global_participant_id: str ) -> list[JointVentureParticipant]: return self.artist_joint_venture_repository.find_by_global_participant_id( global_participant_id=global_participant_id )