System-level Attributes (System Attribute)
Overview
System Attributes are the standard attributes defined centrally by the platform rather than by customers. That makes them distinct from Attribute Master, which holds custom attributes scoped to a single LINE OA.
They provide the baseline set of attributes shared by every OA — standard LINE profile fields, for instance, and the attributes that make up the system merge tags in Template Message.
Structurally this is a straightforward CRUD module with just four endpoints.
Business Flow
- List —
GET /api/system-attributereturns every system attribute. GORM appendsdeleted_date IS NULLautomatically because the entity declaresgorm.DeletedAt. - Create —
POST /api/system-attributecreates a new system attribute from aCreateSystemAttributeDto. - Update —
PUT /api/system-attribute/:idmust useUnscoped(), because the original TypeORM implementation'supdate()call did not apply a soft-delete filter. Matching that behaviour is required for parity. - Delete —
DELETE /api/system-attribute/:idperforms a soft delete. - Downstream use — the results feed two places: the
GET /api/template-message/merge-tags?showSystem=trueendpoint, which folds system attributes into the merge tag list, and form and report building, where they are combined with custom attributes.
Key Files & Functions
The code lives in internal/modules/systemattribute/, split across controller.go,
service.go and dto.go.
All routes are registered on authed.Group("/system-attribute").
| Method | Route | Handler | Policy |
|---|---|---|---|
| GET | /api/system-attribute | h.findAll | read system-attribute |
| POST | /api/system-attribute | h.create | create system-attribute |
| PUT | /api/system-attribute/:id | h.update | update system-attribute |
| DELETE | /api/system-attribute/:id | h.remove | delete system-attribute |
This module has neither ModuleGate nor SuperAdminGuard — callers only need to pass
the global JwtAuth.
Connections to Other Services
- Permissions — requires the global
JwtAuth, which mandates alineOaIdin the token.PolicyModuleSystemAttributeis metadata only and is not yet enforced. - Tables —
system_attribute, which soft-deletes viagorm.DeletedAt. - Consumers — Template Message (system merge tags), Form Builder, and the all-friends report.
- Comparison — Attribute Master serves the same purpose for per-OA custom attributes.