entity

package
v0.0.0-...-6dde671 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateID

func GenerateID() string

GenerateID generates a unique ID that can be used as an identifier for an entity.

Types

type Album

type Album struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

Album represents an album record.

type Business

type Business struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"`
	Name        string             `bson:"name"`
	CategoryID  primitive.ObjectID `bson:"category_id"`
	Description string             `bson:"description"`
	Website     string             `bson:"website"`
	Phone       string             `bson:"phone"`
	Email       string             `bson:"email"`

	OwnerId       primitive.ObjectID
	OwnerName     string
	OwnerJobTitle string
}

type BusinessCategory

type BusinessCategory struct {
	ID          primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
	Name        string             `json:"name,omitempty" bson:"name,omitempty" validate:"required"`
	Description string             `json:"description,omitempty" bson:"description,omitempty"`
	IsFeatured  bool               `json:"featured" bson:"isFeatured,omitempty"`
	IconUrl     string             `json:"iconUrl" bson:"iconUrl"`
	CreatedAt   time.Time          `json:"created_at"`
	UpdatedAt   time.Time          `json:"updated_at"`
	IsDeleted   bool               `json:"is_deleted"`
}

BusinessCategory represents the category each business_ falls in

type User

type User struct {
	ID             primitive.ObjectID `bson:"_id,omitempty"`
	Name           string             `bson:"name"`
	Email          string             `bson:"email"`
	Role           []string           `bson:"role"`
	HashedPassword []byte             `bson:"hashed_password"`
	CreatedAt      time.Time          `json:"created_at"`
	UpdatedAt      time.Time          `json:"updated_at"`
}

User represents a user.

func (User) GetID

func (u User) GetID() primitive.ObjectID

GetID returns the user ID.

func (User) GetName

func (u User) GetName() string

GetName returns the user name.

func (User) GetRole

func (u User) GetRole() []string

Jump to

Keyboard shortcuts

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