api-qobiltu-dev / space /repositories /AccountRepository.go
lifedebugger's picture
Deploy files from GitHub repository
8b40e41
Raw
History Blame Contribute Delete
573 Bytes
package repositories
import (
"api.qobiltu.id/models"
)
func GetAccountbyEmail(email string) Repository[models.Account, models.Account] {
repo := Construct[models.Account, models.Account](
models.Account{Email: email},
)
repo.Transactions(
WhereGivenConstructor[models.Account, models.Account],
Find[models.Account, models.Account],
)
return *repo
}
func CreateAccount(account models.Account) Repository[models.Account, models.Account] {
repo := Construct[models.Account, models.Account](
account,
)
Create(repo)
return *repo
}