Files
BarangaySystem/docs/completed/chklist-20260403030000.md
2026-06-06 18:43:00 +08:00

2.2 KiB

Checklist: Store and Product Management (Big 3 & Multiple Managers)

📦 Database & Models

  • Migration: Create store_managers table with standard fields (hashkey, created_by, updated_by, is_active).
  • Model: Create app/Models/Market/StoreManager.php.
  • Model: Add managers() relationship to app/Models/Market/Store.php.
  • Dictionary: Update ai-docs/dictionary.md with "Big 3" definition.

🔐 Permissions & Hierarchy

  • UserPermissions: Ensure ULTIMATE, SUPER_OPERATOR, OPERATOR are identified as "Big 3".
  • ProductPermissions: Add UserActions::ModifyAllProducts to OPERATOR role in ProductPermissionsDefinition.
  • ProductPermissions: Extend isActionAllowed to check if current user is a parent of any of the store's managers (not just the owner).
  • Permissions Helper: Add isParentOfTargetUser recursive check for Store Owner and all Store Managers.

🏪 Store Management

  • StoreController: Refactor listStores_Admin to filter by "Big 3" OR "Parent of Owner" OR "Parent of any Manager".
  • StoreController: Ensure update and deleteStore_Admin enforce the same hierarchy checks.
  • StoreController: Update canUserAccessPos to include a check against the store_managers table.
  • StoreController: Support saving multiple managers in store and update methods (input should be an array of user hashkeys).

🍎 Product Management

  • ProductController: Refactor editProductAdmin - Only "Big 3" can perform global edits (updating prd_items table fields). Non-Big 3 can only update their own store's pivot data if they are a manager/owner.
  • ProductController: Ensure createNew_Admin requires Big 3 or ownership/parentship of the target store.
  • ProductController: Update AssignProductToOwnStore to support the new store_managers lookup.

🖥️ Frontend Changes

  • CreateStore.vue / EditStore.vue: Implement a multi-select for managers.
  • ManageProductAdmin.vue: Only show global edit fields to Big 3 users.
  • StoreDetail.vue: Ensure correct action buttons (Edit, POS) are visible only based on the new permission logic.