Skip to main content

Users / Employees

Users / Employees manages employee accounts and branch-warehouse permissions. These settings affect menu access, approval authority, receiving permissions, transfer workflows, and branch-specific warehouse operations.

App Entry Points​

AppTarget
MobileEmployeeList -> EmployeeDetail / profile / transfer receive setting
POS Terminalemployee -> EmployeeDetailForm

Workflow​

API And Permission Rules​

Detail Settings And Side Effects​

ControlPermission and behavior
Profile permission togglesOnly employee managers/admin authority can edit and save; ordinary users see current values.
SaveSerializes boolean UI flags as numeric 0/1; server response should be reloaded before relying on new menu access.
Reset another employee passwordManager-only destructive credential action with confirmation.
Change own passwordThe current employee may use the self-service verification/new-password flow; managers can also access it.
Transfer receive settingManager selects a branch, then configures each sub-warehouse independently.
Warehouse toggleCreates a missing grant with canApprove: 1, or updates an existing grant to 0/1; it is scoped by user + branch + warehouse.
Runtime impactPermission changes can affect menus, approvals, receiving and transfers; refresh/re-login may be needed where auth state is cached.
OperationService
List usersgetUsers({ page, search }) -> GET /users
DetailgetUserById(id)
Patch profilepatchUser({ id, payload })
Get warehouse permissionsgetUserBranchWarehousePermissions({ userId, branchId })
Create warehouse permissioncreateUserBranchWarehousePermission({ whsCode, whsName, canApprove: 1 })
Update warehouse permissionupdateUserBranchWarehousePermission with canApprove set to 0 or 1

Important rules:

  • Employee menu is admin-accessible even when normal dept matching is not enough.
  • Warehouse permission changes affect inventory/receiving flows and may require refresh or re-login before every menu recalculates.
  • Approval flags such as customer approval are stored on the user and consumed by customer-management flows.
  • Employee profile self-service is different from admin employee management.

Sales Order Weight Permission​

fillWeight (กรอกน้ำหนักเองได้) is required for the sales-order weight action, together with the order's item-edit status/permission. Being the order owner, having editPrice, or having access to the Employee menu does not replace fillWeight. Tapping แก้ไขน้ำหนัก without this permission shows คุณไม่มีสิทธิแก้ไข; the app also rechecks permission before submission. This applies to Mobile, POS Terminal order detail, and Storefront POS.

Permissions And Guards​

TopicBehavior
Terminal menu keyemployee
deptCode menu set-2, 1, 2, 3, 4, 7, 29, 21, 8, 9, 27
Admin overrideAdmin can access Employee even if dept rule would otherwise fail.
Branch warehouse rulePermissions are scoped by user and branch.

Mobile vs POS Terminal​

TopicMobilePOS Terminal
NavigationEmployee stack with profile and transfer receive setting screensHomeScreen split-pane menu key employee
Permission editDedicated transfer receive setting screenEmployeeDetailForm permission toggles
ProfileMobile employee profile screenDetail form profile fields
RefreshScreen/list refreshSplit list/detail refresh

Developer Handoff Map​

AreaCode
Mobile stackapps/mobile/src/screens/employeeStack/*
Terminal detailapps/pos-terminal/src/screens/HomeScreen/EmployeeDetailForm.tsx
User serviceapps/*/src/services/user.ts, users.ts
Menu accessHomeScreen/mobile menu config and @bsr/utils permission helpers