import 'package:flutter_dotenv/flutter_dotenv.dart';

abstract class ApiEndpoints {
  static const String projectUuid = "bcda711e-9fc2-4168-a05e-171b4026d1ff";
  static String baseUrl = dotenv.env['BASE_URL'] ?? '';
  static const String signUp = '/authentication/user/signup';
  static const String login = '/authentication/user/login';
  static const String forgetPassword = '/authentication/user/forget-password';
  static const String sendOtp = '/authentication/user/send-otp';
  static const String verifyOtp = '/authentication/user/verify-otp';
  static const String getRegion = '/region';
  static const String visitorPassword = '/visitor-passwords';
  static const String getDevices = '/projects/{projectId}/devices';

  static const String getUser = '/user/{userUuid}';

  ////// Devices Management ////////////////

  static const String getAllDevices = '/projects/{projectId}/devices';
  static const String getSpaceDevices =
      '/projects/{projectId}/communities/{communityUuid}/spaces/{spaceUuid}/devices';
  static const String getDeviceStatus = '/devices/{uuid}/functions/status';
  static const String getBatchStatus = '/devices/batch';

  static const String deviceControl = '/devices/{uuid}/command';
  static const String deviceBatchControl = '/devices/batch';
  static const String gatewayApi = '/devices/gateway/{gatewayUuid}/devices';
  static const String openDoorLock = '/door-lock/open/{doorLockUuid}';

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

// Space Module
  static const String createSpace =
      '/projects/{projectId}/communities/{communityId}/spaces';
  static const String listSpaces =
      '/projects/{projectId}/communities/{communityId}/spaces';
  static const String deleteSpace =
      '/projects/{projectId}/communities/{communityId}/spaces/{spaceId}';
  static const String updateSpace =
      '/projects/{projectId}/communities/{communityId}/spaces/{spaceId}';
  static const String getSpace =
      '/projects/{projectId}/communities/{communityId}/spaces/{spaceId}';
  static const String getSpaceHierarchy =
      '/projects/{projectId}/communities/{communityId}/spaces';

// Community Module
  static const String createCommunity = '/projects/{projectId}/communities';
  static const String getCommunityList = '/projects/{projectId}/communities';
  static const String getCommunityListv2 = '/projects/{projectId}/communities/v2';
  static const String getCommunityById =
      '/projects/{projectId}/communities/{communityId}';
  static const String updateCommunity =
      '/projects/{projectId}/communities/{communityId}';
  static const String deleteCommunity =
      '/projects/{projectId}communities/{communityId}';
  static const String getUserCommunities =
      '/projects/{projectId}/communities/user/{userUuid}';
  static const String createUserCommunity =
      '/projects/{projectId}/communities/user';
  static const String getDeviceLogsByDate =
      '/devices/{uuid}/report-logs?code={code}&startTime={startTime}&endTime={endTime}';

  static const String scheduleByDeviceId = '/schedule/{deviceUuid}';
  static const String getScheduleByDeviceId =
      '/schedule/{deviceUuid}?category={category}';
  static const String deleteScheduleByDeviceId =
      '/schedule/{deviceUuid}/{scheduleUuid}';
  static const String updateScheduleByDeviceId =
      '/schedule/enable/{deviceUuid}';
  static const String factoryReset = '/devices/batch';

  //product
  static const String listProducts = '/products';
  static const String getSpaceScenes = '/scene/tap-to-run/{spaceUuid}';
  static const String getSpaceAutomation =
      '/projects/{projectId}/communities/{communityId}/spaces/{spaceUuid}/automations';
  static const String getIconScene = '/scene/icon';
  static const String createScene = '/scene/tap-to-run';
  static const String createAutomation = '/projects/{projectId}/automations';
  static const String getUnitScenes =
      '/projects/{projectId}/communities/{communityUuid}/spaces/{spaceUuid}/scenes';
  static const String getAutomationDetails =
      '/projects/{projectId}/automations/{automationId}';
  static const String getScene = '/scene/tap-to-run/{sceneId}';
  static const String deleteScene = '/scene/tap-to-run/{sceneId}';

  static const String deleteAutomation =
      '/projects/{projectId}/automations/{automationId}';
  static const String updateScene = '/scene/tap-to-run/{sceneId}';

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

  //space model
  static const String listSpaceModels = '/projects/{projectId}/space-models';
  static const String createSpaceModel = '/projects/{projectId}/space-models';
  static const String getSpaceModel =
      '/projects/{projectId}/space-models/{spaceModelUuid}';
  static const String updateSpaceModel =
      '/projects/{projectId}/space-models/{spaceModelUuid}';
  //tag
  static const String listTags = '/projects/{projectId}/tags';

  static const String linkSpaceModel =
      '/projects/{projectId}/space-models/{spaceModelUuid}/spaces/link';

  static const String validateSpaceModel =
      '/projects/{projectId}/spaces/validate';

  static const String roleTypes = '/role/types';
  static const String permission = '/permission/{roleUuid}';
  static const String inviteUser = '/invite-user';

  static const String checkEmail = '/invite-user/check-email';
  static const String getUsers = '/projects/{projectId}/user';
  static const String getUserById = '/projects/{projectId}/user/{userUuid}';
  static const String editUser = '/invite-user/{inviteUserUuid}';
  static const String deleteUser = '/invite-user/{inviteUserUuid}';
  static const String changeUserStatus =
      '/invite-user/{invitedUserUuid}/disable';
  static const String terms = '/terms';
  static const String policy = '/policy';
  static const String userAgreements = '/user/agreements/web/{userUuid}';
  static const String triggerScene = '/scene/tap-to-run/{sceneId}/trigger';
  static const String updateAutomationStatus =
      '/projects/{projectId}/automations/{automationId}';
  static const String getUnitAutomation =
      '/projects/{projectId}/communities/{communityId}/spaces/{unitUuid}/automations';
  static const String spaceOnlyWithDevices =
      '/projects/{projectId}/communities/{communityId}/spaces?onlyWithDevices=true';

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

  static const String resetDevice = '/factory/reset/{deviceUuid}';

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