FEAT[BE] ;: inisiate customer payment report route and related DTOs

This commit is contained in:
aguhh18
2026-01-12 20:00:49 +07:00
parent 80b2cafd2f
commit f0b4fe916c
5 changed files with 95 additions and 4 deletions
@@ -0,0 +1,63 @@
package dto
import (
"time"
)
// CustomerPaymentReportCustomer represents customer information in the report
type CustomerPaymentReportCustomer struct {
ID uint `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
AccountNumber string `json:"account_number"`
Balance float64 `json:"balance"`
Address string `json:"address"`
}
// CustomerPaymentReportRow represents each transaction row
type CustomerPaymentReportRow struct {
ID uint `json:"id"`
DoDate time.Time `json:"do_date"`
RealizationDate time.Time `json:"realization_date"`
AgingDay int `json:"aging_day"`
Reference string `json:"reference"`
VehiclePlate []string `json:"vehicle_plate"`
Qty float64 `json:"qty"`
Weight float64 `json:"weight"`
AverageWeight float64 `json:"average_weight"`
Price float64 `json:"price"`
CreditNote float64 `json:"credit_note"`
FinalPrice float64 `json:"final_price"`
PPN float64 `json:"ppn"`
Total float64 `json:"total"`
Payment float64 `json:"payment"`
AccountsReceivable float64 `json:"accounts_receivable"`
Notes string `json:"notes"`
PickupInfo string `json:"pickup_info"`
SalesMarketing string `json:"sales_marketing"`
}
// CustomerPaymentReportSummary represents summary calculations per customer
type CustomerPaymentReportSummary struct {
TotalQty float64 `json:"total_qty"`
TotalWeight float64 `json:"total_weight"`
TotalInitialAmount float64 `json:"total_initial_amount"`
TotalCreditNote float64 `json:"total_credit_note"`
TotalFinalAmount float64 `json:"total_final_amount"`
TotalPPN float64 `json:"total_ppn"`
TotalGrandAmount float64 `json:"total_grand_amount"`
TotalPayment float64 `json:"total_payment"`
TotalAccountsReceivable float64 `json:"total_accounts_receivable"`
}
// CustomerPaymentReportItem represents data grouped by customer
type CustomerPaymentReportItem struct {
Customer CustomerPaymentReportCustomer `json:"customer"`
Rows []CustomerPaymentReportRow `json:"rows"`
Summary CustomerPaymentReportSummary `json:"summary"`
}
// CustomerPaymentReportResponse represents the complete response
type CustomerPaymentReportResponse struct {
Data []CustomerPaymentReportItem `json:"data"`
}