All checks were successful
Deploy to K8s / deploy (push) Successful in 10s
- Add web/api/handler.go: Handler struct wiring Sources+Config into ServeAdults, ServeJuniors, ServePayments, ServeVersion - Add web/api/build_common.go: getMonthLabels, groupRawPaymentsByPerson, settledBalance, domain-to-wire converters, ensureSlice generic helper - Add web/api/build_adults.go: buildAdultsResponse + buildAdultMemberRow mirroring scripts/views.py:build_adults_view_model - Add web/api/build_juniors.go: buildJuniorsResponse + buildJuniorMemberRow mirroring scripts/views.py:build_juniors_view_model, including "?" sentinel and :NJ,MA breakdown - Add web/api/build_payments.go: buildPaymentsResponse with Unmatched/Unknown bucket - Extend reconcile.FeeData/MonthData with IsUnknown, JuniorAttendance, AdultAttendance - Extend reconcile.Transaction with ManualFix, VS, BankID, SyncID for raw_payments wire field - Export membership.AdultMergedMonths and JuniorMergedMonths - Update sources.go to propagate new FeeData fields and parse extra transaction columns - Wire sources+cfg into web.Run; register /api/* routes via Go 1.22 method+path patterns - Fix pre-existing gofumpt formatting in fio_test.go and fio_table.go Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
705 B
Go
32 lines
705 B
Go
package banksync
|
|
|
|
import (
|
|
"fmt"
|
|
"fuj-management/go/internal/io/fio"
|
|
"io"
|
|
"text/tabwriter"
|
|
)
|
|
|
|
func printFioTable(w io.Writer, txns []fio.Transaction, syncIDs []string, existing map[string]bool) {
|
|
tw := tabwriter.NewWriter(w, 0, 0, 2, ' ', 0)
|
|
fmt.Fprintln(tw, "DATE\tAMOUNT\tSENDER\tVS\tMESSAGE\tBANKID\tSTATUS")
|
|
for i, tx := range txns {
|
|
status := "NEW"
|
|
if existing[syncIDs[i]] {
|
|
status = "DUP"
|
|
}
|
|
fmt.Fprintf(tw, "%s\t%.2f\t%s\t%s\t%s\t%s\t%s\n",
|
|
tx.Date, tx.Amount, tx.Sender, tx.VS,
|
|
truncRunes(tx.Message, 40), tx.BankID, status)
|
|
}
|
|
_ = tw.Flush()
|
|
}
|
|
|
|
func truncRunes(s string, n int) string {
|
|
rs := []rune(s)
|
|
if len(rs) <= n {
|
|
return s
|
|
}
|
|
return string(rs[:n-1]) + "…"
|
|
}
|