#!/usr/bin/env bash

function create_api_constants(){
 DEST_DIR="${FLUTTER_PROJECT_DIR}/lib/core/networking"
 API_CONSTANTS_FILE="$DEST_DIR/api_constants.dart"
  cat <<EOL > "$API_CONSTANTS_FILE"
class ApiConstants {
  static const String apiBaseUrl = "";
}

class ApiErrors {
  static const String badRequestError = "badRequestError";
  static const String noContent = "noContent";
  static const String forbiddenError = "forbiddenError";
  static const String unauthorizedError = "unauthorizedError";
  static const String notFoundError = "notFoundError";
  static const String conflictError = "conflictError";
  static const String internalServerError = "internalServerError";
  static const String unknownError = "unknownError";
  static const String timeoutError = "timeoutError";
  static const String defaultError = "defaultError";
  static const String cacheError = "cacheError";
  static const String noInternetError = "noInternetError";
  static const String loadingMessage = "loading_message";
  static const String retryAgainMessage = "retry_again_message";
  static const String ok = "Ok";
}
EOL
 echo "📄 Created api_constants.dart file successfully at $API_CONSTANTS_FILE"
 echo "✅ Api constants template generated successfully."
}

export -f create_api_constants
