models

package
v0.0.0-...-437e729 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValidRoles

func GetValidRoles() []string

Types

type CreateUserDTO

type CreateUserDTO struct {
	Name            string `json:"name" validate:"required,min=2,max=100"`
	Email           string `json:"email" validate:"required,email"`
	Password        string `json:"password" validate:"required,min=8,max=32"`
	ConfirmPassword string `json:"confirmPassword" validate:"required,min=8,max=32"`
}

type JwtToken

type JwtToken struct {
	Token     string     `json:"token"`
	ExpiresAt *time.Time `json:"expiresAt"`
}

type LoginDTO

type LoginDTO struct {
	Email    string `json:"email" validate:"required,email"`
	Password string `json:"password" validate:"required"`
}

type Project

type Project struct {
	ID          uuid.UUID `json:"id"`
	Name        string    `json:"name" validate:"required,min=3,max=255"`
	Description string    `json:"description"`
	StartDate   time.Time `json:"startDate"`
	EndDate     time.Time `json:"endDate"`
	OwnerId     uuid.UUID `json:"ownerId"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

type ProjectMember

type ProjectMember struct {
	ProjectId uuid.UUID `json:"projectId,omitempty" validate:"required"`
	UserId    uuid.UUID `json:"userId" validate:"required"`
	Role      Role      `json:"role" validate:"required,role"`
	JoinedAt  time.Time `json:"joinedAt"`
	User
}

func (*ProjectMember) CanDeleteProject

func (pm *ProjectMember) CanDeleteProject() bool

func (*ProjectMember) CanEditProject

func (pm *ProjectMember) CanEditProject() bool

type Role

type Role string
const (
	RoleOwner  Role = "owner"
	RoleAdmin  Role = "admin"
	RoleMember Role = "member"
)

func (Role) String

func (r Role) String() string

type Task

type Task struct {
	ID          uuid.UUID `json:"id"`
	Title       string    `json:"title" validate:"required,min=1,max=255"`
	Description string    `json:"description"`
	Status      string    `json:"status" validate:"required"`
	Priority    string    `json:"priority" validate:"required"`
	Assignee    uuid.UUID `json:"assignee" validate:"required,uuid"`
	DueDate     time.Time `json:"dueDate"`
	ProjectID   uuid.UUID `json:"projectId"`
	CreatedBy   uuid.UUID `json:"createdBy"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

type User

type User struct {
	ID        uuid.UUID `json:"id,omitempty"`
	Name      string    `json:"name"`
	Email     string    `json:"email"`
	Password  string    `json:"-"`
	CreatedAt time.Time `json:"createdAt,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