models

package
v0.0.0-...-97b4d81 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2018 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBHost  = "127.0.0.1"
	DBPort  = ":3306"
	DBUser  = "root"
	DBPass  = "root"
	DBDbase = "oswee"
)
View Source
const AID = 1

AID is the Account ID

View Source
const SID = 1

SID is the Stakeholder ID

View Source
const UID = 1

UID is the User ID

Variables

View Source
var SelectedPage int

SelectedPage is used to apply active class for curent tab

Functions

func CustomerCreate

func CustomerCreate(accName string) (lastID int64, err error)

CustomerCreate creates a new customer account

func CustomerDelete

func CustomerDelete(customerID string) error

CustomerDelete updates customer account record state

func CustomerUpdate

func CustomerUpdate(accName, customerID string) error

CustomerUpdate updates customer account information

func MessageCreate

func MessageCreate(email, message string) (lastID int64, err error)

MessageCreate function creates a new message in DB

Types

type Application

type Application struct {
	ID               int    `json:"ID"`
	ParentID         int    `json:"parentID"`
	Sequence         int    `json:"sequence"`
	ShortName        string `json:"shortName"`
	FullName         string `json:"fullName"`
	ShortDescription string `json:"shortDescription"`
	Visibility       int    `json:"visibility"`
	Bcolor           string `json:"bcolor"`
	PrettyTitle      string `json:"prettyTitle"`
	Permalink        string `json:"permalink"`
	IconName         string `json:"icon"`
	Notifications    int32  `json:"notifications"`
	IsNew            bool   `json:"isNew"`
	AppState         string `json:"appState"`
}

Application struct

func GetApplication

func GetApplication(applicationID int) Application

GetApplication function return requested application

func ListApplications

func ListApplications(visibility int) ([]Application, error)

ListApplications is function to retrieve a full list of all users

func ListChildApplications

func ListChildApplications(parentID int) ([]Application, error)

ListChildApplications is function to retrieve a list of all applications based on requested parent

type Apps

type Apps interface {
	ListApplications(visibility int) ([]Application, error)
	ListChildApplications(parentID int) ([]Application, error)
	GetApplication(applicationID int) Application
}

Apps interface

type Customer

type Customer struct {
	ID        int    `json:"ID"`
	Name      string `json:"name"`
	CreatedAt string `json:"createdAt"`
}

Customer struct

func GetCustomer

func GetCustomer(customerID string) Customer

GetCustomer function return selected customer object

func ListCustomers

func ListCustomers() ([]Customer, error)

ListCustomers function return list of all customers

type Organization

type Organization struct {
	ID                int     `json:"ID"`
	LegalID           int64   `json:"legalID"`
	Name              string  `json:"name"`
	FirstCharacter    string  `json:"firstCharacter"`
	PrettyLink        string  `json:"prettyLink"`
	Form              int     `json:"form"`
	LegalAddress      string  `json:"legalAddress"`
	VerificationLevel int     `json:"verificationLevel"`
	Color             string  `json:"color"`
	VatRegistrationID string  `json:"vatRegistrationID"`
	Lat               float64 `json:"lat"`
	Lng               float64 `json:"lng"`
}

Organization struct

func GetOrganization

func GetOrganization(id string) ([]Organization, error)

GetOrganization is a function

func ListOrganizations

func ListOrganizations() ([]Organization, error)

ListOrganizations is function to retrieve a full list of all Organizations

type Project

type Project struct {
	ID           int
	CustomerID   int
	CustomerName string
	Name         string
	ServiceID    int
	ServiceTitle string
	Units        float32
	Amount       float32
	Cost         float32
	Profit       float32
	CreatedAt    string
}

Project represents aany kind of project managed in system

func ListCustomerProjects

func ListCustomerProjects(customerID string) ([]Project, error)

ListCustomerProjects retrieve list of project

func ListProjects

func ListProjects() ([]Project, error)

ListProjects retrieve list of project

type Service

type Service struct {
	ID          int     `json:"ID"`
	Title       string  `json:"title"`
	Description string  `json:"description"`
	UnitPrice   float32 `json:"unitPrice"`
}

Service struct

func ListServices

func ListServices() ([]Service, error)

ListServices is function to retrieve a full list of all Services

type Shortcut

type Shortcut struct {
	ID            int    `json:"ID"`
	ApplicationID int    `json:"applicationID"`
	Order         int    `json:"order"`
	CreatedAt     string `json:"createdAt"`
	Name          string `json:"name"`
	Permalink     string `json:"permalink"`
	Bcolor        string `json:"bcolor"`
	IconName      string `json:"iconName"`
}

Shortcut are user defined shortcut to favorite apps. Order is contstructed by combining account id and number of shortcut sequence.

func ListShortcuts

func ListShortcuts() ([]Shortcut, error)

ListShortcuts retrieve all current user shortcuts

type User

type User struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	Username  string `json:"username"`
	CreatedAt string `json:"createdAt"`
}

User struct

func ListUsers

func ListUsers() ([]User, error)

ListUsers is function to retrieve a full list of all users

Jump to

Keyboard shortcuts

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