repository

package
v0.0.0-...-045cb9c Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 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 AccountRepository

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

func NewAccountRepository

func NewAccountRepository(db *pgxpool.Pool) *AccountRepository

func (*AccountRepository) Create

func (r *AccountRepository) Create(ctx context.Context, acc *domain.Account) error

func (*AccountRepository) Delete

func (r *AccountRepository) Delete(ctx context.Context, id string) error

func (*AccountRepository) FindAllByUserID

func (r *AccountRepository) FindAllByUserID(ctx context.Context, userID string, limit, offset int) ([]domain.Account, error)

func (*AccountRepository) FindByID

func (r *AccountRepository) FindByID(ctx context.Context, id string) (*domain.Account, error)

func (*AccountRepository) Update

func (r *AccountRepository) Update(ctx context.Context, acc *domain.Account) error

type AdminRepository

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

func NewAdminRepository

func NewAdminRepository(db *pgxpool.Pool) *AdminRepository

func (*AdminRepository) Create

func (r *AdminRepository) Create(ctx context.Context, admin *domain.Admin) error

func (*AdminRepository) Delete

func (r *AdminRepository) Delete(ctx context.Context, id string) error

func (*AdminRepository) FindAll

func (r *AdminRepository) FindAll(ctx context.Context, limit, offset int) ([]domain.Admin, error)

func (*AdminRepository) FindByEmail

func (r *AdminRepository) FindByEmail(ctx context.Context, email string) (*domain.Admin, error)

func (*AdminRepository) FindByID

func (r *AdminRepository) FindByID(ctx context.Context, id string) (*domain.Admin, error)

func (*AdminRepository) Update

func (r *AdminRepository) Update(ctx context.Context, admin *domain.Admin) error

type Database

type Database struct {
	Pool *pgxpool.Pool
}

func NewDatabase

func NewDatabase(dbURL string) (*Database, error)

func (*Database) Close

func (db *Database) Close()

type FeeRepository

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

func NewFeeRepository

func NewFeeRepository(db *pgxpool.Pool) *FeeRepository

func (*FeeRepository) CalculateFee

func (r *FeeRepository) CalculateFee(ctx context.Context, feeType domain.FeeType, currency domain.CurrencyCode, amount *utils.BigDecimal) (*utils.BigDecimal, error)

func (*FeeRepository) Create

func (r *FeeRepository) Create(ctx context.Context, t *domain.Fee) error

func (*FeeRepository) Delete

func (r *FeeRepository) Delete(ctx context.Context, id string) error

func (*FeeRepository) FindAll

func (r *FeeRepository) FindAll(ctx context.Context, limit, offset int) ([]domain.Fee, error)

func (*FeeRepository) FindAllByType

func (r *FeeRepository) FindAllByType(ctx context.Context, feeType domain.FeeType, limit, offset int) ([]domain.Fee, error)

func (*FeeRepository) FindByID

func (r *FeeRepository) FindByID(ctx context.Context, id string) (*domain.Fee, error)

func (*FeeRepository) Update

func (r *FeeRepository) Update(ctx context.Context, t *domain.Fee) error

type TransactionRepository

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

func NewTransactionRepository

func NewTransactionRepository(db *pgxpool.Pool) *TransactionRepository

func (*TransactionRepository) Create

func (*TransactionRepository) FindAll

func (r *TransactionRepository) FindAll(ctx context.Context, limit, offset int) ([]domain.Transaction, error)

func (*TransactionRepository) FindByID

type UserRepository

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

func NewUserRepository

func NewUserRepository(db *pgxpool.Pool) *UserRepository

func (*UserRepository) Create

func (r *UserRepository) Create(ctx context.Context, u *domain.User) error

func (*UserRepository) Delete

func (r *UserRepository) Delete(ctx context.Context, id string) error

func (*UserRepository) FindAll

func (r *UserRepository) FindAll(ctx context.Context, limit, offset int) ([]domain.User, error)

func (*UserRepository) FindByEmail

func (r *UserRepository) FindByEmail(ctx context.Context, email string) (*domain.User, error)

func (*UserRepository) FindByID

func (r *UserRepository) FindByID(ctx context.Context, id string) (*domain.User, error)

func (*UserRepository) FindByIDWithAccounts

func (r *UserRepository) FindByIDWithAccounts(ctx context.Context, id string) (*domain.User, error)

func (*UserRepository) Update

func (r *UserRepository) Update(ctx context.Context, u *domain.User) error

Jump to

Keyboard shortcuts

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