progress on batches
This commit is contained in:
143
lib/screens/groups/models/group_batch_model.dart
Normal file
143
lib/screens/groups/models/group_batch_model.dart
Normal file
@@ -0,0 +1,143 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'group_batch_model.g.dart';
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GroupBatch {
|
||||
final String? id;
|
||||
final String? recipientGroupId;
|
||||
final String? userId;
|
||||
final String? currency;
|
||||
final String? description;
|
||||
final double? value;
|
||||
final String? status;
|
||||
final String? paymentProcessorLabel;
|
||||
final String? paymentProcessorName;
|
||||
final String? paymentProcessorImage;
|
||||
final String? transactionTemplate;
|
||||
final String? createdAt;
|
||||
final int? count;
|
||||
final int? successfulCount;
|
||||
final int? failedCount;
|
||||
|
||||
const GroupBatch({
|
||||
this.id,
|
||||
this.recipientGroupId,
|
||||
this.userId,
|
||||
this.currency,
|
||||
this.description,
|
||||
this.value,
|
||||
this.status,
|
||||
this.paymentProcessorLabel,
|
||||
this.paymentProcessorName,
|
||||
this.paymentProcessorImage,
|
||||
this.transactionTemplate,
|
||||
this.createdAt,
|
||||
this.count,
|
||||
this.successfulCount,
|
||||
this.failedCount,
|
||||
});
|
||||
|
||||
factory GroupBatch.fromJson(Map<String, dynamic> json) =>
|
||||
_$GroupBatchFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$GroupBatchToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GroupBatchItem {
|
||||
final String? id;
|
||||
final String? groupBatchId;
|
||||
final String? recipientName;
|
||||
final String? recipientPhone;
|
||||
final double? amount;
|
||||
final String? status;
|
||||
final String? transactionId;
|
||||
final String? errorMessage;
|
||||
final String? createdAt;
|
||||
|
||||
const GroupBatchItem({
|
||||
this.id,
|
||||
this.groupBatchId,
|
||||
this.recipientName,
|
||||
this.recipientPhone,
|
||||
this.amount,
|
||||
this.status,
|
||||
this.transactionId,
|
||||
this.errorMessage,
|
||||
this.createdAt,
|
||||
});
|
||||
|
||||
factory GroupBatchItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GroupBatchItemFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$GroupBatchItemToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class CreateBatchRequest {
|
||||
final String recipientGroupId;
|
||||
final String userId;
|
||||
final String currency;
|
||||
final String description;
|
||||
final double amount;
|
||||
final String? paymentProcessorLabel;
|
||||
final String? paymentProcessorName;
|
||||
final String? paymentProcessorImage;
|
||||
final Map<String, dynamic> transactionTemplate;
|
||||
|
||||
const CreateBatchRequest({
|
||||
required this.recipientGroupId,
|
||||
required this.userId,
|
||||
required this.currency,
|
||||
required this.description,
|
||||
required this.amount,
|
||||
this.paymentProcessorLabel,
|
||||
this.paymentProcessorName,
|
||||
this.paymentProcessorImage,
|
||||
required this.transactionTemplate,
|
||||
});
|
||||
|
||||
factory CreateBatchRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$CreateBatchRequestFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$CreateBatchRequestToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class BatchActionRequest {
|
||||
final String userId;
|
||||
final String idempotencyKey;
|
||||
|
||||
const BatchActionRequest({
|
||||
required this.userId,
|
||||
required this.idempotencyKey,
|
||||
});
|
||||
|
||||
factory BatchActionRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$BatchActionRequestFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$BatchActionRequestToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GroupBatchUpdateRequest {
|
||||
String? id;
|
||||
String? userId;
|
||||
String? paymentProcessorLabel;
|
||||
String? paymentProcessorName;
|
||||
String? paymentProcessorImage;
|
||||
|
||||
GroupBatchUpdateRequest({
|
||||
this.id,
|
||||
this.userId,
|
||||
this.paymentProcessorLabel,
|
||||
this.paymentProcessorName,
|
||||
this.paymentProcessorImage,
|
||||
});
|
||||
|
||||
factory GroupBatchUpdateRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$GroupBatchUpdateRequestFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$GroupBatchUpdateRequestToJson(this);
|
||||
}
|
||||
Reference in New Issue
Block a user