import 'package:flutter_dotenv/flutter_dotenv.dart';

abstract class ApiEndpoints {
  static String baseUrl = dotenv.env['BASE_URL'] ?? '';

////////////////////////////////////// Authentication ///////////////////////////////

  static const String signUp = '/authentication/user/signup';
  static const String login = '/authentication/user/login';
  static const String deleteUser = '/authentication/user/delete/{id}';
  static const String sendOtp = '/authentication/user/send-otp';
  static const String verifyOtp = '/authentication/user/verify-otp';
  static const String forgetPassword = '/authentication/user/forget-password';
  static const String clientLogin = '/client/token';
////////////////////////////////////// Spaces ///////////////////////////////////////

  ///Community Module
//POST
  static const String addCommunity = '/community';
  static const String addCommunityToUser = '/community/user';
//GET
  static const String communityByUuid = '/community/{communityUuid}';
  static const String communityChild = '/community/child/{communityUuid}';
  static const String communityUser = '/community/user/{userUuid}';
//PUT
  static const String renameCommunity = '/community/{communityUuid}';

  ///Building Module
//POST
  static const String addBuilding = '/building';
  static const String addBuildingToUser = '/building/user';
//GET
  static const String buildingByUuid = '/building/{buildingUuid}';
  static const String buildingChild = '/building/child/{buildingUuid}';
  static const String buildingParent = '/building/parent/{buildingUuid}';
  static const String buildingUser = '/building/user/{userUuid}';
//PUT
  static const String renameBuilding = '/building/{buildingUuid}';

  ///Floor Module
//POST
  static const String addFloor = '/floor';
  static const String addFloorToUser = '/floor/user';
//GET
  static const String floorByUuid = '/floor/{floorUuid}';
  static const String floorChild = '/floor/child/{floorUuid}';
  static const String floorParent = '/floor/parent/{floorUuid}';
  static const String floorUser = '/floor/user/{userUuid}';
//PUT
  static const String renameFloor = '/floor/{floorUuid}';

  ///Unit Module
//POST
  static const String addUnit = '/unit';
  static const String addUnitToUser = '/unit/user';
  static const String verifyInvitationCode =
      '/user/{userUuid}/spaces/verify-code';

//GET
  static const String unitByUuid = '/unit/';
  static const String listSubspace =
      '/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/subspaces';
  static const String unitParent = '/unit/parent/{unitUuid}';
  static const String unitUser = '/unit/user/';
  static const String invitationCode =
      '/projects/{projectUuid}/communities/{communityUuid}/spaces/{unitUuid}/invitation-code';
  static const String activationCode = '/invite-user/activation';

//PUT
  static const String renameUnit = '/unit/{unitUuid}';

  //Subspace Module
//POST
  static const String addSubSpace =
      '/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/subspaces';

  ///Room Module
//POST
  static const String addRoom = '/room';
  static const String addRoomToUser = '/room/user';
//GET
  static const String roomByUuid = '/room/{roomUuid}';
  static const String roomParent = '/room/parent/{roomUuid}';
  static const String roomUser = '/room/user/{userUuid}';
//PUT
  static const String renameRoom = '/room/{roomUuid}';

  //SPACE Module
//GET
  static const String userSpaces = '/user/{userUuid}/spaces';
  static const String devices = '/projects/{projectUuid}/devices';

  static const String spaceDevices =
      '/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/devices';

  ///Group Module
//POST
  static const String addGroup = '/group';
  static const String controlGroup = '/group/control';
//GET
  static const String groupBySpace = '/group/{unitUuid}';
  static const String devicesByGroupName =
      '/group/{unitUuid}/devices/{groupName}';

  static const String groupByUuid = '/group/{groupUuid}';
//DELETE
  static const String deleteGroup = '/group/{groupUuid}';

////////////////////////////////////// Devices ///////////////////////////////////////
  ///Device Module
//POST
  static const String addDeviceToRoom = '/device/room';
  static const String addDeviceToGroup = '/device/group';
  static const String controlDevice = '/devices/{deviceUuid}/command';
  static const String firmwareDevice =
      '/devices/{deviceUuid}/firmware/{firmwareVersion}';
  static const String getDevicesByUserId = '/device/user/{userId}';
  static const String getDevicesByUnitId = '/device/unit/{unitUuid}';
  static const String openDoorLock = '/door-lock/open/{doorLockUuid}';

//GET
  static const String deviceByRoom =
      '/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/subspaces/{subSpaceUuid}/devices';
  static const String deviceByUuid = '/devices/{deviceUuid}';
  static const String deviceFunctions = '/devices/{deviceUuid}/functions';
  static const String gatewayApi = '/devices/gateway/{gatewayUuid}/devices';
  static const String deviceFunctionsStatus =
      '/devices/{deviceUuid}/functions/status';
  static const String powerClamp = '/devices/{deviceUuid}/functions/status';

