import 'package:syncrow_app/services/api/api_links_endpoints.dart'; import 'package:syncrow_app/services/api/http_service.dart'; class HomeCreation { static final HTTPService _httpService = HTTPService(); static Future> createCommunity(Map body) async { try { final response = await _httpService.post( path: ApiEndpoints.addCommunity, body: body, showServerMessage: false, expectedResponseModel: (json) { return json; }, ); return response; } catch (e) { rethrow; } } static Future> assignUserToCommunity(Map body) async { try { final response = await _httpService.post( path: ApiEndpoints.addCommunityToUser, body: body, showServerMessage: false, expectedResponseModel: (json) { return json; }, ); return response; } catch (e) { rethrow; } } static Future> createBuilding(Map body) async { try { final response = await _httpService.post( path: ApiEndpoints.addBuilding, body: body, showServerMessage: false, expectedResponseModel: (json) { return json; }, ); return response; } catch (e) { rethrow; } } static Future> assignUserToBuilding(Map body) async { try { final response = await _httpService.post( path: ApiEndpoints.addBuildingToUser, body: body, showServerMessage: false, expectedResponseModel: (json) { return json; }, ); return response; } catch (e) { rethrow; } } static Future> createFloor(Map body) async { try { final response = await _httpService.post( path: ApiEndpoints.addFloor, body: body, showServerMessage: false, expectedResponseModel: (json) { return json; }, ); return response; } catch (e) { rethrow; } } static Future> assignUserToFloor(Map body) async { try { final response = await _httpService.post( path: ApiEndpoints.addBuildingToUser, body: body, showServerMessage: false, expectedResponseModel: (json) { return json; }, ); return response; } catch (e) { rethrow; } } static Future> createUnit(Map body) async { try { final response = await _httpService.post( path: ApiEndpoints.addUnit, body: body, showServerMessage: false, expectedResponseModel: (json) { return json; }, ); return response; } catch (e) { rethrow; } } static Future> assignUserToUnit(Map body) async { try { final response = await _httpService.post( path: ApiEndpoints.addUnitToUser, body: body, showServerMessage: false, expectedResponseModel: (json) { return json; }, ); return response; } catch (e) { rethrow; } } static Future> createRoom(Map body) async { try { final response = await _httpService.post( path: ApiEndpoints.addRoom, body: body, showServerMessage: false, expectedResponseModel: (json) { return json; }, ); return response; } catch (e) { rethrow; } } static Future> assignUserToRoom(Map body) async { try { final response = await _httpService.post( path: ApiEndpoints.addRoomToUser, body: body, showServerMessage: false, expectedResponseModel: (json) { return json; }, ); return response; } catch (e) { rethrow; } } }