aggiunta scelta business o privato

This commit is contained in:
2026-05-19 11:54:59 +02:00
parent 2bdba523ad
commit 4e03d52a5d
11 changed files with 173 additions and 38 deletions

View File

@@ -14,6 +14,7 @@ class CustomerModel extends Equatable {
final String companyId; // UUID
final bool isActive;
final List<AttachmentModel> attachments;
final bool isBusiness;
const CustomerModel({
this.id,
@@ -27,6 +28,7 @@ class CustomerModel extends Equatable {
required this.companyId,
this.isActive = true,
this.attachments = const [],
this.isBusiness = false,
});
@override
@@ -42,6 +44,7 @@ class CustomerModel extends Equatable {
companyId,
isActive,
attachments,
isBusiness,
];
factory CustomerModel.empty() => CustomerModel(
@@ -65,6 +68,7 @@ class CustomerModel extends Equatable {
String? companyId,
bool? isActive,
List<AttachmentModel>? attachments,
bool? isBusiness,
}) {
return CustomerModel(
id: id ?? this.id,
@@ -78,6 +82,7 @@ class CustomerModel extends Equatable {
companyId: companyId ?? this.companyId,
isActive: isActive ?? this.isActive,
attachments: attachments ?? this.attachments,
isBusiness: isBusiness ?? this.isBusiness,
);
}
@@ -102,6 +107,7 @@ class CustomerModel extends Equatable {
?.map((x) => AttachmentModel.fromMap(x))
.toList() ??
const [],
isBusiness: map['is_business'] as bool? ?? false,
);
}
@@ -117,6 +123,7 @@ class CustomerModel extends Equatable {
'do_not_disturb': doNotDisturb,
'company_id': companyId,
'is_active': isActive,
'is_business': isBusiness,
};
}
}