remove some daata
Some checks failed
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled

This commit is contained in:
2026-09-30 14:10:10 +05:00
parent a44c10d445
commit 69d1495b1f
3 changed files with 21 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

View File

@@ -82,8 +82,9 @@ func (r *repository) List(ctx context.Context, filter loanpaidletter.ListFilter)
limitPlaceholder := len(args) + 1
offsetPlaceholder := len(args) + 2
query := fmt.Sprintf(
`SELECT %s%s%s ORDER BY l.id DESC LIMIT $%d OFFSET $%d`,
letterSelectColumns, letterFromClause, whereClause, limitPlaceholder, offsetPlaceholder,
`SELECT l.id, l.unique_id, l.customer_name, l.customer_surname, l.phone, l.status
FROM loan_paid_off_letters l%s ORDER BY l.id DESC LIMIT $%d OFFSET $%d`,
whereClause, limitPlaceholder, offsetPlaceholder,
)
rows, err := r.client.Query(ctx, query, append(args, filter.Limit, offset)...)
@@ -92,10 +93,12 @@ func (r *repository) List(ctx context.Context, filter loanpaidletter.ListFilter)
}
defer rows.Close()
var items []loanpaidletter.LoanPaidLetterDTO
items := []loanpaidletter.LoanPaidLetterListItemDTO{}
for rows.Next() {
item, err := scanLoanPaidLetter(rows)
if err != nil {
var item loanpaidletter.LoanPaidLetterListItemDTO
if err := rows.Scan(
&item.Id, &item.UniqueId, &item.CustomerName, &item.CustomerSurname, &item.Phone, &item.Status,
); err != nil {
return loanpaidletter.ListLoanPaidLetterDTO{}, err
}
items = append(items, item)

View File

@@ -89,9 +89,20 @@ type ListFilter struct {
Limit int
}
// LoanPaidLetterListItemDTO is the list row; branch, passport and loan
// details come from GET /loan-paid-off-letters/:id.
type LoanPaidLetterListItemDTO struct {
Id int64 `json:"id"`
UniqueId *string `json:"uniqueId"`
CustomerName string `json:"customerName"`
CustomerSurname string `json:"customerSurname"`
Phone string `json:"phone"`
Status *string `json:"status"`
}
type ListLoanPaidLetterDTO struct {
Count int64 `json:"count"`
LoanPaidLetters []LoanPaidLetterDTO `json:"loanPaidLetters"`
Count int64 `json:"count"`
LoanPaidLetters []LoanPaidLetterListItemDTO `json:"loanPaidLetters"`
}
// BranchByProvinceDTO is a compact branch row for province-scoped pickers.