Revert "voucher"

This reverts commit cfe690a40f.
This commit is contained in:
Aditya Siregar
2025-09-16 19:31:39 +07:00
parent 36c2352cb2
commit 12ee54390f
15 changed files with 2 additions and 1199 deletions
+1 -12
View File
@@ -94,8 +94,6 @@ func (a *App) Initialize(cfg *config.Config) error {
validators.accountValidator,
*services.orderIngredientTransactionService,
validators.orderIngredientTransactionValidator,
services.voucherService,
validators.voucherValidator,
)
return nil
@@ -169,7 +167,6 @@ type repositories struct {
chartOfAccountRepo *repository.ChartOfAccountRepositoryImpl
accountRepo *repository.AccountRepositoryImpl
orderIngredientTransactionRepo *repository.OrderIngredientTransactionRepositoryImpl
voucherRepo *repository.VoucherRepository
txManager *repository.TxManager
}
@@ -203,8 +200,7 @@ func (a *App) initRepositories() *repositories {
chartOfAccountRepo: repository.NewChartOfAccountRepositoryImpl(a.db),
accountRepo: repository.NewAccountRepositoryImpl(a.db),
orderIngredientTransactionRepo: repository.NewOrderIngredientTransactionRepositoryImpl(a.db).(*repository.OrderIngredientTransactionRepositoryImpl),
voucherRepo: repository.NewVoucherRepository(a.db),
txManager: repository.NewTxManager(a.db),
txManager: repository.NewTxManager(a.db),
}
}
@@ -233,7 +229,6 @@ type processors struct {
chartOfAccountProcessor *processor.ChartOfAccountProcessorImpl
accountProcessor *processor.AccountProcessorImpl
orderIngredientTransactionProcessor *processor.OrderIngredientTransactionProcessorImpl
voucherProcessor *processor.VoucherProcessor
fileClient processor.FileClient
inventoryMovementService service.InventoryMovementService
}
@@ -267,7 +262,6 @@ func (a *App) initProcessors(cfg *config.Config, repos *repositories) *processor
chartOfAccountProcessor: processor.NewChartOfAccountProcessorImpl(repos.chartOfAccountRepo, repos.chartOfAccountTypeRepo),
accountProcessor: processor.NewAccountProcessorImpl(repos.accountRepo, repos.chartOfAccountRepo),
orderIngredientTransactionProcessor: processor.NewOrderIngredientTransactionProcessorImpl(repos.orderIngredientTransactionRepo, repos.productRecipeRepo, repos.ingredientRepo, repos.unitRepo).(*processor.OrderIngredientTransactionProcessorImpl),
voucherProcessor: processor.NewVoucherProcessor(repos.voucherRepo),
fileClient: fileClient,
inventoryMovementService: inventoryMovementService,
}
@@ -300,7 +294,6 @@ type services struct {
chartOfAccountService service.ChartOfAccountService
accountService service.AccountService
orderIngredientTransactionService *service.OrderIngredientTransactionService
voucherService service.VoucherService
}
func (a *App) initServices(processors *processors, repos *repositories, cfg *config.Config) *services {
@@ -331,7 +324,6 @@ func (a *App) initServices(processors *processors, repos *repositories, cfg *con
chartOfAccountService := service.NewChartOfAccountService(processors.chartOfAccountProcessor)
accountService := service.NewAccountService(processors.accountProcessor)
orderIngredientTransactionService := service.NewOrderIngredientTransactionService(processors.orderIngredientTransactionProcessor, repos.txManager)
voucherService := service.NewVoucherService(processors.voucherProcessor)
// Update order service with order ingredient transaction service
orderService = service.NewOrderServiceImpl(processors.orderProcessor, repos.tableRepo, orderIngredientTransactionService, processors.orderIngredientTransactionProcessor, *repos.productRecipeRepo, repos.txManager)
@@ -363,7 +355,6 @@ func (a *App) initServices(processors *processors, repos *repositories, cfg *con
chartOfAccountService: chartOfAccountService,
accountService: accountService,
orderIngredientTransactionService: orderIngredientTransactionService,
voucherService: voucherService,
}
}
@@ -397,7 +388,6 @@ type validators struct {
chartOfAccountValidator *validator.ChartOfAccountValidatorImpl
accountValidator *validator.AccountValidatorImpl
orderIngredientTransactionValidator *validator.OrderIngredientTransactionValidatorImpl
voucherValidator validator.VoucherValidator
}
func (a *App) initValidators() *validators {
@@ -421,6 +411,5 @@ func (a *App) initValidators() *validators {
chartOfAccountValidator: validator.NewChartOfAccountValidator().(*validator.ChartOfAccountValidatorImpl),
accountValidator: validator.NewAccountValidator().(*validator.AccountValidatorImpl),
orderIngredientTransactionValidator: validator.NewOrderIngredientTransactionValidator().(*validator.OrderIngredientTransactionValidatorImpl),
voucherValidator: validator.NewVoucherValidator(),
}
}