@@ -39,17 +39,17 @@ public function __construct(
3939
4040 /**
4141 * @OA\Post(
42- * path="/regions ",
42+ * path="/subnationals ",
4343 * tags={"Regions"},
44- * summary="Create a new region ",
44+ * summary="Create a new subnational ",
4545 * operationId="createRegion",
4646 * @OA\RequestBody(
4747 * required=true,
4848 * @OA\JsonContent(
4949 * required={"countryCode", "title"},
5050 * @OA\Property(property="countryCode", type="string", example="USA", description="Country code (3 characters)"),
51- * @OA\Property(property="title", type="string", example="North America", description="Title of the region "),
52- * @OA\Property(property="slug", type="string", example="north-america", description="Slug for the region (optional)"),
51+ * @OA\Property(property="title", type="string", example="North America", description="Title of the subnational "),
52+ * @OA\Property(property="slug", type="string", example="north-america", description="Slug for the subnational (optional)"),
5353 * @OA\Property(
5454 * property="translations",
5555 * type="array",
@@ -58,7 +58,7 @@ public function __construct(
5858 * @OA\Property(property="webUrl", type="string", format="url", example="https://example.com", description="Web URL for the translation"),
5959 * @OA\Property(property="lang", type="string", example="en", description="Language code (2 characters)"),
6060 * @OA\Property(property="title", type="string", example="North America", description="Title in the specified language"),
61- * @OA\Property(property="description", type="string", example="Description of the region ", description="Description in the specified language")
61+ * @OA\Property(property="description", type="string", example="Description of the subnational ", description="Description in the specified language")
6262 * )
6363 * )
6464 * )
@@ -103,10 +103,10 @@ public function createRegion(Request $request)
103103 }
104104
105105 $ slug = empty ($ request ->input ('slug ' )) ? str_slug ($ request ->input ('title ' )) : $ request ->input ('slug ' );
106- $ existing = $ org ->regions ()->where ('slug ' , '= ' , $ request ->input ('slug ' ))->count ();
106+ $ existing = $ org ->subnationals ()->where ('slug ' , '= ' , $ request ->input ('slug ' ))->count ();
107107
108108 if ($ existing > 0 ) {
109- return response ()->json ([ 'error_message ' => 'This region already exists ' , 'errors ' => []], 409 );
109+ return response ()->json ([ 'error_message ' => 'This subnational already exists ' , 'errors ' => []], 409 );
110110 }
111111
112112 $ region = Region::create ([
@@ -128,22 +128,22 @@ public function createRegion(Request $request)
128128
129129 /**
130130 * @OA\Put(
131- * path="/regions/region /{regionId}",
131+ * path="/subnationals/subnational /{regionId}",
132132 * tags={"Regions"},
133- * summary="Update an existing region ",
133+ * summary="Update an existing subnational ",
134134 * operationId="updateRegion",
135135 * @OA\Parameter(
136136 * name="regionId",
137137 * in="path",
138138 * required=true,
139- * description="ID of the region to update",
139+ * description="ID of the subnational to update",
140140 * @OA\Schema(type="integer", format="int64")
141141 * ),
142142 * @OA\RequestBody(
143143 * required=true,
144144 * @OA\JsonContent(
145- * @OA\Property(property="title", type="string", example="Updated Region Title", description="Updated title of the region (optional)"),
146- * @OA\Property(property="slug", type="string", example="updated-region -slug", description="Updated slug for the region (optional)"),
145+ * @OA\Property(property="title", type="string", example="Updated Region Title", description="Updated title of the subnational (optional)"),
146+ * @OA\Property(property="slug", type="string", example="updated-subnational -slug", description="Updated slug for the subnational (optional)"),
147147 * @OA\Property(
148148 * property="translations",
149149 * type="array",
@@ -172,7 +172,7 @@ public function updateRegion(Request $request, $regionId)
172172 $ region = Region::find ($ regionId );
173173
174174 if (empty ($ region )) {
175- return response ()->json ([ 'error_message ' => 'No region found ' , 'errors ' => []], 404 );
175+ return response ()->json ([ 'error_message ' => 'No subnational found ' , 'errors ' => []], 404 );
176176 }
177177
178178 $ this ->validate ($ request , [
@@ -216,8 +216,8 @@ public function updateRegion(Request $request, $regionId)
216216
217217 /**
218218 * @OA\Get(
219- * path="/regions /{country_code}",
220- * summary="Get all regions for a specific organisation by country code",
219+ * path="/subnationals /{country_code}",
220+ * summary="Get all subnationals for a specific organisation by country code",
221221 * tags={"Regions"},
222222 * @OA\Parameter(
223223 * name="country_code",
@@ -248,7 +248,7 @@ public function getAllForOrganisation($country_code)
248248 }
249249
250250 $ list = [];
251- foreach ($ organisation ->regions as $ region ) {
251+ foreach ($ organisation ->subnationals as $ region ) {
252252 $ data = [
253253 'id ' => $ region ->id ,
254254 'title ' => $ region ->title ,
@@ -270,8 +270,8 @@ public function getAllForOrganisation($country_code)
270270
271271 /**
272272 * @OA\Get(
273- * path="/regions /{country_code}/{code}",
274- * summary="Get regions for a specific organisation by country code and language code",
273+ * path="/subnationals /{country_code}/{code}",
274+ * summary="Get subnationals for a specific organisation by country code and language code",
275275 * tags={"Regions"},
276276 * @OA\Parameter(
277277 * name="country_code",
@@ -309,7 +309,7 @@ public function getForCountryCode($country_code, $code)
309309 }
310310
311311 $ list = [];
312- foreach ($ organisation ->regions as $ region ) {
312+ foreach ($ organisation ->subnationals as $ region ) {
313313 $ translation = $ region ->translations ()
314314 ->where ('language_code ' , '= ' , $ code )
315315 ->first ();
@@ -329,15 +329,15 @@ public function getForCountryCode($country_code, $code)
329329
330330 /**
331331 * @OA\Delete(
332- * path="/regions/region /{regionId}",
332+ * path="/subnationals/subnational /{regionId}",
333333 * tags={"Regions"},
334- * summary="Delete a region ",
334+ * summary="Delete a subnational ",
335335 * operationId="deleteRegion",
336336 * @OA\Parameter(
337337 * name="regionId",
338338 * in="path",
339339 * required=true,
340- * description="ID of the region to delete",
340+ * description="ID of the subnational to delete",
341341 * @OA\Schema(type="integer", format="int64")
342342 * ),
343343 * @OA\Response(
@@ -355,7 +355,7 @@ public function deleteRegion($regionId)
355355 $ region = Region::find ($ regionId );
356356
357357 if (empty ($ region )) {
358- return response ()->json ([ 'error_message ' => 'No region found ' , 'errors ' => []], 404 );
358+ return response ()->json ([ 'error_message ' => 'No subnational found ' , 'errors ' => []], 404 );
359359 }
360360
361361 $ keys = $ region ->translations ()->pluck ('id ' )->toArray ();
@@ -368,9 +368,9 @@ public function deleteRegion($regionId)
368368
369369 /**
370370 * @OA\Delete(
371- * path="/regions/region /translation/{translationId}",
371+ * path="/subnationals/subnational /translation/{translationId}",
372372 * tags={"Regions"},
373- * summary="Delete a region translation",
373+ * summary="Delete a subnational translation",
374374 * operationId="deleteTranslation",
375375 * @OA\Parameter(
376376 * name="translationId",
0 commit comments