coremodel

package
v0.0.0-...-4518a5d Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Overview

Package coremodel core model data. mapping gorm for common tables 1. table sec_user 2. m_lookup_header 3. m_lookup_details

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationGroup

type ApplicationGroup struct {
	//ID id dari group, column: pk
	ID int32 `gorm:"column:pk;AUTO_INCREMENT;primary_key" json:"id"`
	//Code kode group, column: group_code
	Code string `gorm:"column:group_code" json:"code"`
	//Name nama group, column: group_name
	Name string `gorm:"column:group_name" json:"name"`
	//Remark catatan dari group, column: group_remark
	Remark string `gorm:"column:group_remark" json:"remark"`
	//UsageCounter berapa data yang sudah merefer ini , column: count_counter
	UsageCounter int32 `gorm:"column:count_counter" json:"usageCounter"`
}

ApplicationGroup table: sec_group

func (ApplicationGroup) TableName

func (u ApplicationGroup) TableName() string

TableName table name for struct ApplicationGroup

type ApplicationGroupToMenuAssignment

type ApplicationGroupToMenuAssignment struct {
	//ID primary key data, column: pk
	ID int64 `gorm:"column:pk;AUTO_INCREMENT;primary_key" json:"id"`
	//MenuID id dari menu, column: menu_id
	MenuID int64 `gorm:"column:menu_id" json:"menuId"`
	//GroupID id group, column: group_id
	GroupID int64 `gorm:"column:group_id" json:"groupId"`
	//AllowCreateFlag flag : ijinkan new data, column: is_allow_create
	AllowCreateFlag string `gorm:"column:is_allow_create" json:"allowCreateFlag"`
	//AllowEditFlag flag : ijinkan edit data, column: is_allow_edit
	AllowEditFlag string `gorm:"column:is_allow_edit" json:"allowEditFlag"`
	//AllowEraseFlag flag : ijinkan hapus data, column: is_allow_erase
	AllowEraseFlag string `gorm:"column:is_allow_erase" json:"allowEraseFlag"`
}

ApplicationGroupToMenuAssignment table: sec_menu_assignment

func (ApplicationGroupToMenuAssignment) TableName

TableName table name for struct GroupToMenuAssignment

type ApplicationMenu

type ApplicationMenu struct {
	//ID id dari menu, column: pk
	ID int64 `gorm:"column:pk;AUTO_INCREMENT;primary_key" json:"id"`
	//Code kode menu, column: menu_code
	Code string `gorm:"column:menu_code" json:"code"`
	//HavePanelFlag flag apakah memiliki panel atau tiidak, column: is_have_panel
	HavePanelFlag string `gorm:"column:is_have_panel" json:"havePanelFlag"`
	//MenuCSS css menu(icon dsb), column: menu_css
	MenuCSS string `gorm:"column:menu_css" json:"menuCss"`
	//ParentID id induk dari menu, column: parent_id
	ParentID int64 `gorm:"column:parent_id" json:"parentId"`
	//Label label dari menu, column: menu_label
	Label string `gorm:"column:menu_label" json:"label"`
	//MenuTreeCode tree code dari menu, column: menu_tree_code
	MenuTreeCode string `gorm:"column:menu_tree_code" json:"menuTreeCode"`
	//OrderNumber urutan data, column: order_no
	OrderNumber int32 `gorm:"column:order_no" json:"orderNumber"`
	//I18nKey key internalization, column: i18n_key
	I18nKey string `gorm:"column:i18n_key" json:"i18nKey"`
	//RoutePath path dari handler, column: route_path
	RoutePath string `gorm:"column:route_path" json:"routePath"`
	//AdditionalParameter ,, column: additional_param
	AdditionalParameter string `gorm:"column:additional_param" json:"additionalParameter"`
	//StatusCode status data, column: data_status
	StatusCode string `gorm:"column:data_status" json:"statusCode"`
	//TreeLevelPosition level menu. pada level berapa data berada, column: tree_level_position
	TreeLevelPosition int32 `gorm:"column:tree_level_position" json:"treeLevelPosition"`
}

ApplicationMenu table: sec_menu

func (ApplicationMenu) TableName

func (u ApplicationMenu) TableName() string

TableName table name for struct ApplicationMenu

type ApplicationUser

