import 'package:syncrow_app/services/api/api_links_endpoints.dart'; import 'package:syncrow_app/services/api/http_service.dart'; import 'package:syncrow_app/utils/constants/temp_const.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({ required String communityId, required String spaceId, required Map body, }) async { try { final fullPath = ApiEndpoints.addSubSpace .replaceAll('{communityUuid}', communityId) .replaceAll('{spaceUuid}', spaceId) .replaceAll('{projectUuid}', TempConst.projectIdDev); final response = await _httpService.post( path: fullPath, 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; } } }