diff --git a/CHANGELOG.md b/CHANGELOG.md index ad8abee..988f9d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 3.8.13 + +- Changed `destinyInformation` field in `AtsLoadingParamsFormInput` from nullable `List?` to non-nullable `List` with `@Default([])` to ensure it always defaults to an empty list. + ## 3.8.12 - Made `position` field nullable (`InboundPositionStructure?`) in `InboundStructure` and `InboundStructureInput` to support services without a position structure. diff --git a/lib/src/ats/ats.freezed.dart b/lib/src/ats/ats.freezed.dart index e977fe7..8968c97 100644 --- a/lib/src/ats/ats.freezed.dart +++ b/lib/src/ats/ats.freezed.dart @@ -7820,8 +7820,8 @@ mixin _$AtsLoadingParamsFormInput { set correctionFactor(double? value);/// `liquidWeight` Liquid weight for third-party storage double? get liquidWeight;/// `liquidWeight` Liquid weight for third-party storage set liquidWeight(double? value);/// `destinyInformation` Destiny information only on modality seta - List? get destinyInformation;/// `destinyInformation` Destiny information only on modality seta - set destinyInformation(List? value); + List get destinyInformation;/// `destinyInformation` Destiny information only on modality seta + set destinyInformation(List value); /// Create a copy of AtsLoadingParamsFormInput /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -7847,7 +7847,7 @@ abstract mixin class $AtsLoadingParamsFormInputCopyWith<$Res> { factory $AtsLoadingParamsFormInputCopyWith(AtsLoadingParamsFormInput value, $Res Function(AtsLoadingParamsFormInput) _then) = _$AtsLoadingParamsFormInputCopyWithImpl; @useResult $Res call({ - String? id, String? formNumber, String? assetId, String? receptionId, String? driver, double? sampleDensity, double? sampleTemperature, double? assetTemperature, double? analyzedAt,@AtsLoadingParamsSampleOrNullConverter() AtsLoadingParamsSample? sampleType, String? fuelSubtype, double? ambientVolume,@AtsParamsFormModalityOrNullConverter() ParamsFormModality? modality, double? inpm, double? initialWeight, double? finalWeight, double? volume20, double? density20, double? correctionFactor, double? liquidWeight, List? destinyInformation + String? id, String? formNumber, String? assetId, String? receptionId, String? driver, double? sampleDensity, double? sampleTemperature, double? assetTemperature, double? analyzedAt,@AtsLoadingParamsSampleOrNullConverter() AtsLoadingParamsSample? sampleType, String? fuelSubtype, double? ambientVolume,@AtsParamsFormModalityOrNullConverter() ParamsFormModality? modality, double? inpm, double? initialWeight, double? finalWeight, double? volume20, double? density20, double? correctionFactor, double? liquidWeight, List destinyInformation }); @@ -7864,7 +7864,7 @@ class _$AtsLoadingParamsFormInputCopyWithImpl<$Res> /// Create a copy of AtsLoadingParamsFormInput /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? formNumber = freezed,Object? assetId = freezed,Object? receptionId = freezed,Object? driver = freezed,Object? sampleDensity = freezed,Object? sampleTemperature = freezed,Object? assetTemperature = freezed,Object? analyzedAt = freezed,Object? sampleType = freezed,Object? fuelSubtype = freezed,Object? ambientVolume = freezed,Object? modality = freezed,Object? inpm = freezed,Object? initialWeight = freezed,Object? finalWeight = freezed,Object? volume20 = freezed,Object? density20 = freezed,Object? correctionFactor = freezed,Object? liquidWeight = freezed,Object? destinyInformation = freezed,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? formNumber = freezed,Object? assetId = freezed,Object? receptionId = freezed,Object? driver = freezed,Object? sampleDensity = freezed,Object? sampleTemperature = freezed,Object? assetTemperature = freezed,Object? analyzedAt = freezed,Object? sampleType = freezed,Object? fuelSubtype = freezed,Object? ambientVolume = freezed,Object? modality = freezed,Object? inpm = freezed,Object? initialWeight = freezed,Object? finalWeight = freezed,Object? volume20 = freezed,Object? density20 = freezed,Object? correctionFactor = freezed,Object? liquidWeight = freezed,Object? destinyInformation = null,}) { return _then(_self.copyWith( id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as String?,formNumber: freezed == formNumber ? _self.formNumber : formNumber // ignore: cast_nullable_to_non_nullable @@ -7886,8 +7886,8 @@ as double?,volume20: freezed == volume20 ? _self.volume20 : volume20 // ignore: as double?,density20: freezed == density20 ? _self.density20 : density20 // ignore: cast_nullable_to_non_nullable as double?,correctionFactor: freezed == correctionFactor ? _self.correctionFactor : correctionFactor // ignore: cast_nullable_to_non_nullable as double?,liquidWeight: freezed == liquidWeight ? _self.liquidWeight : liquidWeight // ignore: cast_nullable_to_non_nullable -as double?,destinyInformation: freezed == destinyInformation ? _self.destinyInformation : destinyInformation // ignore: cast_nullable_to_non_nullable -as List?, +as double?,destinyInformation: null == destinyInformation ? _self.destinyInformation : destinyInformation // ignore: cast_nullable_to_non_nullable +as List, )); } @@ -7972,7 +7972,7 @@ return $default(_that);case _: /// } /// ``` -@optionalTypeArgs TResult maybeWhen(TResult Function( String? id, String? formNumber, String? assetId, String? receptionId, String? driver, double? sampleDensity, double? sampleTemperature, double? assetTemperature, double? analyzedAt, @AtsLoadingParamsSampleOrNullConverter() AtsLoadingParamsSample? sampleType, String? fuelSubtype, double? ambientVolume, @AtsParamsFormModalityOrNullConverter() ParamsFormModality? modality, double? inpm, double? initialWeight, double? finalWeight, double? volume20, double? density20, double? correctionFactor, double? liquidWeight, List? destinyInformation)? $default,{required TResult orElse(),}) {final _that = this; +@optionalTypeArgs TResult maybeWhen(TResult Function( String? id, String? formNumber, String? assetId, String? receptionId, String? driver, double? sampleDensity, double? sampleTemperature, double? assetTemperature, double? analyzedAt, @AtsLoadingParamsSampleOrNullConverter() AtsLoadingParamsSample? sampleType, String? fuelSubtype, double? ambientVolume, @AtsParamsFormModalityOrNullConverter() ParamsFormModality? modality, double? inpm, double? initialWeight, double? finalWeight, double? volume20, double? density20, double? correctionFactor, double? liquidWeight, List destinyInformation)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _AtsLoadingParamsFormInput() when $default != null: return $default(_that.id,_that.formNumber,_that.assetId,_that.receptionId,_that.driver,_that.sampleDensity,_that.sampleTemperature,_that.assetTemperature,_that.analyzedAt,_that.sampleType,_that.fuelSubtype,_that.ambientVolume,_that.modality,_that.inpm,_that.initialWeight,_that.finalWeight,_that.volume20,_that.density20,_that.correctionFactor,_that.liquidWeight,_that.destinyInformation);case _: @@ -7993,7 +7993,7 @@ return $default(_that.id,_that.formNumber,_that.assetId,_that.receptionId,_that. /// } /// ``` -@optionalTypeArgs TResult when(TResult Function( String? id, String? formNumber, String? assetId, String? receptionId, String? driver, double? sampleDensity, double? sampleTemperature, double? assetTemperature, double? analyzedAt, @AtsLoadingParamsSampleOrNullConverter() AtsLoadingParamsSample? sampleType, String? fuelSubtype, double? ambientVolume, @AtsParamsFormModalityOrNullConverter() ParamsFormModality? modality, double? inpm, double? initialWeight, double? finalWeight, double? volume20, double? density20, double? correctionFactor, double? liquidWeight, List? destinyInformation) $default,) {final _that = this; +@optionalTypeArgs TResult when(TResult Function( String? id, String? formNumber, String? assetId, String? receptionId, String? driver, double? sampleDensity, double? sampleTemperature, double? assetTemperature, double? analyzedAt, @AtsLoadingParamsSampleOrNullConverter() AtsLoadingParamsSample? sampleType, String? fuelSubtype, double? ambientVolume, @AtsParamsFormModalityOrNullConverter() ParamsFormModality? modality, double? inpm, double? initialWeight, double? finalWeight, double? volume20, double? density20, double? correctionFactor, double? liquidWeight, List destinyInformation) $default,) {final _that = this; switch (_that) { case _AtsLoadingParamsFormInput(): return $default(_that.id,_that.formNumber,_that.assetId,_that.receptionId,_that.driver,_that.sampleDensity,_that.sampleTemperature,_that.assetTemperature,_that.analyzedAt,_that.sampleType,_that.fuelSubtype,_that.ambientVolume,_that.modality,_that.inpm,_that.initialWeight,_that.finalWeight,_that.volume20,_that.density20,_that.correctionFactor,_that.liquidWeight,_that.destinyInformation);case _: @@ -8013,7 +8013,7 @@ return $default(_that.id,_that.formNumber,_that.assetId,_that.receptionId,_that. /// } /// ``` -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? id, String? formNumber, String? assetId, String? receptionId, String? driver, double? sampleDensity, double? sampleTemperature, double? assetTemperature, double? analyzedAt, @AtsLoadingParamsSampleOrNullConverter() AtsLoadingParamsSample? sampleType, String? fuelSubtype, double? ambientVolume, @AtsParamsFormModalityOrNullConverter() ParamsFormModality? modality, double? inpm, double? initialWeight, double? finalWeight, double? volume20, double? density20, double? correctionFactor, double? liquidWeight, List? destinyInformation)? $default,) {final _that = this; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? id, String? formNumber, String? assetId, String? receptionId, String? driver, double? sampleDensity, double? sampleTemperature, double? assetTemperature, double? analyzedAt, @AtsLoadingParamsSampleOrNullConverter() AtsLoadingParamsSample? sampleType, String? fuelSubtype, double? ambientVolume, @AtsParamsFormModalityOrNullConverter() ParamsFormModality? modality, double? inpm, double? initialWeight, double? finalWeight, double? volume20, double? density20, double? correctionFactor, double? liquidWeight, List destinyInformation)? $default,) {final _that = this; switch (_that) { case _AtsLoadingParamsFormInput() when $default != null: return $default(_that.id,_that.formNumber,_that.assetId,_that.receptionId,_that.driver,_that.sampleDensity,_that.sampleTemperature,_that.assetTemperature,_that.analyzedAt,_that.sampleType,_that.fuelSubtype,_that.ambientVolume,_that.modality,_that.inpm,_that.initialWeight,_that.finalWeight,_that.volume20,_that.density20,_that.correctionFactor,_that.liquidWeight,_that.destinyInformation);case _: @@ -8028,7 +8028,7 @@ return $default(_that.id,_that.formNumber,_that.assetId,_that.receptionId,_that. @JsonSerializable() class _AtsLoadingParamsFormInput implements AtsLoadingParamsFormInput { - _AtsLoadingParamsFormInput({this.id, this.formNumber, this.assetId, this.receptionId, this.driver, this.sampleDensity, this.sampleTemperature, this.assetTemperature, this.analyzedAt, @AtsLoadingParamsSampleOrNullConverter() this.sampleType, this.fuelSubtype, this.ambientVolume, @AtsParamsFormModalityOrNullConverter() this.modality, this.inpm, this.initialWeight, this.finalWeight, this.volume20, this.density20, this.correctionFactor, this.liquidWeight, this.destinyInformation}); + _AtsLoadingParamsFormInput({this.id, this.formNumber, this.assetId, this.receptionId, this.driver, this.sampleDensity, this.sampleTemperature, this.assetTemperature, this.analyzedAt, @AtsLoadingParamsSampleOrNullConverter() this.sampleType, this.fuelSubtype, this.ambientVolume, @AtsParamsFormModalityOrNullConverter() this.modality, this.inpm, this.initialWeight, this.finalWeight, this.volume20, this.density20, this.correctionFactor, this.liquidWeight, this.destinyInformation = const []}); factory _AtsLoadingParamsFormInput.fromJson(Map json) => _$AtsLoadingParamsFormInputFromJson(json); /// `id` of the loading params form, ignore it if you are using "addLoadingParams" mutation @@ -8072,7 +8072,7 @@ class _AtsLoadingParamsFormInput implements AtsLoadingParamsFormInput { /// `liquidWeight` Liquid weight for third-party storage @override double? liquidWeight; /// `destinyInformation` Destiny information only on modality seta -@override List? destinyInformation; +@override@JsonKey() List destinyInformation; /// Create a copy of AtsLoadingParamsFormInput /// with the given fields replaced by the non-null parameter values. @@ -8100,7 +8100,7 @@ abstract mixin class _$AtsLoadingParamsFormInputCopyWith<$Res> implements $AtsLo factory _$AtsLoadingParamsFormInputCopyWith(_AtsLoadingParamsFormInput value, $Res Function(_AtsLoadingParamsFormInput) _then) = __$AtsLoadingParamsFormInputCopyWithImpl; @override @useResult $Res call({ - String? id, String? formNumber, String? assetId, String? receptionId, String? driver, double? sampleDensity, double? sampleTemperature, double? assetTemperature, double? analyzedAt,@AtsLoadingParamsSampleOrNullConverter() AtsLoadingParamsSample? sampleType, String? fuelSubtype, double? ambientVolume,@AtsParamsFormModalityOrNullConverter() ParamsFormModality? modality, double? inpm, double? initialWeight, double? finalWeight, double? volume20, double? density20, double? correctionFactor, double? liquidWeight, List? destinyInformation + String? id, String? formNumber, String? assetId, String? receptionId, String? driver, double? sampleDensity, double? sampleTemperature, double? assetTemperature, double? analyzedAt,@AtsLoadingParamsSampleOrNullConverter() AtsLoadingParamsSample? sampleType, String? fuelSubtype, double? ambientVolume,@AtsParamsFormModalityOrNullConverter() ParamsFormModality? modality, double? inpm, double? initialWeight, double? finalWeight, double? volume20, double? density20, double? correctionFactor, double? liquidWeight, List destinyInformation }); @@ -8117,7 +8117,7 @@ class __$AtsLoadingParamsFormInputCopyWithImpl<$Res> /// Create a copy of AtsLoadingParamsFormInput /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? formNumber = freezed,Object? assetId = freezed,Object? receptionId = freezed,Object? driver = freezed,Object? sampleDensity = freezed,Object? sampleTemperature = freezed,Object? assetTemperature = freezed,Object? analyzedAt = freezed,Object? sampleType = freezed,Object? fuelSubtype = freezed,Object? ambientVolume = freezed,Object? modality = freezed,Object? inpm = freezed,Object? initialWeight = freezed,Object? finalWeight = freezed,Object? volume20 = freezed,Object? density20 = freezed,Object? correctionFactor = freezed,Object? liquidWeight = freezed,Object? destinyInformation = freezed,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? formNumber = freezed,Object? assetId = freezed,Object? receptionId = freezed,Object? driver = freezed,Object? sampleDensity = freezed,Object? sampleTemperature = freezed,Object? assetTemperature = freezed,Object? analyzedAt = freezed,Object? sampleType = freezed,Object? fuelSubtype = freezed,Object? ambientVolume = freezed,Object? modality = freezed,Object? inpm = freezed,Object? initialWeight = freezed,Object? finalWeight = freezed,Object? volume20 = freezed,Object? density20 = freezed,Object? correctionFactor = freezed,Object? liquidWeight = freezed,Object? destinyInformation = null,}) { return _then(_AtsLoadingParamsFormInput( id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as String?,formNumber: freezed == formNumber ? _self.formNumber : formNumber // ignore: cast_nullable_to_non_nullable @@ -8139,8 +8139,8 @@ as double?,volume20: freezed == volume20 ? _self.volume20 : volume20 // ignore: as double?,density20: freezed == density20 ? _self.density20 : density20 // ignore: cast_nullable_to_non_nullable as double?,correctionFactor: freezed == correctionFactor ? _self.correctionFactor : correctionFactor // ignore: cast_nullable_to_non_nullable as double?,liquidWeight: freezed == liquidWeight ? _self.liquidWeight : liquidWeight // ignore: cast_nullable_to_non_nullable -as double?,destinyInformation: freezed == destinyInformation ? _self.destinyInformation : destinyInformation // ignore: cast_nullable_to_non_nullable -as List?, +as double?,destinyInformation: null == destinyInformation ? _self.destinyInformation : destinyInformation // ignore: cast_nullable_to_non_nullable +as List, )); } diff --git a/lib/src/ats/ats.g.dart b/lib/src/ats/ats.g.dart index 5a9bae3..3917ef1 100644 --- a/lib/src/ats/ats.g.dart +++ b/lib/src/ats/ats.g.dart @@ -864,11 +864,14 @@ _AtsLoadingParamsFormInput _$AtsLoadingParamsFormInputFromJson( density20: (json['density20'] as num?)?.toDouble(), correctionFactor: (json['correctionFactor'] as num?)?.toDouble(), liquidWeight: (json['liquidWeight'] as num?)?.toDouble(), - destinyInformation: (json['destinyInformation'] as List?) - ?.map( - (e) => AtsDestinyInformationInput.fromJson(e as Map), - ) - .toList(), + destinyInformation: + (json['destinyInformation'] as List?) + ?.map( + (e) => + AtsDestinyInformationInput.fromJson(e as Map), + ) + .toList() ?? + const [], ); Map _$AtsLoadingParamsFormInputToJson( @@ -899,7 +902,7 @@ Map _$AtsLoadingParamsFormInputToJson( 'correctionFactor': instance.correctionFactor, 'liquidWeight': instance.liquidWeight, 'destinyInformation': instance.destinyInformation - ?.map((e) => e.toJson()) + .map((e) => e.toJson()) .toList(), }; diff --git a/lib/src/ats/src/reception/loading_params_form_input.dart b/lib/src/ats/src/reception/loading_params_form_input.dart index aae76c5..751d974 100644 --- a/lib/src/ats/src/reception/loading_params_form_input.dart +++ b/lib/src/ats/src/reception/loading_params_form_input.dart @@ -64,7 +64,7 @@ abstract class AtsLoadingParamsFormInput with _$AtsLoadingParamsFormInput { double? liquidWeight, /// `destinyInformation` Destiny information only on modality seta - List? destinyInformation, + @Default([]) List destinyInformation, }) = _AtsLoadingParamsFormInput; factory AtsLoadingParamsFormInput.fromJson(Map json) => _$AtsLoadingParamsFormInputFromJson(json); diff --git a/pubspec.yaml b/pubspec.yaml index ad17b4d..3b10e39 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ description: Layrz API models for Dart/Flutter. This package contains the models used by the Layrz API. name: layrz_models -version: "3.8.12" +version: "3.8.13" repository: https://github.com/goldenm-software/layrz_models environment: