model

package
v1.1.22 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PromptDetail added in v1.1.19

type PromptDetail struct {
	PromptTitle          string        `json:"promptTitle"`
	PromptMessage        string        `json:"promptMessage"`
	ShowPromptWhenValues []interface{} `json:"showPromptWhenValues"` // If blank, shows prompt on every value change
}

PromptDetail contains the metadata regarding prompt for data change

type SettingsMetaData

type SettingsMetaData struct {
	Code            string       `json:"code"`
	DisplayName     string       `json:"displayName"`
	Description     string       `json:"description"`
	GroupName       string       `json:"groupName"`
	DisplaySequence int          `json:"displaySequence"`
	Type            string       `json:"type"`
	TypeParam       string       `json:"typeParam"`
	Default         string       `json:"default"`
	Required        bool         `json:"required"`
	Validation      string       `json:"validation"`
	MaxValue        float32      `json:"maxValue"`
	MinValue        float32      `json:"minValue"`
	Hidden          bool         `json:"hidden"`
	ModuleName      string       `json:"moduleName"`
	SettingsLevel   string       `json:"settingsLevel"`
	AccessLevel     string       `json:"accessLevel"`
	ReadOnly        bool         `json:"readOnly"`
	ShowPrompt      bool         `json:"showPrompt"`
	PromptDetail    PromptDetail `json:"promptDetail"`
}

SettingsMetaData contains the metadata regarding settings

func (*SettingsMetaData) ParseAndValidate

func (metadata *SettingsMetaData) ParseAndValidate(value interface{}) (interface{}, error)

ParseAndValidate checks if the supplied value matches the metadata

type TenantSettings

type TenantSettings struct {
	microappModel.Base
	Settings string `gorm:"column:settings;type:text;"`
}

Tenant supports different organisations from the same micro service.

func NewTenant

func NewTenant(context microappCtx.ExecutionContext, tenantID uuid.UUID, configuration map[string]interface{}, metadata []SettingsMetaData) (*TenantSettings, error)

NewTenant creates new instance of Tenant with specified parameters and returns it

func (*TenantSettings) GetSettings

func (tenant *TenantSettings) GetSettings() (map[string]interface{}, error)

GetSettings gets unmarshalled settings for tenant

func (*TenantSettings) GetSettingsMap

func (tenant *TenantSettings) GetSettingsMap() (map[string]string, error)

GetSettingsMap

func (*TenantSettings) GetTenantSettings

func (tenant *TenantSettings) GetTenantSettings(metadatas []SettingsMetaData, globalTenantSettings map[string]interface{}) error

GetTenantSettings gets the tenant settings with default

func (*TenantSettings) SetTenantSettings

func (tenant *TenantSettings) SetTenantSettings(metadatas []SettingsMetaData, values map[string]interface{}) error

SetTenantSettings updates the tenant settings

func (*TenantSettings) Update

func (tenant *TenantSettings) Update(configuration map[string]interface{}, metadatas []SettingsMetaData) error

Update tenant data

Jump to

Keyboard shortcuts

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