type ApplicationUser struct {
	//ID primary key, column: pk
	ID int64 `gorm:"column:pk;AUTO_INCREMENT;primary_key" json:"id"`
	//RealName nama lengkap, column: real_name
	RealName string `gorm:"column:real_name" json:"realName"`
	//Username username untuk login, column: user_name
	Username string `gorm:"column:user_name" json:"username"`
	//DataStatus status data (A vs D), column: data_status
	DataStatus string `gorm:"column:data_status" json:"dataStatus"`
	//AvatarURL url avatar dari user, column: avatar_url
	AvatarURL string `gorm:"column:avatar_url" json:"avatarUrl"`
	//Password password user(kalau pakai metode password standard), column: password
	Password string `gorm:"column:password" json:"-"`
	//DefaultBranchCode kode cabang default(kode unit kerja - di abaikan kalau PNS), column: default_branch_code
	DefaultBranchCode string `gorm:"column:default_branch_code" json:"defaultBranchCode"`
	//Email email dari user, column: email
	Email string `gorm:"column:email" json:"email"`
	//EmployeeNo reference ke data pegawai, column: emp_no
	EmployeeNo string `gorm:"column:emp_no" json:"employeeNo"`
	//ExpiredDate waktu expired dari user, column: expired_date
	ExpiredDate time.Time `gorm:"column:expired_date" json:"expiredDate"`
	//FailedLoginCount count berapa kali gagal login.counter. kalau melebihi max, maka di lock, column: failed_login_attemps
	FailedLoginCount int32 `gorm:"column:failed_login_attemps" json:"failedLoginCount"`
	//LocaleCode locale code, column: locale
	LocaleCode string `gorm:"column:locale" json:"localeCode"`
	//LockedFlag flag di lock atau tidak, column: is_locked
	LockedFlag string `gorm:"column:is_locked" json:"lockedFlag"`
	//Phone1 phone1, column: phone1
	Phone1 string `gorm:"column:phone1" json:"phone1"`
	//Phone2 phone secondary, column: phone2
	Phone2 string `gorm:"column:phone2" json:"phone2"`
	//Remark catatan, column: remark
	Remark string `gorm:"column:remark" json:"remark"`
	//Uuid UUID, untuk integrasi misal dengan firebase, column: uuid
	UUID string `gorm:"column:uuid" json:"uuid"`
}

ApplicationUser table: sec_user

func (ApplicationUser) TableName

func (u ApplicationUser) TableName() string

TableName table name for struct ApplicationUser

type ApplicationUserGroup

type ApplicationUserGroup struct {
	//ID for column pk .
	ID int32 `gorm:"column:pk;AUTO_INCREMENT;primary_key" json:"id"`
	//GroupID group_id
	GroupID int32 `gorm:"column:group_id" json:"groupId"`
	//UserID column user_id
	UserID int32 `gorm:"column:user_id" json:"userId"`
}

ApplicationUserGroup wrapper for table sec_group_assignment

func (*ApplicationUserGroup) TableName

func (p *ApplicationUserGroup) TableName(db *gorm.DB) string

TableName access to table name for sec_group_assignment

type ApplicationUserToGroupAssignment

type ApplicationUserToGroupAssignment struct {
	//ID id data(surrogate key), column: pk
	ID int64 `gorm:"column:pk;AUTO_INCREMENT;primary_key" json:"id"`
	//GroupID id dari group, column: group_id
	GroupID int64 `gorm:"column:group_id" json:"groupId"`
	//UserID id dari user, column: user_id
	UserID int64 `gorm:"column:user_id" json:"userId"`
	//User refer with column user_id
	User ApplicationUser `gorm:"foreignkey:UserID" json:"user"`
	//Group refer with column group_id
	Group ApplicationGroup `gorm:"foreignkey:GroupID" json:"group"`
	//Creator column: creator_name
	Creator string `gorm:"column:creator_name" json:"creator"`
	//CreatorIpAddress column: creator_ip_address
	CreatorIPAddress string `gorm:"column:creator_ip_address" json:"creatorIpAddress"`
}

ApplicationUserToGroupAssignment table: sec_group_assignment

func (ApplicationUserToGroupAssignment) TableName

TableName table name for struct UserToGroupAssignment

type CommonSequence

type CommonSequence struct {
	//ID nama sequence, column: sequence_name
	ID string `gorm:"column:sequence_name;primary_key" json:"id"`
	//LatestSequence sequence terakhir dari data, column: latest_seq
	LatestSequence int64 `gorm:"column:latest_seq" json:"latestSequence"`
	//Remark catatan untuk sequence, column: seq_remark
	Remark string `gorm:"column:seq_remark" json:"remark"`
}

CommonSequence table: ct_common_sequence

func (CommonSequence) TableName

func (u CommonSequence) TableName() string

TableName table name for struct CommonSequence

type EditDataToken

