Documentation ¶
Index ¶
- Variables
- type AddReservationParams
- type MongoStore
- func (r *MongoStore) AddMovie(ctx context.Context, movie *models.Movie) (*models.Movie, error)
- func (r *MongoStore) AddRepertoire(ctx context.Context, repertoire *models.Repertoire) (*models.Repertoire, error)
- func (r *MongoStore) AddReservation(ctx context.Context, req AddReservationParams) (*models.Reservation, error)
- func (r *MongoStore) CancelReservation(ctx context.Context, resId string) error
- func (r *MongoStore) DeleteHall(ctx context.Context, id string) error
- func (r *MongoStore) DeleteMovie(ctx context.Context, id string) error
- func (r *MongoStore) DeleteRepertoire(ctx context.Context, id string) error
- func (r *MongoStore) DeleteRepertoireForMovie(ctx context.Context, movieId string) error
- func (r *MongoStore) DeleteReservation(ctx context.Context, id string) error
- func (r *MongoStore) GetAllRepertoireForMovie(ctx context.Context, movieId string, startDate time.Time, endDate time.Time) ([]models.Repertoire, error)
- func (r *MongoStore) GetAllReservationsForUser(ctx context.Context, username string) ([]models.Reservation, error)
- func (r *MongoStore) GetHall(ctx context.Context, name string) ([]models.Hall, error)
- func (r *MongoStore) GetHallById(ctx context.Context, id string) (*models.Hall, error)
- func (r *MongoStore) GetMovie(ctx context.Context, id string) (*models.Movie, error)
- func (r *MongoStore) GetRepertoire(ctx context.Context, id string) (*models.Repertoire, error)
- func (r *MongoStore) GetRepertoireByMovieDateTimeHall(ctx context.Context, movieId string, dateValue time.Time, timeValue string, ...) (models.Repertoire, error)
- func (r *MongoStore) GetReservationById(ctx context.Context, id string) (*models.Reservation, error)
- func (r *MongoStore) GetUserByUsername(ctx context.Context, username string) (*models.User, error)
- func (r *MongoStore) InsertHall(ctx context.Context, hall *models.Hall) (*models.Hall, error)
- func (r *MongoStore) InsertReservation(ctx context.Context, reservation *models.Reservation) (*models.Reservation, error)
- func (r *MongoStore) InsertUser(ctx context.Context, user *models.User) (*models.User, error)
- func (r *MongoStore) ListHalls(ctx context.Context) ([]models.Hall, error)
- func (r *MongoStore) ListMovies(ctx context.Context) ([]models.Movie, error)
- func (r *MongoStore) ListRepertoires(ctx context.Context) ([]models.Repertoire, error)
- func (r *MongoStore) SearchMovies(ctx context.Context, movieId string) ([]models.Movie, error)
- func (r *MongoStore) UpdateHall(ctx context.Context, id string, hall models.Hall) (models.Hall, error)
- func (r *MongoStore) UpdateMovie(ctx context.Context, id string, movie *models.Movie) (*models.Movie, error)
- func (r *MongoStore) UpdateRepertoire(ctx context.Context, id string, repertoire models.Repertoire) (*models.Repertoire, error)
- type Store
Constants ¶
This section is empty.
Variables ¶
var (
ErrHallNotFound = errors.New("hall not found")
)
var (
ErrMovieNotFound = errors.New("movie not found")
)
var ErrRecordNotFound = mongo.ErrNoDocuments
var (
ErrRepertoireNotFound = errors.New("repertoire not found")
)
var (
ErrReservationNotFound = errors.New("reservation not found")
)
Functions ¶
This section is empty.
Types ¶
type AddReservationParams ¶
type AddReservationParams struct { Username string `json:"username" binding:"required"` MovieID string `json:"movieId" binding:"required"` Date time.Time `json:"date" binding:"required"` Time string `json:"time" binding:"required"` Hall string `json:"hall" binding:"required"` ReservSeats []string `json:"reservSeats" binding:"required"` }
TransferTxParams contains the input parameters of the transfer transaction
type MongoStore ¶
type MongoStore struct {
// contains filtered or unexported fields
}
func (*MongoStore) AddRepertoire ¶
func (r *MongoStore) AddRepertoire(ctx context.Context, repertoire *models.Repertoire) (*models.Repertoire, error)
AddRepertoire adds a new repertoire to the MongoDB collection
func (*MongoStore) AddReservation ¶
func (r *MongoStore) AddReservation(ctx context.Context, req AddReservationParams) (*models.Reservation, error)
func (*MongoStore) CancelReservation ¶
func (r *MongoStore) CancelReservation(ctx context.Context, resId string) error
func (*MongoStore) DeleteHall ¶
func (r *MongoStore) DeleteHall(ctx context.Context, id string) error
DeleteHall deletes a hall by ID from the MongoDB collection
func (*MongoStore) DeleteMovie ¶
func (r *MongoStore) DeleteMovie(ctx context.Context, id string) error
DeleteMovie deletes a movie by ID from the MongoDB collection
func (*MongoStore) DeleteRepertoire ¶
func (r *MongoStore) DeleteRepertoire(ctx context.Context, id string) error
DeleteRepertoire deletes a repertoire based on its ID
func (*MongoStore) DeleteRepertoireForMovie ¶
func (r *MongoStore) DeleteRepertoireForMovie(ctx context.Context, movieId string) error
DeleteRepertoire deletes a repertoire based on its ID
func (*MongoStore) DeleteReservation ¶
func (r *MongoStore) DeleteReservation(ctx context.Context, id string) error
DeleteReservation deletes a reservation based on its ID
func (*MongoStore) GetAllRepertoireForMovie ¶
func (r *MongoStore) GetAllRepertoireForMovie(ctx context.Context, movieId string, startDate time.Time, endDate time.Time) ([]models.Repertoire, error)
GetRepertoire returns a repertoires based on its movieId
func (*MongoStore) GetAllReservationsForUser ¶
func (r *MongoStore) GetAllReservationsForUser(ctx context.Context, username string) ([]models.Reservation, error)
GetReservation returns a all reservation based on username
func (*MongoStore) GetHallById ¶
func (*MongoStore) GetRepertoire ¶
func (r *MongoStore) GetRepertoire(ctx context.Context, id string) (*models.Repertoire, error)
GetRepertoire returns a repertoire based on its ID
func (*MongoStore) GetRepertoireByMovieDateTimeHall ¶
func (r *MongoStore) GetRepertoireByMovieDateTimeHall(ctx context.Context, movieId string, dateValue time.Time, timeValue string, hallValue string) (models.Repertoire, error)
GetRepertoire returns a repertoire based on its ID
func (*MongoStore) GetReservationById ¶
func (r *MongoStore) GetReservationById(ctx context.Context, id string) (*models.Reservation, error)
GetReservationById returns a reservations based on its ID
func (*MongoStore) GetUserByUsername ¶
Get returns a user by username
func (*MongoStore) InsertHall ¶
AddHall adds a new hall to the MongoDB collection
func (*MongoStore) InsertReservation ¶
func (r *MongoStore) InsertReservation(ctx context.Context, reservation *models.Reservation) (*models.Reservation, error)
AddReservation adds a new reservation to the MongoDB collection
func (*MongoStore) InsertUser ¶
AddHall adds a new hall to the MongoDB collection
func (*MongoStore) ListMovies ¶
ListMovies returns all movies from the MongoDB collection
func (*MongoStore) ListRepertoires ¶
func (r *MongoStore) ListRepertoires(ctx context.Context) ([]models.Repertoire, error)
ListRepertoires returns all repertoires from the MongoDB collection
func (*MongoStore) SearchMovies ¶
GetHall returns a hall by ID from the MongoDB collection
func (*MongoStore) UpdateHall ¶
func (r *MongoStore) UpdateHall(ctx context.Context, id string, hall models.Hall) (models.Hall, error)
UpdateHall updates a hall by ID in the MongoDB collection
func (*MongoStore) UpdateMovie ¶
func (r *MongoStore) UpdateMovie(ctx context.Context, id string, movie *models.Movie) (*models.Movie, error)
UpdateMovie updates a movie by ID in the MongoDB collection
func (*MongoStore) UpdateRepertoire ¶
func (r *MongoStore) UpdateRepertoire(ctx context.Context, id string, repertoire models.Repertoire) (*models.Repertoire, error)
UpdateRepertoire updates a repertoire based on its ID
type Store ¶
type Store interface { GetUserByUsername(ctx context.Context, username string) (*models.User, error) InsertUser(ctx context.Context, user *models.User) (*models.User, error) InsertHall(ctx context.Context, hall *models.Hall) (*models.Hall, error) ListHalls(ctx context.Context) ([]models.Hall, error) GetHall(ctx context.Context, name string) ([]models.Hall, error) GetHallById(ctx context.Context, id string) (*models.Hall, error) UpdateHall(ctx context.Context, id string, hall models.Hall) (models.Hall, error) DeleteHall(ctx context.Context, id string) error AddMovie(ctx context.Context, movie *models.Movie) (*models.Movie, error) ListMovies(ctx context.Context) ([]models.Movie, error) GetMovie(ctx context.Context, id string) (*models.Movie, error) UpdateMovie(ctx context.Context, id string, movie *models.Movie) (*models.Movie, error) DeleteMovie(ctx context.Context, id string) error SearchMovies(ctx context.Context, movieId string) ([]models.Movie, error) AddRepertoire(ctx context.Context, repertoire *models.Repertoire) (*models.Repertoire, error) ListRepertoires(ctx context.Context) ([]models.Repertoire, error) GetRepertoire(ctx context.Context, id string) (*models.Repertoire, error) GetRepertoireByMovieDateTimeHall(ctx context.Context, movieId string, dateValue time.Time, timeValue string, hallValue string) (models.Repertoire, error) GetAllRepertoireForMovie(ctx context.Context, movieId string, startDate time.Time, endDate time.Time) ([]models.Repertoire, error) UpdateRepertoire(ctx context.Context, id string, repertoire models.Repertoire) (*models.Repertoire, error) DeleteRepertoire(ctx context.Context, id string) error DeleteRepertoireForMovie(ctx context.Context, movieId string) error InsertReservation(ctx context.Context, reservation *models.Reservation) (*models.Reservation, error) GetReservationById(ctx context.Context, id string) (*models.Reservation, error) GetAllReservationsForUser(ctx context.Context, username string) ([]models.Reservation, error) DeleteReservation(ctx context.Context, id string) error AddReservation(ctx context.Context, req AddReservationParams) (*models.Reservation, error) CancelReservation(ctx context.Context, resId string) error }