models

package
v0.0.0-...-fad7234 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventJoin = iota
	EventLeave
	EventMessage
)

Variables

This section is empty.

Functions

func AddAssistances

func AddAssistances(m *Assistances) (id int64, err error)

AddAssistances insert a new Assistances into database and returns last inserted Id on success.

func AddChecks

func AddChecks(m *Checks) (id int64, err error)

AddChecks insert a new Checks into database and returns last inserted Id on success.

func AddCondos

func AddCondos(m *Condos) (id int64, err error)

AddCondos insert a new Condos into database and returns last inserted Id on success.

func AddDeliveries

func AddDeliveries(m *Deliveries) (id int64, err error)

AddDeliveries insert a new Tasks into database and returns last inserted Id on success.

func AddGoals

func AddGoals(m *Goals) (id int64, err error)

AddGoals insert a new Goals into database and returns last inserted Id on success.

func AddGoalsComments

func AddGoalsComments(m *GoalsComments) (id int64, err error)

AddGoalsComments insert a new GoalsComments into database and returns last inserted Id on success.

func AddHolidays

func AddHolidays(m *Holidays) (id int64, err error)

AddHolidays insert a new Holidays into database and returns last inserted Id on success.

func AddItems

func AddItems(m *Items) (id int64, err error)

AddItems insert a new Tasks into database and returns last inserted Id on success.

func AddManyOccurrences

func AddManyOccurrences(occurrences []*Occurrences) (err error)

AddManyOccurrences ...

func AddManyVerifications

func AddManyVerifications(verifications []*Verifications) (err error)

AddManyVerifications ...

func AddNotifications

func AddNotifications(m *Notifications) (id int64, err error)

AddNotifications insert a new Notifications into database and returns last inserted Id on success.

func AddObjects

func AddObjects(m *Objects) (id int64, err error)

AddObjects insert a new Tasks into database and returns last inserted Id on success.

func AddOccurrences

func AddOccurrences(m *Occurrences) (id int64, err error)

AddOccurrences insert a new Occurrences into database and returns last inserted Id on success.

func AddPoints

func AddPoints(m *Points) (id int64, err error)

AddPoints insert a new Points into database and returns last inserted Id on success.

func AddQuestions

func AddQuestions(m *Questions) (id int64, err error)

AddQuestions insert a new Questions into database and returns last inserted Id on success.

func AddQuestionsAttachments

func AddQuestionsAttachments(m *QuestionsAttachments) (id int64, err error)

AddQuestionsAttachments insert a new QuestionsAttachments into database and returns last inserted Id on success.

func AddResidents

func AddResidents(m *Residents) (id int64, err error)

AddResidents insert a new Residents into database and returns last inserted Id on success.

func AddSupervisors

func AddSupervisors(m *Supervisors) (id int64, err error)

AddSupervisors insert a new Supervisors into database and returns last inserted Id on success.

func AddTasks

func AddTasks(m *Tasks) (id int64, err error)

AddTasks insert a new Tasks into database and returns last inserted Id on success.

func AddVerifications

func AddVerifications(m *Verifications) (id int64, err error)

AddVerifications insert a new Verifications into database and returns last inserted Id on success.

func AddVotes

func AddVotes(m *Votes) (id int64, err error)

AddVotes insert a new Votes into database and returns last inserted Id on success.

func AddWatchers

func AddWatchers(m *Watchers) (id int64, err error)

AddWatchers insert a new Watchers into database and returns last inserted Id on success.

func AddWorkers

func AddWorkers(m *Workers) (id int64, err error)

AddWorkers insert a new Workers into database and returns last inserted Id on success.

func AddZones

func AddZones(m *Zones) (id int64, err error)

AddZones insert a new Zones into database and returns last inserted Id on success.

func DeleteAssistances

func DeleteAssistances(id int, trash bool) (err error)

DeleteAssistances deletes Assistances by Id and returns error if the record to be deleted doesn't exist

func DeleteChecks

func DeleteChecks(id int, trash bool) (err error)

DeleteChecks deletes Checks by Id and returns error if the record to be deleted doesn't exist

func DeleteCondos

func DeleteCondos(id int, trash bool) (err error)

DeleteCondos deletes Condos by Id and returns error if the record to be deleted doesn't exist

func DeleteDeliveries

func DeleteDeliveries(id int, trash bool) (err error)

DeleteDeliveries deletes Deliveries by Id and returns error if the record to be deleted doesn't exist

func DeleteGoals

func DeleteGoals(id int, trash bool) (err error)

DeleteGoals deletes Goals by Id and returns error if the record to be deleted doesn't exist

func DeleteGoalsComments

func DeleteGoalsComments(id int, trash bool) (err error)

DeleteGoalsComments deletes GoalsComments by Id and returns error if the record to be deleted doesn't exist

func DeleteHolidays

func DeleteHolidays(id int, trash bool) (err error)

DeleteHolidays deletes Holidays by Id and returns error if the record to be deleted doesn't exist

func DeleteItems

func DeleteItems(id int, trash bool) (err error)

DeleteItems deletes Items by Id and returns error if the record to be deleted doesn't exist

func DeleteNotifications

func DeleteNotifications(id int, trash bool) (err error)

DeleteNotifications deletes Notifications by Id and returns error if the record to be deleted doesn't exist

func DeleteObjects

func DeleteObjects(id int, trash bool) (err error)

DeleteObjects deletes Objects by Id and returns error if the record to be deleted doesn't exist

func DeleteOccurrences

func DeleteOccurrences(id int, trash bool) (err error)

DeleteOccurrences deletes Occurrences by Id and returns error if the record to be deleted doesn't exist

func DeletePoints

func DeletePoints(id int, trash bool) (err error)

DeletePoints deletes Points by Id and returns error if the record to be deleted doesn't exist

func DeleteQuestions

func DeleteQuestions(id int, trash bool) (err error)

DeleteQuestions deletes Questions by Id and returns error if the record to be deleted doesn't exist

func DeleteQuestionsAttachments

func DeleteQuestionsAttachments(id int, trash bool) (err error)

DeleteQuestionsAttachments deletes QuestionsAttachments by Id and returns error if the record to be deleted doesn't exist

func DeleteResidents

func DeleteResidents(id int, trash bool) (err error)

DeleteResidents deletes Residents by Id and returns error if the record to be deleted doesn't exist

func DeleteSupervisors

