userModel

package
v0.0.0-...-dd40e37 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupSchemaAndIndexes

func SetupSchemaAndIndexes(client *mongo.Client) error

Types

type Address

type Address struct {
	HouseName string `bson:"houseName" json:"houseName"`
	Landmark  string `bson:"landmark" json:"landmark"`
	City      string `bson:"city" json:"city"`
	State     string `bson:"state" json:"state"`
	Pincode   int    `bson:"pincode" json:"pincode"`
}

type DeliveryAddress

type DeliveryAddress struct {
	Name      string `bson:"name" json:"name"`
	HouseName string `bson:"houseName" json:"houseName"`
	Landmark  string `bson:"landmark" json:"landmark"`
	City      string `bson:"city" json:"city"`
	State     string `bson:"state" json:"state"`
	Pincode   int    `bson:"pincode" json:"pincode"`
	Phone     string `bson:"phone" json:"phone"`
}

type User

type User struct {
	ID              primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	Name            string             `bson:"name" json:"name" validate:"required"`
	Email           string             `bson:"email" json:"email" validate:"required,email" index:"unique"`
	Phone           string             `bson:"phone" json:"phone"`
	ProfilePic      string             `bson:"profilePic" json:"profilePic"`
	Password        string             `bson:"password" json:"password"`
	Address         Address            `bson:"address" json:"address"`
	DeliveryAddress []DeliveryAddress  `bson:"deliveryAddress" json:"deliveryAddress"`
	ProfilePicture  string             `bson:"profilePicture" json:"profilePicture"`
	Orders          []string           `bson:"orders" json:"orders"`
	Wishlists       []string           `bson:"wishlists" json:"wishlists"`
	Bag             []string           `bson:"bag" json:"bag"`
	CreatedAt       time.Time          `bson:"createdAt" json:"createdAt" immutable:"true"`
	LastLoggedIn    time.Time          `bson:"lastLoggedIn" json:"lastLoggedIn"`
	UpdatedAt       time.Time          `bson:"updatedAt" json:"updatedAt"`
}

Jump to

Keyboard shortcuts

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