type EditDataToken struct {
	//Token token, column: id
	Token string `gorm:"column:id;primary_key" json:"token"`
	//UserName ID user owner data, column: user_name
	UserName string `gorm:"column:user_name" json:"userName"`
	//ActiveFlag flag data aktiv atau tidak, column: active_flag
	ActiveFlag string `gorm:"column:active_flag" json:"activeFlag"`
	//ObjectName object di edit(add edit delete), column: object_name
	ObjectName string `gorm:"column:object_name" json:"objectName"`
	//ObjectID ID object, as string, column: object_id_as_str
	ObjectID string `gorm:"column:object_id_as_str" json:"objectId"`
	//CreatedAt column : createdAt time when data was created
	CreatedAt *time.Time `gorm:"column:createdAt" json:"createdAt"`
	//UpdatedAt last update at column : updatedAt
	UpdatedAt *time.Time `gorm:"column:updatedAt" json:"updatedAt"`
}

EditDataToken table: ct_edit_data_token

func (*EditDataToken) BeforeUpdate

func (u *EditDataToken) BeforeUpdate() (err error)

BeforeUpdate hook pre create/ update

func (EditDataToken) TableName

func (u EditDataToken) TableName() string

TableName table name for struct EditDataToken

type LookupDetail

type LookupDetail struct {
	//ID column id
	ID int32 `gorm:"column:id;AUTO_INCREMENT;primary_key" json:"id"`
	//DetailCode column: detail_code kode detail
	DetailCode string `gorm:"column:detail_code;" json:"detailCode"`
	//LovID column: lov_id
	LovID string `gorm:"column:lov_id;" json:"lovId"`
	//Label label for lookup column: lov_label
	Label string `gorm:"column:lov_label;" json:"label"`
	//Value1 label for value 1. arbitary data 1
	Value1 string `gorm:"column:val_1;" json:"value11"`
	//Value2 label for value 2. arbitary data 2
	Value2 string `gorm:"column:val_2;" json:"value12"`
	//I18nKey key internalization for lookup
	I18nKey string `gorm:"column:i18n_key" json:"i18nKey"`
	//SequenceNo sort no for lookup
	SequenceNo int16 `gorm:"column:seq_no" json:"sequenceNo"`
}

LookupDetail Simple table lookup.for table : m_lookup_details

func (*LookupDetail) TableName

func (p *LookupDetail) TableName(db *gorm.DB) (name string)

TableName table name for m_lookup_details

type LookupHeader

type LookupHeader struct {
	//ID code/ id of lookup column : lov_id
	ID string `gorm:"column:lov_id;primary_key" json:"id" `
	//Reamark remark for lookup. for maintence purpose. column lov_remark
	Remark string `gorm:"column:lov_remark" json:"remark"`
	//FlagCacheable Y or N. flag if lookup is cacheable on client
	FlagCacheable string `gorm:"column:is_cacheable" json:"flagCachable"`
	//FlagUseCustomSQL Y and N flag. is lookup using custom sql or from lookup detail
	FlagUseCustomSQL string `gorm:"column:is_use_custom_sql" json:"flagUseCustomSql"`
	//Version version of lookup. to force client reload if cache is expired
	Version string `gorm:"column:lov_version" json:"version"`
	//SQLForData sql for check LOV version. lookup version based on query result
	SQLForData *string `gorm:"column:sql_data" json:"sqlForData"`
	//SQLForDataFiltered sql for data filtered(id is passed with prev data)
	SQLForDataFiltered string `gorm:"column:sql_data_filtered" json:"sqlForDataFiltered"`
	//SQLForVersion sql for version of lookup
	SQLForVersion string `gorm:"column:sql_version" json:"sqlForVersion"`
	//Details list of LookupDetail under this lookup header
	Details *[]LookupDetail `gorm:"-" json:"details"`
	//CodeActualDataType actual data type for code on lookup detail . posible value is : string , number. this value is use to generate in statement on sql
	CodeActualDataType string `gorm:"column:code_actual_data_type" json:"codeActualDataType"`
}

LookupHeader table m_lookup_header

func (*LookupHeader) AppendLookupDetail

func (p *LookupHeader) AppendLookupDetail(detail LookupDetail)

AppendLookupDetail append lookup detail to header

func (*LookupHeader) BeforeUpdate

func (p *LookupHeader) BeforeUpdate() (err error)

BeforeUpdate hook pre create/ update

func (*LookupHeader) TableName

func (p *LookupHeader) TableName(db *gorm.DB) (name string)

TableName table name for m_lookup_header

Jump to

Keyboard shortcuts

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