  ///Device Permission Module
//POST
  static const String addDevicePermission = '/device-permission/add';
//GET
  static const String devicePermissionList = '/device-permission/list';
//PUT
  static const String editDevicePermission = '/device-permission/edit/{userId}';

  static const String assignDeviceToRoom =
      '/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/subspaces/{subSpaceUuid}/devices/{deviceUuid}';

  /// Scene & Automation API  ////////////////////
  /// POST
  static const String createScene = '/scene/tap-to-run';
  static const String triggerScene = '/scene/tap-to-run/{sceneId}/trigger';
  static const String createAutomation = '/projects/{projectId}/automations';

  /// GET
  static const String getUnitScenes =
      '/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/scenes';

  static const String getScene = '/scene/tap-to-run/{sceneId}';
  static const String getIconScene = '/scene/icon';

  static const String getUnitAutomation =
      '/projects/{projectId}/communities/{communityId}/spaces/{unitUuid}/automations';

  static const String getAutomationDetails =
      '/projects/{projectId}/automations/{automationId}';

  /// PUT
  static const String updateScene = '/scene/tap-to-run/{sceneId}';

  static const String updateAutomation =
      '/projects/{projectId}/automations/{automationId}';

  static const String updateAutomationStatus =
      '/projects/{projectId}/automations/{automationId}';

  /// DELETE
  static const String deleteScene = '/scene/tap-to-run/{sceneId}';

  static const String deleteAutomation =
      '/projects/{projectId}/automations/{automationId}';

  //////////////////////Door Lock //////////////////////
  //online
  static const String addTemporaryPassword =
      '/door-lock/temporary-password/online/{doorLockUuid}';
  static const String getTemporaryPassword =
      '/door-lock/temporary-password/online/{doorLockUuid}';

  //one-time offline
  static const String addOneTimeTemporaryPassword =
      '/door-lock/temporary-password/offline/one-time/{doorLockUuid}';
  static const String getOneTimeTemporaryPassword =
      '/door-lock/temporary-password/offline/one-time/{doorLockUuid}';

  //user

  static const String getUser = '/user/{userUuid}';
  static const String saveRegion = '/user/region/{userUuid}';
  static const String saveTimeZone = '/user/timezone/{userUuid}';
  static const String saveName = '/user/name/{userUuid}';
  static const String sendPicture = '/user/profile-picture/{userUuid}';
  static const String getRegion = '/region';
  static const String getTimezone = '/timezone';

  //multiple-time  offline
  static const String addMultipleTimeTemporaryPassword =
      '/door-lock/temporary-password/offline/multiple-time/{doorLockUuid}';
  static const String getMultipleTimeTemporaryPassword =
      '/door-lock/temporary-password/offline/multiple-time/{doorLockUuid}';

  static const String renamePassword =
      '/door-lock/temporary-password/{doorLockUuid}/offline/{passwordId}';

  //multiple-time  offline
  static const String deleteTemporaryPassword =
      '/door-lock/temporary-password/online/{doorLockUuid}/{passwordId}';

  static const String saveSchedule = '/schedule/{deviceUuid}';
  static const String getSchedule =
      '/schedule/{deviceUuid}?category={category}';
  static const String changeSchedule = '/schedule/enable/{deviceUuid}';
  static const String deleteSchedule = '/schedule/{deviceUuid}/{scheduleId}';
  static const String reportLogs =
      '/devices/report-logs/{deviceUuid}?code={code}&startTime={startTime}&endTime={endTime}';
  static const String controlBatch = '/devices/batch';
  static const String statusBatch = '/devices/batch';
  static const String deviceScene = '/devices/{deviceUuid}/scenes';

  static const String fourSceneByName =
      '/devices/{deviceUuid}/scenes?switchName={switchName}';

  static const String resetDevice = '/factory/reset/{deviceUuid}';
  static const String unAssignScenesDevice =
      '/devices/{deviceUuid}/scenes?switchName={switchName}';
  static const String getDeviceLogs = '/devices/report-logs/{uuid}?code={code}';
  static const String terms = '/terms';
  static const String policy = '/policy';
  static const String getPermission = '/permission/{roleUuid}';
  static const String getAllDevices =
      '/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/devices';

  static const String getReportLogs = '/devices/{uuid}/report-logs?code={code}';
}
