fix template, remove okr, use casan.*

This commit is contained in:
thanhnv
2026-07-18 16:45:31 +07:00
parent 0dfd1742d3
commit 13fae3e6c3
249 changed files with 4881 additions and 5702 deletions
@@ -1,11 +1,14 @@
# BD-MOD-01 OKR Management
# Business Design — OKR Web Application
## Screen Layout
- SCR-00 Login: centered sign-in form without sidebar.
- SCR-01 Dashboard: fixed sidebar, fixed header, filter bar, OKR list.
- SCR-02 Detail: objective overview, tabs, key result list.
- SCR-03 Create Objective: title, description, owner, quarter, save.
- SCR-04 Key Result Detail: current progress, progress input, comment, save.
- SCR-00: Login Screen
- SCR-01: Dashboard / OKR List (Left Navigation + List)
- SCR-02: OKR Detail Screen
- SCR-03: Create / Edit Objective
- SCR-04: Key Result Detail / Update
## User Journeys
Each functional requirement must have a normal flow, validation failure, authorization failure where applicable, and observable completion state.
## API Boundary
Frontend calls backend only through src/lib/api.ts and uses cookie/JWT auth.
Network and data boundaries must follow docs/technical_architecture.md. UI components may not bypass the approved API client boundary.
@@ -1,10 +1,14 @@
# DD-MOD-01 OKR Management
# Detail Design — OKR Web Application
## Backend Design
Controllers are thin and call AuthService, UsersService, ObjectivesService, KeyResultsService. PrismaService is the only database access layer.
## Component Design
- apps/okr/backend: owns only responsibilities assigned by the approved architecture.
- apps/okr/frontend: owns only responsibilities assigned by the approved architecture.
## Authorization
JwtAuthGuard verifies Bearer/cookie token. Employees are constrained to ownerId == user.sub. Managers/Admins read all objectives.
## Authorization and Validation
Every entry point validates input, authenticates identity where required, authorizes the resource, and emits safe errors before side effects.
## Progress Calculation
KeyResultsService updates progress in a transaction, writes ProgressUpdate, then recalculates objective status.
## Data and Transaction Design
Persistence, transaction boundaries, concurrency, idempotency, and failure recovery must trace to the data model and requirement IDs.
## Observability
Record correlation IDs, safe structured events, latency, failures, and governance evidence without secrets or sensitive payloads.
@@ -1,28 +1,20 @@
# SRS-MOD-01 OKR Management
## TABLE OF CONTENTS
- [1. Purpose](#1-purpose)
- [2. Scope](#2-scope)
- [3. Functional Requirements](#3-functional-requirements)
- [4. Non Functional Requirements](#4-non-functional-requirements)
# SRS — OKR Web Application
## 1. Purpose
Hệ thống quản lý OKR hỗ trợ đăng nhập, tạo Objective, tạo Key Result, cập nhật tiến độ và dashboard theo tài liệu yêu cầu.
Deliver OKR Web Application from the approved requirement and architecture without inventing product behavior.
## 2. Scope
Module bao gồm SCR-00 đến SCR-04, ba vai trò Admin, Manager, Employee, và dữ liệu User, Objective, Key Result.
Feature 001-okr-web-app; module MOD-01; project okr.
## 3. Functional Requirements
- FR-01 Login: xác thực username/password và phát hành JWT.
- FR-02 Create Objective: tạo Objective có title, description, owner, quarter.
- FR-03 Create Key Result: tạo Key Result gắn với Objective.
- FR-04 Update Progress: cập nhật progress 0-100 và ghi lịch sử cập nhật.
- FR-05 Dashboard: hiển thị danh sách OKR theo quyền truy cập.
- FR-01 | Login | Người dùng đăng nhập
- FR-02 | Create Objective | Tạo Objective
- FR-03 | Create Key Result | Tạo KR
- FR-04 | Update Progress | Cập nhật tiến độ
- FR-05 | Dashboard | Hiển thị OKR
## 4. Non Functional Requirements
- Authentication required.
- API response target dưới 2 giây.
- SQLite được chọn cho kiểm thử không cần Docker.
Architecture constraints are authoritative. Security, validation, traceability, build, test, rollback, and evidence gates are mandatory.
## Metrics
Functional requirements extracted: 5.
Functional requirements extracted: 5. Screens extracted: 5.
@@ -1,8 +1,8 @@
# Test Cases MOD-01
# Test Cases — MOD-01
- TC-01 login rejects wrong password.
- TC-02 employee list returns only own objectives.
- TC-03 manager list returns all seeded objectives.
- TC-04 invalid objective payload returns 400.
- TC-05 progress patch updates a key result and stores progress.
- TC-06 golden manager objective response fails on drift.
- TC-01 FR-01: normal, boundary, invalid, unauthorized, and persistence/effect assertions.
- TC-02 FR-02: normal, boundary, invalid, unauthorized, and persistence/effect assertions.
- TC-03 FR-03: normal, boundary, invalid, unauthorized, and persistence/effect assertions.
- TC-04 FR-04: normal, boundary, invalid, unauthorized, and persistence/effect assertions.
- TC-05 FR-05: normal, boundary, invalid, unauthorized, and persistence/effect assertions.
- TC-06 Golden regression fails on approved-output drift.