repository

package
v0.0.0-...-3eb0fa6 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package repository is a generated GoMock package.

Package repository is a generated GoMock package.

Package repository is a generated GoMock package.

Package repository is a generated GoMock package.

Package repository is a generated GoMock package.

Package repository is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfigRepository

type AppConfigRepository interface {
	GetPaymentPeriod() (int, error)

	SetPaymentPeriod(period int) error

	GetCurrentPeriod() (int, error)

	SetCurrentPeriod(period int) error

	GetEmailTemplate(kind domain.EmailKind) (subject, body string, err error)

	SetEmailTemplate(kind domain.EmailKind, subject, body string) error
}

type ExternalIntegrationRepository

type ExternalIntegrationRepository interface {
	// GetUserRole finds a user by account id and returns his/her role
	GetUserRoleFromAccountID(accountID string) (string, error)
}

ExternalIntegrationRepository is a repository to provide features to external services

type MockAppConfigRepository

type MockAppConfigRepository struct {
	// contains filtered or unexported fields
}

MockAppConfigRepository is a mock of AppConfigRepository interface.

func NewMockAppConfigRepository

func NewMockAppConfigRepository(ctrl *gomock.Controller) *MockAppConfigRepository

NewMockAppConfigRepository creates a new mock instance.

func (*MockAppConfigRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAppConfigRepository) GetCurrentPeriod

func (m *MockAppConfigRepository) GetCurrentPeriod() (int, error)

GetCurrentPeriod mocks base method.

func (*MockAppConfigRepository) GetEmailTemplate

func (m *MockAppConfigRepository) GetEmailTemplate(kind domain.EmailKind) (string, string, error)

GetEmailTemplate mocks base method.

func (*MockAppConfigRepository) GetPaymentPeriod

func (m *MockAppConfigRepository) GetPaymentPeriod() (int, error)

GetPaymentPeriod mocks base method.

func (*MockAppConfigRepository) SetCurrentPeriod

func (m *MockAppConfigRepository) SetCurrentPeriod(period int) error

SetCurrentPeriod mocks base method.

func (*MockAppConfigRepository) SetEmailTemplate

func (m *MockAppConfigRepository) SetEmailTemplate(kind domain.EmailKind, subject, body string) error

SetEmailTemplate mocks base method.

func (*MockAppConfigRepository) SetPaymentPeriod

func (m *MockAppConfigRepository) SetPaymentPeriod(period int) error

SetPaymentPeriod mocks base method.

type MockAppConfigRepositoryMockRecorder

type MockAppConfigRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockAppConfigRepositoryMockRecorder is the mock recorder for MockAppConfigRepository.

func (*MockAppConfigRepositoryMockRecorder) GetCurrentPeriod

func (mr *MockAppConfigRepositoryMockRecorder) GetCurrentPeriod() *gomock.Call

GetCurrentPeriod indicates an expected call of GetCurrentPeriod.

func (*MockAppConfigRepositoryMockRecorder) GetEmailTemplate

func (mr *MockAppConfigRepositoryMockRecorder) GetEmailTemplate(kind interface{}) *gomock.Call

GetEmailTemplate indicates an expected call of GetEmailTemplate.

func (*MockAppConfigRepositoryMockRecorder) GetPaymentPeriod

func (mr *MockAppConfigRepositoryMockRecorder) GetPaymentPeriod() *gomock.Call

GetPaymentPeriod indicates an expected call of GetPaymentPeriod.

func (*MockAppConfigRepositoryMockRecorder) SetCurrentPeriod

func (mr *MockAppConfigRepositoryMockRecorder) SetCurrentPeriod(period interface{}) *gomock.Call

SetCurrentPeriod indicates an expected call of SetCurrentPeriod.

func (*MockAppConfigRepositoryMockRecorder) SetEmailTemplate

func (mr *MockAppConfigRepositoryMockRecorder) SetEmailTemplate(kind, subject, body interface{}) *gomock.Call

SetEmailTemplate indicates an expected call of SetEmailTemplate.

func (*MockAppConfigRepositoryMockRecorder) SetPaymentPeriod

func (mr *MockAppConfigRepositoryMockRecorder) SetPaymentPeriod(period interface{}) *gomock.Call

