# NGO portal: initial implementation

## Entry points
- `/ngo/register`: organisation onboarding request with primary NGO Admin credentials.
- `/ngo/login`: independent email/password NGO authentication (no Piramal SSO).
- `/ngo/`: approved NGO dashboard; Seva Bhaav/Seva Daan submissions and revisions.
- `/ngo/users`: NGO Admin creates users for the same organisation.
- `/ngo/admin`: India Is Us / Super Admin review console.
- `/ngo/admin/create/BHAAV` and `/ngo/admin/create/DAAN`: create submissions for approved NGOs.

## Approval logic
- Registration remains PENDING until approved by India Is Us.
- Approved NGO is linked to existing Partner master, avoiding duplicate NGO identities.
- NGO submissions remain unpublished until reviewed.
- Approved submissions create/update the existing Activity / DonationCause tables.
- Changes to previously published submissions remain pending without touching the live record; publishing the revision updates the live record.
- NGO review and publishing events are recorded in `ngo_audit`.

## IMPORTANT limitations before production rollout
This is an **initial implementation**, not a fully production-hardened NGO module. Invitation emails and secure invitation activation, NGO password reset, document uploads/verification, image uploads in NGO submissions, comprehensive published-field version history, audit UI, reports, NGO profile editing and granular NGO permissions are not implemented. Additional controls are required for sensitive production NGO onboarding (rate limiting, password reset and secure email invitations). The NGO users page currently provisions users with a password entered by NGO Admin; do not use that as a production invitation workflow.

## Deployment
1. Back up production MySQL.
2. Preserve live `.env`, `venv/`, and existing uploads.
3. Install this code and run `python -m flask db upgrade` from the Linux venv.
4. Restart the app (`touch tmp/restart.txt`).
5. Log in with an existing India Is Us / Super Admin account and visit `/ngo/admin`.
6. Test onboarding and publication on staging first.

No `scripts/seed.py` is required for the NGO module.
