1
1
// ignore_for_file: prefer_single_quotes, unnecessary_import, unused_import
2
2
3
3
import 'package:equatable/equatable.dart' ;
4
- import 'package:flutter_deriv_api/api/exceptions/base_api_exception.dart' ;
5
4
5
+ import 'package:flutter_deriv_api/api/exceptions/p2p_advert_exception.dart' ;
6
6
import 'package:flutter_deriv_api/api/models/base_exception_model.dart' ;
7
7
import 'package:flutter_deriv_api/basic_api/generated/p2p_advert_create_receive.dart' ;
8
8
import 'package:flutter_deriv_api/basic_api/generated/p2p_advert_create_send.dart' ;
@@ -176,21 +176,33 @@ enum P2pAdvertCreateTypeEnum {
176
176
/// VisibilityStatusItemEnum mapper.
177
177
final Map <String , VisibilityStatusItemEnum > visibilityStatusItemEnumMapper =
178
178
< String , VisibilityStatusItemEnum > {
179
+ "advert_fixed_rate_disabled" :
180
+ VisibilityStatusItemEnum .advertFixedRateDisabled,
181
+ "advert_float_rate_disabled" :
182
+ VisibilityStatusItemEnum .advertFloatRateDisabled,
179
183
"advert_inactive" : VisibilityStatusItemEnum .advertInactive,
180
184
"advert_max_limit" : VisibilityStatusItemEnum .advertMaxLimit,
181
185
"advert_min_limit" : VisibilityStatusItemEnum .advertMinLimit,
182
186
"advert_remaining" : VisibilityStatusItemEnum .advertRemaining,
187
+ "advert_no_payment_methods" : VisibilityStatusItemEnum .advertNoPaymentMethods,
183
188
"advertiser_ads_paused" : VisibilityStatusItemEnum .advertiserAdsPaused,
184
189
"advertiser_approval" : VisibilityStatusItemEnum .advertiserApproval,
185
190
"advertiser_balance" : VisibilityStatusItemEnum .advertiserBalance,
186
191
"advertiser_block_trade_ineligible" :
187
192
VisibilityStatusItemEnum .advertiserBlockTradeIneligible,
188
193
"advertiser_daily_limit" : VisibilityStatusItemEnum .advertiserDailyLimit,
194
+ "advertiser_schedule" : VisibilityStatusItemEnum .advertiserSchedule,
189
195
"advertiser_temp_ban" : VisibilityStatusItemEnum .advertiserTempBan,
190
196
};
191
197
192
198
/// VisibilityStatusItem Enum.
193
199
enum VisibilityStatusItemEnum {
200
+ /// advert_fixed_rate_disabled.
201
+ advertFixedRateDisabled,
202
+
203
+ /// advert_float_rate_disabled.
204
+ advertFloatRateDisabled,
205
+
194
206
/// advert_inactive.
195
207
advertInactive,
196
208
@@ -203,6 +215,9 @@ enum VisibilityStatusItemEnum {
203
215
/// advert_remaining.
204
216
advertRemaining,
205
217
218
+ /// advert_no_payment_methods.
219
+ advertNoPaymentMethods,
220
+
206
221
/// advertiser_ads_paused.
207
222
advertiserAdsPaused,
208
223
@@ -218,10 +233,12 @@ enum VisibilityStatusItemEnum {
218
233
/// advertiser_daily_limit.
219
234
advertiserDailyLimit,
220
235
236
+ /// advertiser_schedule.
237
+ advertiserSchedule,
238
+
221
239
/// advertiser_temp_ban.
222
240
advertiserTempBan,
223
241
}
224
-
225
242
/// P2p advert create model class.
226
243
abstract class P2pAdvertCreateModel {
227
244
/// Initializes P2p advert create model class .
@@ -398,13 +415,17 @@ abstract class P2pAdvertCreateModel {
398
415
final String ? priceDisplay;
399
416
400
417
/// Reasons why an advert is not visible. Possible values:
418
+ /// - `advert_fixed_rate_disabled` : fixed rate adverts are no longer available in the advert's country.
419
+ /// - `advert_float_rate_disabled` : floating rate adverts are no longer available in the advert's country.
401
420
/// - `advert_inactive` : the advert is set inactive.
402
421
/// - `advert_max_limit` : the minimum order amount exceeds the system maximum order.
403
422
/// - `advert_min_limit` : the maximum order amount is too small to be shown on the advert list.
404
423
/// - `advert_remaining` : the remaining amount of the advert is below the minimum order.
424
+ /// - `advert_no_payment_methods` : the advert has no valid payment methods.
405
425
/// - `advertiser_ads_paused` : the advertiser has paused all adverts.
406
426
/// - `advertiser_approval` : the advertiser's proof of identity is not verified.
407
427
/// - `advertiser_balance` : the advertiser's P2P balance is less than the minimum order.
428
+ /// - `advertiser_schedule` : the advertiser's schedule does not have availability between now and now + order_expiry_period.
408
429
/// - `advertiser_block_trade_ineligible` : the advertiser is not currently eligible for block trading.
409
430
/// - `advertiser_daily_limit` : the advertiser's remaining daily limit is less than the minimum order.
410
431
/// - `advertiser_temp_ban` : the advertiser is temporarily banned from P2P.
@@ -721,13 +742,13 @@ class P2pAdvertCreate extends P2pAdvertCreateModel {
721
742
visibilityStatus: visibilityStatus ?? this .visibilityStatus,
722
743
);
723
744
}
724
-
725
745
/// Advertiser details model class.
726
746
abstract class AdvertiserDetailsModel {
727
747
/// Initializes Advertiser details model class .
728
748
const AdvertiserDetailsModel ({
729
749
required this .ratingCount,
730
750
required this .name,
751
+ required this .isScheduleAvailable,
731
752
required this .isOnline,
732
753
required this .id,
733
754
required this .completedOrdersCount,
@@ -746,6 +767,9 @@ abstract class AdvertiserDetailsModel {
746
767
/// The advertiser's displayed name.
747
768
final String name;
748
769
770
+ /// Inidcates whether the advertiser's schedule has availability between now and now + order_expiry_period.
771
+ final bool isScheduleAvailable;
772
+
749
773
/// Indicates if the advertiser is currently online.
750
774
final bool isOnline;
751
775
@@ -784,6 +808,7 @@ class AdvertiserDetails extends AdvertiserDetailsModel {
784
808
required super .completedOrdersCount,
785
809
required super .id,
786
810
required super .isOnline,
811
+ required super .isScheduleAvailable,
787
812
required super .name,
788
813
required super .ratingCount,
789
814
super .firstName,
@@ -801,6 +826,7 @@ class AdvertiserDetails extends AdvertiserDetailsModel {
801
826
completedOrdersCount: json['completed_orders_count' ],
802
827
id: json['id' ],
803
828
isOnline: getBool (json['is_online' ])! ,
829
+ isScheduleAvailable: getBool (json['is_schedule_available' ])! ,
804
830
name: json['name' ],
805
831
ratingCount: json['rating_count' ],
806
832
firstName: json['first_name' ],
@@ -819,6 +845,7 @@ class AdvertiserDetails extends AdvertiserDetailsModel {
819
845
resultMap['completed_orders_count' ] = completedOrdersCount;
820
846
resultMap['id' ] = id;
821
847
resultMap['is_online' ] = isOnline;
848
+ resultMap['is_schedule_available' ] = isScheduleAvailable;
822
849
resultMap['name' ] = name;
823
850
resultMap['rating_count' ] = ratingCount;
824
851
resultMap['first_name' ] = firstName;
@@ -838,6 +865,7 @@ class AdvertiserDetails extends AdvertiserDetailsModel {
838
865
int ? completedOrdersCount,
839
866
String ? id,
840
867
bool ? isOnline,
868
+ bool ? isScheduleAvailable,
841
869
String ? name,
842
870
int ? ratingCount,
843
871
String ? firstName,
@@ -852,6 +880,7 @@ class AdvertiserDetails extends AdvertiserDetailsModel {
852
880
completedOrdersCount: completedOrdersCount ?? this .completedOrdersCount,
853
881
id: id ?? this .id,
854
882
isOnline: isOnline ?? this .isOnline,
883
+ isScheduleAvailable: isScheduleAvailable ?? this .isScheduleAvailable,
855
884
name: name ?? this .name,
856
885
ratingCount: ratingCount ?? this .ratingCount,
857
886
firstName: firstName ?? this .firstName,
@@ -863,7 +892,6 @@ class AdvertiserDetails extends AdvertiserDetailsModel {
863
892
totalCompletionRate: totalCompletionRate ?? this .totalCompletionRate,
864
893
);
865
894
}
866
-
867
895
/// Payment method details property model class.
868
896
abstract class PaymentMethodDetailsPropertyModel {
869
897
/// Initializes Payment method details property model class .
@@ -992,7 +1020,6 @@ class PaymentMethodDetailsProperty extends PaymentMethodDetailsPropertyModel {
992
1020
usedByOrders: usedByOrders ?? this .usedByOrders,
993
1021
);
994
1022
}
995
-
996
1023
/// Fields property model class.
997
1024
abstract class FieldsPropertyModel {
998
1025
/// Initializes Fields property model class .
0 commit comments