model

package
v0.0.0-...-0406d23 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientCollection     = "clients"
	InvitationCollection = "invitations"
	PermissionCollection = "permissions"
	RoleCollection       = "roles"
	KeyCollection        = "keys"
	UserCollection       = "users"
)

Variables

Functions

This section is empty.

Types

type Comment

type Comment struct {
	ID string `json:"id"`
}

func (Comment) IsEntity

func (Comment) IsEntity()

type Expense

type Expense struct {
	Model       `bson:",inline"`
	User        primitive.ObjectID `json:"user" bson:"user"`
	Type        string             `json:"type" bson:"type"`
	Code        string             `json:"code" bson:"code"`
	Description string             `json:"description,omitempty" bson:"description,omitempty"`
	Amount      float64            `json:"amount" bson:"amount"`
	Currency    string             `json:"currency" bson:"currency"`
	Date        primitive.DateTime `json:"date" bson:"date"`
	Notes       string             `json:"notes,omitempty" bson:"notes,omitempty"`
	Status      string             `json:"status" bson:"status"`
}

func (*Expense) Collection

func (i *Expense) Collection() string

func (*Expense) Index

func (i *Expense) Index() []mongo.IndexModel

func (*Expense) MarshalBSON

func (i *Expense) MarshalBSON() ([]byte, error)

type ExpenseStatus

type ExpenseStatus string
const (
	ExpenseStatusDraft     ExpenseStatus = "DRAFT"
	ExpenseStatusSubmitted ExpenseStatus = "SUBMITTED"
	ExpenseStatusApproved  ExpenseStatus = "APPROVED"
	ExpenseStatusRejected  ExpenseStatus = "REJECTED"
	ExpenseStatusPaid      ExpenseStatus = "PAID"
)

func (ExpenseStatus) IsValid

func (e ExpenseStatus) IsValid() bool

func (ExpenseStatus) MarshalGQL

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

func (ExpenseStatus) String

func (e ExpenseStatus) String() string

func (*ExpenseStatus) UnmarshalGQL

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

type ExpenseType

type ExpenseType string
const (
	ExpenseTypeDebit  ExpenseType = "DEBIT"
	ExpenseTypeCredit ExpenseType = "CREDIT"
)

func (ExpenseType) IsValid

func (e ExpenseType) IsValid() bool

func (ExpenseType) MarshalGQL

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

func (ExpenseType) String

func (e ExpenseType) String() string

func (*ExpenseType) UnmarshalGQL

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

type Expenses

type Expenses struct {
	Count int        `json:"count"`
	Data  []*Expense `json:"data,omitempty"`
}

type Invoice

type Invoice struct {
	Model    `bson:",inline"`
	User     primitive.ObjectID  `json:"user" bson:"user"`
	Code     string              `json:"code" bson:"code"`
	Template string              `json:"template" bson:"template"`
	Amount   float64             `json:"amount" bson:"amount"`
	Currency string              `json:"currency" bson:"currency"`
	DueDate  primitive.Timestamp `json:"dueDate" bson:"due_date"`
	Billing  primitive.M         `json:"billing" bson:"billing"`
	Notes    string              `json:"notes,omitempty" bson:"notes,omitempty"`
	Status   string              `json:"status" bson:"status"`
}

func (*Invoice) Collection

func (i *Invoice) Collection() string

func (*Invoice) Index

func (i *Invoice) Index() []mongo.IndexModel

func (Invoice) IsEntity

func (Invoice) IsEntity()

func (*Invoice) MarshalBSON

func (i *Invoice) MarshalBSON() ([]byte, error)

type Invoices

type Invoices struct {
	Data  []*Invoice `json:"data,omitempty"`
	Count int        `json:"count"`
}

type Model

type Model struct {
	ID        primitive.ObjectID  `json:"id,omitempty" bson:"_id,omitempty"`
	Workspace primitive.ObjectID  `json:"workspace,omitempty" bson:"workspace,omitempty"`
	Metadata  primitive.M         `json:"metadata,omitempty" bson:"metadata,omitempty"`
	Created   primitive.Timestamp `json:"created,omitempty" bson:"created,omitempty"`
	Updated   primitive.Timestamp `json:"updated,omitempty" bson:"updated,omitempty"`
	Deleted   primitive.Timestamp `json:"deleted,omitempty" bson:"deleted,omitempty"`
	Timestamp primitive.Timestamp `json:"timestamp,omitempty" bson:"timestamp,omitempty"`
}

type NewExpense

type NewExpense struct {
	Type        string                 `json:"type"`
	Code        *string                `json:"code,omitempty"`
	Description string                 `json:"description"`
	Amount      float64                `json:"amount"`
	Currency    string                 `json:"currency"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      *string                `json:"status,omitempty"`
	Date        string                 `json:"date"`
	User        string                 `json:"user"`
	Notes       *string                `json:"notes,omitempty"`
	Categories  []string               `json:"categories,omitempty"`
}

type NewInvoice

type NewInvoice struct {
	Code     *string                `json:"code,omitempty"`
	Template *string                `json:"template,omitempty"`
	Amount   *int                   `json:"amount,omitempty"`
	Currency *string                `json:"currency,omitempty"`
	Billing  map[string]interface{} `json:"billing,omitempty"`
	DueDate  *string                `json:"due_date,omitempty"`
	Notes    *string                `json:"notes,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type Payer

type Payer string
const (
	PayerEmployee Payer = "EMPLOYEE"
	PayerCompany  Payer = "COMPANY"
)

func (Payer) IsValid

func (e Payer) IsValid() bool

func (Payer) MarshalGQL

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

func (Payer) String

func (e Payer) String() string

func (*Payer) UnmarshalGQL

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

type Share

type Share struct {
	ID string `json:"id" bson:"_id"`
}

func (Share) IsEntity

func (Share) IsEntity()

type UpdateExpense

type UpdateExpense struct {
	Type        *string                `json:"type,omitempty"`
	Code        *string                `json:"code,omitempty"`
	Description *string                `json:"description,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      *string                `json:"status,omitempty"`
	Date        *string                `json:"date,omitempty"`
	Amount      *float64               `json:"amount,omitempty"`
	Currency    *string                `json:"currency,omitempty"`
	User        *string                `json:"user,omitempty"`
	Notes       *string                `json:"notes,omitempty"`
	Categories  []string               `json:"categories,omitempty"`
}

type UpdateInvoice

type UpdateInvoice struct {
	Code     *string                `json:"code,omitempty"`
	Template *string                `json:"template,omitempty"`
	Amount   *int                   `json:"amount,omitempty"`
	Currency *string                `json:"currency,omitempty"`
	Billing  map[string]interface{} `json:"billing,omitempty"`
	DueDate  *string                `json:"due_date,omitempty"`
	Notes    *string                `json:"notes,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type User

type User struct {
	ID string `json:"id" bson:"_id"`
}

func (User) IsEntity

func (User) IsEntity()

Jump to

Keyboard shortcuts

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