models

package
v0.0.0-...-5b56a75 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Audit

type Audit struct {
	ID       string           `json:"id"`
	Section  Section          `json:"section"`
	Customer Customer         `json:"customer"`
	Action   AuditAction      `json:"action"`
	Metadata webutil.MetaInfo `json:"metadata"`
	Created  time.Time        `json:"created"`
}

Audit is ...

type AuditAction

type AuditAction int
const (
	OnSendMail AuditAction
	OnSignIn
	OnSignOut
	OnAdd
	OnUpdate
	OnDelete
	OnClone
)

type Audits

type Audits struct {
	Total  int      `json:"total"`
	Audits []*Audit `json:"audits"`
}

Audits is ...

type Core

type Core struct {
	ID      string     `json:"id"`
	Created *time.Time `json:"created,omitempty"`
	Updated *time.Time `json:"updated,omitempty"`
}

Core is ...

func (Core) Validate

func (v Core) Validate() error

Validate is ...

type Currency

type Currency int
const (
	CurrencyEUR Currency
	CurrencyUSD
	CurrencyJPY
	CurrencyGBP
	CurrencyAUD
	CurrencyCAD
	CurrencyCHF
	CurrencyCNY
	CurrencySEK
)

type Customer

type Customer struct {
	Core
	Email    string    `json:"email"`
	Status   bool      `json:"status,omitempty"`
	Payments *Payments `json:"payments,omitempty"`
}

Customer is a ...

func (Customer) Validate

func (v Customer) Validate() error

Validate is ...

type Customers

type Customers struct {
	Total     int         `json:"total"`
	Customers []*Customer `json:"customers,omitempty"`
}

Customers is ...

type Letter

type Letter struct {
	Subject string `json:"subject"`
	Text    string `json:"text"`
	Html    string `json:"html"`
}

Letter ...

func (Letter) Validate

func (v Letter) Validate() error

Validate is ...

type License

type License struct {
	Core
	Payment *Payment `json:"payment,omitempty"`
	License *[]byte  `json:"license,omitempty"`
	Hash    string   `json:"hash,omitempty"`
	Data    string   `json:"data,omitempty"`
	Status  bool     `json:"status"`
}

License is a ...

func (License) Validate

func (v License) Validate() error

Validate is ...

type Licenses

type Licenses struct {
	Total    int        `json:"total"`
	Licenses []*License `json:"licenses,omitempty"`
}

Licenses is ...

type Mail

type Mail struct {
	SenderName  string `json:"sender_name"`
	SenderEmail string `json:"sender_email"`
	SMTP        SMTP   `json:"smtp"`
}

Mail is ...

func (Mail) Validate

func (v Mail) Validate() error

Validate is ...

type MailMessage

type MailMessage struct {
	To     string            `json:"to"`
	Letter Letter            `json:"letter"`
	Data   map[string]string `json:"data"`
}

MailMessage ...

func (MailMessage) Validate

func (v MailMessage) Validate() error

Validate is ...

type Metadata

type Metadata map[string]any

Metadata is ...

type Pattern

type Pattern struct {
	Core
	Name     string    `json:"name"`
	Limit    *Metadata `json:"limit,omitempty"`    // license restrictions
	Term     *Term     `json:"term,omitempty"`     // license validity period
	Price    *int      `json:"price,omitempty"`    // price in Stripe format
	Currency *Currency `json:"currency,omitempty"` // currency
	Check    *Metadata `json:"check,omitempty"`    // what will be checked for license verification?
	Private  bool      `json:"private,omitempty"`  // the pattern is available to the administrator only.
	Status   bool      `json:"status,omitempty"`   // pattern activity
	Licenses *Licenses `json:"licenses,omitempty"` // licenses
}

Pattern is a ...

func (Pattern) Validate

func (v Pattern) Validate() error

Validate is ...

type Patterns

type Patterns struct {
	Total    int        `json:"total"`
	Patterns []*Pattern `json:"patterns,omitempty"`
}

Patterns is ...

type Payment

type Payment struct {
	Core
	Customer    *Customer    `json:"customer,omitempty"`
	Pattern     *Pattern     `json:"pattern,omitempty"`
	Transaction *Transaction `json:"transaction,omitempty"`
}

Payment is a ...

func (Payment) Validate

func (v Payment) Validate() error

Validate is ...

type PaymentProvider

type PaymentProvider int
const (
	NONE PaymentProvider
	STRIPE
)

type PaymentStatus

type PaymentStatus int
const (
	UNPAID
	PROCESSED
	CANCELED
	FAILED
)

type Payments

type Payments struct {
	Total    int        `json:"total"`
	Payments []*Payment `json:"payments,omitempty"`
}

Payments is ...

type SMTP

type SMTP struct {
	Host       string `json:"host"`
	Port       int    `json:"port"`
	Encryption int    `json:"encryption"`
	Username   string `json:"username"`
	Password   string `json:"password"`
}

SMTP is ...

func (SMTP) Validate

func (v SMTP) Validate() error

Validate is ...

type Section

type Section int
const (
	SectionSystem Section
	SectionSetting
	SectionCustomer
	SectionPattern
	SectionLicense
	SectionPayment
)

type SettingName

type SettingName struct {
	ID    string `json:"id,omitempty"`
	Key   string `json:"key"`
	Value any    `json:"value,omitempty"`
}

SettingName is ...

func (SettingName) Validate

func (v SettingName) Validate() error

Validate is ...

type SignIn

type SignIn struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

SignIn is ...

func (SignIn) Validate

func (v SignIn) Validate() error

Validate is ...

type Site

type Site struct {
	Domain       string `json:"domain"`
	Name         string `json:"name"`
	Signature    string `json:"signature"`
	EmailSupport string `json:"email_support"`
}

Site is ...

func (Site) Validate

func (v Site) Validate() error

Validate is ...

type Term

type Term int
const (
	Hour Term
	Day
	Week
	Month
	Year
)

func (Term) ToDuration

func (t Term) ToDuration() time.Duration

ToDuration converts a Term to its equivalent time.Duration.

type Transaction

type Transaction struct {
	Provider PaymentProvider `json:"provider"`
	Status   PaymentStatus   `json:"status"`
	Meta     Metadata        `json:"meta,omitempty"`
	Payment  *time.Time      `json:"payment,omitempty"`
}

TransactionTransactionTransaction is ...

Jump to

Keyboard shortcuts

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