entities

package
v0.0.0-...-a1da574 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const EmailRegexp = "^.*$"

EmailRegexp ...

View Source
const UsernameRegexp = "*"

UsernameRegexp ...

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	StripeEntity
	Entity
	Email *Email `json:"email"`
}

Account ...

func NewAccount

func NewAccount() *Account

NewAccount creates new account, initializing id, created at, and email.

func (*Account) SetEmail

func (account *Account) SetEmail(email *Email) error

SetEmail email attribute of account.

type AccountEntity

type AccountEntity struct {
	AccountID string `json:"account_id"`
}

AccountEntity ...

func (*AccountEntity) SetAccountID

func (entity *AccountEntity) SetAccountID(accountID string)

SetAccountID ...

type Address

type Address struct {
	City       string `json:"city"`
	Country    string `json:"country"`
	LineOne    string `json:"line1"`
	LineTwo    string `json:"line2"`
	PostalCode string `json:"postal_code"`
	State      string `json:"state"`
}

Address ...

type Administrator

type Administrator struct {
	Entity
	Business
	UserEntity
}

Administrator ...

type BillingDetails

type BillingDetails struct {
	Entity
	PaymentMethod *PaymentMethod `json:"payment_method"`
	Address       *Address       `json:"address"`
}

BillingDetails ...

type Business

type Business struct {
	Entity
	Desc string `json:"desc"`
	Name string `json:"name"`
	Slug string `json:"slug"`
}

Business ...

type BusinessEntity

type BusinessEntity struct {
	BusinessID string `json:"business_id"`
}

BusinessEntity ...

func (*BusinessEntity) SetBusinessID

func (entity *BusinessEntity) SetBusinessID(businessID string)

SetBusinessID ...

type Course

type Course struct {
	AccountEntity
	Entity
	Name   string `json:"name"`
	Desc   string `json:"desc"`
	Slug   string `json:"slug" pg:",unique"`
	Status string `json:"status"`
}

Course ...

func NewCourse

func NewCourse() *Course

NewCourse ...

type CourseEntity

type CourseEntity struct {
	CourseID string `json:"course_id"`
}

CourseEntity ...

func (*CourseEntity) SetCourseID

func (entity *CourseEntity) SetCourseID(courseID string)

SetCourseID ...

type Customer

type Customer struct {
	AccountEntity
	StripeEntity
	UserEntity
	Entity
}

Customer ...

type CustomerEntity

type CustomerEntity struct {
	CustomerID string `json:"customer_id"`
}

CustomerEntity ...

type Email

type Email string

Email ...

func NewEmail

func NewEmail(emailStr string) *Email

NewEmail ...

func (*Email) String

func (email *Email) String() string

String ...

func (*Email) Validate

func (email *Email) Validate() error

Validate ...

type Enrollment

type Enrollment struct {
	CourseEntity
	StudentEntity
	Entity
}

Enrollment ...

type Entity

type Entity struct {
	ID        string     `json:"id" pg:",pk"`
	CreatedAt *time.Time `json:"created_at"`
	CreatedBy string     `json:"created_by"`
	UpdatedAt *time.Time `json:"updated_at"`
	UpdatedBy string     `json:"updated_by"`
	DeletedAt *time.Time `json:"deleted_at"`
	DeletedBy string     `json:"deleted_by"`
}

Entity ...

func (*Entity) SetCreatedAt

func (entity *Entity) SetCreatedAt() error

SetCreatedAt ...

func (*Entity) SetCreatedBy

func (entity *Entity) SetCreatedBy(id string) error

SetCreatedBy ...

func (*Entity) SetDeletedAt

func (entity *Entity) SetDeletedAt() error

SetDeletedAt ...

func (*Entity) SetDeletedBy

func (entity *Entity) SetDeletedBy() error

SetDeletedBy ...

func (*Entity) SetID

func (entity *Entity) SetID(id string) error

SetID ...

func (*Entity) SetUpdatedAt

func (entity *Entity) SetUpdatedAt() error

SetUpdatedAt ...

func (*Entity) SetUpdatedBy

func (entity *Entity) SetUpdatedBy() error

SetUpdatedBy ...

type Family

type Family struct {
	FamilyMemberEntity
	StudentEntity
	Entity
}

Family ... TODO: add various properties related to policies?

type FamilyMember

type FamilyMember struct {
	BusinessEntity
	UserEntity
	Entity
}

FamilyMember ...

type FamilyMemberEntity

type FamilyMemberEntity struct {
	FamilyMemberID string `json:"family_member_id"`
}

FamilyMemberEntity ...

func (*FamilyMemberEntity) SetFamilyMemberID

func (entity *FamilyMemberEntity) SetFamilyMemberID(familyMemberID string)

SetFamilyMemberID ...

type Group

type Group struct {
	Entity
}

Group ...

type Image

type Image struct {
	Entity
	URL string `json:"url"`
}

Image ...

type Instructor

type Instructor struct {
	BusinessEntity
	UserEntity
	Entity
}

Instructor ...

type PaymentMethod

type PaymentMethod struct {
	CustomerEntity
	StripeEntity
	Entity
}

PaymentMethod ...

type PhoneNumber

type PhoneNumber string

PhoneNumber ...

func (*PhoneNumber) Validate

func (phoneNumber *PhoneNumber) Validate() error

Validate ...

type Profile

type Profile struct {
	UserEntity
	Entity
}

Profile ...

type Role

type Role struct {
}

Role ...

type Schedule

type Schedule struct {
	CourseEntity
	Entity
	Instructors []*Instructor `json:"instructors"`
	StartTime   *time.Time    `json:"start_time"`
	EndTime     *time.Time    `json:"end_time"`
}

Schedule ...

type StripeEntity

type StripeEntity struct {
	StripeID string `json:"stripe_id"`
}

StripeEntity ...

func (*StripeEntity) SetStripeID

func (entity *StripeEntity) SetStripeID(stripeID string)

SetStripeID ...

type StudentEntity

type StudentEntity struct {
	StudentID *string `json:"studentId"`
}

StudentEntity ...

func (*StudentEntity) SetStudentID

func (entity *StudentEntity) SetStudentID(studentID *string)

SetStudentID ...

type Subscription

type Subscription struct {
	Entity
}

Subscription ...

type UserEntity

type UserEntity struct {
	UserID string `json:"user_id"`
}

UserEntity ...

func (*UserEntity) SetUserID

func (entity *UserEntity) SetUserID(userID string)

SetUserID ...

type Username

type Username string

Username ...

func (*Username) Validate

func (username *Username) Validate() error

Validate ...

type Video

type Video struct {
	Entity
}

Video ...

Jump to

Keyboard shortcuts

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