context

package
v1.0.68 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 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 ERPContext

type ERPContext struct {
	DB      *gorm.DB         // Database connection
	Ctx     *context.Context // Context
	Request *http.Request    // HTTP request
	Mongo   *mongo.Client
	// Tambahkan service lainnya di sini
	InventoryService            interface{} // Contoh: InventoryService
	ManufactureService          interface{} // Contoh: ManufactureService
	AuthService                 interface{} // Contoh: AuthService
	AdminAuthService            interface{} // Contoh: AdminAuthService
	RBACService                 interface{} // Contoh: RBACService
	CompanyService              interface{} // Contoh: CompanyService
	ContactService              interface{} // Contoh: ContactService
	FinanceService              interface{} // Contoh: FinanceService
	CooperativeService          interface{} // Contoh: CooperativeService
	OrderService                interface{} // Contoh: OrderService
	LogisticService             interface{} // Contoh: LogisticService
	DistributionService         interface{} // Contoh: DistributionService
	CustomerRelationshipService interface{} // Contoh: CustomerRelationshipService
	FileService                 interface{} // Contoh: FileService
	MedicalService              interface{} // Contoh: MedicalService
	Firestore                   interface{} // Contoh: Firestore
	FCMService                  interface{} // Contoh: Firestore
	IndonesiaRegService         interface{} // Contoh: IndonesiaRegService
	UserService                 interface{} // Contoh: UserService
	ContentManagementService    interface{}
	TagService                  interface{}
	MessageService              interface{}
	ProjectManagementService    interface{}
	AppService                  interface{}
	CrowdFundingService         interface{}
	NotificationService         interface{}
	HRISService                 interface{}
	InternalService             interface{}
	TempData                    interface{}
	Config                      ctxConfig

	ThirdPartyServices map[string]interface{}
	// Add additional services here
	EmailSender  *thirdparty.SMTPSender
	WatzapClient *thirdparty.WatzapClient

	SkipMigration bool // SkipMigration adalah flag untuk menentukan apakah migrasi dijalankan atau tidak
}

ERPContext adalah struct yang menyimpan semua dependencies

func NewERPContext

func NewERPContext(db *gorm.DB, req *http.Request, ctx *context.Context, skipMigrate bool) *ERPContext

NewERPContext membuat instance baru dari ERPContext

func (*ERPContext) AddThirdPartyService

func (erp *ERPContext) AddThirdPartyService(name string, service interface{})

func (*ERPContext) AlterColumn

func (erp *ERPContext) AlterColumn(dst interface{}, field string) error

func (*ERPContext) Migrate

func (erp *ERPContext) Migrate(models ...interface{}) error

func (*ERPContext) SetConfig

func (erp *ERPContext) SetConfig(wkhtmltopdfPath, pdfFooter string)

Jump to

Keyboard shortcuts

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