create transaction from subscription

This commit is contained in:
Fran Jurmanović
2021-06-19 23:40:49 +02:00
parent fdc9187f06
commit 3d43716669
4 changed files with 39 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import (
type WalletService struct {
Db *pg.DB
Ss *SubscriptionService
}
func (as *WalletService) New(am *models.NewWalletBody) *models.Wallet {
@@ -89,6 +90,7 @@ func (as *WalletService) GetHeader(am *models.Auth, embed string, walletId strin
}
for _, sub := range *subscriptions {
as.Ss.SubToTrans(&sub)
startDate := sub.StartDate.Local()
stopDate := firstOfMonthAfterNext
if sub.HasEnd {