User Story #943
openEPIC #930: CS Trust Score
Feature #940: Trust Levels & Badges
Feature #941: Trust Levels & Badges
Backend User Story – Trust Levels & Badges
0%
Description
As the ConnectSouq platform, I want to automatically determine and assign Trust Levels and badges based on a member's Trust Score so that every member's reputation is represented consistently across the platform.
Business Background¶
Trust Levels provide a standardized way to recognize member reputation. Each Trust Level is linked to a configurable Trust Score range and has an associated badge displayed throughout the platform. Whenever a member's Trust Score changes, the system must evaluate whether the member qualifies for a new Trust Level and update it automatically according to the Trust Framework.
Functional Requirements¶
The system shall:
- Maintain configurable Trust Level ranges.
- Evaluate member Trust Score after every score update.
- Assign the appropriate Trust Level.
- Assign the corresponding badge.
- Store Trust Level history.
- Trigger notifications when a member reaches a new Trust Level.
- Expose Trust Level information through APIs.
Business Rules¶
- Trust Levels are determined solely by the configured Trust Score thresholds.
- Every member can have only one active Trust Level at a time.
- Trust Level changes occur automatically after Trust Score recalculation.
- Every Trust Level change must be recorded in the audit log.
- Badge assignment is automatic and cannot be manually modified by members.
- If a Trust Score decreases below a threshold due to governance actions, the Trust Level shall be recalculated accordingly.
Database Changes¶
Table: Trust_Level_Master¶
| Field |
|---|
| LevelId |
| LevelName |
| MinimumScore |
| MaximumScore |
| BadgeImage |
| Description |
| DisplayOrder |
| IsActive |
Table: Member_Trust_Level¶
| Field |
|---|
| MemberId |
| TrustLevelId |
| TrustScore |
| AchievedDate |
| LastUpdated |
Table: Trust_Level_History¶
| Field |
|---|
| HistoryId |
| MemberId |
| PreviousLevel |
| NewLevel |
| PreviousScore |
| UpdatedScore |
| ChangedOn |
API Endpoints¶
GET /api/trust-level/current¶
Retrieve current Trust Level.
GET /api/trust-level/master¶
Retrieve all available Trust Levels.
POST /api/trust-level/evaluate¶
Evaluate and assign Trust Level after score updates.
Validation Rules¶
- Trust Score must exist.
- Trust Level thresholds must not overlap.
- Only active Trust Levels can be assigned.
- Every member must always have one valid Trust Level.
Notifications¶
The system shall notify the member when:
- A new Trust Level is achieved.
- A Trust Level is downgraded due to governance action.
Audit Logs¶
Capture:
- Member ID
- Previous Trust Level
- New Trust Level
- Previous Score
- Updated Score
- Timestamp
- Triggering activity
Acceptance Criteria¶
Scenario 1 – Automatic Level Assignment¶
Given
- Member's Trust Score is updated.
When
- The evaluation process runs.
Then
- The correct Trust Level is assigned.
- The corresponding badge is linked.
- Member profile reflects the updated Trust Level.
- Audit log is created.
Scenario 2 – Level Promotion¶
Given
- Member reaches the minimum score for the next Trust Level.
When
- Trust Score is recalculated.
Then
- Trust Level is upgraded automatically.
- Member receives a notification.
- History record is created.
Scenario 3 – Level Downgrade¶
Given
- Governance action reduces the member's Trust Score below the current threshold.
When
- The evaluation process runs.
Then
- Trust Level is downgraded automatically.
- Member is notified.
- Audit history is maintained.
In Scope (MVP)¶
- Trust Level configuration
- Automatic level evaluation
- Badge assignment
- Level history
- Notifications
- Trust Level APIs
- Audit logging
Out of Scope¶
- Custom badges
- NFT or digital collectibles
- Badge marketplace
- Gamification rewards
- Third-party badge integrations
- Dynamic badge themes
Definition of Done¶
- Trust Level evaluation engine implemented.
- Badge assignment completed.
- APIs documented and tested.
- Notifications integrated.
- Audit logging validated.
- Unit, integration, and QA testing passed.
- Product Owner approval received.
No data to display