SetPaymentPeriod indicates an expected call of SetPaymentPeriod.

type MockExternalIntegrationRepository

type MockExternalIntegrationRepository struct {
	// contains filtered or unexported fields
}

MockExternalIntegrationRepository is a mock of ExternalIntegrationRepository interface.

func NewMockExternalIntegrationRepository

func NewMockExternalIntegrationRepository(ctrl *gomock.Controller) *MockExternalIntegrationRepository

NewMockExternalIntegrationRepository creates a new mock instance.

func (*MockExternalIntegrationRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockExternalIntegrationRepository) GetUserRoleFromAccountID

func (m *MockExternalIntegrationRepository) GetUserRoleFromAccountID(accountID string) (string, error)

GetUserRoleFromAccountID mocks base method.

type MockExternalIntegrationRepositoryMockRecorder

type MockExternalIntegrationRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockExternalIntegrationRepositoryMockRecorder is the mock recorder for MockExternalIntegrationRepository.

func (*MockExternalIntegrationRepositoryMockRecorder) GetUserRoleFromAccountID

func (mr *MockExternalIntegrationRepositoryMockRecorder) GetUserRoleFromAccountID(accountID interface{}) *gomock.Call

GetUserRoleFromAccountID indicates an expected call of GetUserRoleFromAccountID.

type MockPaymentStatusRepository

type MockPaymentStatusRepository struct {
	// contains filtered or unexported fields
}

MockPaymentStatusRepository is a mock of PaymentStatusRepository interface.

func NewMockPaymentStatusRepository

func NewMockPaymentStatusRepository(ctrl *gomock.Controller) *MockPaymentStatusRepository

NewMockPaymentStatusRepository creates a new mock instance.

func (*MockPaymentStatusRepository) Add

func (m *MockPaymentStatusRepository) Add(ctx context.Context, userID, period, authorizer int) error

Add mocks base method.

func (*MockPaymentStatusRepository) Delete

func (m *MockPaymentStatusRepository) Delete(ctx context.Context, userID, period int) (bool, error)

Delete mocks base method.

func (*MockPaymentStatusRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPaymentStatusRepository) Get

func (m *MockPaymentStatusRepository) Get(ctx context.Context, userID, period int) (*domain.PaymentStatus, error)

Get mocks base method.

func (*MockPaymentStatusRepository) GetLatestByUser

func (m *MockPaymentStatusRepository) GetLatestByUser(ctx context.Context, userID int) (*domain.PaymentStatus, error)

GetLatestByUser mocks base method.

func (*MockPaymentStatusRepository) HasMatchingPeriod

func (m *MockPaymentStatusRepository) HasMatchingPeriod(ctx context.Context, userID int, periods []int) (bool, error)

HasMatchingPeriod mocks base method.

func (*MockPaymentStatusRepository) IsFirst

func (m *MockPaymentStatusRepository) IsFirst(ctx context.Context, userID, period int) (bool, error)

IsFirst mocks base method.

func (*MockPaymentStatusRepository) IsLatest

func (m *MockPaymentStatusRepository) IsLatest(ctx context.Context, userID, period int) (bool, error)

IsLatest mocks base method.

func (*MockPaymentStatusRepository) ListPeriodsForUser

func (m *MockPaymentStatusRepository) ListPeriodsForUser(ctx context.Context, userID int) ([]*domain.PaymentStatus, error)

ListPeriodsForUser mocks base method.

func (*MockPaymentStatusRepository) ListUnpaidMembers

func (m *MockPaymentStatusRepository) ListUnpaidMembers(ctx context.Context, paymentPeriod int) ([]*domain.User, error)

ListUnpaidMembers mocks base method.

func (*MockPaymentStatusRepository) ListUsersForPeriod

func (m *MockPaymentStatusRepository) ListUsersForPeriod(ctx context.Context, period int) ([]*domain.PaymentStatus, error)

ListUsersForPeriod mocks base method.

type MockPaymentStatusRepositoryMockRecorder

type MockPaymentStatusRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockPaymentStatusRepositoryMockRecorder is the mock recorder for MockPaymentStatusRepository.

func (*MockPaymentStatusRepositoryMockRecorder) Add

func (mr *MockPaymentStatusRepositoryMockRecorder) Add(ctx, userID, period, authorizer interface{}) *gomock.Call

