Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
cfbdc99
update payments to fullfill discount and be restricted to transfer re…
rawdaGastan Sep 3, 2025
1fc7d11
Merge branch 'master' of github.com:codescalers/kubecloud into master…
rawdaGastan Sep 8, 2025
6847277
depend on usd in invoices and fix tests
rawdaGastan Sep 8, 2025
be8fe7a
save last date the user got billed
rawdaGastan Sep 17, 2025
3101c50
handle margin in tft zero balance
rawdaGastan Sep 17, 2025
834f968
handle shared nodes
rawdaGastan Sep 17, 2025
90dc3e6
Merge branch 'master' of github.com:codescalers/kubecloud into master…
rawdaGastan Sep 17, 2025
a4a08bb
Merge branch 'master' of github.com:codescalers/kubecloud into master…
rawdaGastan Sep 18, 2025
eb4eb7f
Merge branch 'master' of github.com:codescalers/kubecloud into master…
rawdaGastan Sep 22, 2025
5972189
check history of pending amount in transfer records
rawdaGastan Sep 22, 2025
a7c87eb
skip funding users if they have already deployments
rawdaGastan Sep 22, 2025
da5da2a
use logger
rawdaGastan Sep 22, 2025
fbfc8af
- only send min TFTs amount in charging usds - vouchers redeeming - a…
rawdaGastan Sep 24, 2025
3b25901
- use discount from pricing policy
rawdaGastan Sep 28, 2025
aca1c5a
Merge branch 'master' of github.com:codescalers/kubecloud into master…
rawdaGastan Sep 30, 2025
9267a3a
handle all contracts through invoices, settleing money and calculatin…
rawdaGastan Oct 5, 2025
83924fa
Merge branch 'master' of github.com:codescalers/kubecloud into master…
rawdaGastan Oct 15, 2025
891862e
retry calculate overdue - add cancelled ctx case
rawdaGastan Oct 15, 2025
9511c99
add 3 days margin for none pkg - check user usd balance before applyi…
rawdaGastan Oct 16, 2025
0780334
Merge pull request #454 from codescalers/master_payments_upgrade
rawdaGastan Oct 16, 2025
e3604e1
swagger updates
rawdaGastan Oct 19, 2025
7e16f95
update migration file
rawdaGastan Oct 19, 2025
8c4d2a5
Merge pull request #681 from codescalers/development_update_swagger
rawdaGastan Oct 19, 2025
4c75e99
return user balances in USD
rawdaGastan Oct 20, 2025
8dbfcad
Merge pull request #683 from codescalers/development_return_balance_i…
rawdaGastan Oct 20, 2025
971dfad
Merge branch 'master' of github.com:codescalers/kubecloud into develo…
rawdaGastan Nov 20, 2025
1bfdb39
Merge branch 'master' of github.com:codescalers/kubecloud into develo…
rawdaGastan Nov 20, 2025
66fe79a
Merge branch 'master' of github.com:codescalers/kubecloud into develo…
rawdaGastan Dec 21, 2025
a2507a8
Merge branch 'master' of github.com:codescalers/kubecloud into develo…
rawdaGastan Dec 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions backend/cmd/fix_rentables/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"flag"
"fmt"
"kubecloud/internal/core/models"
corepersistence "kubecloud/internal/core/persistence"
"kubecloud/internal/infrastructure/persistence"
"strings"

Expand Down Expand Up @@ -52,8 +53,9 @@ func main() {
defer substrateClient.Close()

// Get all user_nodes records
var allRecords []models.UserNodes
if err := db.GetDB().Order("created_at DESC, id DESC").Find(&allRecords).Error; err != nil {
contractsRepo := corepersistence.NewGormUserContractDataRepository(db)
allRecords, err := contractsRepo.ListAllReservedNodes()
if err != nil {
log.Error().Err(err).Msg("Failed to get user_nodes records")
return
}
Expand Down
14 changes: 12 additions & 2 deletions backend/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,28 @@ func addFlags() error {
}

// === Monitor Balance Interval In Hours ===
if err := bindIntFlag(rootCmd, "monitor_balance_interval_in_minutes", 1, "Number of minutes to monitor balance"); err != nil {
return fmt.Errorf("failed to bind monitor_balance_interval_in_minutes flag: %w", err)
if err := bindIntFlag(rootCmd, "settle_transfer_records_interval_in_minutes", 1, "Number of minutes to monitor balance"); err != nil {
return fmt.Errorf("failed to bind settle_transfer_records_interval_in_minutes flag: %w", err)
}

if err := bindIntFlag(rootCmd, "notify_admins_for_pending_records_in_hours", 1, "Number of hours to notify admins about pending records"); err != nil {
return fmt.Errorf("failed to bind notify_admins_for_pending_records_in_hours flag: %w", err)
}

// === Applied Discount ===
if err := bindStringFlag(rootCmd, "applied_discount", "", "Applied discount to fund users"); err != nil {
return fmt.Errorf("failed to bind applied_discount flag: %w", err)
}

if err := bindIntFlag(rootCmd, "minimum_tft_amount_in_wallet", 10, "Minimum TFT amount in wallet"); err != nil {
return fmt.Errorf("failed to bind minimum_tft_amount_in_wallet flag: %w", err)
}

// === Users Balance Check Interval In Hours ===
if err := bindIntFlag(rootCmd, "users_balance_check_interval_in_hours", 6, "Number of hours to check users balance"); err != nil {
return fmt.Errorf("failed to bind users_balance_check_interval_in_hours flag: %w", err)
}

if err := bindIntFlag(rootCmd, "check_user_debt_interval_in_hours", 48, "Number of upcoming hours to check user debt"); err != nil {
return fmt.Errorf("failed to bind check_user_debt_interval_in_hours flag: %w", err)
}
Expand Down
4 changes: 3 additions & 1 deletion backend/config-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"debug": false,
"disable_sentry": true,
"dev_mode": false,
"monitor_balance_interval_in_minutes": 120,
"notify_admins_for_pending_records_in_hours": 24,
"cluster_health_check_interval_in_hours": 1,
"node_health_check" : {
Expand All @@ -71,6 +70,9 @@
"host": ""
}
},
"settle_transfer_records_interval_in_minutes": 5,
"applied_discount": "gold",
"minimum_tft_amount_in_wallet": 10,
"telemetry": {
"otlp_endpoint": "jaeger:4317"
}
Expand Down
Loading
Loading