func DeleteSupervisors(id int, trash bool) (err error)

DeleteSupervisors deletes Supervisors by Id and returns error if the record to be deleted doesn't exist

func DeleteTasks

func DeleteTasks(id int, trash bool) (err error)

DeleteTasks deletes Tasks by Id and returns error if the record to be deleted doesn't exist

func DeleteVerifications

func DeleteVerifications(id int, trash bool) (err error)

DeleteVerifications deletes Verifications by Id and returns error if the record to be deleted doesn't exist

func DeleteVotes

func DeleteVotes(id int, trash bool) (err error)

DeleteVotes deletes Votes by Id and returns error if the record to be deleted doesn't exist

func DeleteWatchers

func DeleteWatchers(id int, trash bool) (err error)

DeleteWatchers deletes Watchers by Id and returns error if the record to be deleted doesn't exist

func DeleteWorkers

func DeleteWorkers(id int, trash bool) (err error)

DeleteWorkers deletes Workers by Id and returns error if the record to be deleted doesn't exist

func DeleteZones

func DeleteZones(id int, trash bool) (err error)

DeleteZones deletes Zones by Id and returns error if the record to be deleted doesn't exist

func EmailExist

func EmailExist(m *Residents) (res string, err error)

EmailExist verify if email exist into database and returns last inserted Id on success.

func ExistHolidaysByCondoID

func ExistHolidaysByCondoID(date string, condosID int) (ok bool, err error)

ExistHolidaysByCondoID ...

func GetAllAssistances

