refactor nomi tabelle
This commit is contained in:
@@ -104,6 +104,7 @@ class OperationFormCubit extends Cubit<OperationFormState> {
|
||||
batchUuid: current.batchUuid, // MANTIENE IL COLLEGAMENTO
|
||||
customerId: current.customerId, // MANTIENE IL CLIENTE
|
||||
customer: current.customer,
|
||||
reference: current.reference,
|
||||
status: OperationStatus.draft,
|
||||
createdAt: DateTime.now(),
|
||||
),
|
||||
@@ -122,7 +123,21 @@ class OperationFormCubit extends Cubit<OperationFormState> {
|
||||
);
|
||||
|
||||
try {
|
||||
final operationToSave = state.operation.copyWith(status: targetStatus);
|
||||
OperationModel operationToSave = state.operation.copyWith(
|
||||
status: targetStatus,
|
||||
);
|
||||
if (operationToSave.reference.isEmpty) {
|
||||
if (operationToSave.customer != null &&
|
||||
operationToSave.customer!.phoneNumber.isNotEmpty) {
|
||||
operationToSave = operationToSave.copyWith(
|
||||
reference: '${operationToSave.customer?.phoneNumber} - auto',
|
||||
);
|
||||
} else {
|
||||
operationToSave = operationToSave.copyWith(
|
||||
reference: 'Nessun riferimento',
|
||||
);
|
||||
}
|
||||
}
|
||||
final savedOperation = await _repository.saveFullOperation(
|
||||
operation: operationToSave,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user