Fix
This commit is contained in:
parent
3a04990ec8
commit
91f51d129e
@ -135,10 +135,16 @@ func (p *AccountProcessorImpl) ListAccounts(ctx context.Context, req *models.Lis
|
|||||||
}
|
}
|
||||||
|
|
||||||
filterEntity := &entities.Account{
|
filterEntity := &entities.Account{
|
||||||
OrganizationID: organizationID,
|
OrganizationID: organizationID,
|
||||||
OutletID: outletID,
|
OutletID: outletID,
|
||||||
ChartOfAccountID: *req.ChartOfAccountID,
|
}
|
||||||
AccountType: entities.AccountType(*req.AccountType),
|
|
||||||
|
// 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)
|
entities, total, err := p.accountRepo.List(ctx, filterEntity)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user