@venturialstd/music
v0.0.5
Published
Music catalog entities and module for Venturial (artists, albums, tracks, playlists) — Spotify Web API–aligned
Keywords
Readme
@venturialstd/music
TypeORM entities and Nest MusicModule for catalog data (artists, albums, tracks, playlists, …).
Operational vs catalog joins
AlbumArtist/TrackArtist: how anArtistappears on albums or tracks (catalog).ArtistUserMembership: which product user may manage or collaborate on anArtist(rolesOWNER|ADMIN|MEMBER, optionalACTIVE|INVITED). Foreign keys:artistId→music_artist,userId/invitedByUserId→ host appuser(e.g. Baxstageuser.iduuid).
Host apps must register MUSIC_ENTITIES (includes ArtistUserMembership) with TypeORM and run their migrations.
Creating an artist for a user (VL-226)
ArtistUserArtistService.createArtistForUser(actorUserId, input) runs in a single DB transaction: insert Artist, then insert ArtistUserMembership with role OWNER and status ACTIVE. Validation uses CreateArtistForUserDto; failures throw MusicValidationError (code: MUSIC_VALIDATION_FAILED). Missing actor id throws MusicDomainError (MUSIC_INVALID_ACTOR). Map these in HTTP controllers to 4xx responses.
Listing and fetching artists for a user (VL-228)
ArtistUserMembershipQueryService.listArtistsForUser(userId, { limit, offset })— ACTIVE memberships only, ordered by artist name; default limit 20, max 100; returns{ items, total, limit, offset }withArtistAccessibleRow(artistId,name,imageUrl,role,status).getArtistForUser(artistId, userId)— returnsArtistonly with an ACTIVE membership; otherwiseMUSIC_ARTIST_NOT_ACCESSIBLE(single outcome for 404-style mapping).getActiveMembership(artistId, userId)— helper for auth in other services.
Membership mutations (VL-227)
ArtistUserMembershipMutationService: listArtistMembers, addArtistMember, removeArtistMember, updateArtistMember. Authorization is enforced in the service (OWNER / ADMIN / MEMBER matrix). Stable error codes live in MusicMembershipErrorCode (MUSIC_FORBIDDEN, MUSIC_MEMBERSHIP_NOT_FOUND, MUSIC_MEMBERSHIP_CONFLICT, MUSIC_LAST_OWNER, etc.) for thin HTTP controllers.
