diff --git a/internal/processor/account_processor.go b/internal/processor/account_processor.go index 6f991b5..80cfef3 100644 --- a/internal/processor/account_processor.go +++ b/internal/processor/account_processor.go @@ -135,10 +135,16 @@ func (p *AccountProcessorImpl) ListAccounts(ctx context.Context, req *models.Lis } filterEntity := &entities.Account{ - OrganizationID: organizationID, - OutletID: outletID, - ChartOfAccountID: *req.ChartOfAccountID, - AccountType: entities.AccountType(*req.AccountType), + OrganizationID: organizationID, + OutletID: outletID, + } + + // Apply optional filters + if req.ChartOfAccountID != nil { + filterEntity.ChartOfAccountID = *req.ChartOfAccountID + } + if req.AccountType != nil { + filterEntity.AccountType = entities.AccountType(*req.AccountType) } entities, total, err := p.accountRepo.List(ctx, filterEntity)