services

package
v0.0.0-...-a50b575 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2017 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCategory

func AddCategory(category *models.Category) error

func AddContributionToContributions

func AddContributionToContributions(contributions []*models.Contribution, contribution *models.Contribution) []*models.Contribution

Function adds a Contribution to a slice of contributions if contribution does not exist yet in the slice, if contribution exist, it checks if the contribution alreayd contains the ControlCategory and so on...

func AddInspectorToRequest

func AddInspectorToRequest(request *models.Request, auth *bind.TransactOpts) error

func AddJournalEntry

func AddJournalEntry(journalEntry *models.JournalEntry) error

func AddLacksToRequest

func AddLacksToRequest(inspection *models.Inspection, auth *bind.TransactOpts) error

Add inspection Lacks to Request

func CheckLoginWithEmail

func CheckLoginWithEmail(_email string, _password string) (models.User, error)

func CheckLoginWithUsername

func CheckLoginWithUsername(_username string, _password string) (models.User, error)

func CheckRausJournal

func CheckRausJournal(request *models.Request) error

func CountContributions

func CountContributions() (int64, error)

func CountControlCategories

func CountControlCategories() (int64, error)

func CountControlPoints

func CountControlPoints() (int64, error)

func CountLacks

func CountLacks() (int64, error)

func CountLegalForms

func CountLegalForms() (int64, error)

func CountPlantTypes

func CountPlantTypes() (int64, error)

func CountPointGroups

func CountPointGroups() (int64, error)

func CountRoles

func CountRoles() (int64, error)

func CountUsers

func CountUsers() (int64, error)

func CreateContribution

func CreateContribution(c *models.Contribution) error

func CreateControlCategory

func CreateControlCategory(cc *models.ControlCategory) error

func CreateControlPoint

func CreateControlPoint(cp *models.ControlPoint) error

func CreateLack

func CreateLack(l *models.Lack) error

func CreateLegalForm

func CreateLegalForm(lf *models.LegalForm) error

func CreateMultiLacks

func CreateMultiLacks(lacks []models.Lack) error

func CreatePlant

func CreatePlant(r *models.Plant) error

func CreatePlantType

func CreatePlantType(pt *models.PlantType) error

func CreatePointGroup

func CreatePointGroup(pc *models.PointGroup) error

func CreateRequest

func CreateRequest(request *models.Request, auth *bind.TransactOpts) error

CreateRequest deploys a new Request Contract in the blockchain.

func CreateRole

func CreateRole(r *models.Role) error

func CreateUser

func CreateUser(u *models.User) error

func GetAllContributions

func GetAllContributions() []*models.Contribution

func GetAllControlCategories

func GetAllControlCategories() []*models.ControlCategory

func GetAllControlPoints

func GetAllControlPoints() []*models.ControlPoint

func GetAllLacks

func GetAllLacks() []*models.Lack

func GetAllLegalForms

func GetAllLegalForms() []*models.LegalForm

func GetAllPlantTypes

func GetAllPlantTypes() []*models.PlantType

func GetAllPointGroupByCode

func GetAllPointGroupByCode(_code uint16) (*models.PointGroup, error)

func GetAllPointGroupById

func GetAllPointGroupById(_id int64) (*models.PointGroup, error)

func GetAllPointGroups

func GetAllPointGroups() []*models.PointGroup

func GetAllRequests

func GetAllRequests() []*models.Request

GetAllRequests loads all request address stored in the database. With the address, the contract of the request get loaded.

func GetAllRequestsByUserId

func GetAllRequestsByUserId(userId int64) []*models.Request

func GetAllRequestsForInspection

func GetAllRequestsForInspection() []*models.Request

func GetAllRequestsForInspectionByInspectorId

func GetAllRequestsForInspectionByInspectorId(inspectorId int64) []*models.Request

func GetAllUsers

func GetAllUsers() []*models.User

func GetAllUsersByRole

func GetAllUsersByRole(_role string) ([]*models.User, error)

func GetBalanceOf

func GetBalanceOf(address common.Address) (*big.Int, error)

func GetCategories

func GetCategories(userTvd int32) ([]*models.Category, error)

func GetContributionByCode

func GetContributionByCode(_code uint16) (*models.Contribution, error)

func GetContributionById

func GetContributionById(_id int64) (*models.Contribution, error)

func GetContributionByInspectionLack

func GetContributionByInspectionLack(iL *models.InspectionLack) *models.Contribution

func GetCowFromUser

func GetCowFromUser(userTvd int32) ([]*models.Cow, error)

func GetFirstPaymentAmount

func GetFirstPaymentAmount(request *models.Request) (*big.Int, error)

func GetJournal

func GetJournal(tvd string) (*models.Journal, error)

func GetMonthlyStats

func GetMonthlyStats(userTvd int32, month uint8, year uint16) (models.MonthlyStats, error)

func GetRequestAddressById

func GetRequestAddressById(requestId int64) string

func GetRequestById

func GetRequestById(requestId int64, smartContract bool) *models.Request

func GetRequestIdByAddress

func GetRequestIdByAddress(requestAddress string) int64

func GetSecondPaymentAmount

func GetSecondPaymentAmount(request *models.Request) (*big.Int, error)

func GetTransactionForRequest

func GetTransactionForRequest(requestAddress string) []*models.APaymentTokenTransaction

func GetTransactions

func GetTransactions() ([]*models.APaymentTokenTransaction, error)

func GetUserByAddress

func GetUserByAddress(etherumAddress string) (*models.User, error)

func GetUserById

func GetUserById(_id int64) (*models.User, error)

func GetUserByUsername

func GetUserByUsername(_username string) (*models.User, error)

func IsCategoryExisting

func IsCategoryExisting(name string, is_default bool) bool

func IssueToken

func IssueToken(user *models.User) map[string]string

func ParseToken

func ParseToken(signedTokenWithBearer string) (models.Claim, error)

func Transfer

func Transfer(aPaymentTokenTransfer *models.APaymentTokenTransfer, requestAddress string) error

func Validate

func Validate(signedTokenWithBearer string) bool

middleware to protect private pages

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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