This commit is contained in:
2026-05-13 19:24:25 +02:00
parent 24004a99da
commit 3b3cfb5e43
6 changed files with 36 additions and 15 deletions

View File

@@ -162,7 +162,7 @@ class _LatestOperationsCardContent extends StatelessWidget {
Expanded(
flex: 5,
child: Text(
operation.reference,
operation.type,
style: TextStyle(
fontWeight: FontWeight.w600,
color: context.primaryText,

View File

@@ -89,8 +89,10 @@ class TicketModel extends Equatable {
final String? customerId;
final String? targetModelId;
final String? targetSn;
final String? targetPassword;
final String? sourceModelId;
final String? sourceSn;
final String? sourcePassword;
final double customerPrice;
final double internalCost;
final DateTime? closedAt;
@@ -124,8 +126,10 @@ class TicketModel extends Equatable {
this.customerId,
this.targetModelId,
this.targetSn,
this.targetPassword,
this.sourceModelId,
this.sourceSn,
this.sourcePassword,
this.customerPrice = 0.0,
this.internalCost = 0.0,
this.closedAt,
@@ -174,8 +178,10 @@ class TicketModel extends Equatable {
String? customerId,
String? targetModelId,
String? targetSn,
String? targetPassword,
String? sourceModelId,
String? sourceSn,
String? sourcePassword,
double? customerPrice,
double? internalCost,
DateTime? closedAt,
@@ -209,8 +215,10 @@ class TicketModel extends Equatable {
customerId: customerId ?? this.customerId,
targetModelId: targetModelId ?? this.targetModelId,
targetSn: targetSn ?? this.targetSn,
targetPassword: targetPassword ?? this.targetPassword,
sourceModelId: sourceModelId ?? this.sourceModelId,
sourceSn: sourceSn ?? this.sourceSn,
sourcePassword: sourcePassword ?? this.sourcePassword,
customerPrice: customerPrice ?? this.customerPrice,
internalCost: internalCost ?? this.internalCost,
closedAt: closedAt ?? this.closedAt,
@@ -253,6 +261,8 @@ class TicketModel extends Equatable {
targetSn: map['target_sn'] as String?,
sourceModelId: map['source_model_id'] as String?,
sourceSn: map['source_sn'] as String?,
targetPassword: map['target_password'] as String?,
sourcePassword: map['source_password'] as String?,
// Fix per i field numerici di Postgres che potrebbero arrivare come int o double
customerPrice: (map['customer_price'] as num?)?.toDouble() ?? 0.0,
internalCost: (map['internal_cost'] as num?)?.toDouble() ?? 0.0,
@@ -302,6 +312,9 @@ class TicketModel extends Equatable {
'target_sn': targetSn,
'source_model_id': sourceModelId,
'source_sn': sourceSn,
'target_password': targetPassword,
'source_password': sourcePassword,
'customer_price': customerPrice,
'internal_cost': internalCost,
if (closedAt != null) 'closed_at': closedAt!.toUtc().toIso8601String(),
@@ -336,6 +349,8 @@ class TicketModel extends Equatable {
targetSn,
sourceModelId,
sourceSn,
targetPassword,
sourcePassword,
customerPrice,
internalCost,
closedAt,

View File

@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flux/core/blocs/session/session_cubit.dart';
import 'package:flux/core/routes/routes.dart';
import 'package:flux/core/widgets/staff_selector_modal.dart';
import 'package:flux/features/master_data/staff/models/staff_member_model.dart';
@@ -8,7 +7,6 @@ import 'package:flux/features/tickets/blocs/ticket_list_cubit.dart';
import 'package:flux/features/tickets/blocs/ticket_list_state.dart';
import 'package:flux/features/tickets/models/ticket_model.dart';
import 'package:flux/features/tickets/models/ticket_status_extension.dart';
import 'package:flux/features/tickets/ui/ticket_form_screen.dart';
import 'package:go_router/go_router.dart';
class TicketListScreen extends StatefulWidget {

View File

@@ -1,10 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
// Importa il tuo TicketModel, Cubit, ecc.
import 'package:flux/features/tickets/models/ticket_model.dart';
class TicketWorkspaceScreen extends StatelessWidget {
// Passiamo il ticket attuale per avere i dati (o il Cubit se preferisci)
final dynamic ticket; // Sostituisci con TicketModel
final TicketModel ticket; // Sostituisci con TicketModel
const TicketWorkspaceScreen({super.key, required this.ticket});
@@ -67,7 +65,7 @@ class TicketWorkspaceScreen extends StatelessWidget {
),
const SizedBox(height: 8),
Text(
ticket.deviceModel ??
ticket.targetModelName ??
'Modello Sconosciuto', // Es: "iPhone 13 Pro"
style: const TextStyle(
fontSize: 24,
@@ -88,14 +86,25 @@ class TicketWorkspaceScreen extends StatelessWidget {
child: Column(
children: [
const Text(
'PIN / SBLOCCO',
'PIN / SBLOCCO Target device',
style: TextStyle(fontSize: 10, color: Colors.grey),
),
const SizedBox(height: 4),
Text(
ticket.unlockPassword?.isNotEmpty == true
? ticket.unlockPassword!
: 'Nessuno',
ticket.targetPassword ?? '',
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
letterSpacing: 2,
),
),
const Text(
'PIN / SBLOCCO Source device',
style: TextStyle(fontSize: 10, color: Colors.grey),
),
const SizedBox(height: 4),
Text(
ticket.sourcePassword ?? '',
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
@@ -138,7 +147,7 @@ class TicketWorkspaceScreen extends StatelessWidget {
border: Border.all(color: theme.dividerColor),
),
child: Text(
ticket.defectDescription ?? 'Nessuna descrizione inserita.',
ticket.request,
style: const TextStyle(fontSize: 16, height: 1.5),
),
),

View File

@@ -43,7 +43,7 @@ class TrackingCubit extends Cubit<TrackingState> {
companyId: companyId,
message: message,
type: TrackingType.manualNote,
parentId: parentId!,
parentId: parentId,
parentType: parentType,
staffId: staffId,
isInternal: isInternal,