entities

package
v0.0.0-...-31ddaea Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeviceOsAndroid = "ANDROID"
	DeviceOsIOS     = "IOS"
)
View Source
const (
	NotificationTypeEmail = "email"
	NotificationTypeFCM   = "fcm"
	NotificationTypeApp   = "app"
)
View Source
const (
	TemplateLangID = "id"
	TemplateLangEN = "en"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceToken

type DeviceToken struct {
	ID        common.ID
	UserId    string
	Token     string
	OsName    string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func NewDeviceToken

func NewDeviceToken(x DeviceTokenDto, finds ...*DeviceToken) *DeviceToken

func (*DeviceToken) Validate

func (x *DeviceToken) Validate() (err *multierror.Error)

type DeviceTokenDto

type DeviceTokenDto struct {
	ID        *common.ID
	UserId    string
	Token     string
	OsName    string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type DeviceTokenQueryParams

type DeviceTokenQueryParams struct {
	UserId string
}

type Notification

type Notification struct {
	ID        common.ID
	UserId    string
	Type      string
	Data      string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func NewNotification

func NewNotification(x NotificationDto, finds ...*Notification) *Notification

func (*Notification) GetData

func (x *Notification) GetData() (data interface{})

func (*Notification) SetData

func (x *Notification) SetData(data interface{})

func (*Notification) Validate

func (x *Notification) Validate() (err *multierror.Error)

type NotificationDto

type NotificationDto struct {
	ID        *common.ID
	UserId    string
	Type      string
	Data      string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type NotificationMeta

type NotificationMeta struct {
	Data    []*Notification
	Total   int
	Page    int
	PerPage int
}

type NotificationQueryParams

type NotificationQueryParams struct {
	UserId  string
	Page    int
	PerPage int
}

type NotificationSends

type NotificationSends struct {
	UserId       string
	TemplateName string
	Data         string
	Services     []string
	PathEmail    string
}

func (*NotificationSends) GetData

func (x *NotificationSends) GetData() (result map[string]string)

type Template

type Template struct {
	ID        common.ID
	Name      string
	Data      string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func NewTemplate

func NewTemplate(x TemplateDto, finds ...*Template) *Template

func (*Template) GetData

func (x *Template) GetData() (data interface{})

func (*Template) GetTemplateData

func (x *Template) GetTemplateData(data interface{}, lang string) (result TemplateData)

func (*Template) GetTemplateMaps

func (x *Template) GetTemplateMaps(data interface{}, lang string) map[string]string

func (*Template) Validate

func (x *Template) Validate() (err *multierror.Error)

type TemplateData

type TemplateData struct {
	Title string `json:"title"`
	Body  string `json:"body"`
}

type TemplateDataDTO

type TemplateDataDTO struct {
	Title TemplateLanguage `json:"title"`
	Body  TemplateLanguage `json:"body"`
}

type TemplateDto

type TemplateDto struct {
	ID        *common.ID
	Name      string
	Data      string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type TemplateLanguage

type TemplateLanguage struct {
	EN string `json:"en"`
	ID string `json:"id"`
}

type TemplateQueryParams

type TemplateQueryParams struct {
	Search string
}

type User

type User struct {
	ID        common.ID
	Name      string
	Email     string
	Avatar    string
	LangCode  string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (*User) LangDefault

func (x *User) LangDefault()

default english if lang code is empty

Jump to

Keyboard shortcuts

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