models

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	gorm.Model
	ID          uint   `gorm:"primaryKey" faker:"oneof: 1,2",unique`
	Name        string `faker:"name" form:"name" binding:"required"`
	Email       string `faker:"email" form:"email" binding:"required,email"`
	Phone       string `faker:"phone_number" form:"phone"`
	Category    string `faker:"oneof: A, B, C, D" form:"category"`
	LastContact time.Time
	NextContact time.Time
	Notes       string `faker:"paragraph" form:"notes"`
}

func GetContactsToday

func GetContactsToday(db *gorm.DB) ([]Contact, error)

func GetRecentContacts

func GetRecentContacts(db *gorm.DB) ([]Contact, error)

GetRecentContacts returns all contacts with last contact date within the last 10 days

func GetUpcomingContacts

func GetUpcomingContacts(db *gorm.DB) ([]Contact, error)

GetUpcomingContacts returns all contacts with next contact date within the next 10 days

func (*Contact) GetNextContactDate

func (c *Contact) GetNextContactDate() time.Time

func (*Contact) Validate

func (c *Contact) Validate() error

Jump to

Keyboard shortcuts

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