repository

package
v0.0.0-...-49a09ed Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PromotionRepositoryPostgres

type PromotionRepositoryPostgres struct {
	DB *gorm.DB
}

func NewPromotionRepositoryPostgres

func NewPromotionRepositoryPostgres(db *gorm.DB) *PromotionRepositoryPostgres

func (*PromotionRepositoryPostgres) ApplyPromotion

func (r *PromotionRepositoryPostgres) ApplyPromotion(promoID uint, userIDs []int) error

func (*PromotionRepositoryPostgres) GetAppliedUsers

func (r *PromotionRepositoryPostgres) GetAppliedUsers(promoID uint) ([]int, error)

func (*PromotionRepositoryPostgres) GetAvailableUsers

func (r *PromotionRepositoryPostgres) GetAvailableUsers(promoType int) ([]int, error)

type UserRepositoryPostgres

type UserRepositoryPostgres struct {
	DB *gorm.DB
}

func NewUserRepositoryPostgres

func NewUserRepositoryPostgres(db *gorm.DB) *UserRepositoryPostgres

func (*UserRepositoryPostgres) Create

func (r *UserRepositoryPostgres) Create(user *entity.User) error

func (*UserRepositoryPostgres) DeleteByID

func (r *UserRepositoryPostgres) DeleteByID(id uint) error

func (*UserRepositoryPostgres) FindAll

func (r *UserRepositoryPostgres) FindAll() ([]*entity.User, error)

func (*UserRepositoryPostgres) GetByID

func (r *UserRepositoryPostgres) GetByID(id uint) (*entity.User, error)

func (*UserRepositoryPostgres) Update

func (r *UserRepositoryPostgres) Update(user *entity.User) error

Jump to

Keyboard shortcuts

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