Skip to content

Commit

Permalink
Update transaction report format, add sample report html/pdf file
Browse files Browse the repository at this point in the history
Signed-off-by: Masudur Rahman <masudjuly02@gmail.com>
  • Loading branch information
masudur-rahman committed Feb 27, 2025
1 parent 057dec3 commit b72474d
Show file tree
Hide file tree
Showing 5 changed files with 253 additions and 134 deletions.
6 changes: 5 additions & 1 deletion api/handlers/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ func generateReport(ctx telebot.Context, rop ReportCallbackOptions) (gqtypes.Rep
return gqtypes.Report{}, err
}

report := gqtypes.Report{Name: fmt.Sprintf("%v %v", user.FirstName, user.LastName)}
report := gqtypes.Report{
Name: fmt.Sprintf("%v %v", user.FirstName, user.LastName),
StartDate: startTime,
EndDate: now,
}
txnApis := make([]gqtypes.Transaction, 0, len(txns))
for _, txn := range txns {
txnApis = append(txnApis, convert.ToTransactionAPIFormat(txn))
Expand Down
7 changes: 4 additions & 3 deletions models/gqtypes/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ type SummaryGroups struct {
}

type Report struct {
Name string
Transactions []Transaction
Summary SummaryGroups
Name string
Transactions []Transaction
Summary SummaryGroups
StartDate, EndDate time.Time
}

func (s SummaryGroups) String() string {
Expand Down
Loading

0 comments on commit b72474d

Please sign in to comment.