Skip to content

feat: consolidate City/Village terminology across app (#1310)#1379

Open
Zhey-on wants to merge 1 commit intoEnAccess:mainfrom
Zhey-on:feat/1310-consolidate-village-city-terminology
Open

feat: consolidate City/Village terminology across app (#1310)#1379
Zhey-on wants to merge 1 commit intoEnAccess:mainfrom
Zhey-on:feat/1310-consolidate-village-city-terminology

Conversation

@Zhey-on
Copy link
Copy Markdown

@Zhey-on Zhey-on commented Mar 14, 2026

Closes #1310

This PR removes the City/Village naming mismatch and standardizes the app on Village.

Before this change, users had to create a Village but still saw City in several forms, API payloads, and labels. That was confusing, especially on fresh installs.

What I changed

Replaced City references with Village in backend domain logic, routes, requests, services, and related queries.
Added and wired Village resources where City-specific classes were still in use.
Updated database naming/alignment for the City to Village transition, including related references.
Updated frontend services, repositories, components, filters, labels, and tests to use Village terminology consistently.
Removed legacy City-specific paths and tests that no longer match the intended domain language.
Validation

Frontend tests passed:
npm test -- --runInBand src/tests/VillageService.test.js src/tests/ClusterService.test.js
Live API smoke checks passed on local environment:
GET /up -> 200
POST /api/auth/login -> token returned
GET /api/auth/me -> 200
GET /api/villages -> 200
GET /api/customer-registration-app/villages (with token) -> 200
GET /api/clusters/1 -> 200
Expected behavior confirmed:
GET /api/customer-registration-app/villages (without token) -> 401
GET /api/customer-registration-app/cities (legacy path) -> 404
Known limitation during local verification

Backend feature tests for Village/MiniGrid were attempted but could not run due local test DB connectivity:
SQLSTATE[HY000] [2002] Connection refused on connection micro_power_manager.

Implements issue EnAccess#1310 by standardizing domain, API, DB, tests and UI naming from City/Cities to Village/Villages.

Key updates:

- Backend: introduced Village model/controller/request/service, replaced City references in relations, services, routes and exports.

- Database: migrated cities -> villages naming and aligned foreign keys/owner types where required.

- Frontend: replaced City repository/service/components/tests with Village equivalents and updated labels/filters/UI flows.

- Docs & collections: aligned customer-facing wording and request payload fields to village terminology.

Validation on this branch:

- Frontend unit tests passed: npm test -- --runInBand src/__tests__/VillageService.test.js src/__tests__/ClusterService.test.js

- Live API smoke passed on localhost: /up=200, /api/auth/login token issued, /api/auth/me=200, /api/villages=200, /api/customer-registration-app/villages (auth)=200, /api/clusters/1=200

- Expected migration behavior confirmed: /api/customer-registration-app/villages without token=401, legacy /api/customer-registration-app/cities=404

- Backend feature tests were attempted but blocked by environment test DB connectivity: SQLSTATE[HY000] [2002] Connection refused on connection micro_power_manager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Consolidate Village and City terminilogy

1 participant