Service Report #007 New
Date: 2026-01-13
This service report is currently under development and not ready for testing. For the latest MoM (2026-01-06), please check Service Report #006 instead.
Feature Overview
| # | Feature | Issue | Type | Status |
|---|---|---|---|---|
| 1 | Project Settings Create Button Fix | Internal | Bug Fix | 🔍 In Review |
| 2 | Project Settings Role Comparison Docs | Internal | Documentation | 🔍 In Review |
| 3 | Version Centralization | Internal | Enhancement | 🔍 In Review |
| 4 | User Invitation Flow | Internal | Enhancement | 🔍 In Review |
| 5 | Project Registration Optional Commands | Internal | Enhancement | 🔍 In Review |
1. Project Settings Create Button Fix
Source: Internal Request Thai Name: แก้ไขปุ่ม "สร้าง" ในหน้า Project Settings ให้ตรงกับ Worker Registry
Description: Fixed the Create button styling in Project Settings to match the Worker Registry pattern. The button was using mat-button (text button) instead of mat-flat-button (filled green button).
Location: Tools > กำหนดค่า > Project Settings > List View
Before/After
| Before | After |
|---|---|
mat-button (text only, no background) | mat-flat-button (green background) |
| No icon | add icon |
Files Modified
| File | Change |
|---|---|
project-setting-list-toolbar.component.ts | Added MatIconModule import, changed to mat-flat-button with add icon |
.claude/rules/angular.md | Added "Create Button Standard (List Toolbar)" section |
Golden Rule Added
A new golden rule was added to Angular guidelines for consistent create button styling:
| Element | Value |
|---|---|
| Directive | mat-flat-button (green background) |
| Icon | add |
| i18n Key | @@common.create or feature-specific |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Open Project Settings → Verify green "สร้าง" button with add icon | ⌛ Pending |
| 2 | Compare with Worker Registry → Buttons should look identical | ⌛ Pending |
2. Project Settings Role Comparison Docs
Source: Internal Request Thai Name: เพิ่มเอกสารเปรียบเทียบสิทธิ์ระหว่าง Purchasing และ Work Owner
Description: Added detailed role comparison documentation for Project Settings feature, clarifying the differences between Purchasing and Work Owner roles.
Location: Docs Site > Features > Project Settings
Role Comparison Summary
| Capability | Purchasing | Work Owner |
|---|---|---|
| View all projects | ✅ | ✅ |
| Create new projects | ✅ | ❌ |
| Edit all projects | ✅ | ❌ (own only) |
| Delete projects | ✅ | ❌ |
| Edit PO fields (PO.No, Duration, Period) | ✅ | ❌ (read-only) |
| Edit PR.No | ✅ | ✅ |
Work Owner Restrictions
| Restriction | Description |
|---|---|
| No Create button | Button is hidden for Work Owner role |
| Edit own projects only | Cannot edit projects owned by others |
| PO fields read-only | PO.No, Duration, Period are disabled |
| No Delete action | Delete option is not available |
| PR.No is editable | This is the only PO-related field Work Owner can edit |
Files Modified
| File | Change |
|---|---|
docs/docs/features/project-setting.md | Added "Role Comparison: Purchasing vs Work Owner" section |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | View documentation at Features > Project Settings | ⌛ Pending |
| 2 | Verify role comparison table is accurate | ⌛ Pending |
3. Version Centralization
Source: Internal Request Thai Name: รวมศูนย์การจัดการ Version เป็นแหล่งเดียว
Description: Centralized version management to use frontend/package.json as the single source of truth. Previously, the version was duplicated in 5 environment files and hardcoded in the docs site.
Location: Frontend + Docs Site
Architecture
Single Source of Truth
↓
frontend/package.json (version: "2025.10.1.0-preview29")
↓
├─→ version.helper.ts → APP_VERSION constant
│ ↓
│ ├─→ about.component.ts
│ ├─→ login.component.ts
│ └─→ home.component.ts
│
└─→ docs/scripts/sync-version.js (prebuild hook)
↓
└─→ docs/docs/index.md (auto-updated)
Changes Summary
| Area | Before | After |
|---|---|---|
| package.json | 0.0.0 (unused) | 2025.10.1.0-preview29 |
| Environment files | appVersion in 5 files | Removed (using helper) |
| Components | environment.appVersion | APP_VERSION from helper |
| Docs index | Hardcoded version | Auto-synced from package.json |
| Service reports | Version lines in headers | Removed |
Files Created
| File | Description |
|---|---|
frontend/src/app/shared/helpers/version.helper.ts | Exports APP_VERSION from package.json |
docs/scripts/sync-version.js | Syncs version to docs index page |
Files Modified
| File | Change |
|---|---|
frontend/package.json | Updated version to 2025.10.1.0-preview29 |
frontend/tsconfig.json | Added resolveJsonModule: true |
frontend/src/environments/environment.ts | Removed appVersion |
frontend/src/environments/environment.dev.ts | Removed appVersion |
frontend/src/environments/environment.development.ts | Removed appVersion |
frontend/src/environments/environment.thaiscada.ts | Removed appVersion |
frontend/src/environments/environment.neosyntax.ts | Removed appVersion |
frontend/src/app/features/tools/about/about.component.ts | Use APP_VERSION |
frontend/src/app/features/auth/login/login.component.ts | Use APP_VERSION |
frontend/src/app/features/home/home.component.ts | Use APP_VERSION |
docs/package.json | Added sync-version, prestart, prebuild scripts |
docs/docs/service-reports/report-001.md | Removed version line |
docs/docs/service-reports/report-002.md | Removed version line |
docs/docs/service-reports/report-003.md | Removed version line |
docs/docs/service-reports/report-004.md | Removed version line |
docs/docs/service-reports/report-005.md | Removed version line |
docs/docs/service-reports/report-006.md | Removed version line |
Version Bump Process (New)
When bumping version:
- Update
frontend/package.jsonversion field (single source of truth) - Add new section to
docs/docs/release-notes.md - Docs index page updates automatically on build via
sync-version.js
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Build frontend → Verify About page shows correct version | ⌛ Pending |
| 2 | Build docs → Verify index page shows correct version | ⌛ Pending |
| 3 | Run npm run start in docs → Verify sync-version runs | ⌛ Pending |
| 4 | Change package.json version → Rebuild → Verify all updated | ⌛ Pending |
4. User Invitation Flow
Source: Internal Request Thai Name: ระบบเชิญผู้ใช้งานด้วยอีเมลที่กำหนดเอง (Thai/English)
Description: Custom invitation emails replacing Keycloak default emails. The application now controls the invitation email content with bilingual Thai/English support.
Location: User Settings > Send Invitation + /accept-invitation page
Architecture
Admin clicks "Send Invitation"
↓
Backend creates invitation token in DB (72h TTL)
↓
Backend sends custom bilingual email via Mailpit
↓
User clicks link → /accept-invitation?token=xxx
↓
User sets password → Keycloak account created
Files Created
| File | Description |
|---|---|
Domain/Users/UserInvitation.cs | Entity for invitation tokens |
Application/Contracts/IUserInvitationService.cs | Service interface |
Infrastructure/Services/UserInvitationService.cs | Service implementation |
WebApi/Features/Invitations/ValidateInvitationEndpoint.cs | GET /api/invitations/validate/{token} |
WebApi/Features/Invitations/AcceptInvitationEndpoint.cs | POST /api/invitations/accept |
assets/templates/emails/user-invitation.html | Bilingual email template |
frontend/src/app/features/auth/accept-invitation/* | Frontend components (3 files) |
Files Modified
| File | Change |
|---|---|
WebApi/Features/Users/SendInvitationEndpoint.cs | Use IUserInvitationService instead of Keycloak direct |
Infrastructure/Keycloak/KeycloakUserAdminService.cs | Added CreateAccountWithPasswordAsync() |
frontend/src/app/features/auth/auth.routes.ts | Added accept-invitation route |
frontend/src/locale/messages.json | Added acceptInvitation.* keys |
frontend/src/locale/messages.en.json | Added English translations |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Send invitation from User Settings | ⌛ Pending |
| 2 | Check Mailpit for bilingual email | ⌛ Pending |
| 3 | Click link → verify accept-invitation page | ⌛ Pending |
| 4 | Set password → login with new credentials | ⌛ Pending |
| 5 | Re-send invitation → verify old token invalidated | ⌛ Pending |
5. Project Registration Optional Commands
Source: Internal Request Thai Name: ข้ามขั้นตอน Purchasing Review เมื่อมีเลข PO
Description: Skip Purchasing review step when project already has a PO Number. This allows projects with existing PO to go directly to contractor without Purchasing review.
Location: Project Registration Workflow
Architecture
Project has PO Number?
↓ Yes ↓ No
Skip to Contractor → Go through Purchasing
(RequestPreWorkProcedures (ReviewProjectDataByPurchasing)
FormDirect)
Files Created
| File | Description |
|---|---|
Domain/Workflows/OptionalCommandConfig.cs | Configuration for optional commands |
Domain/Workflows/SkipConditionType.cs | Enum for skip conditions (HasPurchaseOrderNo, etc.) |
Application/Contracts/ISkipConditionEvaluator.cs | Evaluator interface |
Infrastructure/Services/SkipConditionEvaluator.cs | Evaluator implementation |
Files Modified
| File | Change |
|---|---|
Application/Services/TaskCommandService.cs | Filter commands based on skip conditions |
Domain/Workflows/ProjectRegistrationWorkflow.cs | Handle RequestPreWorkProceduresFormDirect command |
| Frontend task-command component | Display optional commands with confirmation |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Create project WITH PO Number → should show skip option | ⌛ Pending |
| 2 | Create project WITHOUT PO Number → should require Purchasing review | ⌛ Pending |
| 3 | Confirm skip option → verify workflow proceeds to contractor | ⌛ Pending |