Add indicates an expected call of Add.

func (*MockPaymentStatusRepositoryMockRecorder) Delete

func (mr *MockPaymentStatusRepositoryMockRecorder) Delete(ctx, userID, period interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockPaymentStatusRepositoryMockRecorder) Get

func (mr *MockPaymentStatusRepositoryMockRecorder) Get(ctx, userID, period interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockPaymentStatusRepositoryMockRecorder) GetLatestByUser

func (mr *MockPaymentStatusRepositoryMockRecorder) GetLatestByUser(ctx, userID interface{}) *gomock.Call

GetLatestByUser indicates an expected call of GetLatestByUser.

func (*MockPaymentStatusRepositoryMockRecorder) HasMatchingPeriod

func (mr *MockPaymentStatusRepositoryMockRecorder) HasMatchingPeriod(ctx, userID, periods interface{}) *gomock.Call

HasMatchingPeriod indicates an expected call of HasMatchingPeriod.

func (*MockPaymentStatusRepositoryMockRecorder) IsFirst

func (mr *MockPaymentStatusRepositoryMockRecorder) IsFirst(ctx, userID, period interface{}) *gomock.Call

IsFirst indicates an expected call of IsFirst.

func (*MockPaymentStatusRepositoryMockRecorder) IsLatest

func (mr *MockPaymentStatusRepositoryMockRecorder) IsLatest(ctx, userID, period interface{}) *gomock.Call

IsLatest indicates an expected call of IsLatest.

func (*MockPaymentStatusRepositoryMockRecorder) ListPeriodsForUser

func (mr *MockPaymentStatusRepositoryMockRecorder) ListPeriodsForUser(ctx, userID interface{}) *gomock.Call

ListPeriodsForUser indicates an expected call of ListPeriodsForUser.

func (*MockPaymentStatusRepositoryMockRecorder) ListUnpaidMembers

func (mr *MockPaymentStatusRepositoryMockRecorder) ListUnpaidMembers(ctx, paymentPeriod interface{}) *gomock.Call

ListUnpaidMembers indicates an expected call of ListUnpaidMembers.

func (*MockPaymentStatusRepositoryMockRecorder) ListUsersForPeriod

func (mr *MockPaymentStatusRepositoryMockRecorder) ListUsersForPeriod(ctx, period interface{}) *gomock.Call

ListUsersForPeriod indicates an expected call of ListUsersForPeriod.

type MockPaymentTransactionRepository

type MockPaymentTransactionRepository struct {
	// contains filtered or unexported fields
}

MockPaymentTransactionRepository is a mock of PaymentTransactionRepository interface.

func NewMockPaymentTransactionRepository

func NewMockPaymentTransactionRepository(ctrl *gomock.Controller) *MockPaymentTransactionRepository

NewMockPaymentTransactionRepository creates a new mock instance.

func (*MockPaymentTransactionRepository) Add

func (m *MockPaymentTransactionRepository) Add(ctx context.Context, userID int, token string, expiredAt time.Time) error

Add mocks base method.

func (*MockPaymentTransactionRepository) Delete

Delete mocks base method.

func (*MockPaymentTransactionRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPaymentTransactionRepository) Get

Get mocks base method.

func (*MockPaymentTransactionRepository) RevokeExpired

func (m *MockPaymentTransactionRepository) RevokeExpired(ctx context.Context) error

RevokeExpired mocks base method.

type MockPaymentTransactionRepositoryMockRecorder

type MockPaymentTransactionRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockPaymentTransactionRepositoryMockRecorder is the mock recorder for MockPaymentTransactionRepository.

func (*MockPaymentTransactionRepositoryMockRecorder) Add

func (mr *MockPaymentTransactionRepositoryMockRecorder) Add(ctx, userID, token, expiredAt interface{}) *gomock.Call

Add indicates an expected call of Add.

func (*MockPaymentTransactionRepositoryMockRecorder) Delete

func (mr *MockPaymentTransactionRepositoryMockRecorder) Delete(ctx, token interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockPaymentTransactionRepositoryMockRecorder) Get

func (mr *MockPaymentTransactionRepositoryMockRecorder) Get(ctx, token interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockPaymentTransactionRepositoryMockRecorder) RevokeExpired

