models

package
v0.0.0-...-2d31ac5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRequest

type AuthRequest struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type Entity

type Entity struct {
}

Entity all models will be of this type

type Login

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

type LoginResponse

type LoginResponse struct {
	Token        string `json:"token"`
	RefreshToken string `json:"refresh_token"`
}

type Product

type Product struct {
	Entity
	Id          primitive.ObjectID `json:"id" bson:"_id"`
	Name        string             `json:"name" bson:"name"`
	Description string             `json:"description,omitempty" bson:"description"`
	BasePrice   string             `json:"basePrice" bson:"basePrice"`
	Category    string             `json:"category" bson:"category"`
	ImageURL    string             `json:"imageURL,omitempty" bson:"imageURL"`
	Tags        []string           `json:"tags,omitempty" bson:"tags,omitempty"`
	Version     int                `json:"version" bson:"version"`
}

func (Product) Clone

func (p Product) Clone() *Product

type SignedDetails

type SignedDetails struct {
	Email     string
	FirstName string
	LastName  string
	Uid       string
	UserType  string
	jwt.MapClaims
}

type SignupResponse

type SignupResponse struct {
	Name      string    `json:"name"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"createdAt"`
}

type User

type User struct {
	Id                 primitive.ObjectID `json:"id" bson:"_id"`
	Name               string             `json:"name" bson:"name" binding:"required"`
	Email              string             `json:"email" bson:"email" binding:"required"`
	Password           string             `json:"password" bson:"password" binding:"required,min=8"`
	PasswordConfirm    string             `json:"passwordConfirm" bson:"passwordConfirm,omitempty" binding:"required"`
	Role               string             `json:"role" bson:"role"`
	VerificationCode   string             `json:"verificationCode,omitempty" bson:"verificationCode,omitempty"`
	ResetPasswordToken string             `json:"resetPasswordToken,omitempty" bson:"resetPasswordToken,omitempty"`
	ResetPasswordAt    time.Time          `json:"resetPasswordAt,omitempty" bson:"resetPasswordAt,omitempty"`
	Status             string             `json:"status" bson:"status"`
	Verified           bool               `json:"verified" bson:"verified"`
	CreatedAt          time.Time          `json:"createdAt" bson:"createdAt"`
	UpdatedAt          time.Time          `json:"updatedAt" bson:"updatedAt"`
}

Jump to

Keyboard shortcuts

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