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
- Owner can see Edit History on Allotment Management

- Owner can undo their edit allotment :
- Click the Undo button to undo the allotment setting
- It will take several second to minutes to undo the setting

- Owner can undo their blocking allotment:
- Click the Undo button to undo the blocked allotment (it should have the reason)
- It will take several second to minutes to undo the setting

- Owner can click unblock allotment :
- Click the Unblock button on the available seats page
- It will remove the block history on the edit history page
- 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_inventorieswere directly filtered and paginated. - After the change, a new instance of
Api::Partner::UpdatedInventoryFilteris created and used to filterupdated_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_dateis 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_dateis 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_timeis 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_timeis less than or equal to the provided end_time.
- Date Range Filter:
- Refactored to handle both
date_fromanddate_tomore flexibly. - The filtering uses a scope to conditionally apply the start and end date filters based on their presence.
- Refactored to handle both
[
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
getListHistoryAllotmentto 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.jsandsrc/locales/cn/layout.js), English (src/locales/en/allotments.jsandsrc/locales/en/layout.js), and Thai (src/locales/th/allotments.jsandsrc/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
getListHistoryAllotmentto fetch and format the allotment history data. - Added a new route for the allotment history page.
- Added a new filter for
date_typeto the filters inAllotmentHistoryFilterForm.vue. - Introduced a dropdown in
AllotmentHistory.vueto select the number of items per page. - Enhanced handling of route query parameters for pagination and filtering in both
AllotmentHistory.vueandAllotmentHistory.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
| Method | Path | URL | Description | Payload |
|---|---|---|---|---|
| GET | /history | https://api.hungryhub.com/api/partner/v1/inventories | get history allotment setting | page: 1 per_page: 10 |
New Query
-
DB Schema / Database Migration
-
Improvement:
| Feature Name | Date | What Changed | Description |
|---|---|---|---|
| edit history allotment | 7 march 2025 | innitial document |