func (mr *MockPaymentTransactionRepositoryMockRecorder) RevokeExpired(ctx interface{}) *gomock.Call

RevokeExpired indicates an expected call of RevokeExpired.

type MockTokenRepository

type MockTokenRepository struct {
	// contains filtered or unexported fields
}

MockTokenRepository is a mock of TokenRepository interface.

func NewMockTokenRepository

func NewMockTokenRepository(ctrl *gomock.Controller) *MockTokenRepository

NewMockTokenRepository creates a new mock instance.

func (*MockTokenRepository) Add

func (m *MockTokenRepository) Add(ctx context.Context, userID int, token string, expiredAt time.Time) error

Add mocks base method.

func (*MockTokenRepository) Delete

func (m *MockTokenRepository) Delete(ctx context.Context, token string) error

Delete mocks base method.

func (*MockTokenRepository) DeleteAll

func (m *MockTokenRepository) DeleteAll(ctx context.Context, userID int) error

DeleteAll mocks base method.

func (*MockTokenRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockTokenRepository) GetByToken

func (m *MockTokenRepository) GetByToken(ctx context.Context, token string) (*domain.Token, error)

GetByToken mocks base method.

type MockTokenRepositoryMockRecorder

type MockTokenRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockTokenRepositoryMockRecorder is the mock recorder for MockTokenRepository.

func (*MockTokenRepositoryMockRecorder) Add

func (mr *MockTokenRepositoryMockRecorder) Add(ctx, userID, token, expiredAt interface{}) *gomock.Call

Add indicates an expected call of Add.

func (*MockTokenRepositoryMockRecorder) Delete

func (mr *MockTokenRepositoryMockRecorder) Delete(ctx, token interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockTokenRepositoryMockRecorder) DeleteAll

func (mr *MockTokenRepositoryMockRecorder) DeleteAll(ctx, userID interface{}) *gomock.Call

DeleteAll indicates an expected call of DeleteAll.

func (*MockTokenRepositoryMockRecorder) GetByToken

func (mr *MockTokenRepositoryMockRecorder) GetByToken(ctx, token interface{}) *gomock.Call

GetByToken indicates an expected call of GetByToken.

type MockUserRepository

type MockUserRepository struct {
	// contains filtered or unexported fields
}

MockUserRepository is a mock of UserRepository interface.

func NewMockUserRepository

func NewMockUserRepository(ctrl *gomock.Controller) *MockUserRepository

NewMockUserRepository creates a new mock instance.

func (*MockUserRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockUserRepository) GetByAccountID

func (m *MockUserRepository) GetByAccountID(ctx context.Context, accountID string) (*domain.User, error)

GetByAccountID mocks base method.

func (*MockUserRepository) GetByEmail

func (m *MockUserRepository) GetByEmail(ctx context.Context, email string) (*domain.User, error)

GetByEmail mocks base method.

func (*MockUserRepository) GetByID

func (m *MockUserRepository) GetByID(ctx context.Context, id int) (*domain.User, error)

GetByID mocks base method.

func (*MockUserRepository) Insert

func (m *MockUserRepository) Insert(ctx context.Context, user *domain.User) (int, error)

Insert mocks base method.

func (*MockUserRepository) List

func (m *MockUserRepository) List(ctx context.Context) ([]*domain.User, error)

List mocks base method.

func (*MockUserRepository) ListByID

func (m *MockUserRepository) ListByID(ctx context.Context, ids []int) ([]*domain.User, error)

ListByID mocks base method.

func (*MockUserRepository) Update

func (m *MockUserRepository) Update(ctx context.Context, user *domain.User) error

Update mocks base method.

func (*MockUserRepository) VerifyEmail

func (m *MockUserRepository) VerifyEmail(ctx context.Context, id int, email string) error

VerifyEmail mocks base method.

type MockUserRepositoryMockRecorder

type MockUserRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockUserRepositoryMockRecorder is the mock recorder for MockUserRepository.

func (*MockUserRepositoryMockRecorder) GetByAccountID

func (mr *MockUserRepositoryMockRecorder) GetByAccountID(ctx, accountID interface{}) *gomock.Call

