// lib/domain/provider/order/create_order_provider.dart
import 'package:dio/dio.dart';
import '../../../modules/orders/create_order.dart';
import '../../../service/dio.dart';
import '../../repository/order/create_order_repo.dart';

class CreateOrderProvider implements CreateOrderRepository {
  final CustomDio customDio = CustomDio();

  @override
  Future<CreateOrderResponse> createOrder(CreateOrderRequest request) async {
    try {
      final response = await customDio.postData(
        'https://queue.workolik.com/live/api/v1/mob/orders/createorder',
        request.toJson(),

      );

      print(response);
      return CreateOrderResponse.fromJson(response);
    } catch (e) {
      return CreateOrderResponse(
          status: "error", message_id: 0);
    }
  }
}
