service

package
v0.0.0-...-32a9906 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookingService

type BookingService struct {
	// contains filtered or unexported fields
}

func (*BookingService) CreateBooking

func (s *BookingService) CreateBooking(
	ctx context.Context,
	bookDTO *dto.CreateBookingDTO,
) (*dto.BookingDTO, error)

func (*BookingService) DeleteBooking

func (s *BookingService) DeleteBooking(ctx context.Context, id uuid.UUID) error

func (*BookingService) GetBooking

func (s *BookingService) GetBooking(ctx context.Context, id uuid.UUID) (*dto.BookingDTO, error)

func (*BookingService) ListBookings

func (s *BookingService) ListBookings(ctx context.Context, limit, offset int) ([]*model.Booking, error)

func (*BookingService) UpdateBooking

func (s *BookingService) UpdateBooking(ctx context.Context, booking *model.Booking) error

type BookingServiceInterface

type BookingServiceInterface interface {
	CreateBooking(ctx context.Context, booking *dto.CreateBookingDTO) (*dto.BookingDTO, error)
	GetBooking(ctx context.Context, id uuid.UUID) (*dto.BookingDTO, error)
	DeleteBooking(ctx context.Context, id uuid.UUID) error
}

func NewBookingService

func NewBookingService(
	bookingRepo repository.BookingRepositoryInterface,
	logger logger.Logger,
	redis *redis.Client,
) BookingServiceInterface

type EventService

type EventService struct {
	// contains filtered or unexported fields
}

func (*EventService) CreateEvent

func (s *EventService) CreateEvent(
	ctx context.Context,
	eventDTO *dto.CreateEventDTO,
) (*dto.EventDTO, error)

func (*EventService) DeleteEvent

func (s *EventService) DeleteEvent(
	ctx context.Context,
	id uuid.UUID,
) error

func (*EventService) GetEventByID

func (s *EventService) GetEventByID(
	ctx context.Context,
	id uuid.UUID,
) (*dto.EventDTO, error)

type EventServiceInterface

type EventServiceInterface interface {
	CreateEvent(ctx context.Context, eventDTO *dto.CreateEventDTO) (*dto.EventDTO, error)
	GetEventByID(ctx context.Context, id uuid.UUID) (*dto.EventDTO, error)
	DeleteEvent(ctx context.Context, id uuid.UUID) error
}

func NewEventService

func NewEventService(
	eventRepo repository.EventRepositoryInterface,
	logger logger.Logger,
	redis *redis.Client,
) EventServiceInterface

type TicketService

type TicketService struct {
	// contains filtered or unexported fields
}

func NewTicketService

func NewTicketService(
	bookingRepo repository.BookingRepositoryInterface,
	eventRepo repository.EventRepositoryInterface,
	redis *redis.Client,
) *TicketService

func (*TicketService) CleanupExpiredHolds

func (s *TicketService) CleanupExpiredHolds(ctx context.Context) error

func (*TicketService) HoldTickets

func (s *TicketService) HoldTickets(ctx context.Context, eventID, userID uuid.UUID, quantity int) error

func (*TicketService) ReleaseHold

func (s *TicketService) ReleaseHold(ctx context.Context, eventID, userID uuid.UUID) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL