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

Edit History Allotment on Partner Portal

Description / Background

Adding edit history allotment feature to Partner Portal.

Glossary

Private (https://app.clickup.com/9003122396/docs/8ca1fpw-35796/8ca1fpw-41516)

Objectives

  1. Owner can see Edit History on Allotment Management

  1. Owner can undo their edit allotment :
    1. Click the Undo button to undo the allotment setting
    2. It will take several second to minutes to undo the setting
  2. Owner can undo their blocking allotment:
    1. Click the Undo button to undo the blocked allotment (it should have the reason)
    2. It will take several second to minutes to undo the setting
  3. Owner can click unblock allotment :
    1. Click the Unblock button on the available seats page
    2. It will remove the block history on the edit history page
    3. It will take several second to minutes to unblock the allotment

Scope

Allotment Management menu

Location

Partner Portal

Sequence Diagram / Flow

ERD

-

Backend Implementation

  • Before the change, the updated_inventories were directly filtered and paginated.
  • After the change, a new instance of Api::Partner::UpdatedInventoryFilter is created and used to filter updated_inventories.
  • The filtered inventories are then paginated, and the JSON response is generated using the paginated collection.
  • Start Date Filter:
    • Previously, it filtered inventories based on exact start_date.
    • Now, it filters inventories where updated_inventories.start_date is greater than or equal to the provided start_date.
  • End Date Filter:
    • Previously, it filtered inventories based on exact end_date.
    • Now, it filters inventories where updated_inventories.end_date is less than or equal to the provided end_date.
  • Start Time Filter:
    • Previously, it filtered inventories based on exact start_time.
    • Now, it filters inventories where start_time is greater than or equal to the provided start_time.
  • End Time Filter:
    • Previously, it filtered inventories based on exact end_time.
    • Now, it filters inventories where end_time is less than or equal to the provided end_time.
  • Date Range Filter:
    • Refactored to handle both date_from and date_to more flexibly.
    • The filtering uses a scope to conditionally apply the start and end date filters based on their presence.

[

github.com

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

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

Hybrid Implementation

-

Frontend Implementation

  • Added a new function getListHistoryAllotment to fetch the history of allotments.
  • Added a new SCSS file for allotment history filter form (src/components/filters/allotment-history/AllotmentHistoryFilterForm.scss).
  • Added a new Vue component for allotment history filter form (src/components/filters/allotment-history/AllotmentHistoryFilterForm.vue).
  • Updated Chinese (src/locales/cn/allotments.js and src/locales/cn/layout.js), English (src/locales/en/allotments.js and src/locales/en/layout.js), and Thai (src/locales/th/allotments.js and src/locales/th/layout.js) localization files to include new terms related to allotment history (e.g., "Date From", "Date To", "Quantity Available", "Reason", "Service Type", "Allotment History", "Edit History", "Created At", "Undo", "Available Seats").
  • Updated the navigation configuration to include new menu items for "Available Seats" and "Edit History" under the "Allotment" section.
  • Added a new JavaScript file for the allotment history page.
  • Added a new Vue file for the allotment history page.
  • Added a new action getListHistoryAllotment to fetch and format the allotment history data.
  • Added a new route for the allotment history page.
  • Added a new filter for date_type to the filters in AllotmentHistoryFilterForm.vue.
  • Introduced a dropdown in AllotmentHistory.vue to select the number of items per page.
  • Enhanced handling of route query parameters for pagination and filtering in both AllotmentHistory.vue and AllotmentHistory.js.

[

github.com

https://github.com/hungryhub-team/book-bite/pull/767

](https://github.com/hungryhub-team/book-bite/pull/767)

[

github.com

https://github.com/hungryhub-team/book-bite/pull/771/files

](https://github.com/hungryhub-team/book-bite/pull/771/files)

PRD & Task

Private (https://app.clickup.com/9003122396/docs/8ca1fpw-30456/8ca1fpw-44796) Private (https://app.clickup.com/t/86cxhuk7e) Private (https://app.clickup.com/t/86cy3b72w)

Design

[

www.figma.com

https://www.figma.com/design/ymdLN2ZKzfI0oyX4kps2GQ/Partner-Portal-Desktop?node-id=14028-131&t=PA4fLffa147f5RGI-1

](https://www.figma.com/design/ymdLN2ZKzfI0oyX4kps2GQ/Partner-Portal-Desktop?node-id=14028-131&t=PA4fLffa147f5RGI-1)

API Blueprint

MethodPathURLDescriptionPayload
GET/historyhttps://api.hungryhub.com/api/partner/v1/inventoriesget history allotment settingpage: 1
per_page: 10

New Query

-

DB Schema / Database Migration

-


Improvement:

Feature NameDateWhat ChangedDescription
edit history allotment7 march 2025innitial document