models

package
v0.0.0-...-84b4eae Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllRole = []Role{
	RoleAdmin,
	RoleUser,
}

Functions

This section is empty.

Types

type Cost

type Cost struct {
	ID          string            `json:"id"`
	Owner       string            `json:"owner"`
	Amount      int               `json:"amount,string"`
	OccurDate   time.Time         `json:"occurDate"`
	Description string            `json:"description"`
	Vote        []string          `json:"vote"`
	Category    PortfolioCategory `json:"category"`
	Privacy     Privacy           `json:"privacy"`
}

func (Cost) IsPortfolio

func (Cost) IsPortfolio()

type CostCategory

type CostCategory string
const (
	CostCategoryInvestment CostCategory = "INVESTMENT"
	CostCategoryDaily      CostCategory = "DAILY"
	CostCategoryLearning   CostCategory = "LEARNING"
	CostCategoryCharity    CostCategory = "CHARITY"
	CostCategoryOthers     CostCategory = "OTHERS"
)

func (CostCategory) IsValid

func (e CostCategory) IsValid() bool

func (CostCategory) MarshalGQL

func (e CostCategory) MarshalGQL(w io.Writer)

func (CostCategory) String

func (e CostCategory) String() string

func (*CostCategory) UnmarshalGQL

func (e *CostCategory) UnmarshalGQL(v interface{}) error

type CreateCostInput

type CreateCostInput struct {
	Amount      int          `bson:"amount,omitempty" json:"amount,string,omitempty"`
	OccurDate   time.Time    `bson:"occurDate,omitempty" json:"occurDate,omitempty"`
	Category    CostCategory `bson:"category,omitempty" json:"category,omitempty"`
	Description string       `bson:"description,omitempty" json:"description,omitempty"`
	Privacy     Privacy      `bson:"privacy,omitempty" json:"privacy,omitempty"`
}

func (CreateCostInput) GetAmount

func (c CreateCostInput) GetAmount() int

func (CreateCostInput) GetCategory

func (c CreateCostInput) GetCategory() PortfolioCategory

func (CreateCostInput) GetDescription

func (c CreateCostInput) GetDescription() string

func (CreateCostInput) GetOccurDate

func (c CreateCostInput) GetOccurDate() time.Time

func (CreateCostInput) GetPrivacy

func (c CreateCostInput) GetPrivacy() Privacy

type CreateIncomeInput

type CreateIncomeInput struct {
	Amount      int            `bson:"amount,omitempty" json:"amount,string,omitempty"`
	OccurDate   time.Time      `bson:"occurDate,omitempty" json:"occurDate,omitempty"`
	Category    IncomeCategory `bson:"category,omitempty" json:"category,omitempty"`
	Description string         `bson:"description,omitempty" json:"description,omitempty"`
	Privacy     Privacy        `bson:"privacy,omitempty" json:"privacy,omitempty"`
}

func (CreateIncomeInput) GetAmount

func (c CreateIncomeInput) GetAmount() int

func (CreateIncomeInput) GetCategory

func (c CreateIncomeInput) GetCategory() PortfolioCategory

func (CreateIncomeInput) GetDescription

func (c CreateIncomeInput) GetDescription() string

func (CreateIncomeInput) GetOccurDate

func (c CreateIncomeInput) GetOccurDate() time.Time

func (CreateIncomeInput) GetPrivacy

func (c CreateIncomeInput) GetPrivacy() Privacy

type CreatePortfolioInput

type CreatePortfolioInput interface {
	GetAmount() int
	GetOccurDate() time.Time
	GetCategory() PortfolioCategory
	GetDescription() string
	GetPrivacy() Privacy
}

type CreateUserInput

type CreateUserInput struct {
	Email    string  `bson:"email,omitempty" json:"email,omitempty"`
	UserID   string  `bson:"userID,omitempty" json:"userId,omitempty"`
	NickName *string `bson:"nickName,omitempty" json:"nickName,omitempty"`
}

type Income

type Income struct {
	ID          string            `json:"id"`
	Owner       string            `json:"owner"`
	Amount      int               `json:"amount,string"`
	OccurDate   time.Time         `json:"occurDate"`
	Description string            `json:"description"`
	Vote        []string          `json:"vote"`
	Category    PortfolioCategory `json:"category"`
	Privacy     Privacy           `json:"privacy"`
}

func (Income) IsPortfolio

func (Income) IsPortfolio()

type IncomeCategory

type IncomeCategory string
const (
	IncomeCategoryInvestment IncomeCategory = "INVESTMENT"
	IncomeCategoryParttime   IncomeCategory = "PARTTIME"
	IncomeCategorySalary     IncomeCategory = "SALARY"
	IncomeCategoryOthers     IncomeCategory = "OTHERS"
)

func (IncomeCategory) IsValid

func (e IncomeCategory) IsValid() bool

func (IncomeCategory) MarshalGQL

func (e IncomeCategory) MarshalGQL(w io.Writer)

func (IncomeCategory) String

func (e IncomeCategory) String() string

func (*IncomeCategory) UnmarshalGQL

func (e *IncomeCategory) UnmarshalGQL(v interface{}) error

type Portfolio

type Portfolio interface {
	IsPortfolio()
}

type PortfolioCategory

type PortfolioCategory string
const (
	PortfolioCategoryInvestment PortfolioCategory = "INVESTMENT"
	PortfolioCategoryParttime   PortfolioCategory = "PARTTIME"
	PortfolioCategorySalary     PortfolioCategory = "SALARY"
	PortfolioCategoryDaily      PortfolioCategory = "DAILY"
	PortfolioCategoryLearning   PortfolioCategory = "LEARNING"
	PortfolioCategoryCharity    PortfolioCategory = "CHARITY"
	PortfolioCategoryOthers     PortfolioCategory = "OTHERS"
)

