request

package
v0.0.0-...-8cb3723 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountID

func AccountID(c *gin.Context) (int, error)

func ID

func ID(c *gin.Context) (int, error)

ID returns id url parameter. In case of conversion error to int, request will be aborted with StatusBadRequest.

Types

type Charge

type Charge struct {
	Amount    string `json:"amount" binding:"required"`
	AccountID string `json:"account_id" binding:"required"`
}

Credentials stores the username and password provided in the request

func ChargeBody

func ChargeBody(c *gin.Context) (*Charge, error)

Login parses out the username and password in gin's request context, into Credentials

type Credentials

type Credentials struct {
	Email    string `json:"email" binding:"required"`
	Password string `json:"password" binding:"required"`
}

Credentials stores the username and password provided in the request

func Login

func Login(c *gin.Context) (*Credentials, error)

Login parses out the username and password in gin's request context, into Credentials

type EmailSignup

type EmailSignup struct {
	Email    string `json:"email" binding:"required,min=3,email"`
	Password string `json:"password" binding:"required,min=8"`
}

EmailSignup contains the user signup request

func AccountSignup

func AccountSignup(c *gin.Context) (*EmailSignup, error)

AccountSignup validates user signup request

type ForgotPayload

type ForgotPayload struct {
	Email string `json:"email" binding:"required"`
}

ForgotPayload stores the email provided in the request

func Forgot

func Forgot(c *gin.Context) (*ForgotPayload, error)

Forgot parses out the email in gin's request context, into ForgotPayload

type MagicSignup

type MagicSignup struct {
	Email string `json:"email" binding:"required,min=3,email"`
}

MagicSignup contains the user signup request with a mobile number

func Magic

func Magic(c *gin.Context) (*MagicSignup, error)

Magic validates user signup request via mobile

type MobileSignup

type MobileSignup struct {
	CountryCode string `json:"country_code" binding:"required,min=2"`
	Mobile      string `json:"mobile" binding:"required"`
}

MobileSignup contains the user signup request with a mobile number

func Mobile

func Mobile(c *gin.Context) (*MobileSignup, error)

Mobile validates user signup request via mobile

type MobileVerify

type MobileVerify struct {
	CountryCode string `json:"country_code" binding:"required,min=2"`
	Mobile      string `json:"mobile" binding:"required"`
	Code        string `json:"code" binding:"required"`
	Signup      bool   `json:"signup" binding:"required"`
}

MobileVerify contains the user's mobile verification country code, mobile number and verification code

func AccountVerifyMobile

func AccountVerifyMobile(c *gin.Context) (*MobileVerify, error)

AccountVerifyMobile validates user mobile verification

type Pagination

type Pagination struct {
	Limit  int `form:"limit"`
	Page   int `form:"page" binding:"min=0"`
	Offset int `json:"-"`
}

Pagination contains pagination request

func Paginate

func Paginate(c *gin.Context) (*Pagination, error)

Paginate validates pagination requests

type Password

type Password struct {
	ID          int    `json:"-"`
	OldPassword string `json:"old_password" binding:"required,min=8"`
	NewPassword string `json:"new_password" binding:"required,min=8"`
}

Password contains password change request

func PasswordChange

func PasswordChange(c *gin.Context) (*Password, error)

PasswordChange validates password change request

type RecoverPasswordPayload

type RecoverPasswordPayload struct {
	Email           string `json:"email" binding:"required"`
	OTP             string `json:"otp" binding:"required"`
	Password        string `json:"password" binding:"required"`
	ConfirmPassword string `json:"confrim_password" binding:"required"`
}

RecoverPasswordPayload stores the data provided in the request

func RecoverPassword

func RecoverPassword(c *gin.Context) (*RecoverPasswordPayload, error)

RecoverPassword parses out the data in gin's request context, into RecoverPasswordPayload

type ReferralVerify

type ReferralVerify struct {
	ReferralCode string `json:"referral_code" binding:"required"`
}

func ReferralCodeVerify

func ReferralCodeVerify(c *gin.Context) (*ReferralVerify, error)

ReferralCodeVerify verifies referral code

type RegisterAdmin

