1import 'dart:developer';
3import '../../../../core/api/api_client.dart';
4import '../../../../core/api/api_endpoints.dart';
5import '../../../../core/services/service_locator.dart';
6import '../../../../core/common/models/collection_model.dart';
7import '../models/req/req_collection_confirmation_model.dart';
8import '../models/req/req_collection_information_model.dart';
9import '../models/req/req_collection_payment_model.dart';
10import '../models/req/req_collection_rating_model.dart';
11import '../models/req/req_collection_validation_model.dart';
12import '../models/res/res_cancelation_reason_model.dart';
13import '../models/res/res_collection_confirmation_model.dart';
14import '../models/res/res_collection_contact_model.dart';
15import '../models/res/res_collection_rating_reason_model.dart';
16import '../models/res/res_collection_status_model.dart';
17import '../models/res/res_collection_information_model.dart';
18import '../models/res/res_partner_payment_model.dart';
29 path: ApiEndpoints.getCollections(
35 if (response is List) {
38 (json) => CollectionModel.fromJson(json),
50 required
String? cancelationReasonId,
53 path: ApiEndpoints.updateCollectionStatus,
55 'id': collectionId.toString(),
57 if (cancelationReasonId != null)
58 'cancelationReason': {
59 'id': cancelationReasonId.toString(),
63 return ResCollectionStatusModel.fromJson(response);
67 final response = await
apiClient.get(
path: ApiEndpoints.getCollectionCancelationReasons);
68 if (response is List) {
71 (json) => ResCancelationReasonModel.fromJson(json),
79 required ReqCollectionInformationModel reqInformationCollectionModel,
81 final response = await apiClient.post(
82 path: ApiEndpoints.sendCollectionsInformation,
83 data: reqInformationCollectionModel.toJson(),
85 return ResCollectionInformationModel.fromJson(response);
89 required ReqCollectionValidationModel reqValidationCollectionModel,
91 final test = await apiClient.post(
92 path: ApiEndpoints.validateCollection,
93 data: reqValidationCollectionModel.toJson(),
99 required ReqCollectionConfirmationModel reqCollectionConfirmationModel,
101 final response = await apiClient.post(
102 path: ApiEndpoints.sendCollectionConfirmation,
103 data: reqCollectionConfirmationModel.toJson(),
105 return ResCollectionConfirmationModel.fromJson(response);
109 required ReqCollectionPaymentModel reqCollectionPaymentModel,
111 final response = await apiClient.post(
112 path: ApiEndpoints.sendCollectionPayment,
113 data: reqCollectionPaymentModel.toJson(),
115 return response[
'success'];
119 required ReqCollectionRatingModel reqCollectionRatingModel,
121 final response = await apiClient.post(
122 path: ApiEndpoints.sendCollectionRating,
123 data: reqCollectionRatingModel.toJson(),
125 return response[
'success'];
131 final response = await apiClient.get(
132 path: ApiEndpoints.getCollectionContactList(
136 if (response is List) {
138 (json) => ResCollectionContactModel.fromJson(json),
145 final response = await
apiClient.get(
path: ApiEndpoints.ratingReasons);
146 if (response is List) {
149 (json) => ResCollectionRatingReasonModel.fromJson(json),
159 final response = await apiClient.get(
160 path: ApiEndpoints.getCollectionPaymentModeList(
164 if (response is List) {
sealed class CheckInOutEvent extends Equatable userId
Future< List< ResPartnerPaymentModel > > getCollectionPaymentModeList({ required int restaurentId, }) async
Future< ResCollectionConfirmationModel > sendCollectionConfirmation({ required ReqCollectionConfirmationModel reqCollectionConfirmationModel, }) async
Future< ResCollectionStatusModel > updateCollectionStatus({ required int collectionId, required String status, required String? cancelationReasonId, }) async
Future< void > sendCollectionPayment({ required ReqCollectionPaymentModel reqCollectionPaymentModel, }) async
Future< void > sendCollectionRating({ required ReqCollectionRatingModel reqCollectionRatingModel, }) async
Future< List< ResCancelationReasonModel > > getCollectionCancelationReasons() async
Future< void > validateCollection({ required ReqCollectionValidationModel reqValidationCollectionModel, }) async
Future< List< ResCollectionRatingReasonModel > > getRatingReasons() async
Future< ResCollectionInformationModel > sendCollectionsInformation({ required ReqCollectionInformationModel reqInformationCollectionModel, }) async
Future< List< CollectionModel > > getCollections({ required int userId, required bool notForToday, required String? type, }) async
Future< List< ResCollectionContactModel > > getCollectionContactList({ required int restaurentId, }) async
class UpdateCollectionStatusEvent extends CollectionsEvent collectionId
sealed class CollectionsState extends Equatable collections
ResPartnerPaymentModel({ required super.partnerId, required ResPaymentModeModel super.paymentModeId, })