admin

package
v0.0.0-...-96288a7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("admin: not found")
)

Functions

func AcceptPayment

func AcceptPayment(ctx context.Context, paymentID string) error

func CountCourses

func CountCourses(ctx context.Context) (cnt int64, err error)

func CountPayments

func CountPayments(ctx context.Context, status []int) (cnt int64, err error)

func CountUsers

func CountUsers(ctx context.Context) (cnt int64, err error)

func RejectPayment

func RejectPayment(ctx context.Context, paymentID string, message string) error

Types

type Course

type Course struct {
	ID        string
	Title     string
	Image     string
	Type      int
	Price     float64
	Discount  float64
	URL       string
	CreatedAt time.Time
	UpdatedAt time.Time
	Option    course.Option
	Owner     struct {
		ID       string
		Username string
		Image    string
	}
}

func GetCourses

func GetCourses(ctx context.Context, limit, offset int64) ([]*Course, error)

type Payment

type Payment struct {
	ID            string
	Image         string
	Price         float64
	OriginalPrice float64
	Code          string
	Status        int
	CreatedAt     time.Time
	At            time.Time
	User          struct {
		ID       string
		Username string
		Name     string
		Email    string
		Image    string
	}
	Course struct {
		ID    string
		Title string
		Image string
		URL   string
	}
}

Payment type

func GetPayment

func GetPayment(ctx context.Context, paymentID string) (*Payment, error)

func GetPayments

func GetPayments(ctx context.Context, status []int, limit, offset int64) ([]*Payment, error)
func (x *Payment) CourseLink() string

CourseLink returns course link

type User

type User struct {
	ID        string
	Username  string
	Name      string
	Email     string
	Image     string
	CreatedAt time.Time
}

func GetUsers

func GetUsers(ctx context.Context, limit, offset int64) ([]*User, error)

Jump to

Keyboard shortcuts

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