закупы в бэк

This commit is contained in:
Artem Tsyrulnikov
2026-01-06 19:25:01 +03:00
parent cb6bdd5580
commit 87643735a1
10 changed files with 334 additions and 30 deletions

View File

@@ -221,10 +221,20 @@ func (s *SelectChannelsForPurchase) createPurchase(b *bot.Bot, jwt string) {
// Преобразуем каналы в формат API
var apiChannels []backend.CreatePurchaseChannelInput
for _, ch := range s.Channels {
var details *backend.PurchaseChannelDetails
if ch.PlannedCost != nil {
cost := backend.CostInfo{
Type: "fixed",
Value: *ch.PlannedCost,
}
details = &backend.PurchaseChannelDetails{
Cost: &cost,
}
}
apiChannels = append(apiChannels, backend.CreatePurchaseChannelInput{
Username: ch.Username,
PlannedCost: ch.PlannedCost,
Comment: ch.Comment,
Username: ch.Username,
Comment: ch.Comment,
Details: details,
})
}