ข้ามไปยังเนื้อหาหลัก

เปิด/ปิด สถานะลูกค้า

เมนูเปิด/ปิดสถานะลูกค้าเป็น flow สิทธิ์แคบสำหรับอนุมัติ/ปฏิเสธคำขอลูกค้า และเปิดหรือปิดการใช้งานลูกค้าที่มีอยู่แล้ว สถานะนี้มีผลกับการเลือกลูกค้าใน flow ขาย

ทางเข้าในแอป

AppTarget
Mobilecustomer activation flow ภายใต้หน้าลูกค้า/customer management
POS TerminalcustomerActivation -> CustomerActivationDetailForm

Workflow สถานะลูกค้า

Data และ API Rules

OperationService
Request listgetCustomerActivationSplitList -> getCustomerSapList({ isRequest: true })
DetailgetCustomerSapById(customerId)
Approve requestapproveCustomerRequest(customerCode)
Reject requestrejectCustomerRequest(customerCode)
Toggle active stateupdateCustomerStatus(customerCode, { status })

ปุ่มและเงื่อนไขการตัดสินใจ

ปุ่มเงื่อนไข/ผลลัพธ์
อนุมัติ/ปฏิเสธต้องมีสิทธิ์และ customer code; การปฏิเสธไม่ใช่การลบ customer master
เปิด/ปิดสถานะเป็น endpoint แยกจากการอนุมัติคำขอ และมีผลต่อการเลือกลูกค้าในงานขาย
Refreshต้องทำทุกครั้ง เพราะ request และ active state เป็นข้อมูลจาก Server

กฎธุรกิจ

กฎรายละเอียด
สิทธิ์แคบเมนูนี้ใช้ deptCode แคบกว่า Customer Management
อนุมัติคำขอapprove/reject request endpoint แยกจาก generic status update
ผลกับงานขายลูกค้า inactive ควรถูก block จากการเปิดใบสั่งขาย/ใบจองใหม่
ต้อง refreshหลังเปลี่ยนสถานะต้อง refresh เพราะ downstream flow ใช้สถานะปัจจุบัน
Auditapprove/reject ควรเก็บ actor/time จาก server ไม่ควร fake status เฉพาะ local โดยไม่ refresh

สิทธิ์และ guard

เรื่องรายละเอียด
Terminal menu keycustomerActivation
deptCode ที่เห็นเมนู2, 4, 7, 16, 29
เงื่อนไขสาขาจำกัดด้วย dept code และ customer list context ของ selected branch
Action userเฉพาะผู้ใช้ที่เห็นเมนูนี้ควรเห็น queue/action เปิดปิดสถานะ

Mobile vs POS Terminal

เรื่องMobilePOS Terminal
Navigationentry ภายใต้ customer/customer-management flowssplit-pane detail form
Listcustomer request/customer listgetCustomerActivationSplitList พร้อม isRequest=1
Detail actionsapprove/reject/status change ตามที่ exposeaction ใน CustomerActivationDetailForm
หลัง actionrefresh list/detailrefresh split list/detail

Developer Handoff Map

AreaCode
Terminal detailapps/pos-terminal/src/screens/HomeScreen/CustomerActivationDetailForm.tsx
Customer serviceapps/*/src/services/customers.ts
Terminal split dataapps/pos-terminal/src/services/splitMenuData.ts -> getCustomerActivationSplitList
Menu configapps/pos-terminal/src/screens/HomeScreen/config.ts และ mobile menu config
Sales dependencycustomer selection blocking ใน sales/booking flows

เอกสารที่เกี่ยวข้อง