feat[BE]: add address field to CustomerRelationDTO and refactor payment report functions for improved clarity and structure

This commit is contained in:
aguhh18
2026-01-15 10:41:44 +07:00
parent 3a89e18b16
commit c316a6d7a9
3 changed files with 30 additions and 24 deletions
@@ -19,7 +19,6 @@ import (
expenseRepo "gitlab.com/mbugroup/lti-api.git/internal/modules/expenses/repositories"
marketingRepo "gitlab.com/mbugroup/lti-api.git/internal/modules/marketing/repositories"
areaDTO "gitlab.com/mbugroup/lti-api.git/internal/modules/master/areas/dto"
customerDTO "gitlab.com/mbugroup/lti-api.git/internal/modules/master/customers/dto"
customerRepo "gitlab.com/mbugroup/lti-api.git/internal/modules/master/customers/repositories"
supplierDTO "gitlab.com/mbugroup/lti-api.git/internal/modules/master/suppliers/dto"
warehouseDTO "gitlab.com/mbugroup/lti-api.git/internal/modules/master/warehouses/dto"
@@ -473,14 +472,9 @@ func (s *repportService) processCustomerPayment(ctx context.Context, customerID
rows = filteredRows
}
summary := dto.CalculateCustomerPaymentSummary(rows, initialBalance)
summary := dto.ToCustomerPaymentReportSummary(rows, initialBalance)
return dto.CustomerPaymentReportItem{
Customer: customerDTO.ToCustomerRelationDTO(*customer),
InitialBalance: initialBalance,
Rows: rows,
Summary: summary,
}, nil
return dto.ToCustomerPaymentReportItem(*customer, initialBalance, rows, summary), nil
}
func (s *repportService) determineSalesStatusAndPaymentDate(transactions []repportRepo.CustomerPaymentTransaction, currentIndex int, previousBalance, currentBalance float64) (string, *time.Time) {