Open gregbrowndev opened 1 year ago
Repositories should follow a collection-oriented style with a save function to handle upserting the object as a unit of state.
save
Example:
trait JobRepository[F[_]: MonadCancelThrow] { def nextIdentity(): F[JobId] def save(job: Job): EitherT[F, String, Unit] def delete(job: Job): EitherT[F, String, Unit] def get(id: JobId): EitherT[F, String, Job] def find( filterOpt: Option[JobFilter], paginationOpt: Option[Pagination] ): F[List[Job]] }
Repositories should follow a collection-oriented style with a
save
function to handle upserting the object as a unit of state.Example: