Hence the parent company should have access to all its children companies' stations, hierarchically. For example, we have 3 companies A, B, and C owning respectively 10, 5, and 2 charging stations. Company B belongs to A and company C belongs to B. Then we can say that company A owns 17, company B owns 7, and company C owns 2 charging stations in total.
Database
- Station (id, name, company_id, address)
- Company (id, parent_company_id, name)