merch-api/internal/merch/dto.go

78 lines
1.6 KiB
Go
Raw Normal View History

2026-03-01 22:14:43 +03:00
package merch
2026-03-04 17:59:46 +03:00
import "time"
2026-03-04 17:02:11 +03:00
// Origins
2026-03-01 22:14:43 +03:00
type newOriginDTO struct {
Name string `json:"name"`
}
type originsDTO struct {
Origins []originItem `json:"origins"`
}
type originItem struct {
2026-03-04 17:02:11 +03:00
Id int64 `json:"id"`
2026-03-01 22:14:43 +03:00
Name string `json:"name"`
}
type deleteOriginDTO struct {
Name string `json:"name"`
}
2026-03-04 17:02:11 +03:00
// Merch
type newMerchDTO struct {
Name string `json:"name"`
Links []originLink `json:"links"`
}
type originLink struct {
2026-03-07 15:49:54 +03:00
Origin string `json:"origin"`
Link string `json:"origin_link"`
2026-03-04 17:02:11 +03:00
}
2026-03-04 17:59:46 +03:00
type merchDTO struct {
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
MerchUuid string `json:"merch_uuid"`
Name string `json:"name"`
}
2026-03-07 15:49:54 +03:00
type updateMerchDTO struct {
MerchUuid string `json:"merch_uuid"`
Name string `json:"name"`
}
type extraDataDTO struct {
MerchUuid string `json:"merch_uuid"`
Links []originLink `json:"links"`
}
2026-03-10 23:44:24 +03:00
// prices dtos
type PriceEntry struct {
CreatedAt int64 `json:"created_at"`
Value int `json:"value"`
}
type OriginWithPrices struct {
Origin string `json:"origin"`
Prices []PriceEntry
}
type PricesResponse struct {
Name string `json:"name"`
MerchUuid string `json:"merch_uuid"`
Origins []OriginWithPrices `json:"origins"`
}
2026-03-11 19:32:14 +03:00
type ZeroPrice struct {
Id int64 `json:"id,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
MerchUuid string `json:"merch_uuid"`
Name string `json:"name"`
Origin string `json:"origin"`
}
type DeleteZeroPrices struct {
Id int64 `json:"id"`
MerchUuid string `json:"merch_uuid"`
}