models

package
v0.0.0-...-a67f385 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Id        int        `json:"id,omitempty" db:"id"`
	PublicId  uuid.UUID  `json:"public_id" db:"public_id" binding:"required"`
	Name      string     `json:"name" db:"name" binding:"required"`
	Username  string     `json:"username" db:"username" binding:"required"`
	Token     string     `json:"token,omitempty" db:"token"`
	Role      Role       `json:"role" db:"role" binding:"required"`
	CreatedAt *time.Time `json:"created_at" db:"created_at"`
}

type Event

type Event struct {
	Type  EventType
	Value interface{}
}

type EventType

type EventType string
const (
	EVENT_ACCOUNT_CREATED EventType = "auth.created"
	EVENT_ACCOUNT_UPDATED EventType = "auth.updated"
	EVENT_ACCOUNT_REMOVED EventType = "auth.removed"

	EVENT_TASK_CREATED       EventType = "task.created"
	EVENT_TASK_BIRD_CAGED    EventType = "task.bird_caged"
	EVENT_TASK_MILLET_BOWLED EventType = "task.millet_bowled"
)

type Role

type Role int // TODO перевести все константы в верхний регистр
const (
	Employee Role = iota
	Manager
	Accountant
	Admin
)

type Task

type Task struct {
	Id                int        `json:"id" db:"id"`
	PublicId          uuid.UUID  `json:"public_id" db:"public_id"`
	AssignedAccountId int        `json:"assigned_account_id" db:"assigned_account_id"`
	Description       string     `json:"description" db:"description" binding:"required"`
	JiraId            string     `json:"jira_id,omitempty" db:"jira_id"`
	Status            TaskStatus `json:"status" db:"status"`
	CreatedAt         *time.Time `json:"created_at" db:"created_at"`
}

type TaskStatus

type TaskStatus int
const (
	TASK_DEFAULT        TaskStatus = iota
	TASK_BIRD_IN_CAGE              // Assigned
	TASK_MILLET_IN_BOWL            // Completed
)

Jump to

Keyboard shortcuts

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