models

package
v0.0.0-...-979743d Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BearerTokens = map[string]string{}

Functions

func AuthenticateUser

func AuthenticateUser(req *requests.LoginRequest, db *sql.DB) (bool, error)

AuthenticateUser checks credentials of the user

func UpdatePaymentStatusByTransactionId

func UpdatePaymentStatusByTransactionId(transactionId *string, status utils.PaymentStatus, db *sql.DB) error

Types

type AccessToken

type AccessToken struct {
	Token string `json:"token"`
}

type ApiResponse

type ApiResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
	Errors  interface{} `json:"errors,omitempty"`
}

type Payment

type Payment struct {
	ID                  int    `json:"id,omitempty"`
	UserID              int    `json:"user_id"`
	SenderMobileNo      string `json:"sender_mobile_no"`
	BeneficiaryMobileNo string `json:"beneficiary_mobile_no"`
	Amount              int    `json:"amount"`
	TransactionID       string `json:"transaction_id"`
	Status              string `json:"status"`
}

func GetPaymentByTransactionId

func GetPaymentByTransactionId(transactionId *string, db *sql.DB) (*Payment, error)

func InsertIntoPayment

func InsertIntoPayment(req *requests.MakePaymentRequest, transactionId *string, db *sql.DB) (*Payment, error)

func NewPaymentWithMakePaymentRequest

func NewPaymentWithMakePaymentRequest(req *requests.MakePaymentRequest, transactionId *string) *Payment

type User

type User struct {
	Id       int    `json:"id" db:"id"`
	FullName string `json:"full_name" db:"full_name"`
	Email    string `json:"email" db:"email"`
	Password string `json:"password,omitempty" db:"password"`
	Token    string `json:"token,omitempty"`
}

func GetUserByEmail

func GetUserByEmail(email *string, db *sql.DB) (*User, error)

Jump to

Keyboard shortcuts

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