func (PortfolioCategory) IsValid

func (e PortfolioCategory) IsValid() bool

func (PortfolioCategory) MarshalGQL

func (e PortfolioCategory) MarshalGQL(w io.Writer)

func (PortfolioCategory) String

func (e PortfolioCategory) String() string

func (*PortfolioCategory) UnmarshalGQL

func (e *PortfolioCategory) UnmarshalGQL(v interface{}) error

type Privacy

type Privacy string
const (
	PrivacyPublic  Privacy = "PUBLIC"
	PrivacyFriend  Privacy = "FRIEND"
	PrivacyPrivate Privacy = "PRIVATE"
)

func (Privacy) IsValid

func (e Privacy) IsValid() bool

func (Privacy) MarshalGQL

func (e Privacy) MarshalGQL(w io.Writer)

func (Privacy) String

func (e Privacy) String() string

func (*Privacy) UnmarshalGQL

func (e *Privacy) UnmarshalGQL(v interface{}) error

type Role

type Role string
const (
	RoleAdmin Role = "ADMIN"
	RoleUser  Role = "USER"
)

func (Role) IsValid

func (e Role) IsValid() bool

func (Role) MarshalGQL

func (e Role) MarshalGQL(w io.Writer)

func (Role) String

func (e Role) String() string

func (*Role) UnmarshalGQL

func (e *Role) UnmarshalGQL(v interface{}) error

type UpdateCostInput

type UpdateCostInput struct {
	Amount      *int          `bson:"amount,omitempty" json:"amount,string,omitempty"`
	OccurDate   *time.Time    `bson:"occurDate,omitempty" json:"occurDate,omitempty"`
	Category    *CostCategory `bson:"category,omitempty" json:"category,omitempty"`
	Description *string       `bson:"description,omitempty" json:"description,omitempty"`
	Privacy     *Privacy      `bson:"privacy,omitempty" json:"privacy,omitempty"`
}

func (UpdateCostInput) GetAmount

func (c UpdateCostInput) GetAmount() *int

func (UpdateCostInput) GetCategory

func (c UpdateCostInput) GetCategory() *PortfolioCategory

func (UpdateCostInput) GetDescription

func (c UpdateCostInput) GetDescription() *string

func (UpdateCostInput) GetOccurDate

func (c UpdateCostInput) GetOccurDate() *time.Time

func (UpdateCostInput) GetPrivacy

func (c UpdateCostInput) GetPrivacy() *Privacy

func (UpdateCostInput) IsPortfolioInput

func (UpdateCostInput) IsPortfolioInput()

type UpdateIncomeInput

type UpdateIncomeInput struct {
	Amount      *int            `bson:"amount,omitempty" json:"amount,string,omitempty"`
	OccurDate   *time.Time      `bson:"occurDate,omitempty" json:"occurDate,omitempty"`
	Category    *IncomeCategory `bson:"category,omitempty" json:"category,omitempty"`
	Description *string         `bson:"description,omitempty" json:"description,omitempty"`
	Privacy     *Privacy        `bson:"privacy,omitempty" json:"privacy,omitempty"`
}

func (UpdateIncomeInput) GetAmount

func (c UpdateIncomeInput) GetAmount() *int

func (UpdateIncomeInput) GetCategory

func (c UpdateIncomeInput) GetCategory() *PortfolioCategory

func (UpdateIncomeInput) GetDescription

func (c UpdateIncomeInput) GetDescription() *string

func (UpdateIncomeInput) GetOccurDate

func (c UpdateIncomeInput) GetOccurDate() *time.Time

func (UpdateIncomeInput) GetPrivacy

func (c UpdateIncomeInput) GetPrivacy() *Privacy

func (UpdateIncomeInput) IsPortfolioInput

func (UpdateIncomeInput) IsPortfolioInput()

type UpdatePortfolio

type UpdatePortfolio struct {
	Amount      *int               `bson:"amount,omitempty" json:"amount,string,omitempty"`
	OccurDate   *time.Time         `bson:"occurDate,omitempty" json:"occurDate,omitempty"`
	Category    *PortfolioCategory `bson:"category,omitempty" json:"category,omitempty"`
	Description *string            `bson:"description,omitempty" json:"description,omitempty"`
	Privacy     *Privacy           `bson:"privacy,omitempty" json:"privacy,omitempty"`
}

type UpdatePortfolioInput

type UpdatePortfolioInput interface {
	GetAmount() *int
	GetOccurDate() *time.Time
	GetCategory() *PortfolioCategory
	GetDescription() *string
	GetPrivacy() *Privacy
}

type UpdateUserInput

type UpdateUserInput struct {
	Email    *string `bson:"email,omitempty" json:"email,omitempty"`
	UserID   *string `bson:"userID,omitempty" json:"userId,omitempty"`
	NickName *string `bson:"nickName,omitempty" json:"nickName,omitempty"`
}

type User

type User struct {
	ID        string    `json:"id"`
	Email     string    `json:"email"`
	UserID    string    `json:"userId"`
	NickName  *string   `json:"nickName"`
	CreatedAt time.Time `json:"createdAt"`
	// granted permission to friends to view portfolio
	Friends []string `json:"friends"`
	// permission to view followers portfolio
	Followers []string `json:"followers"`
	Role      Role     `json:"role"`
}

type UserInput

type UserInput struct {
	Email    *string `json:"email"`
	UserID   *string `json:"userId"`
	NickName *string `json:"nickName"`
}

Jump to

Keyboard shortcuts

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