From 91f51d129edb11379ec53c1958332b46111bfaba Mon Sep 17 00:00:00 2001 From: Aditya Siregar Date: Fri, 12 Sep 2025 15:41:08 +0700 Subject: [PATCH] Fix --- internal/processor/account_processor.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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)