Documentation
¶
Index ¶
- func SendPasswordResetEmail(toEmail, username, token string) error
- func SendSignUpEmail(toEmail, username, token string) error
- type AIFirstResponse
- type AIPersistedResponse
- func (a *AIPersistedResponse) GetAllAIResponses(db *gorm.DB, userID string) (*AIPersistedResponse, error)
- func (a *AIPersistedResponse) GetResponseByDateRange(db *gorm.DB, userID string, from, to time.Time, pagination config.Pagination) ([]AIPersistedResponse, error)
- func (a *AIPersistedResponse) GetResponseByNoOfDays(db *gorm.DB, userID string, days int, pagination config.Pagination) ([]AIPersistedResponse, error)
- func (a *AIPersistedResponse) GetTodayResponse(db *gorm.DB, userID string, pagination config.Pagination) ([]AIPersistedResponse, error)
- type AIResponse
- type AIServiceImpl
- type AIServiceRequest
- type AIServiceResponse
- type AuthErrorResponse
- type ConfirmSignupRequest
- type ConfirmSignupResponse
- type Email
- type EmailTemplateData
- type ErrorResponse
- type IntString
- type InvestmentAdvice
- type JWTClaims
- type LoginRequest
- type LoginResponse
- type LogoutRequest
- type LogoutResponse
- type PasswordChangeRequest
- type PasswordChangeResponse
- type PasswordReset
- func (p *PasswordReset) CreatePasswordReset(db *gorm.DB, passReset *PasswordReset) error
- func (p *PasswordReset) GetPasswordResetByEmail(db *gorm.DB, email string) (*PasswordReset, error)
- func (p *PasswordReset) GetPasswordResetByID(db *gorm.DB, id string) (*PasswordReset, error)
- func (p *PasswordReset) GetPasswordResetByToken(db *gorm.DB, token string) (*PasswordReset, error)
- func (p *PasswordReset) UpdatePasswordReset(db *gorm.DB, reset *PasswordReset) error
- type PasswordResetRequest
- type PasswordResetResponse
- type Profile
- type ProfileRequest
- type ProfileResponse
- type Recommendation
- type ResendLinkResponse
- type ServerErrorResponse
- type SignupRequest
- type SignupResponse
- type User
- func (u *User) CreateUser(db *gorm.DB, user *User) error
- func (u *User) DeleteUser(db *gorm.DB, userID string) error
- func (u *User) GetUserActivityByEmail(db *gorm.DB, email string) (*User, error)
- func (u *User) GetUserByEmail(db *gorm.DB, email string) (*User, error)
- func (u *User) GetUserByID(db *gorm.DB, id string) (*User, error)
- func (u *User) GetUserByUsername(db *gorm.DB, name string) (*User, error)
- func (u *User) IsUserActive(db *gorm.DB, isActive bool) (bool, error)
- func (u *User) UpdateUserPassword(db *gorm.DB, user *User) error
- type UserSession
- func (u *UserSession) CreateUserSession(db *gorm.DB, session *UserSession) error
- func (u *UserSession) DeleteUserSession(db *gorm.DB, userID string) error
- func (u *UserSession) GetUserSession(db *gorm.DB, userID string, token string) (*UserSession, error)
- func (u *UserSession) GetUserSessionByID(db *gorm.DB, userID string) (*UserSession, error)
- func (u *UserSession) HardDeleteUserSession(db *gorm.DB, userID string) error
- func (p *UserSession) UpdateUserSession(db *gorm.DB, session *UserSession) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendPasswordResetEmail ¶
func SendSignUpEmail ¶
Types ¶
type AIFirstResponse ¶
type AIFirstResponse struct {
Recommendations []Recommendation `json:"recommendations"`
}
type AIPersistedResponse ¶
type AIPersistedResponse struct { ID uint `gorm:"primaryKey;autoIncrement"` UserID string `json:"userId"` User User `gorm:"foreignKey:UserID"` Status string `json:"status"` Query datatypes.JSON `gorm:"type:jsonb" json:"query"` Data datatypes.JSON `gorm:"type:jsonb" json:"data,omitempty"` Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
func (*AIPersistedResponse) GetAllAIResponses ¶
func (a *AIPersistedResponse) GetAllAIResponses(db *gorm.DB, userID string) (*AIPersistedResponse, error)
func (*AIPersistedResponse) GetResponseByDateRange ¶
func (a *AIPersistedResponse) GetResponseByDateRange(db *gorm.DB, userID string, from, to time.Time, pagination config.Pagination) ([]AIPersistedResponse, error)
func (*AIPersistedResponse) GetResponseByNoOfDays ¶
func (a *AIPersistedResponse) GetResponseByNoOfDays(db *gorm.DB, userID string, days int, pagination config.Pagination) ([]AIPersistedResponse, error)
func (*AIPersistedResponse) GetTodayResponse ¶
func (a *AIPersistedResponse) GetTodayResponse(db *gorm.DB, userID string, pagination config.Pagination) ([]AIPersistedResponse, error)
type AIResponse ¶
type AIResponse struct { Status string `json:"status" example:"success"` Data InvestmentAdvice `json:"data,omitempty"` }
type AIServiceImpl ¶
type AIServiceImpl struct {
// contains filtered or unexported fields
}
func NewAIService ¶
func NewAIService(apiKey string) (*AIServiceImpl, error)
func (*AIServiceImpl) FineTunedResponse ¶
func (a *AIServiceImpl) FineTunedResponse(req AIServiceRequest) (string, error)
func (*AIServiceImpl) GetAIResponse ¶
func (a *AIServiceImpl) GetAIResponse(message string) (string, error)
type AIServiceRequest ¶
type AIServiceRequest struct { Age int `json:"age" validate:"required"` Location string `json:"location" validate:"required"` InvestmentKnowledge string `json:"investmentKnowledge" validate:"required"` InvestmentPurpose string `json:"investmentPurpose" validate:"required"` InvestmentHorizon int `json:"investmentHorizon" validate:"required"` RiskTolerance string `json:"riskTolerance" validate:"required"` Amount float64 `json:"amount" validate:"required"` Currency string `json:"currency" validate:"required"` }
type AIServiceResponse ¶
type AuthErrorResponse ¶
type ConfirmSignupRequest ¶
type ConfirmSignupResponse ¶
type EmailTemplateData ¶
type ErrorResponse ¶
type InvestmentAdvice ¶
type InvestmentAdvice struct {
InvestmentAdvice string `json:"investmentAdvice" example:"Based on your risk tolerance, we recommend a diversified portfolio of stocks and bonds."`
}
type LoginRequest ¶
type LoginResponse ¶
type LogoutRequest ¶
type LogoutRequest struct {
Email string `json:"email" binding:"required,email"`
}
type LogoutResponse ¶
type PasswordChangeRequest ¶
type PasswordChangeResponse ¶
type PasswordReset ¶
type PasswordReset struct { ID string `gorm:"type:uuid;primaryKey;unique;not null"` UserID string `gorm:"index"` Email string `gorm:"uniqueIndex;not null"` Token string `gorm:"uniqueIndex;not null"` ExpiresAt time.Time `gorm:"not null"` CreatedAt time.Time }
func (*PasswordReset) CreatePasswordReset ¶
func (p *PasswordReset) CreatePasswordReset(db *gorm.DB, passReset *PasswordReset) error
func (*PasswordReset) GetPasswordResetByEmail ¶
func (p *PasswordReset) GetPasswordResetByEmail(db *gorm.DB, email string) (*PasswordReset, error)
func (*PasswordReset) GetPasswordResetByID ¶
func (p *PasswordReset) GetPasswordResetByID(db *gorm.DB, id string) (*PasswordReset, error)
func (*PasswordReset) GetPasswordResetByToken ¶
func (p *PasswordReset) GetPasswordResetByToken(db *gorm.DB, token string) (*PasswordReset, error)
func (*PasswordReset) UpdatePasswordReset ¶
func (p *PasswordReset) UpdatePasswordReset(db *gorm.DB, reset *PasswordReset) error
type PasswordResetRequest ¶
type PasswordResetRequest struct {
Email string `json:"email" binding:"required,email"`
}
type PasswordResetResponse ¶
type ProfileRequest ¶
type ProfileRequest struct {
Email string `json:"email" binding:"required,email"`
}
type ProfileResponse ¶
type Recommendation ¶
type Recommendation struct { FinancialProduct string `json:"financial_product"` Ticker string `json:"ticker"` Provider string `json:"provider"` BriefDescription string `json:"brief_description"` ExpectedReturn string `json:"expected_return"` Composition IntString `json:"composition"` Principal IntString `json:"principal"` EstimatedReturnValue IntString `json:"estimated_return_value"` }
type ResendLinkResponse ¶
type ServerErrorResponse ¶
type SignupRequest ¶
type SignupResponse ¶
type User ¶
type User struct { ID string `gorm:"type:uuid;primaryKey;unique;not null"` Name string `gorm:"not null"` Email string `gorm:"uniqueIndex;not null"` Password string `gorm:"not null"` FirstName string `gorm:"not null"` LastName string `gorm:"not null"` IsActive bool `gorm:"default:false"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` }
func (*User) GetUserActivityByEmail ¶
func (*User) GetUserByEmail ¶
func (*User) GetUserByUsername ¶
type UserSession ¶
type UserSession struct { ID string `gorm:"type:uuid;primaryKey;unique;not null"` UserID string `gorm:"index;unique;not null"` Token string `gorm:"uniqueIndex;not null"` ExpiresAt time.Time `gorm:"not null"` CreatedAt time.Time }
func (*UserSession) CreateUserSession ¶
func (u *UserSession) CreateUserSession(db *gorm.DB, session *UserSession) error
func (*UserSession) DeleteUserSession ¶
func (u *UserSession) DeleteUserSession(db *gorm.DB, userID string) error
func (*UserSession) GetUserSession ¶
func (u *UserSession) GetUserSession(db *gorm.DB, userID string, token string) (*UserSession, error)
func (*UserSession) GetUserSessionByID ¶
func (u *UserSession) GetUserSessionByID(db *gorm.DB, userID string) (*UserSession, error)
func (*UserSession) HardDeleteUserSession ¶
func (u *UserSession) HardDeleteUserSession(db *gorm.DB, userID string) error
func (*UserSession) UpdateUserSession ¶
func (p *UserSession) UpdateUserSession(db *gorm.DB, session *UserSession) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.