@SuzGupta I'm not saying it's not best practice. But if there's a better way, I'm not doing it.
I think this approach is very obvious and easy to follow.
@SuzGupta mocking data for the previews has actually been the most challenging part of using SwiftData for me! amazing how often it's the previews that source of my problems
I dunno if it helps but for the sorting I added a creationDate property to the Prospect class and then used @Query with SortDescriptor to sort by that date like we did waayyy back in this previous project:
@SuzGupta I'm pretty sure the issue had to do with me not giving creationDate a default property when I first added it, so SwiftData didn't know how to do a data migration for the model with the updated property (and then just crashed when trying to add a model with the new property to the old container).
But also just deleting the app and its data and then rebuilding to make sure it started fresh was an easy way to not deal with data migrations 😅