demand

package
v0.0.0-...-0e3259e Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2020 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Package demand "Every package should have a package comment, a block comment preceding the package clause. For multi-file packages, the package comment only needs to be present in one file, and any one will do. The package comment should introduce the package and provide information relevant to the package as a whole. It will appear first on the godoc page and should set up the detailed documentation that follows."

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(ctx context.Context, k *datastore.Key, d *Demand, tIDs []string,
	px []*photo.Photo) (*datastore.Key, error)

Add puts the demand, it's tag relations and it's photos also returns it's key and an error.

func UpdateStatus

func UpdateStatus(ctx context.Context, ek, v string) error

UpdateStatus set's demand status to given value "v" by given encoded demand key "ek" and returns an error.

Types

type Demand

type Demand struct {
	ID           string    `datastore:"-"`
	UserID       string    `datastore:"-" json:"userID"`
	AccountID    string    `datastore:"-" json:"accountID"`
	Description  string    `datastore:",noindex" json:"description"`
	Created      time.Time `json:"created"`
	LastModified time.Time `json:"lastModified"`
	Status       string    `json:"status"`
}

Demand attributes are; Type is remote or inPlace IF THERE IS AT LEAST ONE OFFER DO NOT LET USER TO CHANGE DEMAND !!!!!!!!!!!!!!!! Status is underConsideration, active, rejected, changed, removed, finished, disaproved. PIC is Person In Charge whom aprove this. User key is the ancestor. UserID and AccountID are used to if controles at frontend to be able to modify a demand and create an offer.

func GetLatestLimited

func GetLatestLimited(ctx context.Context, lim int) ([]Demand, error)

GetLatestLimited returns limited entities from the begining of the kind with given limit and an error.

func Update

func Update(ctx context.Context, d *Demand, ek string) (*Demand, error)

Update updates and returns (only with "ID", "LastModified" and "Status" fields) the entity by the given encoded entity key "ek" and also returns an error.

type Demands

type Demands map[string]*Demand

Demands is a *Demand map.

func GetMulti

func GetMulti(ctx context.Context, kx []*datastore.Key) (Demands, error)

GetMulti returns the corresponding entities as a map with their "ID"s assigned by their keys and an error.

func GetNextByParentLimited

func GetNextByParentLimited(ctx context.Context, crsrAsString string, pk *datastore.Key,
	lim int) (Demands, string, error)

GetNextByParentLimited returns limited entities filtered by user key as parent from the previous cursor in an order. Also, returns the next cursor as string and an error.

Jump to

Keyboard shortcuts

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