Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
restaurant_partner_payments_isar_model.dart
Go to the documentation of this file.
1import 'package:isar/isar.dart';
2import '../../../../features/collections/data/models/res/res_partner_payment_model.dart';
3
4part 'restaurant_partner_payments_isar_model.g.dart';
5
8 @Index(type: IndexType.value)
9 Id? id;
10
11 @Index(type: IndexType.value)
12 int? restaurantId;
13
14 List<PartnerPayment>? partnerPayments;
15
17
19 required int restaurantId,
20 required List<ResPartnerPaymentModel> payments,
21 }) {
24 ..partnerPayments = payments
25 .map((payment) => PartnerPayment.fromModel(payment))
26 .toList();
27 }
28
29 List<ResPartnerPaymentModel>? toModel() {
30 return partnerPayments?.map((payment) => payment.toModel()).toList();
31 }
32}
33
34@embedded
35class PartnerPayment {
38
39 static PartnerPayment fromModel(ResPartnerPaymentModel model) {
40 return PartnerPayment()
41 ..partnerId = model.partnerId
42 ..paymentModeId = PaymentMode.fromModel(model.paymentModeId as ResPaymentModeModel);
43 }
44
51}
52
53@embedded
55 int? id;
57
59 return PaymentMode()
60 ..id = model.id
61 ..name = model.name;
62 }
63
66 id: id!,
67 name: name!,
68 );
69 }
70}
static PaymentMode fromModel(ResPaymentModeModel model)
Index(type:IndexType.value) int? restaurantId
Index(type:IndexType.value) Id? id
static RestaurantPartnerPaymentsIsarModel() RestaurantPartnerPaymentsIsarModel fromModel({ required int restaurantId, required List< ResPartnerPaymentModel > payments, })
final Partner partnerId
final String type
final int restaurantId
class Partner String
class ResPartnerPaymentModel extends ResPartnerPaymentEntity ResPaymentModeModel({ required super.id, required super.name, })
ResPartnerPaymentModel({ required super.partnerId, required ResPaymentModeModel super.paymentModeId, })
ResCollectionContactModel toModel()
static CollectionContact fromModel(ResCollectionContactModel model)
class SearchWeeklyCollectionsEvent extends WeeklyCollectionsEvent collection