func GetAllAssistances(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllAssistances retrieves all Assistances matches certain condition. Returns empty list if no records exist

func GetAllChecks

func GetAllChecks(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllChecks retrieves all Checks matches certain condition. Returns empty list if no records exist

func GetAllCondos

func GetAllCondos(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllCondos retrieves all Condos matches certain condition. Returns empty list if no records exist

func GetAllHolidays

func GetAllHolidays(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllHolidays retrieves all Holidays matches certain condition. Returns empty list if no records exist

func GetAllOccurrences

func GetAllOccurrences(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllOccurrences retrieves all Occurrences matches certain condition. Returns empty list if no records exist

func GetAllPoints

func GetAllPoints(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllPoints retrieves all Points matches certain condition. Returns empty list if no records exist

func GetAllQuestions

func GetAllQuestions(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllQuestions retrieves all Questions matches certain condition. Returns empty list if no records exist

func GetAllQuestionsAttachments

func GetAllQuestionsAttachments(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllQuestionsAttachments retrieves all QuestionsAttachments matches certain condition. Returns empty list if no records exist

func GetAllResidents

func GetAllResidents(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllResidents retrieves all Residents matches certain condition. Returns empty list if no records exist

func GetAllSupervisors

func GetAllSupervisors(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllSupervisors retrieves all Supervisors matches certain condition. Returns empty list if no records exist

func GetAllVerifications

func GetAllVerifications(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllVerifications retrieves all Verifications matches certain condition. Returns empty list if no records exist

func GetAllVotes

func GetAllVotes(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllVotes retrieves all Votes matches certain condition. Returns empty list if no records exist

func GetAllWatchers

func GetAllWatchers(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllWatchers retrieves all Watchers matches certain condition. Returns empty list if no records exist

func GetAllWorkers

func GetAllWorkers(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllWorkers retrieves all Workers matches certain condition. Returns empty list if no records exist

func GetAllZones

func GetAllZones(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllZones retrieves all Zones matches certain condition. Returns empty list if no records exist

func GetHolidaysByCondosID

func GetHolidaysByCondosID(year int, month time.Month, condosID int) (holidays map[string]*Holidays, err error)

GetHolidaysByCondosID ..

func GetMD5Hash

func GetMD5Hash(text string) string

GetMD5Hash =

func LoginResidents

func LoginResidents(m *Residents) (id int, err error)

LoginResidents login a Residents, returns if Exists.

func LoginSupervisors

func LoginSupervisors(m *Supervisors) (id int, err error)

LoginSupervisors login a Supervisors, returns if Exists.

func LoginWatchers

func LoginWatchers(m *Watchers) (id int, err error)

LoginWatchers login a Watchers, returns if Exists.

func NewArchive

func NewArchive(event Event)

NewArchive saves new event to archive list.

func RestoreFromTrash

func RestoreFromTrash(tableName string, id int) (err error)

RestoreFromTrash ...

func SetStatus

func SetStatus(m *Verifications) (res string, err error)

SetStatus set viewed to true last inserted Id on success.

func UpdateAssistancesByID

func UpdateAssistancesByID(m *Assistances) (err error)

UpdateAssistancesByID updates Assistances by Id and returns error if the record to be updated doesn't exist

func UpdateChecksByID

func UpdateChecksByID(m *Checks) (err error)

UpdateChecksByID updates Checks by Id and returns error if the record to be updated doesn't exist

func UpdateCondosByID

func UpdateCondosByID(m *Condos) (err error)

UpdateCondosByID updates Condos by Id and returns error if the record to be updated doesn't exist

func UpdateDeliveriesByID

func UpdateDeliveriesByID(m *Deliveries, ignoreStatus bool) (err error)

UpdateDeliveriesByID updates deliveries by Id and returns error if the record to be updated doesn't exist

func UpdateGoalsByID

func UpdateGoalsByID(m *Goals, ignoreStatus bool) (err error)

UpdateGoalsByID updates Points by Id and returns error if the record to be updated doesn't exist

func UpdateGoalsCommentsByID

func UpdateGoalsCommentsByID(m *GoalsComments) (err error)

UpdateGoalsCommentsByID updates Points by Id and returns error if the record to be updated doesn't exist

func UpdateHolidaysByID

func UpdateHolidaysByID(m *Holidays) (err error)

UpdateHolidaysByID updates Holidays by Id and returns error if the record to be updated doesn't exist

func UpdateItemsByID

func UpdateItemsByID(m *Items, ignoreStatus bool) (err error)

UpdateItemsByID updates Items by Id and returns error if the record to be updated doesn't exist

func UpdateNotificationsByID

func UpdateNotificationsByID(m *Notifications) (err error)

UpdateNotificationsByID updates Notifications by Id and returns error if the record to be updated doesn't exist

func UpdateObjectsByID

func UpdateObjectsByID(m *Objects, ignoreStatus bool) (err error)

UpdateObjectsByID updates Objects by Id and returns error if the record to be updated doesn't exist

func UpdateOccurrencesByID

func UpdateOccurrencesByID(m *Occurrences) (err error)

UpdateOccurrencesByID updates Occurrences by Id and returns error if the record to be updated doesn't exist

func UpdatePointsByID

func UpdatePointsByID(m *Points) (err error)

UpdatePointsByID updates Points by Id and returns error if the record to be updated doesn't exist

func UpdateQuestionsAttachmentsByID

func UpdateQuestionsAttachmentsByID(m *QuestionsAttachments) (err error)

UpdateQuestionsAttachmentsByID updates QuestionsAttachments by Id and returns error if the record to be updated doesn't exist

func UpdateQuestionsByID

func UpdateQuestionsByID(m *Questions) (err error)

UpdateQuestionsByID updates Questions by Id and returns error if the record to be updated doesn't exist

func UpdateResidentsByID

func UpdateResidentsByID(m *Residents) (err error)

UpdateResidentsByID updates Residents by Id and returns error if the record to be updated doesn't exist

func UpdateSupervisorsByID

func UpdateSupervisorsByID(m *Supervisors) (err error)

UpdateSupervisorsByID updates Supervisors by Id and returns error if the record to be updated doesn't exist

func UpdateTasksByID

func UpdateTasksByID(m *Tasks, ignoreStatus bool) (err error)

UpdateTasksByID updates Points by Id and returns error if the record to be updated doesn't exist

func UpdateVerificationsByID

func UpdateVerificationsByID(m *Verifications) (err error)

UpdateVerificationsByID updates Verifications by Id and returns error if the record to be updated doesn't exist

func UpdateVotesByID

func UpdateVotesByID(m *Votes) (err error)

UpdateVotesByID updates Votes by Id and returns error if the record to be updated doesn't exist

func UpdateWatchersByID

func UpdateWatchersByID(m *Watchers) (err error)

UpdateWatchersByID updates Watchers by Id and returns error if the record to be updated doesn't exist

func UpdateWorkersByID

func UpdateWorkersByID(m *Workers) (err error)

UpdateWorkersByID updates Workers by Id and returns error if the record to be updated doesn't exist

func UpdateZonesByID

func UpdateZonesByID(m *Zones) (err error)

UpdateZonesByID updates Zones by Id and returns error if the record to be updated doesn't exist

func ValidateExists

func ValidateExists(modelName string, id int) (exists bool)

ValidateExists FK

Types

type Assistances

type Assistances struct {
	ID         int       `orm:"column(id);pk" json:"id,omitempty"`
	Date       string    `orm:"column(date);type(datetime);" json:"date,omitempty" validate:"required"`
	Type       string    `orm:"column(type)" json:"type,omitempty" validate:"required,alpha"`
	Longitude  string    `orm:"column(longitude)" json:"longitude,omitempty" validate:"required"`
	Latitude   string    `orm:"column(latitude)" json:"latitude,omitempty" validate:"required"`
	WorkTimeID int       `orm:"column(work_time_id);null" json:"work_time_id"`
	Worker     *Workers  `orm:"rel(fk);column(workers_id)" json:"workers,omitempty"`
	Watcher    *Watchers `orm:"rel(fk);column(watchers_id)" json:"watchers,omitempty"`
	Day        string    `orm:"-" json:"day,omitempty"`
	Token      string    `orm:"-" json:"token,omitempty"`
	CreatedAt  time.Time `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt  time.Time `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt  time.Time `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Assistances Model

func GetAssistancesByID

func GetAssistancesByID(id int) (v *Assistances, err error)

GetAssistancesByID retrieves Assistances by Id. Returns error if Id doesn't exist

func GetAssistancesFromTrash

func GetAssistancesFromTrash() (assistances []*Assistances, err error)

GetAssistancesFromTrash return Assistances soft Deleted

func (*Assistances) TableName

func (t *Assistances) TableName() string

TableName =

type Checks

type Checks struct {
	ID          int            `orm:"column(id);pk" json:"id,omitempty"`
	Date        string         `orm:"column(date);type(datetime);" json:"date,omitempty" valid:"Required"`
	Comment     string         `orm:"column(comment);null" json:"comment,omitempty"`
	Worker      *Workers       `orm:"rel(fk);column(workers_id)" json:"workers,omitempty"`
	Occurrences []*Occurrences `orm:"reverse(many);" json:"occurrences,omitempty"`
	CreatedAt   time.Time      `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt   time.Time      `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt   time.Time      `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Checks Model

func GetChecksByID

func GetChecksByID(id int) (v *Checks, err error)

GetChecksByID retrieves Checks by Id. Returns error if Id doesn't exist

func GetChecksFromTrash

func GetChecksFromTrash() (checks []*Checks, err error)

GetChecksFromTrash return Checks soft Deleted

func GetCondosChecksByDate

func GetCondosChecksByDate(condoID int, date time.Time) (checks []*Checks, err error)

GetCondosChecksByDate ...

func GetCondosChecksByMonth

func GetCondosChecksByMonth(condoID int, year int, month time.Month) (checks []*Checks, err error)

GetCondosChecksByMonth ...

func (*Checks) TableName

func (t *Checks) TableName() string

TableName =

type Condos

type Condos struct {
	ID                int            `orm:"column(id);pk" json:"id"`
	Name              string         `orm:"column(name);size(255)" json:"name,omitempty" valid:"Required"`
	RUT               string         `orm:"column(rut);size(255)" json:"rut" valid:"Required"`
	UserLimit         int            `orm:"column(user_limit);size(255)" json:"user_limit" valid:"Required"`
	ZoneLimit         int            `orm:"column(zone_limit);size(255)" json:"zone_limit" valid:"Required"`
	HourValue         float32        `orm:"colum(hour_value);size(20)" json:"hour_value" valid:"Required"`
	ExtraHourIncrease float32        `orm:"colum(extra_hour_increase);size(20)" json:"extra_hour_increase" valid:"Required"`
	WorkingHours      int            `orm:"column(working_hours)" json:"working_hours" valid:"Required"`
	AssistancesMod    bool           `orm:"column(assistances_mod)" json:"assistances_mod" valid:"Required"`
	RoutesMod         bool           `orm:"column(routes_mod)" json:"routes_mod" valid:"Required"`
	DeliveryMod       bool           `orm:"column(delivery_mod)" json:"delivery_mod" valid:"Required"`
	TasksMod          bool           `orm:"column(tasks_mod)" json:"tasks_mod" valid:"Required"`
	ChecksMod         bool           `orm:"column(checks_mod)" json:"checks_mod" valid:"Required"`
	SurveysMod        bool           `orm:"column(surveys_mod)" json:"surveys_mod" valid:"Required"`
	AlertsTime        string         `orm:"column(alerts_time);type(alerts_time);null" json:"alerts_time,omitempty"`
	Zones             []*Zones       `orm:"reverse(many)" json:"zone,omitempty"`
	Workers           []*Workers     `orm:"reverse(many)" json:"workers,omitempty"`
	Holidays          []*Holidays    `orm:"reverse(many)" json:"holidays,omitempty"`
	Objects           []*Objects     `orm:"reverse(many)" json:"objects,omitempty"`
	Residents         []*Residents   `orm:"reverse(many)" json:"residents,omitempty"`
	Questions         []*Questions   `orm:"reverse(many)" json:"questions,omitempty"`
	Watchers          []*Watchers    `orm:"-" json:"watchers,omitempty"`
	Supervisors       []*Supervisors `orm:"-" json:"supervisors,omitempty"`
	CreatedAt         time.Time      `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt         time.Time      `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt         time.Time      `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Condos Model

func GetCondosByID

func GetCondosByID(id int) (v *Condos, err error)

GetCondosByID retrieves Condos by Id. Returns error if Id doesn't exist

func GetCondosByRUT

func GetCondosByRUT(RUT string) (condo *Condos, err error)

GetCondosByRUT ...

func GetCondosFromTrash

func GetCondosFromTrash() (condos []*Condos, err error)

GetCondosFromTrash return Condos soft Deleted

func GetCondosWithoutLimit

func GetCondosWithoutLimit() (condos []*Condos, err error)

func (*Condos) TableName

func (t *Condos) TableName() string

TableName =

type Deliveries

type Deliveries struct {
	ID        int       `orm:"column(id);pk" json:"id"`
	Name      string    `orm:"column(name);" json:"name,omitempty" valid:"Required"`
	Approved  bool      `orm:"column(approved);" json:"approved"`
	Date      string    `orm:"column(date);auto_now_add;type(datetime);" json:"date,omitempty"`
	Worker    *Workers  `orm:"column(worker_id);rel(fk);" json:"worker,omitempty"`
	Items     []*Items  `orm:"reverse(many);" json:"items,omitempty"`
	CreatedAt time.Time `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt time.Time `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt time.Time `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Deliveries Model

func GetDeliveriesByID

func GetDeliveriesByID(id int) (v *Deliveries, err error)

GetDeliveriesByID retrieves deliveries by Id. Returns error if Id doesn't exist

func GetDeliveriesByWorkersID

func GetDeliveriesByWorkersID(workerID int) (deliveries []*Deliveries, err error)

GetDeliveriesByWorkersID ...

func GetDeliveriesFromTrash

func GetDeliveriesFromTrash() (deliveries []*Deliveries, err error)

GetDeliveriesFromTrash return Points soft Deleted

func (*Deliveries) TableName

func (t *Deliveries) TableName() string

TableName =

type EmptyAssistancesWorkers

type EmptyAssistancesWorkers struct {
	Entry       []*Workers `json:"entry,omitempty"`
	Break       []*Workers `json:"break,omitempty"`
	FinishBreak []*Workers `json:"finish_break,omitempty"`
	Exit        []*Workers `json:"exit,omitempty"`
}

EmptyAssistancesWorkers ...

func GetCondosWorkersEmptyAssistancesByDate

func GetCondosWorkersEmptyAssistancesByDate(condosID int, date time.Time) (emptyAssistancesWorkers *EmptyAssistancesWorkers, err error)

GetCondosWorkersEmptyAssistancesByDate ...

type Event

type Event struct {
	Type      EventType // JOIN, LEAVE, MESSAGE
	User      string
	CondoID   int
	Timestamp int // Unix timestamp (secs)
	Content   string
}

func GetEvents

func GetEvents(lastReceived int) []Event

GetEvents returns all events after lastReceived.

type EventType

type EventType int

EventType ...

type Goals

type Goals struct {
	ID            int              `orm:"column(id);pk" json:"id"`
	Name          string           `orm:"column(name);" json:"name,omitempty" valid:"Required"`
	Description   string           `orm:"column(description);" json:"description,omitempty"`
	Completed     bool             `orm:"column(completed);" json:"completed" valid:"Required"`
	Date          string           `orm:"column(date);type(datetime);" json:"date,omitempty"`
	DateEnd       string           `orm:"column(date_end);" json:"date_end,omitempty"`
	Task          *Tasks           `orm:"column(task_id);rel(fk);" json:"task,omitempty"`
	GoalsComments []*GoalsComments `orm:"reverse(many);" json:"comments,omitempty"`
	Token         string           `orm:"-" json:"token,omitempty"`
	CreatedAt     time.Time        `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt     time.Time        `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt     time.Time        `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Goals Model

func GetGoalsByID

func GetGoalsByID(id int) (v *Goals, err error)

GetGoalsByID retrieves Points by Id. Returns error if Id doesn't exist

func GetGoalsFromTrash

func GetGoalsFromTrash() (goals []*Goals, err error)

GetGoalsFromTrash return Points soft Deleted

func (*Goals) TableName

func (t *Goals) TableName() string

TableName =

type GoalsComments

type GoalsComments struct {
	ID             int       `orm:"column(id);pk" json:"id"`
	Description    string    `orm:"column(description);null" json:"description,omitempty" valid:"Required"`
	Date           string    `orm:"column(date);type(datetime);" json:"date,omitempty"`
	Goal           *Goals    `orm:"column(goal_id);rel(fk);" json:"goal,omitempty"`
	Worker         *Workers  `orm:"column(worker_id);rel(fk);" json:"worker,omitempty"`
	Attachment     string    `orm:"column(attachment);null" json:"attachment,omitempty" `
	AttachmentMime string    `orm:"column(attachment_mime);null" json:"attachment_mime,omitempty"`
	CreatedAt      time.Time `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt      time.Time `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt      time.Time `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

GoalsComments Model

func GetGoalsCommentsByID

func GetGoalsCommentsByID(id int) (v *GoalsComments, err error)

GetGoalsCommentsByID retrieves Points by Id. Returns error if Id doesn't exist

func GetGoalsCommentsFromTrash

func GetGoalsCommentsFromTrash() (goalsComments []*GoalsComments, err error)

GetGoalsCommentsFromTrash return Points soft Deleted

func (*GoalsComments) TableName

func (t *GoalsComments) TableName() string

TableName =

type Holidays

type Holidays struct {
	ID        int       `orm:"column(id);pk" json:"id"`
	Date      string    `orm:"column(date);type(date)" json:"date,omitempty" valid:"Required"`
	Condo     *Condos   `orm:"rel(fk);column(condos_id)" json:"condos,omitempty"`
	CreatedAt time.Time `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt time.Time `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt time.Time `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Holidays Model

func GetHolidaysByID

func GetHolidaysByID(id int) (v *Holidays, err error)

GetHolidaysByID retrieves Holidays by Id. Returns error if Id doesn't exist

func GetHolidaysFromTrash

func GetHolidaysFromTrash() (holidays []*Holidays, err error)

GetHolidaysFromTrash return Holidays soft Deleted

func (*Holidays) TableName

func (t *Holidays) TableName() string

TableName =

type Items

type Items struct {
	ID                int         `orm:"column(id);pk" json:"id"`
	Address           string      `orm:"column(address);" json:"address,omitempty" valid:"Required"`
	Description       string      `orm:"column(description);" json:"description,omitempty" valid:"Required"`
	Street_number     string      `orm:"column(street_number);" json:"street_number,omitempty" `
	Office_department string      `orm:"column(office_department);" json:"office_department,omitempty" `
	Addressee         string      `orm:"column(addressee);" json:"addressee,omitempty" `
	Code              string      `orm:"column(code);" json:"code,omitempty" `
	Delivered         bool        `orm:"column(delivered);" json:"delivered" `
	DateEnd           string      `orm:"column(date_end);type(string);" json:"date_end,omitempty"`
	Comment           string      `orm:"column(comment);null" json:"comment,omitempty"`
	ImageUUID         string      `orm:"column(image_uuid);null" json:"image_uuid,omitempty"`
	ImageMime         string      `orm:"column(image_mime);null" json:"image_mime,omitempty"`
	Delivery          *Deliveries `orm:"rel(fk);column(delivery_id)" json:"delivery,omitempty"`
	Token             string      `orm:"-" json:"token,omitempty"`
	CreatedAt         time.Time   `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt         time.Time   `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt         time.Time   `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Items ...

func GetItemsByID

func GetItemsByID(id int) (v *Items, err error)

GetItemsByID retrieves Items by Id. Returns error if Id doesn't exist

func GetItemsFromTrash

func GetItemsFromTrash() (items []*Items, err error)

GetItemsFromTrash return Points soft Deleted

func (*Items) TableName

func (t *Items) TableName() string

TableName =

type Notifications

type Notifications struct {
	ID          int       `orm:"column(id);pk" json:"id"`
	Name        string    `orm:"column(name);" json:"name,omitempty" valid:"Required"`
	Description string    `orm:"column(description);" json:"description,omitempty" valid:"Required"`
	Approved    bool      `orm:"column(approved);" json:"approved"`
	View        bool      `orm:"column(view);" json:"view"`
	Date        string    `orm:"column(date);type(string);" json:"date,omitempty"`
	ImageUUID   string    `orm:"column(image_uuid);null" json:"image_uuid,omitempty"`
	ImageMime   string    `orm:"column(image_mime);null" json:"image_mime,omitempty"`
	Worker      *Workers  `orm:"rel(fk);column(worker_id)" json:"worker,omitempty"`
	CreatedAt   time.Time `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt   time.Time `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt   time.Time `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Notifications ...

func GetNotificationsByCondosID

func GetNotificationsByCondosID(condosID int) (notifications []*Notifications, err error)

GetNotificationsByCondosID return Supervisors soft Deleted

func GetNotificationsByID

func GetNotificationsByID(id int) (v *Notifications, err error)

GetNotificationsByID retrieves Notifications by Id. Returns error if Id doesn't exist

func GetNotificationsFromTrash

func GetNotificationsFromTrash() (notifications []*Notifications, err error)

GetNotificationsFromTrash return Notifications soft Deleted

func (*Notifications) TableName

func (t *Notifications) TableName() string

TableName =

type Objects

type Objects struct {
	ID          int            `orm:"column(id);pk" json:"id"`
	Name        string         `orm:"column(name);" json:"name,omitempty" valid:"Required"`
	Code        string         `orm:"column(code);" json:"code,omitempty" valid:"Required"`
	Quantity    int            `orm:"column(quantity);" json:"quantity,omitempty" valid:"Required"`
	Condo       *Condos        `orm:"rel(fk);column(condos_id)" json:"condos,omitempty"`
	Occurrences []*Occurrences `orm:"reverse(many);" json:"occurrences,omitempty"`
	CreatedAt   time.Time      `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt   time.Time      `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt   time.Time      `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Objects ...

func GetObjectsByID

func GetObjectsByID(id int) (v *Objects, err error)

GetObjectsByID retrieves Objects by Id. Returns error if Id doesn't exist

func GetObjectsFromTrash

func GetObjectsFromTrash() (objects []*Objects, err error)

GetObjectsFromTrash return Points soft Deleted

func (*Objects) TableName

func (t *Objects) TableName() string

TableName =

type Occurrences

type Occurrences struct {
	ID        int       `orm:"column(id);pk" json:"id,omitempty"`
	Comment   string    `orm:"column(comment);" json:"comment,omitempty" valid:"Required"`
	ImageUUID string    `orm:"column(image_uuid);" json:"image_uuid,omitempty"`
	ImageMime string    `orm:"column(image_mime);" json:"image_mime,omitempty"`
	Object    *Objects  `orm:"rel(fk);column(objects_id)" json:"objects,omitempty"`
	Check     *Checks   `orm:"rel(fk);column(checks_id)" json:"checks,omitempty"`
	CreatedAt time.Time `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt time.Time `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt time.Time `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Occurrences Model

func GetOccurrencesByID

func GetOccurrencesByID(id int) (v *Occurrences, err error)

GetOccurrencesByID retrieves Occurrences by Id. Returns error if Id doesn't exist

func GetOccurrencesFromTrash

func GetOccurrencesFromTrash() (occurrences []*Occurrences, err error)

GetOccurrencesFromTrash return Occurrences soft Deleted

func (*Occurrences) TableName

func (t *Occurrences) TableName() string

TableName =

type Points

type Points struct {
	ID            int              `orm:"column(id);pk" json:"id"`
	Name          string           `orm:"column(name);size(255)" json:"name,omitempty" valid:"Required"`
	Zone          *Zones           `orm:"rel(fk);column(zones_id)" json:"zones,omitempty"`
	Verifications []*Verifications `orm:"reverse(many);" json:"verifications,omitempty"`
	CreatedAt     time.Time        `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt     time.Time        `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt     time.Time        `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Points Model

func GetPointsByID

func GetPointsByID(id int) (v *Points, err error)

GetPointsByID retrieves Points by Id. Returns error if Id doesn't exist

func GetPointsFromTrash

func GetPointsFromTrash() (points []*Points, err error)

GetPointsFromTrash return Points soft Deleted

func (*Points) TableName

func (t *Points) TableName() string

TableName =

type Questions

type Questions struct {
	ID                   int                     `orm:"column(id);pk" json:"id"`
	Label                string                  `orm:"column(label);" json:"label,omitempty"`
	Date                 string                  `orm:"column(date);type(datetime);" json:"date,omitempty"`
	DateEnd              string                  `orm:"column(date_end);" json:"date_end,omitempty"`
	Approved             bool                    `orm:"column(approved);" json:"approved,omitempty" `
	Description          string                  `orm:"column(description);" json:"description,omitempty"`
	CommitteeOnly        bool                    `orm:"column(committee_only);" json:"committee_only,omitempty"`
	Price                float32                 `orm:"column(price);null" json:"price,omitempty"`
	Condo                *Condos                 `orm:"rel(fk);column(condos_id)" json:"condos,omitempty"`
	Votes                []*Votes                `orm:"reverse(many)" json:"votes,omitempty"`
	QuestionsAttachments []*QuestionsAttachments `orm:"reverse(many)" json:"attachments,omitempty"`
	CreatedAt            time.Time               `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt            time.Time               `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt            time.Time               `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Questions Model

func GetQuestionsByCondosID

func GetQuestionsByCondosID(condoID int) (questions []*Questions, err error)

GetQuestionsByCondosID return Questions by condo's id

func GetQuestionsByID

func GetQuestionsByID(id int) (v *Questions, err error)

GetQuestionsByID retrieves Questions by Id. Returns error if Id doesn't exist

func GetQuestionsFromTrash

func GetQuestionsFromTrash() (questions []*Questions, err error)

GetQuestionsFromTrash return Questions soft Deleted

func (*Questions) TableName

func (t *Questions) TableName() string

TableName =

type QuestionsAttachments

type QuestionsAttachments struct {
	ID             int        `orm:"column(id);pk" json:"id"`
	Name           string     `orm:"column(name);" json:"name,omitempty" valid:"Required"`
	AttachmentUUID string     `orm:"column(attachment_uuid);" json:"attachment_uuid,omitempty"`
	AttachmentMime string     `orm:"column(attachment_mime);" json:"attachment_mime,omitempty"`
	Question       *Questions `orm:"rel(fk);column(questions_id)" json:"questions,omitempty"`
	CreatedAt      time.Time  `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt      time.Time  `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt      time.Time  `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

QuestionsAttachments Model

func GetQuestionsAttachmentsByID

func GetQuestionsAttachmentsByID(id int) (v *QuestionsAttachments, err error)

GetQuestionsAttachmentsByID retrieves QuestionsAttachments by Id. Returns error if Id doesn't exist

func GetQuestionsAttachmentsFromTrash

func GetQuestionsAttachmentsFromTrash() (questionsAttachments []*QuestionsAttachments, err error)

GetQuestionsAttachmentsFromTrash return QuestionsAttachments soft Deleted

func (*QuestionsAttachments) TableName

func (t *QuestionsAttachments) TableName() string

TableName =

type Residents

type Residents struct {
	ID          int       `orm:"column(id);pk" json:"id"`
	Name        string    `orm:"column(name);size(255)" json:"name,omitempty" valid:"Required"`
	Condo       *Condos   `orm:"rel(fk);column(condos_id)" json:"condos,omitempty"`
	Email       string    `orm:"column(email);size(255)" json:"email,omitempty" valid:"Required"`
	Phone       string    `orm:"column(phone);size(255)" json:"phone,omitempty"`
	Committee   bool      `orm:"column(committee);" json:"committee,omitempty"`
	RUT         string    `orm:"column(rut);" json:"rut,omitempty"`
	Password    string    `orm:"column(password);size(255)" json:"password,omitempty" valid:"Required"`
	ImageUUID   string    `orm:"column(image_uuid)" json:"image_uuid,omitempty"`
	ImageMime   string    `orm:"column(image_mime)" json:"image_mime,omitempty"`
	Departament string    `orm:"column(departament)" json:"departament,omitempty"`
	Percentage  float32   `orm:"column(percentage)" json:"percentage,omitempty"`
	Approved    bool      `orm:"column(approved)" json:"approved"`
	Votes       []*Votes  `orm:"reverse(many)" json:"votes,omitempty"`
	Token       string    `orm:"-" json:"token,omitempty"`
	CreatedAt   time.Time `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt   time.Time `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt   time.Time `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Residents Model

func GetResidentsByCondosID

func GetResidentsByCondosID(condosID int) (residents []*Residents, err error)

GetResidentsByCondosID ...

func GetResidentsByEmail

func GetResidentsByEmail(email string) (v *Residents, err error)

GetResidentsByEmail retrieves Residents by email. Returns error if Id doesn't exist

func GetResidentsByID

func GetResidentsByID(id int) (v *Residents, err error)

GetResidentsByID retrieves Residents by Id. Returns error if Id doesn't exist

func GetResidentsFromTrash

func GetResidentsFromTrash() (residents []*Residents, err error)

GetResidentsFromTrash return Residents soft Deleted

func (*Residents) TableName

func (t *Residents) TableName() string

TableName =

type Supervisors

type Supervisors struct {
	ID        int       `orm:"column(id);pk" json:"id"`
	Username  string    `orm:"column(username);size(255)" json:"username,omitempty" valid:"Required"`
	Password  string    `orm:"column(password);" json:"password,omitempty" valid:"Required"`
	Phone     string    `orm:"column(phone);null" json:"phone,omitempty" valid:"Required"`
	Token     string    `orm:"-" json:"token,omitempty"`
	Worker    *Workers  `orm:"rel(fk);column(workers_id)" json:"worker,omitempty"`
	CreatedAt time.Time `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt time.Time `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt time.Time `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Supervisors Model

func GetSupervisorsByCondosID

func GetSupervisorsByCondosID(condosID int) (supervisors []*Supervisors, err error)

GetSupervisorsByCondosID return Supervisors soft Deleted

func GetSupervisorsByID

func GetSupervisorsByID(id int) (v *Supervisors, err error)

GetSupervisorsByID retrieves Supervisors by Id. Returns error if Id doesn't exist

func GetSupervisorsByUsername

func GetSupervisorsByUsername(username string) (v *Supervisors, err error)

GetSupervisorsByUsername retrieves Supervisors by username. Returns error if Id doesn't exist

func GetSupervisorsByWorkersID

func GetSupervisorsByWorkersID(workerID int) (v *Supervisors, err error)

GetSupervisorsByWorkersID retrieves Supervisors by workerID. Returns error if Id doesn't exist

func GetSupervisorsFromTrash

func GetSupervisorsFromTrash() (supervisors []*Supervisors, err error)

GetSupervisorsFromTrash return Supervisors soft Deleted

func (*Supervisors) TableName

func (t *Supervisors) TableName() string

TableName =

type Tasks

type Tasks struct {
	ID        int       `orm:"column(id);pk" json:"id"`
	Name      string    `orm:"column(name);" json:"name,omitempty" valid:"Required"`
	Approved  bool      `orm:"column(approved);" json:"approved" valid:"Required"`
	Date      string    `orm:"column(date);auto_now_add;type(datetime);" json:"date,omitempty"`
	DateEnd   string    `orm:"column(date_end);" json:"date_end,omitempty"`
	Address   string    `orm:"column(address);" json:"address,omitempty"`
	Phone     string    `orm:"column(phone);" json:"phone,omitempty"`
	Worker    *Workers  `orm:"column(worker_id);rel(fk);" json:"worker,omitempty"`
	Goals     []*Goals  `orm:"reverse(many);" json:"goals,omitempty"`
	CreatedAt time.Time `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt time.Time `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt time.Time `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Tasks Model

func GetTasksByID

func GetTasksByID(id int) (v *Tasks, err error)

GetTasksByID retrieves Points by Id. Returns error if Id doesn't exist

func GetTasksByWorkersID

func GetTasksByWorkersID(workerID int) (tasks []*Tasks, err error)

GetTasksByWorkersID ...

func GetTasksFromTrash

func GetTasksFromTrash() (tasks []*Tasks, err error)

GetTasksFromTrash return Points soft Deleted

func (*Tasks) TableName

func (t *Tasks) TableName() string

TableName =

type Verifications

type Verifications struct {
	ID                int       `orm:"column(id);pk" json:"id,omitempty"`
	Date              string    `orm:"column(date);type(datetime);" json:"date,omitempty" valid:"Required"`
	SupervisorComment string    `orm:"column(supervisor_comment);" json:"supervisor_comment,omitempty"`
	WatcherComment    string    `orm:"column(watcher_comment);" json:"watcher_comment,omitempty"`
	ImageUUID         string    `orm:"column(image_uuid);" json:"image_uuid,omitempty"`
	ImageMime         string    `orm:"column(image_mime);" json:"image_mime,omitempty"`
	Latitude          float32   `orm:"column(latitude)" json:"latitude" valid:"Required"`
	Longitude         float32   `orm:"column(longitude)" json:"longitude" valid:"Required"`
	Watcher           *Watchers `orm:"rel(fk);column(watchers_id)" json:"watchers,omitempty"`
	Point             *Points   `orm:"rel(fk);column(points_id)" json:"point,omitempty"`
	CreatedAt         time.Time `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt         time.Time `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt         time.Time `orm:"column(deleted_at);type(datetime);null" json:"-"`
	Viewed            bool      `orm:"column(viewed);" json:"viewed"`
}

Verifications Model

func GetCondosVerificationsByMonth

func GetCondosVerificationsByMonth(condosID int, year int, month time.Month) (Verifications []*Verifications, err error)

GetCondosVerificationsByMonth ...

func GetVerificationsByID

func GetVerificationsByID(id int) (v *Verifications, err error)

GetVerificationsByID retrieves Verifications by Id. Returns error if Id doesn't exist

func GetVerificationsFromTrash

func GetVerificationsFromTrash() (verifications []*Verifications, err error)

GetVerificationsFromTrash return Verifications soft Deleted

func GetWatchersVerificationsByMonth

func GetWatchersVerificationsByMonth(watchersID int, year int, month time.Month) (Verifications []*Verifications, err error)

GetWatchersVerificationsByMonth ...

func (*Verifications) TableName

func (t *Verifications) TableName() string

TableName =

type Votes

type Votes struct {
	ID        int        `orm:"column(id);pk" json:"id"`
	Resident  *Residents `orm:"rel(fk);column(residents_id)" json:"residents,omitempty"`
	Question  *Questions `orm:"rel(fk);column(questions_id)" json:"questions,omitempty"`
	Accepted  bool       `orm:"column(accepted);" json:"accepted,omitempty" valid:"Required"`
	Comment   string     `orm:"column(comment);size(255)" json:"comment,omitempty"`
	CreatedAt time.Time  `orm:"column(created_at);type(datetime);null;auto_now_add" json:"created_at,omitempty"`
	UpdatedAt time.Time  `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt time.Time  `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Votes Model

func GetVotesByID

func GetVotesByID(id int) (v *Votes, err error)

GetVotesByID retrieves Votes by Id. Returns error if Id doesn't exist

func GetVotesFromTrash

func GetVotesFromTrash() (votes []*Votes, err error)

GetVotesFromTrash return Votes soft Deleted

func (*Votes) TableName

func (t *Votes) TableName() string

TableName =

type Watchers

type Watchers struct {
	ID             int              `orm:"column(id);pk" json:"id"`
	Username       string           `orm:"column(username);size(255)" json:"username,omitempty" valid:"Required"`
	Password       string           `orm:"column(password);" json:"password,omitempty" valid:"Required"`
	Phone          string           `orm:"column(phone);" json:"phone,omitempty" valid:"Required"`
	AssistancesMod bool             `orm:"column(assistances_mod)" json:"assistances_mod"`
	RoutesMod      bool             `orm:"column(routes_mod)" json:"routes_mod"`
	DeliveryMod    bool             `orm:"column(delivery_mod)" json:"delivery_mod"`
	TasksMod       bool             `orm:"column(tasks_mod)" json:"tasks_mod"`
	ChecksMod      bool             `orm:"column(checks_mod)" json:"checks_mod"`
	Token          string           `orm:"-" json:"token,omitempty"`
	Worker         *Workers         `orm:"rel(fk);column(workers_id)" json:"worker,omitempty"`
	Verifications  []*Verifications `orm:"reverse(many);" json:"verifications,omitempty"`
	CreatedAt      time.Time        `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt      time.Time        `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt      time.Time        `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Watchers Model

func GetWatchersByCondosID

func GetWatchersByCondosID(condosID int) (watchers []*Watchers, err error)

GetWatchersByCondosID ...

func GetWatchersByID

func GetWatchersByID(id int) (v *Watchers, err error)

GetWatchersByID retrieves Watchers by Id. Returns error if Id doesn't exist

func GetWatchersByUsername

func GetWatchersByUsername(username string) (v *Watchers, err error)

GetWatchersByUsername retrieves Watchers by username. Returns error if Id doesn't exist

func GetWatchersByWorkersID

func GetWatchersByWorkersID(workerID int) (v *Watchers, err error)

GetWatchersByWorkersID retrieves Watchers by workerID. Returns error if Id doesn't exist

func GetWatchersFromTrash

func GetWatchersFromTrash() (watchers []*Watchers, err error)

GetWatchersFromTrash return Watchers soft Deleted

func (*Watchers) GetVerificationsByDate

func (t *Watchers) GetVerificationsByDate(date time.Time) (err error)

GetVerificationsByDate ...

func (*Watchers) TableName

func (t *Watchers) TableName() string

TableName =

type Workers

type Workers struct {
	ID               int                     `orm:"column(id);pk" json:"id"`
	FirstName        string                  `orm:"column(first_name);size(255)" json:"first_name,omitempty" valid:"Required"`
	Condo            *Condos                 `orm:"rel(fk);column(condos_id)" json:"condos,omitempty"`
	Assistances      []*Assistances          `orm:"reverse(many)" json:"assistances,omitempty"`
	Notifications    []*Notifications        `orm:"reverse(many)" json:"notifications,omitempty"`
	ImageUUID        string                  `orm:"column(image_uuid)" json:"image_uuid,omitempty"`
	ImageMime        string                  `orm:"column(image_mime)" json:"-"`
	FaceID           string                  `orm:"column(face_id)" json:"-"`
	Approved         bool                    `orm:"column(approved)" json:"approved"`
	RUT              string                  `orm:"column(rut);size(255);null" json:"rut,omitempty"`
	Address          string                  `orm:"column(address);null" json:"address,omitempty"`
	Phone            string                  `orm:"column(phone);null" json:"phone,omitempty"`
	Community        string                  `orm:"column(community);null" json:"community,omitempty"`
	Email            string                  `orm:"column(email);" json:"email,omitempty" valid:"Required"`
	City             string                  `orm:"column(city);null" json:"city,omitempty"`
	Country          string                  `orm:"column(country);null" json:"country,omitempty"`
	TodayAssistances map[string]*Assistances `orm:"-" json:"today_assistances,omitempty"`
	MonthData        *monthDetail            `orm:"-" json:"month_data,omitempty"`
	YearData         *yearDetail             `orm:"-" json:"year_data,omitempty"`
	CreatedAt        time.Time               `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt        time.Time               `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt        time.Time               `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Workers Model

func GetWorkersByCondosID

func GetWorkersByCondosID(condosID int) (workers []*Workers, err error)

GetWorkersByCondosID ...

func GetWorkersByEmail

func GetWorkersByEmail(email string) (v *Workers, err error)

GetWorkersByEmail retrieves Workers by email. Returns error if Id doesn't exist

func GetWorkersByID

func GetWorkersByID(id int) (v *Workers, err error)

GetWorkersByID retrieves Workers by Id. Returns error if Id doesn't exist

func GetWorkersFromTrash

func GetWorkersFromTrash() (workers []*Workers, err error)

GetWorkersFromTrash return Workers soft Deleted

func (*Workers) GetCurrentWorkTimeAssistances

func (t *Workers) GetCurrentWorkTimeAssistances() (err error)

GetCurrentWorkTimeAssistances ...

func (*Workers) GetMonthAssistancesData

func (t *Workers) GetMonthAssistancesData(year int, month time.Month) (err error)

GetMonthAssistancesData ...

func (*Workers) GetTodayAssistances

func (t *Workers) GetTodayAssistances() (err error)

GetTodayAssistances ...

func (*Workers) GetYearAssistancesData

func (t *Workers) GetYearAssistancesData(year int) (err error)

GetYearAssistancesData ...

func (*Workers) TableName

func (t *Workers) TableName() string

TableName =

type Zones

type Zones struct {
	ID        int       `orm:"column(id);pk" json:"id"`
	Name      string    `orm:"column(name);size(255)" json:"name,omitempty" valid:"Required"`
	Condo     *Condos   `orm:"rel(fk);column(condos_id)" json:"condos,omitempty"`
	Points    []*Points `orm:"reverse(many)" json:"points,omitempty"`
	Token     string    `orm:"-" json:"token,omitempty"`
	CreatedAt time.Time `orm:"column(created_at);type(datetime);null;auto_now_add" json:"-"`
	UpdatedAt time.Time `orm:"column(updated_at);type(datetime);null" json:"-"`
	DeletedAt time.Time `orm:"column(deleted_at);type(datetime);null" json:"-"`
}

Zones Model

func GetZonesByID

func GetZonesByID(id int) (v *Zones, err error)

GetZonesByID retrieves Zones by Id. Returns error if Id doesn't exist

func GetZonesFromTrash

func GetZonesFromTrash() (zones []*Zones, err error)

GetZonesFromTrash return Zones soft Deleted

func (*Zones) TableName

func (t *Zones) TableName() string

TableName =

Jump to

Keyboard shortcuts

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