models

package
v0.0.0-...-457b880 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMongoInstance

func GetMongoInstance() (*mongo.Client, context.Context, context.CancelFunc)

Get a Mongo instance (Client, Context, Cancel)

func Setup

func Setup()

Setup Environment variables and make sure database is initialized

Types

type Color

type Color struct {
	Hex string `json:"hex" bson:"hex"`
	JS  string `json:"js" bson:"js"`
}

Model for the color used in the other models

type GetSpecificIndividuals

type GetSpecificIndividuals struct {
	Individuals []string `json:"individuals" validate:"required"`
}

Model for the get specific individuals

type GetSpecificParties

type GetSpecificParties struct {
	Parties []string `json:"parties" validate:"required"`
}

Model for the get specific parties

type Individual

type Individual struct {
	Id          primitive.ObjectID `json:"_id" bson:"_id"`
	FirstName   string             `json:"firstname" bson:"firstname,omitempty" validate:"required"`
	LastName    string             `json:"lastname" bson:"lastname,omitempty" validate:"required"`
	BirthDate   string             `json:"birthdate" bson:"birthdate,omitempty" validate:"required"`
	Image       string             `json:"image" bson:"image" validate:"required"`
	Affiliation string             `json:"affiliation" bson:"affiliation"`
	Color       Color              `json:"color" bson:"color" validate:"required"`
}

Model for the individual object

type Party

type Party struct {
	Id           primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	Name         string             `json:"name" bsin:"name,omitempty" validate:"required"`
	Abbreviation string             `json:"abbreviation" bson:"abbreviation,omitempty" validate:"required"`
	Leader       string             `json:"leader" bson:"leader,omitempty" validate:"required"`
	Color        Color              `json:"color" bson:"color,omitempty" validate:"required"`
}

Model for the party object

type UpdateIndividualBirthDateInput

type UpdateIndividualBirthDateInput struct {
	BirthDate string `json:"birthdate" validate:"required"`
}

Model for the update party leader input

type UpdateIndividualFirstNameInput

type UpdateIndividualFirstNameInput struct {
	FirstName string `json:"firstname" validate:"required"`
}

Model for the update individual ƒirstname input

type UpdateIndividualLastNameInput

type UpdateIndividualLastNameInput struct {
	LastName string `json:"lastname" validate:"required"`
}

Model for the update individual lastname input

type UpdatePartyAbbreviationInput

type UpdatePartyAbbreviationInput struct {
	Abbreviation string `json:"abbreviation" validate:"required"`
}

Model for the update party abbreviation input

type UpdatePartyColorInput

type UpdatePartyColorInput struct {
	Color string `json:"color" validate:"required"`
}

Model for the update party color input

type UpdatePartyLeaderInput

type UpdatePartyLeaderInput struct {
	Leader string `json:"leader" validate:"required"`
}

Model for the update party leader input

type UpdatePartyLogoInput

type UpdatePartyLogoInput struct {
}

Model for the update party logo input

type UpdatePartyNameInput

type UpdatePartyNameInput struct {
	Name string `json:"name" validate:"required"`
}

Model for the update party name input

Jump to

Keyboard shortcuts

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