2.2 KiB
2.2 KiB
Checklist: Store and Product Management (Big 3 & Multiple Managers)
📦 Database & Models
- Migration: Create
store_managerstable with standard fields (hashkey,created_by,updated_by,is_active). - Model: Create
app/Models/Market/StoreManager.php. - Model: Add
managers()relationship toapp/Models/Market/Store.php. - Dictionary: Update
ai-docs/dictionary.mdwith "Big 3" definition.
🔐 Permissions & Hierarchy
- UserPermissions: Ensure
ULTIMATE,SUPER_OPERATOR,OPERATORare identified as "Big 3". - ProductPermissions: Add
UserActions::ModifyAllProductstoOPERATORrole inProductPermissionsDefinition. - ProductPermissions: Extend
isActionAllowedto check if current user is a parent of any of the store's managers (not just the owner). - Permissions Helper: Add
isParentOfTargetUserrecursive check for Store Owner and all Store Managers.
🏪 Store Management
- StoreController: Refactor
listStores_Adminto filter by "Big 3" OR "Parent of Owner" OR "Parent of any Manager". - StoreController: Ensure
updateanddeleteStore_Adminenforce the same hierarchy checks. - StoreController: Update
canUserAccessPosto include a check against thestore_managerstable. - StoreController: Support saving multiple managers in
storeandupdatemethods (input should be an array of user hashkeys).
🍎 Product Management
- ProductController: Refactor
editProductAdmin- Only "Big 3" can perform global edits (updatingprd_itemstable fields). Non-Big 3 can only update their own store's pivot data if they are a manager/owner. - ProductController: Ensure
createNew_Adminrequires Big 3 or ownership/parentship of the target store. - ProductController: Update
AssignProductToOwnStoreto support the newstore_managerslookup.
🖥️ 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.