Skip to content

Instantly share code, notes, and snippets.

@pawelkaczor
Created February 20, 2021 10:20
Show Gist options
  • Save pawelkaczor/9908cd3935535cfc1851aa3a8e54563c to your computer and use it in GitHub Desktop.
Save pawelkaczor/9908cd3935535cfc1851aa3a8e54563c to your computer and use it in GitHub Desktop.
Fast and Furious
package pl.newicom.faf
import java.time.Instant
// showtimes
package object calendar {
case class Screening(
id: EntityId,
franchiseId: EntityId,
movieId: EntityId,
cinemaId: EntityId,
room: Room,
startsAt: Instant,
endsAt: Instant
)
}
package pl.newicom
// shared
package object faf {
type Opinion = String
type EntityId = String
type Room = String
// Like a tenant
case class Franchise(id: EntityId)
case class Movie(id: EntityId, title: String)
case class Cinema(id: EntityId, franchiseId: EntityId)
}
package pl.newicom.faf
import java.time.Instant
package object pricing {
// Pricing can depend on promotions, reservations etc.
case class PriceCatalog(id: EntityId, franchiseId: EntityId, publishedOn: Instant)
}
package pl.newicom.faf
package object ratings {
class RatingValue(val value: Int) extends AnyVal {
require(value >= 1 && value <= 5)
}
case class Review(movieId: EntityId, rating: RatingValue, opinion: Option[Opinion])
}
package pl.newicom.faf
package object reservation {
// See: https://github.com/jarrvis/ticket-booking
// Possible scenario:
/*
- The user selects the day and the time when he/she would like to see the movie.
- The system lists movies available in the given time interval - title and screening times.
- The user chooses a particular screening.
- The system gives information regarding screening room and available seats.
- The user chooses seats, and gives the name of the person doing the reservation (name and surname).
- The system gives back the total amount to pay and reservation expiration time.
*/
}

Fast and Furious - franchise

I'm sorry, but I provided only simple packages as entry points for service implementations. The packages represent separate services. The identification of possible services and the multi-tenancy (franchises) are the only interesting issues that I could think of based on the provided task description.

Unfortunately I find the challenge confusing as it mixes different goals and "levels". I can not design and solve a problem which is not described more precisely. It all depends on the concrete requirements. Depending on the requirements, the result architecture/design can be completely different. I leave all the simple tasks that do not involve (non-trivial) problem solving.

Best regards, Paweł Kaczor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment