закупы в бэк

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

@@ -632,28 +632,52 @@ type Purchase struct {
Status string `json:"status"`
CreativeID string `json:"creative_id"`
Channels []PurchaseChannelOut `json:"channels"`
Details *PurchaseDetails `json:"details,omitempty"`
}
type PurchaseChannelOut struct {
ID string `json:"id"`
Status string `json:"status"`
PlannedCost *float64 `json:"planned_cost"`
Comment *string `json:"comment"`
InviteLink string `json:"invite_link"`
InviteLinkType string `json:"invite_link_type"`
Channel Channel `json:"channel"`
ID string `json:"id"`
Status string `json:"status"`
Comment *string `json:"comment"`
InviteLink string `json:"invite_link"`
InviteLinkType string `json:"invite_link_type"`
Channel Channel `json:"channel"`
Details *PurchaseChannelDetails `json:"details,omitempty"`
}
type CostInfo struct {
Type string `json:"type"`
Value float64 `json:"value"`
}
type PurchaseDetails struct {
PlacementAt *string `json:"placement_at,omitempty"`
PaymentAt *string `json:"payment_at,omitempty"`
Cost *CostInfo `json:"cost,omitempty"`
CostBeforeBargain *float64 `json:"cost_before_bargain,omitempty"`
PurchaseType *string `json:"purchase_type,omitempty"`
Format *string `json:"format,omitempty"`
Comment *string `json:"comment,omitempty"`
}
type PurchaseChannelDetails struct {
PlacementAt *string `json:"placement_at,omitempty"`
Cost *CostInfo `json:"cost,omitempty"`
CostBeforeBargain *float64 `json:"cost_before_bargain,omitempty"`
Format *string `json:"format,omitempty"`
}
type CreatePurchaseChannelInput struct {
Username string `json:"username"`
Status *string `json:"status,omitempty"`
PlannedCost *float64 `json:"planned_cost,omitempty"`
Comment *string `json:"comment,omitempty"`
Username string `json:"username"`
Status *string `json:"status,omitempty"`
Comment *string `json:"comment,omitempty"`
Details *PurchaseChannelDetails `json:"details,omitempty"`
}
type CreatePurchaseInput struct {
CreativeID string `json:"creative_id"`
Channels []CreatePurchaseChannelInput `json:"channels"`
Details *PurchaseDetails `json:"details,omitempty"`
}
func (c *Client) CreatePurchase(