feat - Service - Providers

This commit is contained in:
2026-04-16 11:48:11 +02:00
parent 29790a7a36
commit 787873a26f
11 changed files with 758 additions and 55 deletions

View File

@@ -13,6 +13,7 @@ class ServiceModel extends Equatable {
final bool isBozza;
final String note;
final bool resultOk;
final String? customerDisplayName;
// Telefonia
final int al;
@@ -44,6 +45,7 @@ class ServiceModel extends Equatable {
this.energyServices = const [],
this.finServices = const [],
this.entertainmentServices = const [],
this.customerDisplayName,
});
ServiceModel copyWith({
@@ -64,6 +66,7 @@ class ServiceModel extends Equatable {
List<EnergyServiceModel>? energyServices,
List<FinServiceModel>? finServices,
List<EntertainmentServiceModel>? entertainmentServices,
String? customerDisplayName,
}) {
return ServiceModel(
id: id ?? this.id,
@@ -84,6 +87,7 @@ class ServiceModel extends Equatable {
finServices: finServices ?? this.finServices,
entertainmentServices:
entertainmentServices ?? this.entertainmentServices,
customerDisplayName: customerDisplayName ?? this.customerDisplayName,
);
}
@@ -106,6 +110,7 @@ class ServiceModel extends Equatable {
energyServices,
finServices,
entertainmentServices,
customerDisplayName,
];
factory ServiceModel.fromMap(Map<String, dynamic> map) {
@@ -141,6 +146,9 @@ class ServiceModel extends Equatable {
?.map((x) => EntertainmentServiceModel.fromMap(x))
.toList() ??
const [],
customerDisplayName: map['customer'] != null
? "${map['customer']['name']} ${map['customer']['surname']}"
: "Cliente sconosciuto",
);
}