260224:1606 20260224:1600 V1.8.0
All checks were successful
Build and Deploy / deploy (push) Successful in 6m25s
All checks were successful
Build and Deploy / deploy (push) Successful in 6m25s
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# 📝 **Documents Management System Version 1.6.1: แนวทางการพัฒนา FullStackJS**
|
||||
|
||||
**สถานะ:** first-draft
|
||||
**วันที่:** 2025-12-17
|
||||
**สถานะ:**
|
||||
**วันที่:** 2026-02-24
|
||||
**อ้างอิง:** Requirements Specification v1.8.0
|
||||
**Classification:** Internal Technical Documentation
|
||||
|
||||
@@ -380,7 +380,7 @@ Unified Workflow Engine (Core Architecture)
|
||||
|
||||
### **3.10 สถาปัตยกรรมระบบ (System Architecture)**
|
||||
|
||||
โครงสร้างโมดูล (Module Structure) อ้างถึง Backend Development Plan v1.4.5
|
||||
โครงสร้างโมดูล (Module Structure) อ้างถึง Backend Development Plan v1.8.0
|
||||
|
||||
### **3.11 กลยุทธ์ความทนทานและการจัดการข้อผิดพลาด (Resilience & Error Handling Strategy)**
|
||||
|
||||
@@ -706,7 +706,7 @@ export function QueryProvider({ children }: { children: React.ReactNode }) {
|
||||
|
||||
สำหรับ Next.js App Router เราจะใช้ State Management แบบ Simplified โดยแบ่งเป็น 3 ระดับหลัก:
|
||||
|
||||
- 4.10.ๅ. **Server State (สถานะข้อมูลจากเซิร์ฟเวอร์)**
|
||||
- 4.10.1. **Server State (สถานะข้อมูลจากเซิร์ฟเวอร์)**
|
||||
|
||||
- **เครื่องมือ:** **TanStack Query (React Query)**
|
||||
- **ใช้เมื่อ:** จัดการข้อมูลที่ดึงมาจาก NestJS API ทั้งหมด
|
||||
@@ -722,13 +722,12 @@ export function QueryProvider({ children }: { children: React.ReactNode }) {
|
||||
|
||||
- 4.10.3. **UI State (สถานะ UI ชั่วคราว):**
|
||||
|
||||
- **เครื่องมือ:** **useState**, **useReducer** (ใน Component)
|
||||
- **ใช้เมื่อ:** จัดการสถานะเฉพาะ Component
|
||||
- **ครอบคลุม:** Modal เปิด/ปิด, Dropdown state, Loading states
|
||||
- **เครื่องมือ:** **useState**, **useReducer** (ใน Component) หรือ **Zustand** (สำหรับ Global Client State เช่น Preferences, Auth)
|
||||
- **ใช้เมื่อ:** จัดการสถานะเฉพาะ Component หรือข้อมูลที่แชร์ทั้งแอปโดยไม่พึ่งพาเซิร์ฟเวอร์
|
||||
- **ครอบคลุม:** Modal เปิด/ปิด, Dropdown state, Loading states, Themes, Sidebar
|
||||
|
||||
- **ยกเลิกการใช้:**
|
||||
|
||||
- ❌ Zustand (ไม่จำเป็น เนื่องจากใช้ React Query และ React Hook Form)
|
||||
- ❌ Context API สำหรับ Server State (ใช้ React Query แทน)
|
||||
|
||||
- **ตัวอย่าง Implementation:**
|
||||
@@ -1082,9 +1081,9 @@ Views เหล่านี้ทำหน้าที่เป็นแหล
|
||||
|
||||
## **Document Control:**
|
||||
|
||||
- **Document:** FullStackJS v1.6.1
|
||||
- **Version:** 1.6
|
||||
- **Date:** 2025-12-17
|
||||
- **Document:** FullStackJS v1.8.0
|
||||
- **Version:** 1.8
|
||||
- **Date:** 2026-02-24
|
||||
- **Author:** NAP LCBP3-DMS & Gemini
|
||||
- **Status:** first-draft
|
||||
- **Classification:** Internal Technical Documentation
|
||||
@@ -1092,4 +1091,4 @@ Views เหล่านี้ทำหน้าที่เป็นแหล
|
||||
|
||||
---
|
||||
|
||||
`End of FullStackJS Guidelines v1.6.1`
|
||||
`End of FullStackJS Guidelines v1.8.0`
|
||||
|
||||
@@ -463,7 +463,7 @@ async approve(@Param('id') id: string, @CurrentUser() user: User) {
|
||||
## 📚 เอกสารอ้างอิง
|
||||
|
||||
- [FullStack Guidelines](05-01-fullstack-js-guidelines.md)
|
||||
- [Backend Plan v1.4.5](../02-Architecture/02-02-software-architecture.md)
|
||||
- [Backend Plan v1.8.0](../02-Architecture/02-02-software-architecture.md)
|
||||
- [Data Dictionary](../03-Data-and-Storage/03-01-data-dictionary.md)
|
||||
- [Workflow Engine Plan](../01-Requirements/01-03-modules/README.md)
|
||||
|
||||
|
||||
@@ -192,8 +192,8 @@ export function useCreateCorrespondence() {
|
||||
await queryClient.cancelQueries({ queryKey: ['correspondences'] });
|
||||
const previous = queryClient.getQueryData(['correspondences']);
|
||||
|
||||
queryClient.setQueryData(['correspondences'], (old: any) => [
|
||||
...old,
|
||||
queryClient.setQueryData(['correspondences'], (old: Correspondence[] | undefined) => [
|
||||
...(old || []),
|
||||
newCorrespondence,
|
||||
]);
|
||||
|
||||
@@ -272,9 +272,9 @@ import { persist } from 'zustand/middleware';
|
||||
|
||||
// Draft Store (with localStorage persistence)
|
||||
interface DraftStore {
|
||||
drafts: Record<string, any>;
|
||||
saveDraft: (formKey: string, data: any) => void;
|
||||
loadDraft: (formKey: string) => any;
|
||||
drafts: Record<string, unknown>;
|
||||
saveDraft: (formKey: string, data: Record<string, unknown>) => void;
|
||||
loadDraft: (formKey: string) => Record<string, unknown> | undefined;
|
||||
clearDraft: (formKey: string) => void;
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
interface DynamicFormProps {
|
||||
schemaName: string;
|
||||
onSubmit: (data: any) => void;
|
||||
onSubmit: (data: Record<string, unknown>) => void;
|
||||
}
|
||||
|
||||
export function DynamicForm({ schemaName, onSubmit }: DynamicFormProps) {
|
||||
@@ -442,7 +442,7 @@ export function DynamicForm({ schemaName, onSubmit }: DynamicFormProps) {
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
|
||||
{Object.entries(schema.schema_definition.properties).map(
|
||||
([key, prop]: [string, any]) => (
|
||||
([key, prop]: [string, Record<string, unknown>]) => (
|
||||
<FormField
|
||||
key={key}
|
||||
control={form.control}
|
||||
@@ -466,7 +466,7 @@ export function DynamicForm({ schemaName, onSubmit }: DynamicFormProps) {
|
||||
}
|
||||
|
||||
// Helper function to render different field types
|
||||
function renderFieldByType(type: string, field: any) {
|
||||
function renderFieldByType(type: string, field: Record<string, unknown>) {
|
||||
switch (type) {
|
||||
case 'string':
|
||||
return <Input {...field} />;
|
||||
@@ -643,7 +643,7 @@ test.describe('Correspondence Workflow', () => {
|
||||
## 📚 เอกสารอ้างอิง
|
||||
|
||||
- [FullStack Guidelines](05-01-fullstack-js-guidelines.md)
|
||||
- [Frontend Plan v1.4.5](../02-Architecture/02-02-software-architecture.md)
|
||||
- [Frontend Plan v1.8.0](../02-Architecture/02-02-software-architecture.md)
|
||||
- [Next.js Documentation](https://nextjs.org/docs)
|
||||
- [TanStack Query](https://tanstack.com/query)
|
||||
- [shadcn/ui](https://ui.shadcn.com)
|
||||
|
||||
@@ -1232,7 +1232,7 @@ describe('[ClassName/FeatureName]', () => {
|
||||
- [Backend Guidelines](05-02-backend-guidelines.md) - Backend development standards
|
||||
- [Frontend Guidelines](05-03-frontend-guidelines.md) - Frontend development standards
|
||||
- [System Architecture](../02-Architecture/02-01-system-context.md) - System overview
|
||||
- [API Design](../02-architecture/02-02-api-design.md) - API specifications
|
||||
- [API Design](../02-Architecture/02-04-api-design.md) - API specifications
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
| Attribute | Value |
|
||||
| ------------------ | -------------------------------- |
|
||||
| **Version** | 1.7.0 |
|
||||
| **Version** | 1.8.0 |
|
||||
| **Status** | Active |
|
||||
| **Last Updated** | 2025-12-18 |
|
||||
| **Last Updated** | 2026-02-24 |
|
||||
| **Owner** | Nattanin Peancharoen |
|
||||
| **Classification** | Internal Technical Documentation |
|
||||
|
||||
@@ -20,12 +20,18 @@
|
||||
|
||||
## 📚 Table of Contents
|
||||
|
||||
- [หลักการพัฒนาหลัก (Core Principles)](#-หลักการพัฒนาหลัก-core-principles)
|
||||
- [คู่มือการพัฒนา (Implementation Guides)](#-คู่มือการพัฒนา-implementation-guides)
|
||||
- [มาตรฐานการเขียนโปรแกรม (Coding Standards)](#-มาตรฐานการเขียนโปรแกรม-coding-standards)
|
||||
- [Technology Stack Recap](#-technology-stack-recap)
|
||||
- [Testing Strategy](#-testing-strategy)
|
||||
- [Related Documents](#-related-documents)
|
||||
- [🛠️ Implementation Specification](#️-implementation-specification)
|
||||
- [📊 Document Status](#-document-status)
|
||||
- [📚 Table of Contents](#-table-of-contents)
|
||||
- [🎯 หลักการพัฒนาหลัก (Core Principles)](#-หลักการพัฒนาหลัก-core-principles)
|
||||
- [📖 คู่มือการพัฒนา (Implementation Guides)](#-คู่มือการพัฒนา-implementation-guides)
|
||||
- [1. FullStack JS Guidelines](#1-fullstack-js-guidelines)
|
||||
- [2. Backend Guidelines](#2-backend-guidelines)
|
||||
- [3. Frontend Guidelines](#3-frontend-guidelines)
|
||||
- [4. Document Numbering System](#4-document-numbering-system)
|
||||
- [🧪 Testing Strategy](#-testing-strategy)
|
||||
- [🛠️ Technology Stack Recap](#️-technology-stack-recap)
|
||||
- [🔗 Related Documents](#-related-documents)
|
||||
|
||||
---
|
||||
|
||||
@@ -44,7 +50,7 @@
|
||||
## 📖 คู่มือการพัฒนา (Implementation Guides)
|
||||
|
||||
### 1. [FullStack JS Guidelines](./05-01-fullstack-js-guidelines.md)
|
||||
**แนวทางการพัฒนาภาพรวมทั้งระบบ (v1.7.0)**
|
||||
**แนวทางการพัฒนาภาพรวมทั้งระบบ (v1.8.0)**
|
||||
- โครงสร้างโปรเจกต์ (Monorepo-like focus)
|
||||
- Naming Conventions & Code Style
|
||||
- Secrets & Environment Management
|
||||
@@ -67,7 +73,7 @@
|
||||
- React Hook Form + Zod for Client Validation
|
||||
- API Client Interceptors (Auth & Idempotency)
|
||||
|
||||
### 4. [Document Numbering System](./../01-Requirements/business-rules/01-02-02-doc-numbering-rules.md)
|
||||
### 4. [Document Numbering System](../01-Requirements/business-rules/01-02-02-doc-numbering-rules.md)
|
||||
**รายละเอียดการนำระบบออกเลขที่เอกสารไปใช้งาน**
|
||||
- Table Schema: Templates, Counters, Audit
|
||||
- Double-Lock Strategy (Redis Redlock + Database VersionColumn)
|
||||
@@ -101,19 +107,18 @@
|
||||
|
||||
## 🔗 Related Documents
|
||||
|
||||
- 📋 [Requirements Specification](../01-requirements/README.md)
|
||||
- 🏗️ [Architecture Specification](../02-architecture/README.md)
|
||||
- 📋 [Requirements Specification](../01-Requirements/README.md)
|
||||
- 🏗️ [Architecture Specification](../02-Architecture/README.md)
|
||||
- 🚀 [Operations Specification](../04-Infrastructure-OPS/README.md)
|
||||
- 🎯 [Active Tasks](../06-tasks/README.md)
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
**LCBP3-DMS Implementation Specification v1.7.0**
|
||||
**LCBP3-DMS Implementation Specification v1.8.0**
|
||||
|
||||
[FullStack](./05-01-fullstack-js-guidelines.md) • [Backend](./05-02-backend-guidelines.md) • [Frontend](./05-03-frontend-guidelines.md) • [Testing](./05-04-testing-strategy.md)
|
||||
|
||||
[Main README](../../README.md) • [Architecture](../02-architecture/README.md) • [Requirements](../01-requirements/README.md)
|
||||
[Main README](../../README.md) • [Architecture](../02-Architecture/README.md) • [Requirements](../01-Requirements/README.md)
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user