domain

package
v1.0.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProfileFollowingCreatedEventName = "event:profileFollowingCreated"
	ProfileFollowingDeletedEventName = "event:profileFollowingDeleted"
)

Variables

View Source
var (
	ErrInvalidFirstNameLength = &errors.Error{
		Err:    "invalid first_name length",
		Code:   "BAD_REQUEST",
		Status: http.StatusBadRequest,
	}
	ErrInvalidLastNameLength = &errors.Error{
		Err:    "invalid last_name length",
		Code:   "BAD_REQUEST",
		Status: http.StatusBadRequest,
	}
	ErrInvalidCityLength = &errors.Error{
		Err:    "invalid city length",
		Code:   "BAD_REQUEST",
		Status: http.StatusBadRequest,
	}
	ErrInvalidInterestsLength = &errors.Error{
		Err:    "invalid interests length",
		Code:   "BAD_REQUEST",
		Status: http.StatusBadRequest,
	}
	ErrIncorrectGender = &errors.Error{
		Err:    fmt.Sprintf("incorrect gender type: may only %s, %s", GenderTypeFemale, GenderTypeMale),
		Code:   "BAD_REQUEST",
		Status: http.StatusBadRequest,
	}
)

Functions

This section is empty.

Types

type Account

type Account struct {
	ID           uuid.UUID `db:"id" json:"id"`
	Login        string    `db:"login" json:"login"`
	PasswordHash []byte    `db:"password_hash" json:"-"`
	PasswordSalt []byte    `db:"password_salt" json:"-"`
}

type GenderType

type GenderType string
const (
	GenderTypeMale   GenderType = "male"
	GenderTypeFemale GenderType = "female"
)

type Profile

type Profile struct {
	ID        uuid.UUID   `db:"id" json:"id"`
	FirstName string      `db:"first_name" json:"first_name"`
	LastName  string      `db:"last_name" json:"last_name"`
	BirthDate *types.Date `db:"birth_date" json:"birth_date"`
	Gender    GenderType  `db:"gender" json:"gender"`
	Interests string      `db:"interests" json:"interests"`
	City      string      `db:"city" json:"city"`
}

func (*Profile) Modify

func (dto *Profile) Modify()

func (*Profile) Validate

func (dto *Profile) Validate() error

TODO add test for validate function

type ProfileFollowingCreatedEvent

type ProfileFollowingCreatedEvent struct {
	ProfileID  uuid.UUID
	FollowerID uuid.UUID
}

type ProfileFollowingDeletedEvent

type ProfileFollowingDeletedEvent struct {
	ProfileID  uuid.UUID
	FollowerID uuid.UUID
}

Jump to

Keyboard shortcuts

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