Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Benefit Type

Description / Background

In the past, special benefit like free drinks were shown in menu images or promotional artwork. However, this wasn’t always clear to users and important benefits could be missed.

To improve the user experience and make these perks more visible, we’re adding a dedicated Benefits section to the package detail page. This section will clearly show any extra value that comes with a package.

This change helps users better understand what they’re getting and highlights the value of booking with Hungry Hub.

Objectives

  • Admin can set the benefit type on the package detail
  • Admin can set the benefit type for all package
  • Admin can pick from 3 type of benefit:
    • No Benefit
    • Extra Benefit → for benefit beyond what's offered in-store, like one extra drink per person.
    • Exclusive →to label package that only available on Hungry Hub platform.
  • User can see the benefit label under the package name on restaurant page

  •  User can see what kind of extra benefit by hovering the "extra benefit" label
  • User can learn more about the benefit type on about the package section of the package detail page
  • User can see the benefit type on 3 language (TH, EN, CN)

Scope

 restaurant page, package detail page, package on admin dashboard

How to set the Benefit Type

  1. Open Admin Dashboard

https://hungryhub.com/admin/dashboard?locale=th

  1. Open menu Packages
  2. Pick the Package type → open the package type menu
  3. Pick the package you want to edit or create new one
  4. Find the Benefit Type section

  1. Pick the benefit type
  2. Click Update

Sequence Diagram / Flow

 -

ERD

 

Backend Implementation

  • A new benefit_type field is added to all package models (e.g., Ayce, SetMenu, HungryAtHome, etc.) with possible values:
    • no_benefit
    • extra_benefit
    • exclusive
  • Default is no_benefit.
  • This is handled via a polymorphic association and enumerized field.
  • A new related model, HhPackage::PackageBenefit, is created to store "extra benefit" descriptions for packages.
    • Each benefit can have translated descriptions (English, Thai, etc.).
    • Descriptions are limited to 80 characters.
  • In the admin panel (Vue form), a new "Benefit Type" radio selector is added.
  • If "Extra Benefit" is selected, admins can add one or multiple benefit descriptions per locale.
  • There’s validation to ensure at least one benefit is added if "Extra Benefit" is chosen.
  • New database tables and migrations:
    • hh_package_package_benefits table for storing package benefit data.
    • Translation table for descriptions.
    • New columns (benefit_type) added to all package tables.
  • A migration seeds "Extra Benefit" and "Exclusive" as new custom labels.
  • Packages now accept nested attributes for package benefits.
  • When a package's benefit_type is changed away from "Extra Benefit," all associated benefits are deleted.
  • Benefits are included in package serialization (exposed via API).
  • New helper methods in service classes to check for extra benefit or exclusivity.
  • The API serializer now exposes:
    • The benefit_type attribute.
    • An extra_benefits array with benefit details.
  • Refactoring and reordering for clarity in some files.
  • Improved comments and documentation for new and existing methods.

[

github.com

https://github.com/hungryhub-team/hh-server/pull/6807

](https://github.com/hungryhub-team/hh-server/pull/6807)

Hybrid Implementation

-

Frontend Implementation

-

PRD & Task

PRD: Private (https://app.clickup.com/9003122396/docs/8ca1fpw-7922/8ca1fpw-51616)

Private (https://app.clickup.com/t/86cz47749

Design

[

www.figma.com

https://www.figma.com/design/T9kSuAj3GZW7khySGNq84m/Store-Page-Update?node-id=9139-1083&t=AlOErUnWeUQbXuRV-1

](https://www.figma.com/design/T9kSuAj3GZW7khySGNq84m/Store-Page-Update?node-id=9139-1083&t=AlOErUnWeUQbXuRV-1)

API Blueprint

MethodPathURLDescriptionPayload
 all /restaurant_package remove custom label from the response,
add new attribute benefit_type

New Query

 -

DB Schema / Database Migration

  • create new table hh_package_package_benefits
  • add description column on hh_package_package_benefits
  • add translation for description column
  • New columns (benefit_type) added to all package tables.

Improvement:

Feature NameDateWhat ChangedDescription