""" Logic for retrieving LabelParticipant information. """ import uuid from account.models import application as app_model, label_participant, types def get_lp_applications(lp_uuid: uuid.UUID) -> list[types.TenantApplication]: """ Get applications available for this label participant. Only Insights is supported for label participants right now, so it's hardcoded, unless the brand is KNR (since they only do royalties and Insights is for distribution) """ brand_name = label_participant.get_brand_by_lp_uuid(lp_uuid) if brand_name == 'knr' or not brand_name: return [] return [ { 'application_id': app_model.INSIGHTS_APP, 'roles': [app_model.INSIGHTS_BASE_ROLE], 'url': app_model.get_application_url( app_model.INSIGHTS_APP, brand_name, ), }, { 'application_id': app_model.SETTINGS_APP, 'roles': [app_model.SETTINGS_BASE_ROLE], 'url': app_model.get_application_url( app_model.SETTINGS_APP, brand_name, ), }, ]