entity

package
v0.0.0-...-c3afde3 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package entity defines all structs that flow through all application layers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrAlreadyExists

func ErrAlreadyExists() error

ErrAlreadyExists returns codes.AlreadyExists explained that the user already exists.

func ErrEmptyUser

func ErrEmptyUser() error

ErrEmptyUser returns codes.InvalidArgument explained that the instance is empty or nil.

func ErrInternal

func ErrInternal(message string) error

ErrInternal returns codes.Internal explained that unexpected behavior occurred in system.

func ErrInvalidEmail

func ErrInvalidEmail() error

ErrInvalidEmail returns codes.InvalidArgument explained that the user's email is invalid.

func ErrInvalidName

func ErrInvalidName() error

ErrInvalidName returns codes.InvalidArgument explained that the user's name is invalid.

func ErrNotFound

func ErrNotFound() error

ErrNotFound returns codes.NotFound explained that the user is not found.

Types

type Auditable

type Auditable struct {
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
	CreatedBy string
	UpdatedBy string
	DeletedBy string
}

Auditable defines logical data related to audit.

type RegisterUserInput

type RegisterUserInput struct {
	User *User
}

RegisterUserInput holds input data for register user workflow.

type RegisterUserOutput

type RegisterUserOutput struct {
}

RegisterUserOutput holds output data for register user workflow.

type User

type User struct {
	ID         string
	KeycloakID string
	Name       string
	Email      string
	Username   string
	Password   string
	Auditable
}

User defines the logical data of a user.

type UserOutbox

type UserOutbox struct {
	ID      string
	Status  UserOutboxStatus
	Payload *User
	Auditable
}

UserOutbox defines logical data of user outbox.

type UserOutboxStatus

type UserOutboxStatus string

UserOutboxStatus enumerates user outbox status.

var (
	// UserOutboxStatusReady means ready to be picked up.
	UserOutboxStatusReady UserOutboxStatus = "READY"
	// UserOutboxStatusProcessed means being processed.
	UserOutboxStatusProcessed UserOutboxStatus = "PROCESSED"
	// UserOutboxStatusDelivered means successfully sent to server.
	UserOutboxStatusDelivered UserOutboxStatus = "DELIVERED"
	// UserOutboxStatusFailed means failure.
	UserOutboxStatusFailed UserOutboxStatus = "FAILED"
)

Jump to

Keyboard shortcuts

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