Skip to main content

TWPRO-6918 - Packages

Models​

Package​

Represents a package of treatments. The Package has the following attributes:

  • name : Name of the package (eg. "special summer haircut")
  • description : Description of the package
  • venue_id : Venue id for performance reasons
  • position : Position of the package in the list of packages for a venue
  • deleted_at : Soft delete field

A Package can have many PackageOptions.

PackageOptions​

Represents all the treatment options included in a package.

For example, for the "special summer haircut" package, we might have "option 1 - short hair" that includes "shampoo - short hair", "haircut - short hair", and "blow dry - short hair", as well as "option 2 - long hair" that includes "shampoo - long hair", "haircut - long hair", and "blow dry - long hair".

A PackageOption will be associated to the respective VenueTreatments through the PackageOptionResource model.

The PackageOption has the following attributes:

  • name : Name of the package option (eg. "option 1 - short hair")
  • position : Position of the package option in the list of package options for a package
  • deleted_at : Soft delete field

PackageOptionResource​

This is a relationship model that has the reference to the PackageOption, a reference to a VenueTreatment and a position field for sorting.

The PackageOptionResource has the following attributes:

  • package_option_id : Reference to the PackageOption
  • venue_treatment_id : Reference to the VenueTreatment
  • position : Position of the package option in the list of package options for a package

Diagram​

Here's a diagram in mermaid format that visualizes the relationships between these models: