model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	AccountBase
	Customer int // FK

	AcceptablePaymentMethod string

	Bank        string
	BankCode    string
	BankId      int
	AccountCode string

	Balance int
}

type AccountBase

type AccountBase struct {
	Id        int
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (*AccountBase) BeforeCreate

func (base *AccountBase) BeforeCreate(tx *gorm.DB) (err error)

func (AccountBase) TableName

func (AccountBase) TableName() string

type Customer

type Customer struct {
	gorm.Model
	CustomerBase

	Type string `default:"person" json:"type" xml:"type" enum:"person,institue,business"`
}

Polymorhic mode for customer -> person,institue,business

type CustomerActivity

type CustomerActivity struct {
	gorm.Model

	CustomerId int // FK
	ServiceId  int // FK
	Title      string
	Value      string
	Time       time.Time
	Result     string
}

type CustomerBase

type CustomerBase struct {
	Id        int
	CreatedAt time.Time
	UpdatedAt time.Time
}

type CustomerPrefrence

type CustomerPrefrence struct {
	gorm.Model
	CustomerBase

	CustomerId int // FK
	ServiceId  int // FK
	Title      string
	Value      string
	File       string
	Type       string `default:"value" json:"type" xml:"type" enum:"file,value"`
	ExpireAt   time.Time
}

type CustomerService

type CustomerService struct {
	gorm.Model
	CustomerBase

	ServiceId int // FK
	IsActive  bool
	ExpireAt  time.Time
}

type Institution

type Institution struct {
	gorm.Model
	InstitutionBase
	Title string
}

type InstitutionBase

type InstitutionBase struct {
	Id        int
	CreatedAt time.Time
	UpdatedAt time.Time
}

type InstitutionConfig

type InstitutionConfig struct {
	gorm.Model
	InstituionId int
	Key          string
	Value        string
	Category     string `json:"category,omitempty" xml:"category"`
	IsActive     bool   `default:"true" json:"isActive" xml:"isActive"`
}

type InstitutionMeta

type InstitutionMeta struct {
	gorm.Model
	InstituionId int
	Address      string
}

type InstitutionStaff

type InstitutionStaff struct {
	gorm.Model
	InstituionId int
	MemeberId    int
	Level        string // admin, master, user, superuser
}

type Payment

type Payment struct {
	gorm.Model
	PaymentBase

	Amount int
	Code   string
}

type PaymentBase

type PaymentBase struct {
	Id        int
	CreatedAt time.Time
	UpdatedAt time.Time
}

type PaymentChannel

type PaymentChannel struct {
	gorm.Model
	PaymentBase

	Channel string // Satna, Shaba, Paya, Swift
}

type PaymentCommission

type PaymentCommission struct {
	gorm.Model
	PaymentBase

	PaymentId  int // FK
	Commission int
}

type PaymentItem

type PaymentItem struct {
	gorm.Model
	PaymentBase

	PaymentId int // FK

	Order           int
	Amount          int
	PayeeAccountId  int // FK
	PayeerAccountId int // FK
	Description     string
}

type PaymentMeta

type PaymentMeta struct {
	gorm.Model
	PaymentBase

	PaymentId              int // FK
	RetryNumber            int
	OriginTracingCode      string
	DestinationTracingCode string

	PaymentChannel int // FK
}

type PaymentResult

type PaymentResult struct {
	gorm.Model
	PaymentBase

	PaymentId int // FK
	IsSuccess bool

	FailureCode        string
	FailureDescription string
	FailureMessage     string
}

type Permission

type Permission struct {
	gorm.Model
	PermissionBase

	Title string
	Value string
}

type PermissionBase

type PermissionBase struct {
	Id        int
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Person

type Person struct {
	gorm.Model
	PersonBase

	Name   string
	Family string
}

type PersonBase

type PersonBase struct {
	Id        int
	CreatedAt time.Time
	UpdatedAt time.Time
}

type PersonConnection

type PersonConnection struct {
	gorm.Model

	PersonId  int
	Title     string
	Value     string
	IsDefualt string
}

type PersonLegalInquiry

type PersonLegalInquiry struct {
	gorm.Model

	PersonId int
	Title    string
	Value    string
	Issuer   string
	Time     time.Time
}

type PersonMeta

type PersonMeta struct {
	gorm.Model

	PersonId     int
	NationalCode string
	Passport     string
	Protratit    string
}

type PersonStatus

type PersonStatus struct {
	gorm.Model

	PersonId      int
	CurrectStatus string
	LastStatus    string
	UpdatedTime   time.Time
}

type PersonVerificationCannel

type PersonVerificationCannel struct {
	gorm.Model

	PersonId int
	Title    string
	Value    string
}

type PersonVerificationToken

type PersonVerificationToken struct {
	gorm.Model

	PersonId int
	Token    string
	ExpireAt time.Time
	Channel  int

	Status string `default:"PENDING" xml:"status" json:"status" enum:"PENDING,VERIFIED"`
}

type RoleAbstract

type RoleAbstract struct {
	gorm.Model
	RoleBase

	Title          string
	Value          string
	PermissionList []Permission
}

type RoleBase

type RoleBase struct {
	Id        int
	CreatedAt time.Time
	UpdatedAt time.Time
}

type RoleCustomer

type RoleCustomer struct {
	gorm.Model
	RoleBase

	RoleType   string `default:"individual" json:"roleType" xml:"roleType" enum:"institutional,individual"`
	RoleId     int    // FK
	CustomerId int    // FK
}

Polymorphic role handling

type RoleCustomerActivityNotification

type RoleCustomerActivityNotification struct {
	gorm.Model
	RoleBase

	Channel  string `default:"sms" json:"channel" xml:"channel" enum:"sms,slack,bale"`
	Values   []string
	Template string

	CriteriaType string `default:"sql" json:"criteriaType" xml:"criteriaType" enum:"sql,go"`
	Criteria     string // user=='admin'
}

type RoleCustomerHistory

type RoleCustomerHistory struct {
	gorm.Model
	RoleBase

	PerformerId int // FK
	Current     string
	Changed     string
}

type RoleIndevisual

type RoleIndevisual struct {
	gorm.Model
	RoleBase

	RoleId         int // FK
	IsCustomed     bool
	Title          string
	Value          string
	PermissionList []Permission
}

type RoleInstitutional

type RoleInstitutional struct {
	gorm.Model
	RoleBase

	RoleId         int // FK
	InstitueId     int // FK
	IsCustomed     bool
	Title          string
	Value          string
	PermissionList []Permission
}

type Service

type Service struct {
	gorm.Model
	ServiceBase

	Title       string
	Description string
}

type ServiceBase

type ServiceBase struct {
	Id        int
	CreatedAt time.Time
	UpdatedAt time.Time
}

type ServiceStatus

type ServiceStatus struct {
	gorm.Model
	ServiceBase

	ServiceId int
	Status    string
}

type Workflow

type Workflow struct {
	gorm.Model
	WorkflowBase

	WorkflowAbstract   []WorkflowAbstract `json:"workflowAbstract" xml:"workflowAbstract" gorm:"foreignKey:WorkflowAbstractId"`
	WorkflowAbstractId int                `json:"workflowAbstractId" xml:"workflowAbstractId"`
	Payment            int                `json:"payment" xml:"payment" gorm:"foreignKey:PaymentId"`
	PaymentId          int                `json:"paymentId" xml:"paymentId" `

	Status WorkflowStatus
}

type WorkflowAbstract

type WorkflowAbstract struct {
	gorm.Model
	WorkflowBase

	Title       string `json:"title" gorm:"index,not null"`
	Description string `json:"description"`

	BPMNFile   string `json:"bpmnFile"`
	HasDiagram bool   `json:"hasDiagram" default:"false"`
}

type WorkflowBase

type WorkflowBase struct {
	Id        int       `json:"id" gorm:"primaryKey,unique,not null"`
	CreatedAt time.Time `json:"createdAt" gorm:"index,not null"`
	UpdatedAt time.Time `json:"updatedAt" gorm:"index"`
}

type WorkflowPermission

type WorkflowPermission struct {
	gorm.Model
	WorkflowPermissionBase

	Workflow     []Workflow               `json:"workflow" xml:"workflow" gorm:"foreignKey:workflowId"`
	WorkflowId   int                      `json:"workflowId" xml:"workflowId"`
	Customer     []Customer               `json:"customer" xml:"customer" gorm:"foreignKey:customerId"`
	CustomerId   int                      `json:"customerId" xml:"customerId"`
	Permission   []WorkflowPermissionType `json:"permission" xml:"permission" gorm:"foreignKey:permissionId"`
	PermissionId int                      `json:"permissionId" xml:"permissionId"`
}

type WorkflowPermissionBase

type WorkflowPermissionBase struct {
	Id        int       `json:"id" gorm:"primaryKey,unique,not null"`
	CreatedAt time.Time `json:"createdAt" gorm:"index,not null"`
	UpdatedAt time.Time `json:"updatedAt" gorm:"index"`
}

type WorkflowPermissionType

type WorkflowPermissionType struct {
	gorm.Model
	WorkflowPermissionBase

	Title string `json:"title" xml:"title" gorm:"index,not null"`
	Value string `json:"value" xml:"value" gorm:"index,not null"`
}

type WorkflowStatus

type WorkflowStatus struct {
	gorm.Model
	WorkflowBase

	Workflow   []Workflow `json:"workflow" xml:"workflow" gorm:"foreignKey:workflowId"`
	WorkflowId int        `json:"workflowId" xml:"workflowId"`
	Status     string     `default:"PENDING" json:"status" xml:"status" enum:"DONE,PENDING"`
}

type WorkflowStep

type WorkflowStep struct {
	gorm.Model
	WorkflowBase

	Title       string `json:"title" xml:"title" gorm:"index"`
	Value       string `json:"value" xml:"value"`
	Order       int    `json:"order" xml:"order"`
	Description string `json:"description" xml:"description"`
}

type WorkflowStepPermission

type WorkflowStepPermission struct {
	gorm.Model
	WorkflowPermissionBase

	WorkflowStep   []WorkflowStep               `json:"workflowStep" xml:"workflowStep" gorm:"foreignKey:workflowStepId"`
	WorkflowStepId int                          `json:"workflowStepId" xml:"workflowStepId"`
	Customer       []Customer                   `json:"customer" xml:"customer" gorm:"foreignKey:customerId"`
	CustomerId     int                          `json:"customerId" xml:"customerId"`
	Permission     []WorkflowStepPermissionType `json:"permission" xml:"permission" gorm:"foreignKey:permissionId"`
	PermissionId   int                          `json:"permissionId" xml:"permissionId"`
}

type WorkflowStepPermissionType

type WorkflowStepPermissionType struct {
	gorm.Model
	WorkflowPermissionBase

	Title string `json:"title" xml:"title" gorm:"index,not null"`
	Value string `json:"value" xml:"value" gorm:"index,not null"`
}

Jump to

Keyboard shortcuts

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