docs(sdlc): reformat work products to audited reference layout

This commit is contained in:
Thanakorn
2026-09-09 08:09:54 +07:00
parent f2da2f51b5
commit 9553d94ec6
209 changed files with 8063 additions and 5762 deletions
@@ -0,0 +1,168 @@
# Software Design
<!-- footer: SD -->
| Document No | Software Design | Release, Version, By: | 25690306 V1.0 NoC |
| Project Name | โครงการพัฒนาระบบบริหารจัดการคลังสินค้า (BRN WMS) บริษัท บี.อาร์.เอ็น เอ็นเตอร์ไพรส์ จำกัด |
| Project Code | 200-WMS-26-001-00 |
| Title | เอกสารการออกแบบระบบ (System Design Document) |
| Project Period | 5 มกราคม 2569 – 24 สิงหาคม 2569 |
| Organizer | คุณอภิรัชช์ สุภัทรประทีป (Project Manager) , คุณนพพงษ์ เจริญสุข (System Analyst) |
| Recorder | คุณเยาวลักษณ์ บางชมภู (Document Control) |
## HIGH LEVEL DESIGN
### Use Case Diagram
ผู้ใช้งานของระบบและกลุ่มการใช้งานหลัก
| Actor | คำอธิบาย | การใช้งานหลัก |
| --- | --- | --- |
| Owner | เจ้าของบริษัท สิทธิ์สูงสุดภายในบริษัท | ตั้งค่าบริษัท จัดการผู้ใช้ และใช้งานทุกโมดูล |
| Admin | ผู้ดูแลระบบภายในบริษัท | จัดการข้อมูลหลัก ผู้ใช้ สิทธิ์ และใช้งานทุกโมดูลปฏิบัติการ |
| Staff | ผู้ปฏิบัติงาน | บันทึกรายการคลังสินค้า ขาย จัดซื้อ และการเงินตามสิทธิ์ |
| Viewer | ผู้ใช้แบบอ่านอย่างเดียว | ดูหน้าจอและรายงานที่ได้รับสิทธิ์ |
| System Scheduler | ผู้กระทำอัตโนมัติ (Node.js) | สรุปยอดสต๊อก/GL และแจ้งเตือนตามกำหนดเวลา |
| SMTP Service | ผู้กระทำภายนอก | ส่งอีเมล Onboarding กู้คืนรหัสผ่าน และแจ้งเตือน |
### Component Diagram
โครงสร้างส่วนประกอบของระบบแบ่งตามชั้นการทำงาน
| ชั้น (Layer) | ส่วนประกอบ | อ้างอิง SR |
| --- | --- | --- |
| Presentation | หน้าจอ PHP ในแต่ละโมดูล (`app/<module>/`), JavaScript และ CSS ที่รองรับ Responsive | SR02:002, SR06:002, SR06:003 |
| Business Logic | Manager/Service Classes ใน `app/assets/utils/classes/` เรียกใช้จาก Page Controller | SR02:003, SR03:001–SR03:011 |
| Data Access | Manager Classes เข้าถึงฐานข้อมูล MariaDB โดยตรง พร้อม Trait รวมตรรกะที่ใช้ร่วมกัน | SR02:004, SR06:001, SR08:001–SR08:005 |
| Real-time / Scheduler | บริการ Node.js (`server.js`, `scheduler.js`) ควบคุมด้วย pm2 | SR03:011, SR06:004, SR06:005 |
| External | บริการ SMTP สำหรับส่งอีเมล และ Socket.IO Client บน Browser | SR06:004, SR06:005 |
### Deployment Diagram
การติดตั้งระบบแบ่งเป็น 4 ชั้นบริการ
| ชั้นการติดตั้ง (Tier) | ส่วนประกอบ | อ้างอิง SR |
| --- | --- | --- |
| Client | Web Browser (Chrome/Edge/Firefox) บน Desktop, Tablet และ Mobile พร้อม Socket.IO Client | SR06:002, SR06:003, SR06:005 |
| Web Tier | PHP 8 บน Apache ติดตั้งแบบ Manual หรือ Container `docker/php` | SR01:003, SR02:005 |
| Data Tier | MariaDB ฐานข้อมูล `wms` (ผู้ใช้/บริษัท) และ `wms2` (คลัง/บัญชี) | SR06:001, SR08:001–SR08:004 |
| Service Tier | Node.js `server.js` และ `scheduler.js` ควบคุมด้วย pm2 | SR03:011, SR06:004 |
### User Interface Design
ผังหน้าจอหลักของระบบแบ่งตามโมดูลการใช้งาน
| กลุ่มหน้าจอ | หน้าจอ |
| --- | --- |
| Login & Onboarding | เข้าสู่ระบบ / ลงทะเบียนบริษัท / รับคำเชิญเข้าร่วมบริษัท / ลืมรหัสผ่าน / ยืนยัน OTP |
| Dashboard | แดชบอร์ดคลังสินค้า / แดชบอร์ดบัญชีและการเงิน |
| Master Data | คลังสินค้า / พื้นที่จัดเก็บ / ช่องจัดเก็บ / หมวดสินค้า / สินค้า / ประเภทผู้ติดต่อ / ผู้ติดต่อ |
| Inventory Control | รับสินค้าเข้า / จ่ายสินค้าออก / โอนย้ายสินค้า / ยอดคงเหลือ / Lot & Serial / พิมพ์บาร์โค้ด |
| Sales | ใบเสนอราคา / ใบสั่งขาย / ใบแจ้งหนี้ / ใบรับคืนและใบลดหนี้ |
| Purchasing | ใบขอซื้อ / ใบสั่งซื้อ / ใบแจ้งหนี้ซื้อ / ใบคืนสินค้าผู้ขาย |
| Finance | ใบวางบิลรับ / ใบเสร็จรับเงิน / ใบวางบิลจ่าย / ใบสำคัญจ่าย |
| Accounting | ผังบัญชี / แผนก / สูตรบัญชี / สมุดรายวัน / บัญชีแยกประเภท |
| Reports | รายงานสต๊อก / ความเคลื่อนไหว / ความจุคลัง / สินค้าใกล้หมด / สินค้าหมดอายุ / รายงานการเงิน |
| Settings | ข้อมูลบริษัท / SMTP / ผู้ใช้งานและสิทธิ์ / การตั้งค่าระบบ |
## Software Baseline
หัวข้อนี้ระบุสิ่งที่ถูกกำหนดเป็น Baseline ของซอฟต์แวร์ วันที่กำหนด และผู้อนุมัติ เพื่อให้ตรวจสอบเส้นทาง Baseline → Configuration → Change ได้ในเอกสารชุดเดียวกัน
| รายการที่กำหนดเป็น Baseline | ค่าที่ควบคุม | ที่จัดเก็บ |
| --- | --- | --- |
| Source Code ของแอปพลิเคชัน | Git commit `6c39700` บน branch `main` | Repository หลัก `git@188.166.228.62:nok/wms-app.git` |
| โครงสร้างฐานข้อมูล | Schema ที่สร้างโดย `setup.php` และ `docker/mariadb/init-wms2.sql` | ควบคุมใน Repository เดียวกัน |
| ค่าตั้งค่าและชุดติดตั้ง | `docker-compose.yml`, `docker/`, `.env.example` (ไม่รวมค่าความลับ) | ควบคุมใน Repository เดียวกัน |
| เอกสาร Work Products | Branch `sdlc` และ Tag `sdlc-v1.0-final` | Repository หลักและ Remote สำรอง `git@github.com:thanakorninbox-dev/wms-app.git` |
| หัวข้อ | รายละเอียด |
| --- | --- |
| วันที่กำหนด Baseline | 17 สิงหาคม 2569 (Baseline ของระบบที่ส่งมอบ) |
| ผู้จัดทำ Baseline | คุณธนกร สถิตวิทยากุล (Developer) |
| ผู้ตรวจสอบ | คุณนพพงษ์ เจริญสุข (System Analyst) และ คุณปริญ งามขำ (QA/Tester) |
| ผู้อนุมัติ | คุณเสรี วิริยะสกุลธรณ์ (Project Sponsor) พร้อมการตรวจรับเมื่อ 17 สิงหาคม 2569 |
| เอกสารควบคุมที่เกี่ยวข้อง | Software Configuration (WP 8) ระบุรายการ Configuration Item และการควบคุมเวอร์ชัน |
| การสอบกลับ | Traceability Record (WP 13) เชื่อมโยงความต้องการกับ Software Unit และ Test Case บน Baseline นี้ |
| การเปลี่ยนแปลง Baseline | ต้องผ่าน Change Report (CH-001–CH-003) และบันทึกผลใน Correction Register เมื่อเป็นการแก้ไขข้อบกพร่อง |
## Software Unit
| ID | Description | Functional Interfaces Detail | References | Files |
| --- | --- | --- | --- | --- |
| UN01 — ผู้ใช้งานและสิทธิ์ (Identity & Access) | | | | |
| UN01.001 | Identity – Register & Onboarding | ลงทะเบียนเจ้าของบริษัท, ยืนยันอีเมล, เชิญผู้ใช้และรับคำเชิญเข้าบริษัทที่ถูกต้อง | SR03:001, SR08:001 | app/login/, UserManager.php |
| UN01.002 | Identity – Login & Role Guard | เข้าสู่ระบบด้วย Username/Password, ตรวจบทบาทและสิทธิ์แอปพลิเคชันฝั่งเซิร์ฟเวอร์ก่อนเข้าทุกหน้า | SR03:001, SR04:001, SR07:005 | app/login/, UserManager.php, app/assets/utils/ |
| UN01.003 | Identity – Password Recovery / OTP / Session | ลืมรหัสผ่านผ่านอีเมล, OTP, Hash รหัสผ่าน bcrypt, บล็อก Concurrent Login | SR03:001, SR01:004, SR07:003 | PasswordManager.php, PasswordResetManager.php |
| UN01.004 | Identity – User & App-Access Administration | เพิ่ม/แก้ไข/ปิดใช้ผู้ใช้, กำหนดบทบาทและสิทธิ์การเข้าถึงแอปพลิเคชัน | SR03:001, SR08:001 | app/setting/, UserManager.php |
| UN02 — ตั้งค่าบริษัท (Company Settings) | | | | |
| UN02.001 | Company – Profile & System Settings | แก้ไขข้อมูลบริษัท, โลโก้, ค่าตั้งค่าระบบต่อบริษัท | SR03:002 | CompanyProfileManager.php, CompanySettingManager.php |
| UN02.002 | Company – SMTP & Mail Dispatch | ตั้งค่า SMTP ต่อบริษัท และส่งอีเมล Onboarding/กู้คืนรหัสผ่าน/แจ้งเตือน | SR03:002, SR06:004 | SmtpManager.php |
| UN03 — ข้อมูลหลัก (Master Data) | | | | |
| UN03.001 | Master – Warehouse / Storage / Bin | จัดการคลังสินค้า พื้นที่ และช่องจัดเก็บ พร้อมความจุ | SR03:003, SR08:002 | app/inventory/, WarehouseManager.php |
| UN03.002 | Master – Product & Category | จัดการหมวดสินค้า สินค้า หน่วยนับ และรูปสินค้า | SR03:003, SR08:002 | ProductManager.php |
| UN03.003 | Master – Contact | จัดการประเภทผู้ติดต่อ ลูกค้า และผู้ขาย | SR03:003, SR08:002 | app/contact/, ContactManager.php |
| UN03.004 | Master – Warehouse Layer Configuration | สลับโครงสร้างคลังแบบชั้นเดียว/หลายชั้นต่อบริษัท | SR03:003 | CompanySettingManager.php, WarehouseManager.php |
| UN04 — ควบคุมสินค้าคงคลัง (Inventory Control) | | | | |
| UN04.001 | ICS – Stock-in | รับสินค้าเข้าตามสินค้า จำนวน ตำแหน่ง เอกสารอ้างอิง สร้างความเคลื่อนไหวและยอดคงเหลือ | SR03:004, SR08:003 | app/ics/, StockManager.php, StockTablesTrait.php |
| UN04.002 | ICS – Stock-out | จ่ายสินค้าออกโดยตรวจสิทธิ์และยอดคงเหลือ ปฏิเสธจำนวนเกิน | SR03:004, SR09:003 | StockManager.php |
| UN04.003 | ICS – Stock Transfer | โอนย้ายระหว่างตำแหน่ง ต้นทาง/ปลายทางผูกเป็นรายการเดียว | SR03:004 | StockManager.php |
| UN04.004 | ICS – Lot / Serial / Expiry | บันทึกและสอบกลับ Lot, Serial Number, วันหมดอายุ | SR03:004, SR08:002 | StockSourceManager.php, md_lot |
| UN04.005 | ICS – Barcode Label & Scan | พิมพ์ฉลากบาร์โค้ด SKU/ตำแหน่ง และรับค่าจากเครื่องสแกน | SR03:004 | BarcodeManager.php, location_barcode_label.php |
| UN04.006 | ICS – File Attachment | แนบและเรียกดูไฟล์ที่อนุญาตในรายการที่รองรับ | SR03:004 | FileUploader.php |
| UN05 — ขาย (Sales) | | | | |
| UN05.001 | Sales – Quotation | สร้าง/แก้ไข/อนุมัติใบเสนอราคา และแปลงเป็นใบสั่งขาย | SR03:005, SR04:002 | app/order/, QuotationManager.php |
| UN05.002 | Sales – Sales Order | สร้างใบสั่งขาย ยืนยัน และตัดสต๊อกตามสถานะ | SR03:005, SR04:002 | OrderManager.php |
| UN05.003 | Sales – Invoice | ออกใบแจ้งหนี้จากใบสั่งขาย และบันทึก GL | SR03:005, SR04:002 | app/revenue/, InvoiceManager.php |
| UN05.004 | Sales – Return / Credit Note | รับคืนสินค้าและออกใบลดหนี้ พร้อมปรับสต๊อก/บัญชี | SR03:005, SR04:002 | ReturnManager.php |
| UN06 — จัดซื้อ (Purchasing) | | | | |
| UN06.001 | Purchasing – Purchase Request | สร้างและอนุมัติใบขอซื้อ | SR03:006 | app/po/, PurchaseRequestManager.php |
| UN06.002 | Purchasing – Purchase Order | แปลงใบขอซื้อเป็นใบสั่งซื้อ และติดตามสถานะ | SR03:006, SR04:002 | PurchaseOrderManager.php |
| UN06.003 | Purchasing – Purchase Invoice | บันทึกใบแจ้งหนี้ซื้อ รับสินค้าเข้า และบันทึก GL | SR03:006, SR04:002 | PurchaseOrderManager.php, StockManager.php |
| UN06.004 | Purchasing – Supplier Return | คืนสินค้าผู้ขาย พร้อมปรับสต๊อก/บัญชี | SR03:006, SR04:002 | SupplierReturnManager.php |
| UN07 — การเงิน (Finance) | | | | |
| UN07.001 | Finance – Receipt Billing & Receipt | วางบิลรับและบันทึกใบเสรจรับเงินผูกกับใบแจ้งหนี้ | SR03:007, SR04:002 | app/finance/, ReceiptBillingManager.php, ReceiptManager.php |
| UN07.002 | Finance – Payment Billing & Payment | วางบิลจ่ายและบันทึกใบสำคัญจ่ายผูกกับใบแจ้งหนี้ซื้อ | SR03:007, SR04:002 | PaymentBillingManager.php, PaymentManager.php |
| UN08 — บัญชี (Accounting) | | | | |
| UN08.001 | Accounting – Chart of Accounts / Departments / Formulas | จัดการผังบัญชี แผนก และสูตรบัญชีอัตโนมัติ | SR03:008, SR08:002 | app/accounting/, PostingManager.php |
| UN08.002 | Accounting – Journal & GL Posting | บันทึกสมุดรายวันและผ่านรายการ GL แบบสมดุลภายใน Transaction | SR03:008, SR09:003 | app/journal/, PostingManager.php |
| UN09 — รายงานและแดชบอร์ด (Reports & Dashboard) | | | | |
| UN09.001 | Reports – Dashboard & Aggregates | แดชบอร์ดคลังสินค้าและบัญชีจากตารางสรุปยอด | SR03:009, SR05:001, SR05:002 | app/dashboard/, app/ac_dashboard/, EtlStockManager.php |
| UN09.002 | Reports – Stock Reports | ภาพรวมสต๊อก, ความเคลื่อนไหว, ความจุ, สินค้าใกล้หมด, หมดอายุ, Lot | SR03:009 | app/reports/, ReportManager.php |
| UN09.003 | Reports – Financial Reports | งบทดลอง, งบกำไรขาดทุน, งบดุล, VAT, สมุดรายวัน, ความเคลื่อนไหว GL | SR03:009 | ReportManager.php |
| UN09.004 | Reports – Filter / Print / Export | กรอง ดู พิมพ์ และส่งออกรายงานตามขอบเขตสิทธิ์ | SR03:009, SR04:003 | app/reports/ |
| UN10 — ควบคุมเอกสาร (Document Control) | | | | |
| UN10.001 | Document – Numbering | ออกเลขที่เอกสารตามลำดับที่กำหนด (document_number_sequences) | SR03:010, SR04:005, SR08:004 | DocumentNumberManager.php |
| UN10.002 | Document – Lifecycle & Status | ควบคุมสถานะเอกสาร ปฏิเสธการเปลี่ยนสถานะที่ไม่ถูกต้อง พร้อม Confirm Dialog และข้อความข้อผิดพลาด | SR03:010, SR09:001, SR09:002 | BatchActionManager.php, Manager classes |
| UN10.003 | Document – Audit Fields & History | บันทึกผู้สร้าง ผู้แก้ไข วันที่ และประวัติรายการ | SR03:010, SR09:001 | td_* tables, td_bin_log |
| UN11 — แจ้งเตือนและงานตามกำหนดเวลา (Notification & Scheduler) | | | | |
| UN11.001 | Node – Socket.IO Notification Server | รับเหตุการณ์จาก PHP ผ่าน Endpoint ที่ป้องกันด้วย Secret และส่งต่อไปยัง Browser ของผู้ใช้ที่เกี่ยวข้อง | SR03:011, SR04:004, SR06:004, SR06:005 | nodejs/server.js |
| UN11.002 | Node – Scheduler (ETL & Alerts) | สรุปยอดสต๊อก/GL, แจ้งเตือนสินค้าใกล้หมดและใบแจ้งหนี้ค้างชำระ ตามกำหนดเวลา Asia/Bangkok | SR03:011, SR05:002, SR01:006 | nodejs/scheduler.js, app/cron/ |
| UN12 — ความปลอดภัยและการแยกข้อมูล (Security & Tenant Scope) | | | | |
| UN12.001 | Security – Tenant Scope Guard | จำกัดทุก Query และ Action ให้อยู่ในบริษัท/คลังที่ผู้ใช้ได้รับอนุญาต | SR04:001, SR04:003, SR07:002 | StockTablesTrait.php, Manager classes |
| UN12.002 | Security – Server-side Validation | ตรวจสอบข้อมูลนำเข้า, Prepared Statements, Escape Output ป้องกัน SQLi/XSS | SR07:002, SR07:004 | Manager classes, app/assets/utils/ |
| UN12.003 | Security – Operation Lock & Usage Guard | ล็อกช่วงเวลาผ่านรายการ และจำกัดโควตารายการต่อบริษัท | SR07:002, SR09:003 | OperationLockManager.php, UsageGuard.php |
| UN12.004 | Security – TLS & Secret Configuration | ค่าตั้งค่า TLS, NODE_EMIT_SECRET และ Secrets ที่สร้างตอนติดตั้ง | SR07:001, SR01:005 | docker/php/config.php.template, .env |
| UN13 — ติดตั้งและสำรองข้อมูล (Deployment & Backup) | | | | |
| UN13.001 | Deploy – setup.php Schema Installer | สร้างฐานข้อมูล wms/wms2 และตารางทั้งหมดในขั้นตอนเดียว | SR01:003, SR08:005, SR06:001 | setup.php, docker/mariadb/init-wms2.sql |
| UN13.002 | Deploy – Docker Compose Stack | Container php-apache, mariadb, node/pm2 พร้อม Entrypoint สร้าง config.php | SR02:005, SR01:003 | docker-compose.yml, docker/ |
| UN13.003 | Deploy – .env Generator | สร้าง .env และความลับอัตโนมัติ ไม่เก็บใน Git | SR01:005 | docker/init-env.sh, .env.example |
| UN13.004 | Deploy – Backup & Restore | สำรอง Git 2 Remote, mysqldump รายวัน, ขั้นตอนกู้คืน | SR01:003 | Product Operation Guide, backup remote |
## ผู้จัดทำเอกสาร (Secretary)
| ชื่อ | ตำแหน่ง | ลายเซ็น | วันที่ |
| --- | --- | --- | --- |
| คุณนพพงษ์ เจริญสุข | System Analyst | | |
## ผู้ตรวจสอบเอกสาร (Reviewer)
| ชื่อ | ตำแหน่ง | ลายเซ็น | วันที่ |
| --- | --- | --- | --- |
| คุณเยาวลักษณ์ บางชมภู | Document Control | | |
## ผู้อนุมัติ (Approval)
| ชื่อ | ตำแหน่ง | ลายเซ็น | วันที่ |
| --- | --- | --- | --- |
| คุณเสรี วิริยะสกุลธรณ์ | Project Sponsor | | |
@@ -1,121 +0,0 @@
# Software Design
| Document field | Value |
|---|---|
| Document | Software Design |
| Project | BRN WMS |
| Project code | 200-WMS-26-001-00 |
| Title | System Design Document |
| Project period | 05/01/26–24/08/26 |
| Release | 17/08/26 V1.0 |
| Standard | ISO/IEC 29110 Basic Profile |
| Organizer | Apirach Supattaratpateep (Project Manager), Noppong Chareunsook (System Analyst), Thanakorn Sathitwitayakul (Developer) |
| Recorder | Thanakorn Sathitwitayakul — Developer |
| Status | Final — describes the as-built architecture; from the current codebase |
## Basis
This design was derived from the current repository structure and class list rather than authored before implementation. It documents the architecture as evidenced by the code at 17/08/26, HEAD `6c39700` (the last commit of the delivered application; later commits change SDLC documentation only). Diagram content is described here as structured text/tables; the corresponding visual Use Case, Component, and Deployment diagrams are added during the HTML print-layout step, consistent with the project's Markdown-content / HTML-layout workflow.
## HIGH LEVEL DESIGN
### Use case actors and actions
| Actor | Description | Representative actions |
|---|---|---|
| Owner | Company owner; highest-privilege role within a company | Full access to configuration, users, and all operational modules within the company |
| Admin | Administrative user within a company | Manage company settings, users, application access, and all operational modules |
| Staff | Operational user | Perform warehouse, sales, purchasing, and finance transactions within permitted scope |
| Viewer | Read-only user | View authorized screens and reports without creating/editing transactions |
| System (Node.js scheduler) | Automated actor | Executes scheduled stock/GL aggregate maintenance and low-stock/overdue-invoice alerts |
| Email/SMTP service | External actor | Delivers onboarding, password-reset, and notification email sent by the application |
### Component layers
| Layer | Composition | SR reference |
|---|---|---|
| Presentation | PHP page views under each `app/<module>/` directory; responsive UI; `app/assets/js/custom.js` and supporting JS/CSS | SR02:002, SR06:002, SR06:003 |
| Business logic | 31 manager/service classes plus one shared trait (32 files) in `app/assets/utils/classes/` (Section "Software Unit" below), invoked from page controllers | SR02:003, SR03:001–SR03:011 |
| Data access | Manager classes query two MariaDB databases directly (no separate ORM layer); `StockTablesTrait` centralizes shared stock-table access patterns | SR02:004, SR06:001, SR08:001–SR08:005 |
| Real-time/scheduled services | Node.js `server.js` (Socket.IO notification relay) and `scheduler.js` (cron-style aggregate/alert jobs), managed by pm2 (`ecosystem.config.js`) | SR03:011, SR06:004, SR06:005 |
| External integration | SMTP email delivery (`SmtpManager`); browser Socket.IO client for real-time notifications | SR06:004, SR06:005 |
### Deployment tiers
| Tier | Composition | SR reference |
|---|---|---|
| Client | Browser (Chrome/Edge/Firefox), responsive UI, Socket.IO client connection | SR06:002, SR06:003, SR06:005 |
| Web tier | PHP 8+ application; manual LAMP install (`setup.php`) or `docker/php` container (php-apache, config generated from `.env` at entrypoint) | SR01:003, SR02:005 |
| Data tier | MariaDB, two databases: `wms` (identity/company) and `wms2` (WMS/accounting); manual install or `docker/mariadb` container | SR06:001, SR08:001–SR08:004 |
| Real-time/scheduler tier | Node.js `server.js` + `scheduler.js` under pm2; manual install or `docker/node` container | SR03:011, SR06:004, SR06:005 |
| External | SMTP server (configured per company via `company_smtp`) | SR06:004 |
## Software Unit
One unit per business-logic manager class, plus the two Node.js services. Each unit's SR reference is its owning module in the SRS (Section SR03).
| ID | Description | Functional interfaces detail | SR reference |
|---|---|---|---|
| UN01 | `UserManager` | User CRUD, role assignment, application-access flags | SR03:001 |
| UN02 | `PasswordManager` | Password hashing (bcrypt), validation, change | SR03:001, SR01:004 |
| UN03 | `PasswordResetManager` | Forgot-password token issuance and reset flow | SR03:001 |
| UN04 | `CompanyProfileManager` | Company profile CRUD | SR03:002 |
| UN05 | `CompanySettingManager` | Company-level system settings | SR03:002 |
| UN06 | `SmtpManager` | Per-company SMTP configuration and mail dispatch | SR03:002, SR06:004 |
| UN07 | `WarehouseManager` | Warehouse/storage/bin master data and capacity/occupancy | SR03:003, SR03:004 |
| UN08 | `ProductManager` | Product and product-category master data | SR03:003 |
| UN09 | `ContactManager` | Contact type and contact master data | SR03:003 |
| UN10 | `StockManager` | Stock-in/out/transfer, lot/serial/expiry, balances | SR03:004 |
| UN11 | `StockSourceManager` | Stock source/traceability resolution | SR03:004 |
| UN12 | `StockTablesTrait` | Shared stock-table query/aggregation logic reused by stock-facing managers | SR03:004 |
| UN13 | `BarcodeManager` | SKU/location barcode label generation and scan handling | SR03:004 |
| UN14 | `EtlStockManager` | Stock aggregate (ETL) table maintenance | SR03:009, SR05:002 |
| UN15 | `QuotationManager` | Quotation lifecycle | SR03:005 |
| UN16 | `OrderManager` | Sales-order lifecycle | SR03:005 |
| UN17 | `InvoiceManager` | Sales-invoice lifecycle | SR03:005 |
| UN18 | `ReturnManager` | Sales-return / credit-note lifecycle | SR03:005 |
| UN19 | `PurchaseRequestManager` | Purchase-request lifecycle | SR03:006 |
| UN20 | `PurchaseOrderManager` | Purchase-order lifecycle | SR03:006 |
| UN21 | `SupplierReturnManager` | Supplier-return lifecycle | SR03:006 |
| UN22 | `ReceiptBillingManager` | Receipt billing lifecycle | SR03:007 |
| UN23 | `ReceiptManager` | Receipt lifecycle | SR03:007 |
| UN24 | `PaymentBillingManager` | Payment billing lifecycle | SR03:007 |
| UN25 | `PaymentManager` | Payment lifecycle | SR03:007 |
| UN26 | `PostingManager` | Chart of accounts, account formulas, journal, GL posting | SR03:008 |
| UN27 | `ReportManager` | Operational and financial report generation | SR03:009 |
| UN28 | `DocumentNumberManager` | Controlled document-number sequence generation | SR03:010 |
| UN29 | `BatchActionManager` | Bulk/batch record operations | SR02:003 |
| UN30 | `OperationLockManager` | Posting-window / operation-lock enforcement | SR07:002, SR09:003 |
| UN31 | `UsageGuard` | Company usage-package/transaction-quota enforcement | SR07:002 |
| UN32 | `FileUploader` | Supported file-attachment upload handling | SR03:004 |
| UN33 | `nodejs/server.js` | Socket.IO real-time notification relay | SR03:011, SR06:005 |
| UN34 | `nodejs/scheduler.js` | Scheduled stock/GL aggregate maintenance and low-stock/overdue-invoice alerts | SR03:011, SR05:002 |
## User Interface Design
The delivered UI is an implemented, responsive PHP application (login, dashboard, warehouse/inventory, sales, purchasing, finance, accounting, reports, settings). Because the UI already exists as running screens rather than pre-implementation mockups, wireframe capture is not reproduced here; representative screenshots are added during the HTML print-layout step where useful, consistent with the Software User Documentation (work product 18), which documents actual screens.
## Approval
### Prepared by
Name: Thanakorn Sathitwitayakul
Role: Developer
Signature: ______________________________________________
Date: ___________________________________________________
### Reviewed by
Name: Apirach Supattaratpateep
Role: Project Manager
Signature: ______________________________________________
Date: ___________________________________________________
### Reviewed and authorized by
Name: Seri Viriyasakultorn
Project roles: Project Sponsor / Customer Representative / Authorized Approver
Position: Managing Director
Company: B.R.N. Enterprise Co., Ltd.
Signature: ______________________________________________
Date: ___________________________________________________