[IMP] pms: add active field to board service#402
Open
DarioLodeiros wants to merge 1 commit into
Open
Conversation
Allow archiving board service regimes that are no longer commercialised (seasonal packages, retired group rates, board services that have been replaced) without affecting historical reservations or invoices that reference them. The active flag lives on pms.board.service as the source of truth and its write override propagates archive/restore down to: - pms.board.service.line (composition of the regime) - pms.board.service.room.type (per-room-type assignment) - pms.board.service.room.type.line (composition at room-type level) Each model also exposes its own active field so individual rows can be toggled independently when needed (e.g. retire a regime only for a specific room type). UI: - pms.board.service and pms.board.service.room.type forms gain the standard "Archived" ribbon. - pms.board.service form has a dedicated search view with an "Archived" filter, wired to the configuration menu. Historical pms.reservation.board_service_room_id references remain intact since the rows are archived rather than deleted; the regime simply stops appearing in selection dropdowns for new operations. Added a regression test in tests/test_pms_board_service.py covering the forward and reverse propagation of the active flag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Allow archiving board service regimes that are no longer commercialised (seasonal packages, retired group rates, board services that have been replaced) without affecting historical reservations or invoices that reference them.
Mirrors the same pattern recently introduced for
room.closure.reason(#xxxx).Behaviour
The active flag lives on
pms.board.serviceas the source of truth and itswriteoverride propagates archive/restore down to:pms.board.service.line(composition of the regime)pms.board.service.room.type(per-room-type assignment)pms.board.service.room.type.line(composition at room-type level)Each model also exposes its own
activefield so individual rows can be toggled independently when needed (for example, retire a regime only for a specific room type).Historical
pms.reservation.board_service_room_idreferences remain intact since the rows are archived rather than deleted; the regime simply stops appearing in selection dropdowns for new operations.UI
pms.board.serviceandpms.board.service.room.typeforms gain the standard "Archived" ribbon.pms.board.serviceform has a dedicated search view with an "Archived" filter, wired to the configuration menu action.Test plan
-i pms --test-tags /pms:TestBoardService).test_archive_board_service_propagates_to_childrencovers forward and reverse propagation of the active flag.