Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CooperativeService ¶
type CooperativeService struct {
CompanyService *company.CompanyService
CooperativeSettingService *cooperative_setting.CooperativeSettingService
CooperativeMemberService *cooperative_member.CooperativeMemberService
LoanApplicationService *loan_application.LoanApplicationService
SavingService *saving.SavingService
NetSurplusService *net_surplus.NetSurplusService
FinanceService *finance.FinanceService
// contains filtered or unexported fields
}
func NewCooperativeService ¶
func NewCooperativeService(ctx *context.ERPContext, companySrv *company.CompanyService, financeService *finance.FinanceService) *CooperativeService
NewCooperativeService creates a new instance of CooperativeService.
The service provides methods for managing the cooperative feature of the application. It requires a pointer to a GORM database instance, a pointer to an ERPContext, a pointer to a CompanyService, and a pointer to a FinanceService.
The service instance is then used to initialize other services, such as CooperativeSettingService, CooperativeMemberService, LoanApplicationService, SavingService, and NetSurplusService.
func (*CooperativeService) CooperationAccountsTemplate ¶
func (c *CooperativeService) CooperationAccountsTemplate(userID, companyID *string) []models.AccountModel
func (*CooperativeService) IslamicCooperationAccountsTemplate ¶
func (c *CooperativeService) IslamicCooperationAccountsTemplate(userID, companyID *string) []models.AccountModel
func (*CooperativeService) Migrate ¶
func (s *CooperativeService) Migrate() error
Migrate migrates the database schema for the CooperativeService.
If the SkipMigration flag is set to true in the context, this method will not perform any migration and will return nil. Otherwise, it will attempt to auto-migrate the database to include the schemas for CooperativeSettingModel, CooperativeMemberModel, LoanApplicationModel, SavingModel, InstallmentPayment, NetSurplusModel, and MemberInvitationModel. If the migration process encounters an error, it will return that error. Otherwise, it will return nil upon successful migration.