1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-08-06 22:32:51 +02:00

WIP: not sure how to solve user_account calling account.CanModifyAccount

This commit is contained in:
Lee Brown
2019-08-13 23:41:06 -08:00
parent 4be0454421
commit 3bc814a01e
8 changed files with 198 additions and 132 deletions

View File

@ -3,6 +3,7 @@ package user_account
import (
"context"
"database/sql/driver"
"github.com/jmoiron/sqlx"
"strings"
"time"
@ -13,6 +14,18 @@ import (
"gopkg.in/go-playground/validator.v9"
)
// Repository defines the required dependencies for UserAccount.
type Repository struct {
DbConn *sqlx.DB
}
// NewRepository creates a new Repository that defines dependencies for UserAccount.
func NewRepository(db *sqlx.DB) *Repository {
return &Repository{
DbConn: db,
}
}
// UserAccount defines the one to many relationship of an user to an account. This
// will enable a single user access to multiple accounts without having duplicate
// users. Each association of a user to an account has a set of roles and a status