Documentation ¶
Index ¶
- type Business
- type BusinessRepo
- type Contact
- type Entrepreneur
- type EntrepreneurRepo
- type Event
- type EventRepo
- type Growth
- type Institution
- type InstitutionRepo
- type PublicUser
- type Reward
- type RewardRepo
- type Solution
- type SolutionRepo
- type Team
- type TeamRepo
- type Trainee
- type TraineeRepo
- type User
- type UserRepository
- type UserWithPassword
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Business ¶
type Business struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Type commons.BusinessTypes `json:"type"` Level commons.BusinessLevels `json:"level"` Founded time.Time `json:"founded"` Growths []Growth `json:"growths"` ContactPerson Contact `json:"contactPerson"` Entrepreneurs []Entrepreneur `json:"entrepreneurs"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
type BusinessRepo ¶
type Entrepreneur ¶
type Entrepreneur struct { ID string `json:"id"` Forename string `json:"forename"` Surname string `json:"surname"` Gender commons.Genders `json:"gender"` BirthDate time.Time `json:"birthDate"` Phone string `json:"phone"` Email string `json:"email"` BusinessID string `json:"businessId"` Business Business `json:"business"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
func (*Entrepreneur) Validate ¶
func (e *Entrepreneur) Validate() map[string]string
type EntrepreneurRepo ¶
type EntrepreneurRepo interface { Create(person *Entrepreneur) (*Entrepreneur, map[string]string) List() (*[]Entrepreneur, error) Get(id string) (*Entrepreneur, error) GetByPhoneEmail(phone, email string) (*Entrepreneur, error) AddToBusiness(person *Entrepreneur) (string, error) }
type Event ¶
type Event struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` StartDate time.Time `json:"startDate"` EndDate time.Time `json:"endDate"` InstitutionID string `json:"institutionId"` Institution Institution `json:"institution"` Trainees []Trainee `json:"trainees"` Teams []Team `json:"teams"` Rewards []Reward `json:"rewards"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
type Growth ¶
type Growth struct { ID string `json:"id"` Year int64 `json:"year"` NetWorth float64 `json:"netWorth"` Income float64 `json:"income"` Expenditure float64 `json:"expenditure"` Assets string `json:"assets"` BusinessID string `json:"businessId"` Business Business `json:"business"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
type Institution ¶
type Institution struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Address string `json:"address"` ContactPerson Contact `json:"contactPerson"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
func (*Institution) Validate ¶
func (i *Institution) Validate() map[string]string
type InstitutionRepo ¶
type InstitutionRepo interface { Create(institute *Institution) (*Institution, map[string]string) List() (*[]Institution, error) Get(id string) (*Institution, error) GetByName(name string) (*Institution, error) Update(institute *Institution) (string, error) }
type PublicUser ¶
type Reward ¶
type RewardRepo ¶
type Solution ¶
type Solution struct { ID string `json:"id"` Title string `json:"title"` Description string `json:"description"` EventID string `json:"eventId"` Event Event `json:"event"` TeamID string `json:"teamId"` Team Team `json:"team"` RewardID string `json:"RewardId"` Reward Reward `json:"reward"` Position int `json:"position"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
type SolutionRepo ¶
type Team ¶
type Trainee ¶
type Trainee struct { ID string `json:"id"` Forename string `json:"forename"` Surname string `json:"surname"` Gender commons.Genders `json:"gender"` BirthDate time.Time `json:"birthDate"` Phone string `json:"phone"` Email string `json:"email"` Qualification string `json:"qualification"` EventID string `json:"eventId"` Event Event `json:"event"` TeamID string `json:"teamId"` Team Team `json:"team"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
type TraineeRepo ¶
type TraineeRepo interface { Create(trainee *Trainee) (*Trainee, map[string]string) List(event string) (*[]Trainee, error) Get(id string) (*Trainee, error) GetByPhoneEmail(event, phoneEmail string) (*Trainee, error) GetByEmail(event, email string) (*Trainee, error) AddToTeam(trainee *Trainee) (*Trainee, error) }
type User ¶
type User struct { ID string `json:"id"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Phone string `json:"phone"` Password string `json:"password"` BasePassword string `json:"basePassword"` Status string `json:"status"` Role commons.Roles `json:"role"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
func (*User) CheckPassword ¶
func (*User) HashPassword ¶
func (user *User) HashPassword()
func (*User) PublicUser ¶
func (user *User) PublicUser() *PublicUser
func (*User) RetrievePassword ¶
func (user *User) RetrievePassword() *UserWithPassword
type UserRepository ¶
type UserRepository interface { Add(record *User) (*User, map[string]string) Login(phone string) (*User, error) Edit(record *User) (*User, map[string]string) ResetPassword(phone string) (*User, error) ChangePassword(user User) (*User, error) CreatePassword(user User) (*User, error) Disable(id string) (*User, error) Enable(id string) (*User, error) Users() (*[]User, error) User(id string) (*User, error) Remove(id string) (string, error) }
type UserWithPassword ¶
Click to show internal directories.
Click to hide internal directories.