profile

package
v0.0.0-...-d49efea Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProfileRepository

func NewProfileRepository(db *mongo.Database) *repository

func NewProfileService

func NewProfileService(repository Repository) *service

func NewPutProfileService

func NewPutProfileService(repository Repository) *putservice

Types

type Address

type Address struct {
	Street     string `json:"street,omitempty" validate:"omitempty" updateValidation:"omitempty"`
	City       string `json:"city" validate:"required" updateValidation:"omitempty"`
	State      string `json:"state" validate:"required" updateValidation:"omitempty"`
	PostalCode string `json:"postalCode" validate:"required" updateValidation:"omitempty"`
	Country    string `json:"country" validate:"required" updateValidation:"omitempty"`
}

type PutService

type PutService interface {
	PutProfileService(userID string, input *UpdateProfileInput) (*model.User, error)
}

type Repository

type Repository interface {
	UpdateProfile(userID string, updates bson.M) (*model.User, error)
}

type Service

type Service interface {
	UpdateProfileService(userID string, input *UpdateProfileInput) (*model.User, error)
}

type UpdateProfileInput

type UpdateProfileInput struct {
	FirstName      string  `json:"firstName" validate:"required,alpha" updateValidation:"omitempty,alpha"`
	LastName       string  `json:"lastName" validate:"required,alpha" updateValidation:"omitempty,alpha"`
	Phone          string  `json:"phone" validate:"required,e164" updateValidation:"omitempty,e164"`
	Address        Address `json:"address" validate:"required" updateValidation:"omitempty"`
	Birthday       string  `json:"birthday" validate:"required,customdate,datebeforetoday" updateValidation:"omitempty,customdate,datebeforetoday"`
	Gender         string  `json:"gender" validate:"required,oneof=male female" updateValidation:"omitempty,oneof=male female"`
	Nationality    string  `json:"nationality" validate:"omitempty" updateValidation:"omitempty"`
	Bio            string  `json:"bio" validate:"omitempty" updateValidation:"omitempty"`
	ProfilePicture string  `json:"profilePicture" validate:"omitempty,url" updateValidation:"omitempty,url"`
}

type UserProfileUpdateError

type UserProfileUpdateError struct {
	*util.BaseError
}

func (*UserProfileUpdateError) Error

func (e *UserProfileUpdateError) Error() string

Jump to

Keyboard shortcuts

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