GetByAccountID indicates an expected call of GetByAccountID.

func (*MockUserRepositoryMockRecorder) GetByEmail

func (mr *MockUserRepositoryMockRecorder) GetByEmail(ctx, email interface{}) *gomock.Call

GetByEmail indicates an expected call of GetByEmail.

func (*MockUserRepositoryMockRecorder) GetByID

func (mr *MockUserRepositoryMockRecorder) GetByID(ctx, id interface{}) *gomock.Call

GetByID indicates an expected call of GetByID.

func (*MockUserRepositoryMockRecorder) Insert

func (mr *MockUserRepositoryMockRecorder) Insert(ctx, user interface{}) *gomock.Call

Insert indicates an expected call of Insert.

func (*MockUserRepositoryMockRecorder) List

func (mr *MockUserRepositoryMockRecorder) List(ctx interface{}) *gomock.Call

List indicates an expected call of List.

func (*MockUserRepositoryMockRecorder) ListByID

func (mr *MockUserRepositoryMockRecorder) ListByID(ctx, ids interface{}) *gomock.Call

ListByID indicates an expected call of ListByID.

func (*MockUserRepositoryMockRecorder) Update

func (mr *MockUserRepositoryMockRecorder) Update(ctx, user interface{}) *gomock.Call

Update indicates an expected call of Update.

func (*MockUserRepositoryMockRecorder) VerifyEmail

func (mr *MockUserRepositoryMockRecorder) VerifyEmail(ctx, id, email interface{}) *gomock.Call

VerifyEmail indicates an expected call of VerifyEmail.

type MockUserRoleRepository

type MockUserRoleRepository struct {
	// contains filtered or unexported fields
}

MockUserRoleRepository is a mock of UserRoleRepository interface.

func NewMockUserRoleRepository

func NewMockUserRoleRepository(ctrl *gomock.Controller) *MockUserRoleRepository

NewMockUserRoleRepository creates a new mock instance.

func (*MockUserRoleRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockUserRoleRepository) Update

func (m *MockUserRoleRepository) Update(ctx context.Context, id int, role domain.RoleType) error

Update mocks base method.

func (*MockUserRoleRepository) UpdateAllWithRule

func (m *MockUserRoleRepository) UpdateAllWithRule(ctx context.Context, currentPeriod, paymentPeriod int) error

UpdateAllWithRule mocks base method.

func (*MockUserRoleRepository) UpdateWithRule

func (m *MockUserRoleRepository) UpdateWithRule(ctx context.Context, id, currentPeriod, paymentPeriod int) error

UpdateWithRule mocks base method.

type MockUserRoleRepositoryMockRecorder

type MockUserRoleRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockUserRoleRepositoryMockRecorder is the mock recorder for MockUserRoleRepository.

func (*MockUserRoleRepositoryMockRecorder) Update

func (mr *MockUserRoleRepositoryMockRecorder) Update(ctx, id, role interface{}) *gomock.Call

Update indicates an expected call of Update.

func (*MockUserRoleRepositoryMockRecorder) UpdateAllWithRule

func (mr *MockUserRoleRepositoryMockRecorder) UpdateAllWithRule(ctx, currentPeriod, paymentPeriod interface{}) *gomock.Call

UpdateAllWithRule indicates an expected call of UpdateAllWithRule.

func (*MockUserRoleRepositoryMockRecorder) UpdateWithRule

func (mr *MockUserRoleRepositoryMockRecorder) UpdateWithRule(ctx, id, currentPeriod, paymentPeriod interface{}) *gomock.Call

UpdateWithRule indicates an expected call of UpdateWithRule.

type OIDCAccountInfoRepository

type OIDCAccountInfoRepository interface {
	// Save - アカウント情報の保存
	Save(ctx context.Context, account *domain.OIDCAccountInfo) error

	// GetByToken - Tokenで検索・取得
	GetByToken(ctx context.Context, token string) (*domain.OIDCAccountInfo, error)

	// Delete - 削除
	Delete(ctx context.Context, token string) error
}

OIDCAccountInfoRepository - ソーシャルログインに用いるアカウント情報関連の操作 DBに未登録のユーザーがログインした際にここに情報を保存する ユーザーがSignupする際にここに保存した情報を使用する

type PaymentStatusRepository

