Files
ksif-manage-front/.agent/project.md

89 lines
4.0 KiB
Markdown

# Frontend Project Rules
- After every `.agent/project.md` change, run `cd "D:\_____Dev\_________AgentHarnessBase"`, then `.\scripts\agent-harness.ps1 compose --project ksif-manage-front` and `.\scripts\agent-harness.ps1 verify --project ksif-manage-front` to keep the generated agent documents current and verified.
## 1. Scope
Project-specific rules for the Sejong Institute dashboard frontend. Follow the approved screen design and backend API contract. Do not invent undefined permissions, fields, APIs, or calculation rules. Reuse the existing authentication implementation.
## 2. User Roles
- `1001`, `2001` → Admin
- `3001` → Center
- Center users may access only their own `center_cd` scope.
- Backend authorization based on the authenticated user is authoritative. Do not allow Center users to query another Center by changing `center_cd`.
- Do not expose Admin-only create/update/delete actions to Center users.
## 3. Notice / Popup Targeting
```text
0 center mappings → All Centers
1+ center mappings → Mapped Centers only
```
Admin UI must support `All` or selected Centers. Do not introduce a separate `is_all` concept.
## 4. Q&A
```text
Question 1 : Answer 0..1
```
- A question can have at most one answer.
- Do not implement multiple answers, comments, or threaded replies.
- When a Center user first opens a question detail containing an answer, the backend updates the answer-view status.
- Reflect the state returned by the backend.
## 5. File Upload
Applies to Notice, Q&A Question, and Q&A Answer:
- Maximum 5 files
- Maximum 5 MB per file
- `.exe` is not allowed
- Validate on the frontend for UX; backend validation is authoritative.
- Keep question attachments and answer attachments separate.
- Physical file paths are a backend concern.
## 6. Pagination
- Use the existing company pagination module.
- Do not implement another pagination system.
- Preserve search/filter/page state when returning from detail/edit/delete where practical.
## 7. Report Header
Multi-level headers use:
```text
report_header_group
→ variable_group
→ variable_name
→ report_header_label
```
- Use `report_header_order` for column order.
- Do not infer display order from IDs or alphabetical sorting.
- Merge adjacent identical headers using `rowSpan` / `colSpan`.
- `7-point` and `100-point` are fixed child display values under one logical report header, not separate report headers.
- Backend calculates both values; frontend only renders them.
## 8. Progress Report
- Backend calculates Progress Report values in real time from the external survey DB.
- Do not implement survey calculations or 7-point/100-point conversion in the frontend.
- Center users can view only their own Center.
- Implement Admin filters only when defined by the approved screen/API.
## 9. Final Report
- Final Report values are pre-calculated and stored before display.
- Frontend must not recalculate them.
- Build the screen from report header/result data returned by the backend.
## 10. Excel Download
- Export must use the **current screen query/filter conditions**.
- Send the same active conditions with the download request.
- Backend generates the Excel file; frontend uses the existing common download utility.
## 11. Common Rules
- Build screens from API DTOs; do not expose DB structures directly.
- Backend is authoritative for permissions, Center scope, Notice/Popup eligibility, Q&A access, and report calculations.
- Follow backend soft-delete behavior; do not manipulate deletion DB fields directly.
- Reuse existing common HTTP/Auth/Error/File Download modules.
- Do not add features not present in the approved screen design.
## 12. Open Decisions
Do not invent behavior for unresolved items:
- Detailed permission differences between Admin roles `1001` and `2001`
- Final API endpoints and request/response field names
- Exact Admin report filters
- Rich Text Editor / HTML sanitization policy
- Numeric rounding/display rules not defined by the backend
Check existing code and screen design first. If still unclear, ask the user before implementation.