models

package
v0.0.0-...-3f06ee3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2016 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 Address

type Address struct {
	Address    string
	PostalCode string
	City       string
	Country    string
}

Address Reusable address struct for contacts and invoices

type Contact

type Contact struct {
	Model          `storm:"inline"`
	OrganizationID bson.ObjectId `storm:"index"`
	DisplayName    string
	FirstName      string
	LastName       string
	CompanyName    string
	Addresses      []ContactAddress `json:",omitempty"`
	Email          string
	PhoneNumber    string
	VATNumber      string
}

Contact organization contact

type ContactAddress

type ContactAddress struct {
	Model     `storm:"inline"`
	ContactID bson.ObjectId `storm:"index"`
	Address
}

ContactAddress address of a Customer

type Invoice

type Invoice struct {
	Model          `storm:"inline"`
	OrganizationID bson.ObjectId `storm:"index"`
	Number         string
	ContactID      bson.ObjectId `storm:"index"`
	Contact        *Contact
	Address
	VATNumber   string
	Amount      int64
	CreatedAt   time.Time
	UpdatedAt   time.Time
	InvoiceDate time.Time `storm:"index"`
	DueDate     time.Time `storm:"index"`
	PaidDate    time.Time

	Details []InvoiceDetail
	Status  string
	// contains filtered or unexported fields
}

Invoice Invoice model

type InvoiceDetail

type InvoiceDetail struct {
	Quantity    int
	Description string
	Amount      int
	Vat         int
}

InvoiceDetail detail line of an Invoice

type Model

type Model struct {
	ID bson.ObjectId `storm:"id"`
}

Model main entity for models

type Organization

type Organization struct {
	Model `storm:"inline"`
	Name  string `storm:"unique"`
	Users []User `json:",omitempty"`
}

Organization is the overarching entity over all the data

type OrganizationUsers

type OrganizationUsers struct {
	Model          `storm:"inline"`
	OrganizationId bson.ObjectId `storm:"index"`
	UserID         bson.ObjectId `storm:"index"`
}

OrganizationUsers links users to organizations

type User

type User struct {
	Model    `storm:"inline"`
	Username string `storm:"unique"`
	Email    string
	Password string `json:"-"`
}

User user to authenticate with

Jump to

Keyboard shortcuts

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