indiehd / web-api

GNU Affero General Public License v3.0
6 stars 4 forks source link

Remove `price` from `Song` model because it's handled through the Velkart `Product` now #192

Open cbj4074 opened 3 years ago

cbj4074 commented 3 years ago

The same is true for albums.full_album_price.

cbj4074 commented 3 years ago

@mblarsen You'll probably want to slap me, but this change (removing album.full_album_price) will break a bunch of tests.

Given that we shouldn't store the full-album price in two different places, the test(s) would need to look at $album->asset->product->price, instead of $album->full_album_price.

This isn't a big deal, but we'll need to rework the affected tests.

At this point, I'm trying to reason through the factory-related changes that would need to be made, particularly when using make() instead of create() on the Song and Album factories.

For example, https://github.com/indiehd/web-api/blob/be28f4da802e1ca4c6b67829cf1e555889ee65d8/tests/Feature/Casts/MoneyTest.php references full_album_price in many of its tests. Given this change, those tests can no longer use a simple make() call on the factory, and, at a minimum, will need to use a factory state(s), it seems.