type RegisterAdmin struct {
	FirstName                         string `json:"first_name" binding:"required"`
	LastName                          string `json:"last_name" binding:"required"`
	Username                          string `json:"username" binding:"required,min=3,alphanum"`
	Password                          string `json:"password" binding:"required,min=8"`
	Email                             string `json:"email" binding:"required,email"`
	RoleID                            int    `json:"role_id" binding:"required"`
	AccountID                         string `json:"account_id"`
	AccountNumber                     string `json:"account_number"`
	AccountCurrency                   string `json:"account_currency"`
	AccountStatus                     string `json:"account_status"`
	DOB                               string `json:"dob"`
	City                              string `json:"city"`
	State                             string `json:"state"`
	Country                           string `json:"country"`
	TaxIDType                         string `json:"tax_id_type"`
	TaxID                             string `json:"tax_id"`
	FundingSource                     string `json:"funding_source"`
	EmploymentStatus                  string `json:"employment_status"`
	InvestingExperience               string `json:"investing_experience"`
	PublicShareholder                 string `json:"public_shareholder"`
	AnotherBrokerage                  string `json:"another_brokerage"`
	DeviceID                          string `json:"device_id"`
	ProfileCompletion                 string `json:"profile_completion"`
	BIO                               string `json:"bio"`
	FacebookURL                       string `json:"facebook_url"`
	TwitterURL                        string `json:"twitter_url"`
	InstagramURL                      string `json:"instagram_url"`
	PublicPortfolio                   string `json:"public_portfolio"`
	EmployerName                      string `json:"employer_name"`
	Occupation                        string `json:"occupation"`
	UnitApt                           string `json:"unit_apt"`
	ZipCode                           string `json:"zip_code"`
	StockSymbol                       string `json:"stock_symbol"`
	BrokerageFirmName                 string `json:"brokerage_firm_name"`
	BrokerageFirmEmployeeName         string `json:"brokerage_firm_employee_name"`
	BrokerageFirmEmployeeRelationship string `json:"brokerage_firm_employee_relationship"`
	ShareholderCompanyName            string `json:"shareholder_company_name"`
	Avatar                            string `json:"avatar"`
	ReferralCode                      string `json:"referral_code"`
	ReferredBy                        string `json:"referred_by"`
}

RegisterAdmin contains admin registration request

func AccountCreate

func AccountCreate(c *gin.Context) (*RegisterAdmin, error)

AccountCreate validates account creation request

type SetAccessToken

type SetAccessToken struct {
	PublicToken string `json:"public_token" binding:"required"`
	AccountID   string `json:"account_id" binding:"required"`
}

Credentials stores the username and password provided in the request

func SetAccessTokenbody

func SetAccessTokenbody(c *gin.Context) (*SetAccessToken, error)

Login parses out the username and password in gin's request context, into Credentials

type Update

type Update struct {
	ID                                int     `json:"id"`
	FirstName                         *string `json:"first_name"`
	LastName                          *string `json:"last_name"`
	Username                          *string `json:"username"`
	Password                          *string `json:"-"`
	Email                             *string `json:"email"`
	Mobile                            *string `json:"mobile"`
	CountryCode                       *string `json:"country_code"`
	Address                           *string `json:"address"`
	AccountID                         *string `json:"account_id"`
	AccountNumber                     *string `json:"account_number"`
	AccountCurrency                   *string `json:"account_currency"`
	AccountStatus                     *string `json:"account_status"`
	DOB                               *string `json:"dob"`
	City                              *string `json:"city"`
	State                             *string `json:"state"`
	Country                           *string `json:"country"`
	TaxIDType                         *string `json:"tax_id_type"`
	TaxID                             *string `json:"tax_id"`
	FundingSource                     *string `json:"funding_source"`
	EmploymentStatus                  *string `json:"employment_status"`
	InvestingExperience               *string `json:"investing_experience"`
	PublicShareholder                 *string `json:"public_shareholder"`
	AnotherBrokerage                  *string `json:"another_brokerage"`
	DeviceID                          *string `json:"device_id"`
	ProfileCompletion                 *string `json:"profile_completion"`
	BIO                               *string `json:"bio"`
	FacebookURL                       *string `json:"facebook_url"`
	TwitterURL                        *string `json:"twitter_url"`
	InstagramURL                      *string `json:"instagram_url"`
	PublicPortfolio                   *string `json:"public_portfolio"`
	EmployerName                      *string `json:"employer_name"`
	Occupation                        *string `json:"occupation"`
	UnitApt                           *string `json:"unit_apt"`
	ZipCode                           *string `json:"zip_code"`
	StockSymbol                       *string `json:"stock_symbol"`
	BrokerageFirmName                 *string `json:"brokerage_firm_name"`
	BrokerageFirmEmployeeName         *string `json:"brokerage_firm_employee_name"`
	BrokerageFirmEmployeeRelationship *string `json:"brokerage_firm_employee_relationship"`
	ShareholderCompanyName            *string `json:"shareholder_company_name"`
	Avatar                            *string `json:"avatar"`
	ReferredBy                        *string `json:"referred_by"`
	WatchlistID                       *string `json:"watchlist_id"`
}

