Documentation ¶
Index ¶
- Constants
- func InitHTTPHandler(router *mux.Router, adminSession *middleware.AdminSession, ...)
- type Artist
- type ArtistRepository
- type CreateEventRequest
- type CreateEventResponse
- type CreateLocationRequest
- type CreateShowRequest
- type CreateTicketAllocation
- type Event
- type EventRepository
- type EventUseCase
- type EventUseCaseProperty
- type HTTPHandler
- type Location
- type LocationRepository
- type LocationResponse
- type OrderRuleAggregation
- type OrderRuleDay
- type OrderRuleMaximumTicket
- type OrderRuleRangeDate
- type Promotor
- type PromotorRepository
- type PromotorResponse
- type Show
- type ShowRepository
- type ShowResponse
Constants ¶
View Source
const ( VenueOnline string = "ONLINE" ShowTypeLive string = "LIVE" ShowTypeHologramLive string = "HOLOGRAM_LIVE" ShowTypeOnline string = "ONLINE" TicketTierOnline string = "ONLINE" TicketTierWood string = "WOOD" TicketTierBronze string = "BRONZE" TicketTierSilver string = "SILVER" TicketTierGold string = "GOLD" TypeOrderRuleRangeDate string = "ORDER_RULE_RANGE_DATE" )
Variables ¶
This section is empty.
Functions ¶
func InitHTTPHandler ¶
func InitHTTPHandler(router *mux.Router, adminSession *middleware.AdminSession, validate *validator.Validate, eventUsecase EventUseCase)
Types ¶
type ArtistRepository ¶
type ArtistRepository interface { FindManyByEventID(ctx context.Context, eventID string, tx *sql.Tx) ([]Artist, error) Save(ctx context.Context, a Artist, tx *sql.Tx) error }
func NewArtistRepository ¶
func NewArtistRepository(logger *logrus.Logger, db *sql.DB) ArtistRepository
type CreateEventRequest ¶
type CreateEventRequest struct { Name string `json:"name" validate:"required"` Description string `json:"description" validate:"required"` Artists []string `json:"artists" validate:"required,dive,required"` Promotors []struct { Name string `json:"name" validate:"required"` Email string `json:"email" validate:"email"` Phone string `json:"phone" validate:"required"` } `json:"promotors" validate:"required,dive"` OnlineTicketPrice float64 `json:"online_ticket_price" validate:"required"` TotalOnlineTicketAllocation int64 `json:"total_online_ticket_allocation" validate:"required"` Shows []CreateShowRequest `json:"shows" validate:"required,dive,required"` ShowTime string `json:"show_time" validate:"datetime=2006-01-02 15:04:05"` OrderRuleDay []int64 `json:"order_rule_day" validate:"omitempty,dive,min=0,max=6"` OrderRuleRangeDate struct { StartDate string `json:"start_date" validate:"datetime=2006-01-02 15:04:05"` EndDate string `json:"end_date" validate:"datetime=2006-01-02 15:04:05"` } `json:"order_rule_range_date" validate:"required"` OrderRuleMaximumTicket int64 `json:"order_rule_maximum_ticket" validate:"-"` }
func (CreateEventRequest) ToEntityEvent ¶
type CreateEventResponse ¶
type CreateEventResponse struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Status string `json:"status"` Promotors []PromotorResponse Artists []string `json:"artists"` Shows []ShowResponse CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func (*CreateEventResponse) PopulateFromEntity ¶
func (r *CreateEventResponse) PopulateFromEntity(e Event)
type CreateLocationRequest ¶
type CreateLocationRequest struct { Country string `json:"country" validate:"required"` City string `json:"city" validate:"required"` FormattedAddress string `json:"formatted_address" validate:"formatted_address"` Latitude float64 `json:"latitude" validate:"required"` Longitude float64 `json:"longitude" validate:"required"` }
type CreateShowRequest ¶
type CreateShowRequest struct { Venue string `json:"venue" validate:"required"` Type string `json:"type" validate:"oneof=LIVE HOLOGRAM_LIVE"` Online bool `json:"online" validate:"-"` Location *CreateLocationRequest `json:"location" validate:"-"` TotalTicketAllocation int64 `json:"total_ticket_allocation"` TicketAllocation []CreateTicketAllocation `json:"ticket_allocation" validate:"required,dive"` }
type CreateTicketAllocation ¶
type EventRepository ¶
type EventRepository interface { BeginTx(ctx context.Context) (*sql.Tx, error) CommitTx(ctx context.Context, tx *sql.Tx) error Rollback(ctx context.Context, tx *sql.Tx) error Save(ctx context.Context, e Event, tx *sql.Tx) error FindByID(ctx context.Context, ID string, tx *sql.Tx) (Event, error) Update(ctx context.Context, ID string, update Event, tx *sql.DB) error }
func NewEventRepository ¶
func NewEventRepository(logger *logrus.Logger, db *sql.DB) EventRepository
type EventUseCase ¶
type EventUseCase interface {
CreateEvent(ctx context.Context, req CreateEventRequest) (interface{}, error)
}
func NewEventUseCase ¶
func NewEventUseCase(props EventUseCaseProperty) EventUseCase
type EventUseCaseProperty ¶
type EventUseCaseProperty struct { Logger *logrus.Logger Location *time.Location Timeout time.Duration EventRepository EventRepository ArtistRepository ArtistRepository PromotorRepository PromotorRepository ShowRepository ShowRepository LocationRepository LocationRepository OrderRuleDayRepository order.OrderRuleDayRepository OrderRuleRangeDateRepository order.OrderRuleRangeDateRepository TicketStockRepository ticket.TicketStockRepository }
type HTTPHandler ¶
type HTTPHandler struct { SessionMiddleware *middleware.AdminSession Validate *validator.Validate EventUseCase EventUseCase }
func (HTTPHandler) CreateEvent ¶
func (handler HTTPHandler) CreateEvent(w http.ResponseWriter, r *http.Request)
type LocationRepository ¶
type LocationRepository interface { FindByShowID(ctx context.Context, showID string, tx *sql.Tx) (Location, error) Save(ctx context.Context, l Location, tx *sql.Tx) error }
func NewLocationRepository ¶
func NewLocationRepository(logger *logrus.Logger, db *sql.DB) LocationRepository
type LocationResponse ¶
type OrderRuleAggregation ¶
type OrderRuleAggregation struct { OrderRuleRangeDate order.OrderRuleRangeDate OrderRuleDay []order.OrderRuleDay }
type OrderRuleDay ¶
type OrderRuleMaximumTicket ¶
type OrderRuleRangeDate ¶
type PromotorRepository ¶
type PromotorRepository interface { FindManyByEventID(ctx context.Context, eventID string, tx *sql.Tx) ([]Promotor, error) Save(ctx context.Context, p Promotor, tx *sql.Tx) error }
func NewPromotorRepository ¶
func NewPromotorRepository(logger *logrus.Logger, db *sql.DB) PromotorRepository
type PromotorResponse ¶
type ShowRepository ¶
type ShowRepository interface { Save(ctx context.Context, s Show, tx *sql.Tx) error FindByID(ctx context.Context, ID string, tx *sql.Tx) (Show, error) FindManyByEventID(ctx context.Context, eventID string, tx *sql.Tx) ([]Show, error) Update(ctx context.Context, ID string, s Show, tx *sql.Tx) error }
func NewShowRepository ¶
func NewShowRepository(logger *logrus.Logger, db *sql.DB) ShowRepository
type ShowResponse ¶
Click to show internal directories.
Click to hide internal directories.