repositories

package
v0.0.0-...-c60c4f7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrgRepository

type OrgRepository interface {
	Create(ctx context.Context, org *domains.Org) (int64, error)
	CreateWithTx(ctx context.Context, tx *sqlx.Tx, org *domains.Org) (int64, error)
	GetByID(ctx context.Context, id int64) (*domains.Org, error)
	Fetch(ctx context.Context, p ParamsForFetchOrgs) ([]*domains.Org, int64, error)
	Update(ctx context.Context, org *domains.Org, fieldsToUpdate []string) error
	DeleteById(ctx context.Context, id int64) error
}

func NewPgsqlOrgRepository

func NewPgsqlOrgRepository(mdbi *datastore.MasterDbInstance, sdbi *datastore.SlaveDbInstance) OrgRepository

NewPgsqlOrgRepository will create new an orgRepository object representation of OrgRepository interface

type ParamsForFetchOrgs

type ParamsForFetchOrgs struct {
	contexts.CommonParamsForFetch
	Ids      []int64
	Statuses []string
}

type ParamsForFetchUserOrgs

type ParamsForFetchUserOrgs struct {
	UserIds []int64
	OrgId   int64
	Emails  []string
	contexts.CommonParamsForFetch
}

type ParamsForFetchUsers

type ParamsForFetchUsers struct {
	contexts.CommonParamsForFetch
}

type UserOrgRepository

type UserOrgRepository interface {
	Create(ctx context.Context, userOrg *domains.UserOrg) (int64, error)
	CreateWithTx(ctx context.Context, tx *sqlx.Tx, userOrg *domains.UserOrg) (int64, error)
	UpdateByUserIdAndOrgId(ctx context.Context, userOrg *domains.UserOrg, fieldsToUpdate []string) error
	DeleteByUserIdAndOrgId(ctx context.Context, userId, orgId int64) error
	Fetch(ctx context.Context, params ParamsForFetchUserOrgs) (rs []*domains.UserOrg, count int64, err error)
}

func NewPgsqlUserOrgRepository

func NewPgsqlUserOrgRepository(mdbi *datastore.MasterDbInstance, sdbi *datastore.SlaveDbInstance) UserOrgRepository

NewPgsqlUserOrgRepository will create new an userOrgRepository object representation of UserOrgRepository interface

type UserRepository

type UserRepository interface {
	Create(ctx context.Context, user *domains.User) (int64, error)
	GetByID(ctx context.Context, id int64) (*domains.User, error)
	Fetch(ctx context.Context, p ParamsForFetchUsers) ([]*domains.User, int64, error)
	Update(ctx context.Context, user *domains.User, fieldsToUpdate []string) error
	DeleteById(ctx context.Context, id int64) error
	GetByCode(ctx context.Context, code string) (*domains.User, error)
	GetByEmail(ctx context.Context, email string) (*domains.User, error)
}

func NewPgsqlUserRepository

func NewPgsqlUserRepository(mdbi *datastore.MasterDbInstance, sdbi *datastore.SlaveDbInstance) UserRepository

NewPgsqlUserRepository will create new an userRepository object representation of UserRepository interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL