merch-api/internal/merch/dto.go

96 lines
2 KiB
Go

package merch
import "time"
// Origins
type newOriginDTO struct {
Name string `json:"name"`
}
type originsDTO struct {
Origins []originItem `json:"origins"`
}
type originItem struct {
Id int64 `json:"id"`
Name string `json:"name"`
}
type deleteOriginDTO struct {
Name string `json:"name"`
}
// Merch
type newMerchDTO struct {
Name string `json:"name"`
Links []originLink `json:"links"`
}
type originLink struct {
Origin string `json:"origin"`
Link string `json:"origin_link"`
}
type merchDTO struct {
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
MerchUuid string `json:"merch_uuid"`
Name string `json:"name"`
}
type updateMerchDTO struct {
MerchUuid string `json:"merch_uuid"`
Name string `json:"name"`
}
type extraDataDTO struct {
MerchUuid string `json:"merch_uuid"`
Links []originLink `json:"links"`
}
// 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"`
}
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"`
}
// Labels
type LabelDTO struct {
Name string `json:"name"`
Color string `json:"color,omitempty"`
BgColor string `json:"bg_color,omitempty"`
}
type LabelsList struct {
LabelUuid string `json:"label_uuid"`
Name string `json:"name"`
Color string `json:"color,omitempty"`
BgColor string `json:"bg_color,omitempty"`
}
type LabelLink struct {
MerchUuid string `json:"merch_uuid"`
LabelUuid string `json:"label_uuid"`
}