import 'package:dio/dio.dart'; import 'package:eatvio_app/features/chat/models/chat_message_model.dart'; import 'package:eatvio_app/features/chat/models/chat_messages_model.dart'; import 'package:eatvio_app/features/chat/models/chat_room_model.dart'; import 'package:eatvio_app/features/chat/models/chat_room_pagination_model.dart'; import 'package:eatvio_app/features/chat/models/order_id_to_conversation_model.dart'; import 'package:eatvio_app/features/chat/models/payment_model.dart'; import 'package:eatvio_app/features/chat/models/plan_complain_model.dart'; import 'package:eatvio_app/features/payment/models/promo_applied_list_response.dart'; import 'package:eatvio_app/features/payment/models/promo_apply_response.dart'; import 'package:eatvio_app/features/payment/models/promo_remove_response.dart'; import 'package:eatvio_app/features/payment/models/promo_validate_response.dart'; import 'package:eatvio_app/features/plans/models/chosen_plan_model.dart'; import 'package:retrofit/retrofit.dart'; part 'chat_service.g.dart'; @RestApi() abstract class ChatService { factory ChatService(Dio dio, {String baseUrl}) = _ChatService; @GET('/api/v2/chat/index') Future getChatRooms({ @Query('page') required int page, @Query('filters[data][\$conversation_name]') String? query, }); @GET('/api/v2/chat/show/{uuid}') Future getChatRoom({ @Path() required String uuid, }); @POST('/api/v2/chat/message/send/{slug}') @MultiPart() Future sendMessage({ @Header('X-Socket-ID') required String socketId, @Path() required String slug, @Part() String? data, @Part(name: 'media_data[]', contentType: 'multipart/form-data') List? mediaData, }); @GET('/api/v2/chat/show/{id}/messages?page={page}') Future getChatMessages({ @Path() required String id, @Path() required int page, }); @GET('/api/v2/chat/get_by_user/{user}') Future getChatRoomIdByUserSlug({ @Path() required String user, }); @POST('/api/chat/{id}/messages/markAsRead') Future markMessagesAsRead({ @Path() required String id, @Body() required Map> body, }); @POST('/api/chosen_plans/{id}/cancel') Future cancelChosenPlan({ @Path() required int id, }); @POST('/api/chosen_plans/{id}/negotiate_contract_start') Future choseStartPlanDate({ @Path() required int id, @Body() required Map date, }); @POST('/api/chosen_plans/{id}/start_payment_process') Future getPaymentLink({ @Path() required int id, @Body() required Map body, }); @GET('/api/chosen_plans/applied_promos') Future listAppliedPromoCodes(); @POST('/api/chosen_plans/{id}/validate_promo') Future validatePromoCode({ @Path() required int id, @Body() required Map body, }); @POST('/api/chosen_plans/{id}/apply_promo') Future applyPromoCode({ @Path() required int id, @Body() required Map body, }); @DELETE('/api/chosen_plans/{id}/remove_promo_code') Future removePromoCode({ @Path() required int id, }); @GET('/api/consultation/resolve/order_id_to_conversation/{orderId}') Future resolveOrderIdToConversation({ @Path() required String orderId, }); @GET('/api/chosen_plans/show/{id}') Future getChosenPlan({ @Path() required int id, }); @POST('/api/chosen_plans/{id}/confirm_finish') Future finishChosenPlan({ @Path() required int id, }); @POST('/api/chosen_plans/{id}/complain') Future complainAboutConsultation({ @Path() required int id, @Body() required PlanComplainModel body, }); @GET('/api/chat/get_by_user/{slug}') Future getChatByUserSlug({ @Path() required String slug, }); }