type PaymentStatusRepository interface {
	// Add - 新しい支払情報の追加
	Add(ctx context.Context, userID, period int, authorizer int) error

	// Get - 特定の支払い情報の取得
	Get(ctx context.Context, userID, period int) (*domain.PaymentStatus, error)

	// Delete - 支払情報を削除
	Delete(ctx context.Context, userID, period int) (bool, error)

	// GetLatestByUser - 最新の支払情報の取得
	GetLatestByUser(ctx context.Context, userID int) (*domain.PaymentStatus, error)

	// ListForPeriod returns all users paying in the period
	ListUsersForPeriod(ctx context.Context, period int) ([]*domain.PaymentStatus, error)

	// ListForUser returns all periods the user paid in
	ListPeriodsForUser(ctx context.Context, userID int) ([]*domain.PaymentStatus, error)

	// IsLatest reports the specified payment status is the latest or not.
	// CAUTION: This method doesn't check the specified status exists
	IsLatest(ctx context.Context, userID, period int) (bool, error)

	// IsFirst reports the specified payment status is the first or not.
	// CAUTION: This method doesn't check the specified status exists
	IsFirst(ctx context.Context, userID, period int) (bool, error)

	// HasMatchingPeriod returns whether there is a payment status matching parameters
	HasMatchingPeriod(ctx context.Context, userID int, periods []int) (bool, error)

	// ListUnpaidMembers returns all unpaid members for the specified period
	ListUnpaidMembers(ctx context.Context, paymentPeriod int) ([]*domain.User, error)
}

PaymentStatusRepository - サークル費支払関連のDB操作

type PaymentTransactionRepository

type PaymentTransactionRepository interface {
	// Add - 新しい支払情報の追加
	Add(ctx context.Context, userID int, token string, expiredAt time.Time) error

	Get(ctx context.Context, token string) (*domain.PaymentTransaction, error)

	Delete(ctx context.Context, token string) error

	RevokeExpired(ctx context.Context) error
}

PaymentTransactionRepository - サークル費支払い時のトークン管理

type TokenRepository

type TokenRepository interface {
	// Add - 新しいトークンの追加
	Add(ctx context.Context, userID int, token string, expiredAt time.Time) error

	// GetByToken - トークンを検索する
	GetByToken(ctx context.Context, token string) (*domain.Token, error)

	// Delete - トークンを削除する
	Delete(ctx context.Context, token string) error

	// DeleteAll - 特定ユーザのトークンを一生削除する
	DeleteAll(ctx context.Context, userID int) error
}

TokenRepository - 認証用トークンのDB操作

type UserRepository

type UserRepository interface {
	// Insert - 新規サークル員の追加
	Insert(ctx context.Context, user *domain.User) (int, error)

	// GetByID - IDで検索
	GetByID(ctx context.Context, id int) (*domain.User, error)

	// GetByAccountID - Account IDで検索
	GetByAccountID(ctx context.Context, accountID string) (*domain.User, error)

	// GetByEmail - Emailで検索
	GetByEmail(ctx context.Context, email string) (*domain.User, error)

	// List - 全ユーザを取得
	List(ctx context.Context) ([]*domain.User, error)

	// ListByID - ユーザIDが一致する全てのユーザを取得
	ListByID(ctx context.Context, ids []int) ([]*domain.User, error)

	// Update - ユーザのプロフィールを更新する(idで識別)
	Update(ctx context.Context, user *domain.User) error

	// VerifyEmail - メールアドレスを認証済みにする
	VerifyEmail(ctx context.Context, id int, email string) error
}

UserRepository - User関連のDB操作

type UserRoleRepository

type UserRoleRepository interface {
	// Update - 手動でroleを切り替え
	Update(ctx context.Context, id int, role domain.RoleType) error

	// UpdateWithRule - ルールに基づき自動でユーザのロールを変更する
	UpdateWithRule(ctx context.Context, id, currentPeriod, paymentPeriod int) error

	// UpdateAllWithRule - ルールに基づき自動で全てのユーザのロールを変更する
	UpdateAllWithRule(ctx context.Context, currentPeriod, paymentPeriod int) error
}

UserRoleRepository - Userの権限関連のDB操作

Jump to

Keyboard shortcuts

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