Greenstand / Greenstand/treetracker-admin-api

Add organization status and rejection reason fields

Open
#673 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
32
Forks
85
PR merge metrics
No merged PRs in 30d

Description

**Description**

Backend support for the organization lifecycle in [#1204](https://github.com/Greenstand/treetracker-admin-client/issues/1204).
The frontend is built (demo [Video](https://youtu.be/qNMYjxRkePQ?si=DJMk700ybKIu2jng)): An admin moves an organization through **Pending → Active / Rejected** with a reason captured on rejection, and **Active ↔ Suspended**.

The record currently only has `active` (boolean), which can't express these states.
Image

**Fields needed on `stakeholder` (type = organization)**

| Column | Type | Notes |
|--------|------|-------|
| status | enum / varchar | pending / active / suspended / rejected |
| rejection_reason | text | set when status = rejected |

**Endpoints**

No new endpoint. The frontend already uses these (on stakeholder-api).
They only need to carry the two fields:

| Method | Endpoint | Change |
|--------|----------|--------|
| GET | /stakeholders/{id} | return `status` and `rejection_reason` |
| PATCH | /stakeholders/{id} | accept `status` and `rejection_reason` |

**Placement**
I opened this in admin-api per Seba, though the frontend currently connects to stakeholder-api (`/stakeholders`).

**A couple of quick questions** to @dadiorchen
1. Which repo should own these fields? Admin-api or stakeholder-api?
2. Should `status` live in the stakeholder schema, or a separate SaaS schema?

Happy to move the issue wherever it fits best.

Contributor guide

No contributing guide indexed for this repository

Research direction

First resolve whether admin-api or stakeholder-api owns the change and whether the fields belong in the stakeholder schema or a separate SaaS schema. Then inspect the stakeholder GET /stakeholders/{id} and PATCH /stakeholders/{id} handlers and persistence layer; done means organization records expose and accept status and rejection_reason with the listed lifecycle values.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.