Update contains password change request

func UpdateProfile

func UpdateProfile(c *gin.Context) (*Update, error)

UpdateProfile updates user's profile

type UpdateUser

type UpdateUser struct {
	ID                                int     `json:"-"`
	FirstName                         *string `json:"first_name,omitempty" binding:"omitempty,min=2"`
	LastName                          *string `json:"last_name,omitempty" binding:"omitempty,min=2"`
	Mobile                            *string `json:"mobile,omitempty"`
	Phone                             *string `json:"phone,omitempty"`
	Address                           *string `json:"address,omitempty"`
	AccountID                         *string `json:"account_id,omitempty"`
	AccountNumber                     *string `json:"account_number,omitempty"`
	AccountCurrency                   *string `json:"account_currency,omitempty"`
	AccountStatus                     *string `json:"account_status,omitempty"`
	DOB                               *string `json:"dob,omitempty"`
	City                              *string `json:"city,omitempty"`
	State                             *string `json:"state,omitempty"`
	Country                           *string `json:"country,omitempty"`
	TaxIDType                         *string `json:"tax_id_type,omitempty"`
	TaxID                             *string `json:"tax_id,omitempty"`
	FundingSource                     *string `json:"funding_source,omitempty"`
	EmploymentStatus                  *string `json:"employment_status"`
	InvestingExperience               *string `json:"investing_experience,omitempty"`
	PublicShareholder                 *string `json:"public_shareholder,omitempty"`
	AnotherBrokerage                  *string `json:"another_brokerage,omitempty"`
	DeviceID                          *string `json:"device_id,omitempty"`
	ProfileCompletion                 *string `json:"profile_completion,omitempty"`
	BIO                               *string `json:"bio,omitempty"`
	FacebookURL                       *string `json:"facebook_url,omitempty"`
	TwitterURL                        *string `json:"twitter_url,omitempty"`
	InstagramURL                      *string `json:"instagram_url,omitempty"`
	PublicPortfolio                   *string `json:"public_portfolio,omitempty"`
	EmployerName                      *string `json:"employer_name,omitempty"`
	Occupation                        *string `json:"occupation,omitempty"`
	UnitApt                           *string `json:"unit_apt,omitempty"`
	ZipCode                           *string `json:"zip_code,omitempty"`
	StockSymbol                       *string `json:"stock_symbol,omitempty"`
	BrokerageFirmName                 *string `json:"brokerage_firm_name,omitempty"`
	BrokerageFirmEmployeeName         *string `json:"brokerage_firm_employee_name,omitempty"`
	BrokerageFirmEmployeeRelationship *string `json:"brokerage_firm_employee_relationship,omitempty"`
	ShareholderCompanyName            *string `json:"shareholder_company_name,omitempty"`
	Avatar                            *string `json:"avatar,omitempty"`
	ReferredBy                        *string `json:"referred_by,omitempty"`
	ReferralCode                      *string `json:"referral_code,omitempty"`
}

UpdateUser contains user update data from json request

func UserUpdate

func UserUpdate(c *gin.Context) (*UpdateUser, error)

UserUpdate validates user update request

Jump to

Keyboard shortcuts

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