sistemati ticket

This commit is contained in:
2026-05-12 11:14:48 +02:00
parent 57061da20d
commit 2aab70aec5
14 changed files with 367 additions and 95 deletions

View File

@@ -1,12 +1,13 @@
import 'package:equatable/equatable.dart';
import 'package:flux/core/utils/extensions.dart';
import 'package:flux/features/customers/models/customer_model.dart';
/// Enum per il tipo di ticket
enum TicketType {
repair('repair', 'Riparazione'),
softwareSetup('software_setup', 'Setup software'),
dataTransfer('data_transfer', 'Trasferimento dati'),
operationTicket('operation_ticket', 'Ticket di operazione'),
softwareSetup('software_setup', 'Impost. software'),
dataTransfer('data_transfer', 'Trasf. dati'),
operationTicket('operation_ticket', 'Ticket operazione'),
other('other', 'Altro');
final String value;
@@ -106,8 +107,7 @@ class TicketModel extends Equatable {
final DateTime? estimatedDeliveryAt;
final TicketResult? ticketResult;
final String? resolutionNotes;
final String? customerName;
final String? customerEmail;
final CustomerModel? customer;
final String? targetModelName;
final String? sourceModelName;
final String? createdById;
@@ -142,8 +142,7 @@ class TicketModel extends Equatable {
this.estimatedDeliveryAt,
this.ticketResult,
this.resolutionNotes,
this.customerName,
this.customerEmail,
this.customer,
this.targetModelName,
this.sourceModelName,
this.createdById,
@@ -193,8 +192,7 @@ class TicketModel extends Equatable {
DateTime? estimatedDeliveryAt,
TicketResult? ticketResult,
String? resolutionNotes,
String? customerName,
String? customerEmail,
CustomerModel? customer,
String? targetModelName,
String? sourceModelName,
String? createdById,
@@ -230,8 +228,7 @@ class TicketModel extends Equatable {
estimatedDeliveryAt: estimatedDeliveryAt ?? this.estimatedDeliveryAt,
ticketResult: ticketResult ?? this.ticketResult,
resolutionNotes: resolutionNotes ?? this.resolutionNotes,
customerName: customerName ?? this.customerName,
customerEmail: customerEmail ?? this.customerEmail,
customer: customer ?? this.customer,
targetModelName: targetModelName ?? this.targetModelName,
sourceModelName: sourceModelName ?? this.sourceModelName,
createdById: createdById ?? this.createdById,
@@ -279,8 +276,9 @@ class TicketModel extends Equatable {
: null,
ticketResult: TicketResult.fromString(map['ticket_result'] as String?),
resolutionNotes: map['resolution_notes'] as String?,
customerName: (map['customer']?['name'] as String?).myFormat(),
customerEmail: (map['customer']?['email'] as String?).myFormat(),
customer: map['customer'] != null
? CustomerModel.fromMap(map['customer'] as Map<String, dynamic>)
: null,
targetModelName: (map['target_model']?['name_with_brand'] as String?)
?.myFormat(),
sourceModelName: (map['source_model']?['name_with_brand'] as String?)
@@ -354,8 +352,7 @@ class TicketModel extends Equatable {
ticketResult,
resolutionNotes,
includedAccessories,
customerName,
customerEmail,
customer,
targetModelName,
sourceModelName,
createdById,