add file AgentBadge-Verifivaction.md - #12
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new requirements/specification document describing the “Professional Agent” badge (trust score + granting/revoking) and a property listing verification workflow (verification requests, statuses, and supporting documents). This fits into the repository’s existing set of product/API/database documentation markdown files.
Changes:
- Introduces user stories plus acceptance criteria/edge cases for agent badge and property verification flows.
- Documents example API endpoints for creating/revoking agent badges.
- Proposes database entities for trust metrics, agent badges, verification requests, users, and companies.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,234 @@ | |||
| # 1. User Stories | |||
| * **Edge Cases:** | ||
| * Admin attempts to set `is_verified` = `TRUE` without uploaded documents -> the system prevents the action or displays a confirmation warning. | ||
|
|
||
| # 3. API Endpoints (Login & Roles) |
| # 3. API Endpoints (Login & Roles) | ||
|
|
||
| ## 1. Create Agent Badge | ||
| * **Endpoint:** POST /agent-badges |
| ``` | ||
|
|
||
| ## 2. Revoke Agent Badge | ||
| * **Endpoint:** PUT /agent-badges/{id} |
| ## 1. Create Agent Badge | ||
| * **Endpoint:** POST /agent-badges | ||
| * **Description:** Creates a "Professional Agent" badge and assigns it to a specific agent. | ||
| * **Headers:** Host: Shaqqa.com, Accept: application/json |
Comment on lines
+141
to
+149
| { | ||
| "id": "1", | ||
| "agent_id": "12", | ||
| "granted_by": "845", | ||
| "badge_name": "Professional Agent", | ||
| "status": "active", | ||
| "granted_at": "2026-04-29T10:00:00Z", | ||
| "granted_at_score": 82.5 | ||
| } |
| * Upon resubmission, status returns to `PENDING` and a new review cycle begins. | ||
| * `reviewed_by` and `reviewed_at` are updated with each admin action. | ||
| * **Edge Cases:** | ||
| * User ignores `NEEDS_EDIT` for a long period -> the listing is automatically deleted. |
Comment on lines
+44
to
+45
| * The badge is automatically revoked when `trust_score` drops to <= `70`. | ||
| * `revoked_by`, `revoked_at`, and `revoked_at_score` are recorded. |
| * **`email`** (VARCHAR, UNIQUE): Unique email address of the user. | ||
| * **`phone`** (VARCHAR): Contact phone number. | ||
| * **`password_hash`** (VARCHAR): Encrypted password hash for authentication. | ||
| * **`role`** (ENUM): The role of the user (`REGULAR`, `AGENT`, `COMPANY_ADMIN`, `ADMIN`). |
Comment on lines
+183
to
+189
| ## 1. Table: `RealEstateCompany` | ||
| * **`id`** (PK): Unique identifier for the real estate company. | ||
| * **`name`** (VARCHAR): Name of the real estate company. | ||
| * **`license_number`** (VARCHAR, UNIQUE): Unique license number of the company. | ||
| * **`logo_url`** (VARCHAR): URL path for the company logo. | ||
| * **`verified`** (BOOLEAN): `TRUE` if the company is verified. | ||
| * **`created_at`** (TIMESTAMP): Timestamp indicating when the record was created. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.