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

Completed updating biz logic packages to use repository pattern

This commit is contained in:
Lee Brown
2019-08-14 11:40:26 -08:00
parent 3bc814a01e
commit e45dd56149
25 changed files with 530 additions and 353 deletions

View File

@ -6,12 +6,41 @@ import (
"strings"
"time"
"geeks-accelerator/oss/saas-starter-kit/internal/account"
"geeks-accelerator/oss/saas-starter-kit/internal/platform/notify"
"geeks-accelerator/oss/saas-starter-kit/internal/platform/web/webcontext"
"geeks-accelerator/oss/saas-starter-kit/internal/user"
"geeks-accelerator/oss/saas-starter-kit/internal/user_account"
"github.com/jmoiron/sqlx"
"github.com/pkg/errors"
"github.com/sudo-suhas/symcrypto"
)
// Repository defines the required dependencies for User Invite.
type Repository struct {
DbConn *sqlx.DB
User *user.Repository
UserAccount *user_account.Repository
Account *account.Repository
ResetUrl func(string) string
Notify notify.Email
secretKey string
}
// NewRepository creates a new Repository that defines dependencies for User Invite.
func NewRepository(db *sqlx.DB, user *user.Repository, userAccount *user_account.Repository, account *account.Repository,
resetUrl func(string) string, notify notify.Email, secretKey string) *Repository {
return &Repository{
DbConn: db,
User: user,
UserAccount: userAccount,
Account: account,
ResetUrl: resetUrl,
Notify: notify,
secretKey: secretKey,
}
}
// SendUserInvitesRequest defines the data needed to make an invite request.
type SendUserInvitesRequest struct {
AccountID string `json:"account_id" validate:"required,uuid" example:"c4653bf9-5978-48b7-89c5-95704aebb7e2"`