dnwcamp

package
v0.0.0-...-845ebfe Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2015 License: MIT, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MONGODBSERVER = "mongodb://dnwUser:dnw0001@ds051459.mongolab.com:51459/campmaster" // Database URL
	DATABASE  = "campmaster"    // Database name containing the app registration collection
	COL_CAMPS = "Camps"         // Name of camp configuration collection
	COL_REG   = "Registrations" // All camp registrations
)

Variables

This section is empty.

Functions

func BuildDBSession

func BuildDBSession() (*mgo.Session, error)

func CloseConnection

func CloseConnection(s *mgo.Session)

func ConnectCollection

func ConnectCollection(s *mgo.Session, db string, collection string) *mgo.Collection

func CreateCampIndex

func CreateCampIndex() error

CreateCampIndex - Is a setup function called to create the index set required on the camps collection

func DeleteDNWTennisDB

func DeleteDNWTennisDB() error

func DeleteRegistrationCollection

func DeleteRegistrationCollection() error

func OpenCampCollection

func OpenCampCollection() (*mgo.Session, *mgo.Collection, error)

func OpenRegistrationCollection

func OpenRegistrationCollection() (*mgo.Session, *mgo.Collection, error)

Types

type ByTimeStamp

type ByTimeStamp []Registration

func (ByTimeStamp) Len

func (a ByTimeStamp) Len() int

func (ByTimeStamp) Less

func (a ByTimeStamp) Less(i, j int) bool

func (ByTimeStamp) Swap

func (a ByTimeStamp) Swap(i, j int)

type ByTypeAndAge

type ByTypeAndAge []Camper

func (ByTypeAndAge) Len

func (a ByTypeAndAge) Len() int

func (ByTypeAndAge) Less

func (a ByTypeAndAge) Less(i, j int) bool

func (ByTypeAndAge) Swap

func (a ByTypeAndAge) Swap(i, j int)

type Camp

type Camp struct {
	ID             bson.ObjectId `bson:"_id,omitempty"`
	Cid            int64         "Cid"            // Defines a logical Camp
	Title          string        "Title"          // Generic name for camp
	Active         bool          "Active"         // Flips to no when camp is past signup dates
	Cost           int64         "Cost"           // Base cost of camp - Applies to all sections
	RegStart       string        "RegStart"       // DateTime signup can begin
	RegEnd         string        "RegEnd"         // DateTime signup can end
	RefundDeadline string        "RefundDeadline" // Last date to cancel and get a refund
	BillingDate    string        "BillingDate"    // Date on which charge will be billed -- 1st time use in 2015
	CampOver       string        "CampOver"       // Date after which the site should no longer allow registrations and flip to a see you next year page
	CamperTypes    []string      "CamperTypes"    // Classes of campers - For DNW - Homeowner / Guest
	Sections       []Section     "Sections"       // Array of sections for this camp
}

func GetActiveCamp

func GetActiveCamp(cid string) (*Camp, error)

func ListCamps

func ListCamps() ([]Camp, error)

ListCamps - returns a slice containing all camp documents

func ListCurrentCamp

func ListCurrentCamp() (*Camp, error)

ListCurrentCamp - returns only the current camp

func NewCamp

func NewCamp() *Camp

NewCamp returns a new camp structure.

func (*Camp) AddSection

func (s *Camp) AddSection() error

AddSection adds a new camp section to this camp

func (*Camp) Save

func (s *Camp) Save() error

Save - Saves changes made to a camp

type Camper

type Camper struct {
	Name      string "camperName"
	Age       string "camperAge"
	ShirtSize string "camperShirtSize" // Other items can be added
	// Could do this as a uniform where we having clothing and collect sizes
	// What to show would be part of camp setup
	Type      string          "camperType"       // Defines which class of camper this person is - Options defined in Camp
	TimeStamp string          "timeStamp"        // Date and time this camper was entered
	Comment   string          "comment"          // Comment field for each camper
	Sections  []bson.ObjectId "camperSections"   // IDs of sections this camper is assigned to
	WaitList  []bson.ObjectId "camperWaitListed" // IDs of sections this camper is wait listed for
}

func NewCamper

func NewCamper() Camper

type Registration

type Registration struct {
	RegId        bson.ObjectId `bson:"_id,omitempty"` // ID of this registration
	RegCampId    bson.ObjectId "campId"               // ID of the camp this registration is connected to
	RegName      string        "regName"              // Name for this registration
	RegPhone     string        "regPhone"             // Contact phone for this registration
	RegSite      string        "regSite"              // Home Site or other identifier for billing
	RegEmail     string        "regEmail"             // Contact email for this registration
	RegTimeStamp string        "regTimeStamp"         // Date and time this entry was submitted
	RegComments  string        "RegComments"          // Comment field
	RegRequests  []Request     "regRequests"          // List of camp section ids and priority
	RegCampers   []Camper      "regCampers"           // List of campers registered
}

func ListRegistrations

func ListRegistrations() ([]Registration, error)

func ListReservationsForCamp

func ListReservationsForCamp(campID bson.ObjectId) ([]Registration, error)

func NewRegistration

func NewRegistration() Registration

NewRegstration creates a new registration structure.

func (Registration) AddCamper

func (r Registration) AddCamper(c Camper) Registration

func (Registration) Save

func (r Registration) Save() error

type Request

type Request struct {
	ReqSectionId bson.ObjectId `bson:"reqSectionId"` // bson ObjectId of the camp section being requested
	ReqPriority  int64         "reqPriority"         // 1st through nth choice - using a priority > 1 time is not legal			// Human Readable camp name
}

func NewRequest

func NewRequest(s bson.ObjectId, p int64) Request

type Section

type Section struct {
	ID               bson.ObjectId `bson:"Id"`        // ID of this section
	Name             string        "Name"             // Friendly name for this section
	Start            string        "Start"            // DateTime camp section starts
	End              string        "End"              // DateTime camp section ends
	CostDifferential int64         "CostDifferential" // Discount or premium paid for this section

}

func NewCampSection

func NewCampSection() *Section

Jump to

Keyboard shortcuts

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