resonatecoop / api

The one Resonate API to rule them all

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create userTrackPurchase table

simonv3 opened this issue · comments

commented

Right now, whether or not a user owns a track is calculated by the amount of plays the user has for the track.

If a user has 9 plays, they own the track. Conversely, if a user buys a track, we insert 9 plays into the database.

This is not really great for statistics and licensing stuff.

So we should add a userTrackPurchase(userId, trackId, purchasedAtDate, purchaseType) table in which we store info about the purchase. The purchaseType property could be "stream" | "purchase" to indicate whether it was bought by having streamed x times or whether it was a straight up purchase. Just some metadata.