diff --git a/.fvmrc b/.fvmrc index 0b52810..0bcd154 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,4 +1,4 @@ { - "flutter": "3.41.4", + "flutter": "3.41.8", "flavors": {} } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ff99f8e..4231988 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 3.8.8 + +- Fixed `casesMonitorConfig` type in `Workspace` model to be a list of nullable `CaseMonitorCard?` instead of non-nullable `CaseMonitorCard`. +- Added `AtsMdfe` model +- Added `mdfeId`, `mdfe` and `mdfes` values in `AtsOperation` model +- Added default values to `StockClosingInput` model +- Added `ATS_INVOICE_SWAP` value in `ReferenceCategory` enum + ## 3.8.7 - Updated `openingBalance` to `openingBalance20` in `StockClosingTank` model diff --git a/lib/src/ats/ats.dart b/lib/src/ats/ats.dart index 0ed9850..d99e8fa 100644 --- a/lib/src/ats/ats.dart +++ b/lib/src/ats/ats.dart @@ -51,6 +51,7 @@ part 'src/entries/entry_input.dart'; // ATS Operations Models part 'src/operations/operation.dart'; part 'src/operations/status.dart'; +part 'src/operations/ats_mdfe.dart'; // ATS Converters part 'src/converters/order_status.dart'; diff --git a/lib/src/ats/ats.freezed.dart b/lib/src/ats/ats.freezed.dart index 8c6e71e..9c5a5dc 100644 --- a/lib/src/ats/ats.freezed.dart +++ b/lib/src/ats/ats.freezed.dart @@ -13156,7 +13156,10 @@ mixin _$AtsOperation { AtsEtaStatus? get etaStatus;/// [loadingOrders] is the list of loading orders linked to the operation. List? get loadingOrders;/// [terminalEntryAt] is the timestamp of the terminal entry. @TimestampOrNullConverter() DateTime? get terminalEntryAt;/// [terminalExitAt] is the timestamp of the terminal exit. -@TimestampOrNullConverter() DateTime? get terminalExitAt; +@TimestampOrNullConverter() DateTime? get terminalExitAt;/// [mdfeId] is the ID of the MDF-e linked to the operation. + String? get mdfeId;/// [mdfe] is the MDF-e linked to the operation. + AtsMdfe? get mdfe;/// [mdfes] is the list of MDF-e linked to the operation. + List? get mdfes; /// Create a copy of AtsOperation /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -13169,16 +13172,16 @@ $AtsOperationCopyWith get copyWith => _$AtsOperationCopyWithImpl Object.hashAll([runtimeType,id,sellerAssetId,transportAssetId,transportCompanyAssetId,purchasedAt,createdAt,finishedAt,pendingToReview,const DeepCollectionEquality().hash(ordersIds),sellerAsset,transportAsset,transportCompanyAsset,sellerInformation,transportInformation,orderStatus,category,deliverCategory,const DeepCollectionEquality().hash(purchaseOrders),const DeepCollectionEquality().hash(statuses),totalQuantity,const DeepCollectionEquality().hash(productsInformation),const DeepCollectionEquality().hash(ctes),const DeepCollectionEquality().hash(caclFormsIds),const DeepCollectionEquality().hash(caclForms),const DeepCollectionEquality().hash(manifests),const DeepCollectionEquality().hash(history),minEta,etaStatus,const DeepCollectionEquality().hash(loadingOrders),terminalEntryAt,terminalExitAt]); +int get hashCode => Object.hashAll([runtimeType,id,sellerAssetId,transportAssetId,transportCompanyAssetId,purchasedAt,createdAt,finishedAt,pendingToReview,const DeepCollectionEquality().hash(ordersIds),sellerAsset,transportAsset,transportCompanyAsset,sellerInformation,transportInformation,orderStatus,category,deliverCategory,const DeepCollectionEquality().hash(purchaseOrders),const DeepCollectionEquality().hash(statuses),totalQuantity,const DeepCollectionEquality().hash(productsInformation),const DeepCollectionEquality().hash(ctes),const DeepCollectionEquality().hash(caclFormsIds),const DeepCollectionEquality().hash(caclForms),const DeepCollectionEquality().hash(manifests),const DeepCollectionEquality().hash(history),minEta,etaStatus,const DeepCollectionEquality().hash(loadingOrders),terminalEntryAt,terminalExitAt,mdfeId,mdfe,const DeepCollectionEquality().hash(mdfes)]); @override String toString() { - return 'AtsOperation(id: $id, sellerAssetId: $sellerAssetId, transportAssetId: $transportAssetId, transportCompanyAssetId: $transportCompanyAssetId, purchasedAt: $purchasedAt, createdAt: $createdAt, finishedAt: $finishedAt, pendingToReview: $pendingToReview, ordersIds: $ordersIds, sellerAsset: $sellerAsset, transportAsset: $transportAsset, transportCompanyAsset: $transportCompanyAsset, sellerInformation: $sellerInformation, transportInformation: $transportInformation, orderStatus: $orderStatus, category: $category, deliverCategory: $deliverCategory, purchaseOrders: $purchaseOrders, statuses: $statuses, totalQuantity: $totalQuantity, productsInformation: $productsInformation, ctes: $ctes, caclFormsIds: $caclFormsIds, caclForms: $caclForms, manifests: $manifests, history: $history, minEta: $minEta, etaStatus: $etaStatus, loadingOrders: $loadingOrders, terminalEntryAt: $terminalEntryAt, terminalExitAt: $terminalExitAt)'; + return 'AtsOperation(id: $id, sellerAssetId: $sellerAssetId, transportAssetId: $transportAssetId, transportCompanyAssetId: $transportCompanyAssetId, purchasedAt: $purchasedAt, createdAt: $createdAt, finishedAt: $finishedAt, pendingToReview: $pendingToReview, ordersIds: $ordersIds, sellerAsset: $sellerAsset, transportAsset: $transportAsset, transportCompanyAsset: $transportCompanyAsset, sellerInformation: $sellerInformation, transportInformation: $transportInformation, orderStatus: $orderStatus, category: $category, deliverCategory: $deliverCategory, purchaseOrders: $purchaseOrders, statuses: $statuses, totalQuantity: $totalQuantity, productsInformation: $productsInformation, ctes: $ctes, caclFormsIds: $caclFormsIds, caclForms: $caclForms, manifests: $manifests, history: $history, minEta: $minEta, etaStatus: $etaStatus, loadingOrders: $loadingOrders, terminalEntryAt: $terminalEntryAt, terminalExitAt: $terminalExitAt, mdfeId: $mdfeId, mdfe: $mdfe, mdfes: $mdfes)'; } @@ -13189,11 +13192,11 @@ abstract mixin class $AtsOperationCopyWith<$Res> { factory $AtsOperationCopyWith(AtsOperation value, $Res Function(AtsOperation) _then) = _$AtsOperationCopyWithImpl; @useResult $Res call({ - String? id, String? sellerAssetId, String? transportAssetId, String? transportCompanyAssetId,@TimestampOrNullConverter() DateTime? purchasedAt,@TimestampOrNullConverter() DateTime? createdAt,@TimestampOrNullConverter() DateTime? finishedAt, bool? pendingToReview, List? ordersIds, Asset? sellerAsset, Asset? transportAsset, Asset? transportCompanyAsset, AtsCompanyInformation? sellerInformation, AtsTransportInformation? transportInformation,@JsonKey(unknownEnumValue: AtsPurchaseOrderStatus.generated) AtsPurchaseOrderStatus? orderStatus,@JsonKey(unknownEnumValue: AtsPurchaseOrderCategoriesEntity.notDefined) AtsPurchaseOrderCategoriesEntity? category,@JsonKey(unknownEnumValue: AtsPurchaseOrderSubCategories.notDefined) AtsPurchaseOrderSubCategories? deliverCategory, List? purchaseOrders, List? statuses, double? totalQuantity, List? productsInformation, List? ctes, List? caclFormsIds, List? caclForms, List? manifests, List? history,@TimestampOrNullConverter() DateTime? minEta, AtsEtaStatus? etaStatus, List? loadingOrders,@TimestampOrNullConverter() DateTime? terminalEntryAt,@TimestampOrNullConverter() DateTime? terminalExitAt + String? id, String? sellerAssetId, String? transportAssetId, String? transportCompanyAssetId,@TimestampOrNullConverter() DateTime? purchasedAt,@TimestampOrNullConverter() DateTime? createdAt,@TimestampOrNullConverter() DateTime? finishedAt, bool? pendingToReview, List? ordersIds, Asset? sellerAsset, Asset? transportAsset, Asset? transportCompanyAsset, AtsCompanyInformation? sellerInformation, AtsTransportInformation? transportInformation,@JsonKey(unknownEnumValue: AtsPurchaseOrderStatus.generated) AtsPurchaseOrderStatus? orderStatus,@JsonKey(unknownEnumValue: AtsPurchaseOrderCategoriesEntity.notDefined) AtsPurchaseOrderCategoriesEntity? category,@JsonKey(unknownEnumValue: AtsPurchaseOrderSubCategories.notDefined) AtsPurchaseOrderSubCategories? deliverCategory, List? purchaseOrders, List? statuses, double? totalQuantity, List? productsInformation, List? ctes, List? caclFormsIds, List? caclForms, List? manifests, List? history,@TimestampOrNullConverter() DateTime? minEta, AtsEtaStatus? etaStatus, List? loadingOrders,@TimestampOrNullConverter() DateTime? terminalEntryAt,@TimestampOrNullConverter() DateTime? terminalExitAt, String? mdfeId, AtsMdfe? mdfe, List? mdfes }); -$AssetCopyWith<$Res>? get sellerAsset;$AssetCopyWith<$Res>? get transportAsset;$AssetCopyWith<$Res>? get transportCompanyAsset;$AtsCompanyInformationCopyWith<$Res>? get sellerInformation;$AtsTransportInformationCopyWith<$Res>? get transportInformation; +$AssetCopyWith<$Res>? get sellerAsset;$AssetCopyWith<$Res>? get transportAsset;$AssetCopyWith<$Res>? get transportCompanyAsset;$AtsCompanyInformationCopyWith<$Res>? get sellerInformation;$AtsTransportInformationCopyWith<$Res>? get transportInformation;$AtsMdfeCopyWith<$Res>? get mdfe; } /// @nodoc @@ -13206,7 +13209,7 @@ class _$AtsOperationCopyWithImpl<$Res> /// Create a copy of AtsOperation /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? sellerAssetId = freezed,Object? transportAssetId = freezed,Object? transportCompanyAssetId = freezed,Object? purchasedAt = freezed,Object? createdAt = freezed,Object? finishedAt = freezed,Object? pendingToReview = freezed,Object? ordersIds = freezed,Object? sellerAsset = freezed,Object? transportAsset = freezed,Object? transportCompanyAsset = freezed,Object? sellerInformation = freezed,Object? transportInformation = freezed,Object? orderStatus = freezed,Object? category = freezed,Object? deliverCategory = freezed,Object? purchaseOrders = freezed,Object? statuses = freezed,Object? totalQuantity = freezed,Object? productsInformation = freezed,Object? ctes = freezed,Object? caclFormsIds = freezed,Object? caclForms = freezed,Object? manifests = freezed,Object? history = freezed,Object? minEta = freezed,Object? etaStatus = freezed,Object? loadingOrders = freezed,Object? terminalEntryAt = freezed,Object? terminalExitAt = freezed,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? sellerAssetId = freezed,Object? transportAssetId = freezed,Object? transportCompanyAssetId = freezed,Object? purchasedAt = freezed,Object? createdAt = freezed,Object? finishedAt = freezed,Object? pendingToReview = freezed,Object? ordersIds = freezed,Object? sellerAsset = freezed,Object? transportAsset = freezed,Object? transportCompanyAsset = freezed,Object? sellerInformation = freezed,Object? transportInformation = freezed,Object? orderStatus = freezed,Object? category = freezed,Object? deliverCategory = freezed,Object? purchaseOrders = freezed,Object? statuses = freezed,Object? totalQuantity = freezed,Object? productsInformation = freezed,Object? ctes = freezed,Object? caclFormsIds = freezed,Object? caclForms = freezed,Object? manifests = freezed,Object? history = freezed,Object? minEta = freezed,Object? etaStatus = freezed,Object? loadingOrders = freezed,Object? terminalEntryAt = freezed,Object? terminalExitAt = freezed,Object? mdfeId = freezed,Object? mdfe = freezed,Object? mdfes = freezed,}) { return _then(_self.copyWith( id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as String?,sellerAssetId: freezed == sellerAssetId ? _self.sellerAssetId : sellerAssetId // ignore: cast_nullable_to_non_nullable @@ -13239,7 +13242,10 @@ as DateTime?,etaStatus: freezed == etaStatus ? _self.etaStatus : etaStatus // ig as AtsEtaStatus?,loadingOrders: freezed == loadingOrders ? _self.loadingOrders : loadingOrders // ignore: cast_nullable_to_non_nullable as List?,terminalEntryAt: freezed == terminalEntryAt ? _self.terminalEntryAt : terminalEntryAt // ignore: cast_nullable_to_non_nullable as DateTime?,terminalExitAt: freezed == terminalExitAt ? _self.terminalExitAt : terminalExitAt // ignore: cast_nullable_to_non_nullable -as DateTime?, +as DateTime?,mdfeId: freezed == mdfeId ? _self.mdfeId : mdfeId // ignore: cast_nullable_to_non_nullable +as String?,mdfe: freezed == mdfe ? _self.mdfe : mdfe // ignore: cast_nullable_to_non_nullable +as AtsMdfe?,mdfes: freezed == mdfes ? _self.mdfes : mdfes // ignore: cast_nullable_to_non_nullable +as List?, )); } /// Create a copy of AtsOperation @@ -13302,6 +13308,18 @@ $AtsTransportInformationCopyWith<$Res>? get transportInformation { return $AtsTransportInformationCopyWith<$Res>(_self.transportInformation!, (value) { return _then(_self.copyWith(transportInformation: value)); }); +}/// Create a copy of AtsOperation +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AtsMdfeCopyWith<$Res>? get mdfe { + if (_self.mdfe == null) { + return null; + } + + return $AtsMdfeCopyWith<$Res>(_self.mdfe!, (value) { + return _then(_self.copyWith(mdfe: value)); + }); } } @@ -13384,10 +13402,10 @@ return $default(_that);case _: /// } /// ``` -@optionalTypeArgs TResult maybeWhen(TResult Function( String? id, String? sellerAssetId, String? transportAssetId, String? transportCompanyAssetId, @TimestampOrNullConverter() DateTime? purchasedAt, @TimestampOrNullConverter() DateTime? createdAt, @TimestampOrNullConverter() DateTime? finishedAt, bool? pendingToReview, List? ordersIds, Asset? sellerAsset, Asset? transportAsset, Asset? transportCompanyAsset, AtsCompanyInformation? sellerInformation, AtsTransportInformation? transportInformation, @JsonKey(unknownEnumValue: AtsPurchaseOrderStatus.generated) AtsPurchaseOrderStatus? orderStatus, @JsonKey(unknownEnumValue: AtsPurchaseOrderCategoriesEntity.notDefined) AtsPurchaseOrderCategoriesEntity? category, @JsonKey(unknownEnumValue: AtsPurchaseOrderSubCategories.notDefined) AtsPurchaseOrderSubCategories? deliverCategory, List? purchaseOrders, List? statuses, double? totalQuantity, List? productsInformation, List? ctes, List? caclFormsIds, List? caclForms, List? manifests, List? history, @TimestampOrNullConverter() DateTime? minEta, AtsEtaStatus? etaStatus, List? loadingOrders, @TimestampOrNullConverter() DateTime? terminalEntryAt, @TimestampOrNullConverter() DateTime? terminalExitAt)? $default,{required TResult orElse(),}) {final _that = this; +@optionalTypeArgs TResult maybeWhen(TResult Function( String? id, String? sellerAssetId, String? transportAssetId, String? transportCompanyAssetId, @TimestampOrNullConverter() DateTime? purchasedAt, @TimestampOrNullConverter() DateTime? createdAt, @TimestampOrNullConverter() DateTime? finishedAt, bool? pendingToReview, List? ordersIds, Asset? sellerAsset, Asset? transportAsset, Asset? transportCompanyAsset, AtsCompanyInformation? sellerInformation, AtsTransportInformation? transportInformation, @JsonKey(unknownEnumValue: AtsPurchaseOrderStatus.generated) AtsPurchaseOrderStatus? orderStatus, @JsonKey(unknownEnumValue: AtsPurchaseOrderCategoriesEntity.notDefined) AtsPurchaseOrderCategoriesEntity? category, @JsonKey(unknownEnumValue: AtsPurchaseOrderSubCategories.notDefined) AtsPurchaseOrderSubCategories? deliverCategory, List? purchaseOrders, List? statuses, double? totalQuantity, List? productsInformation, List? ctes, List? caclFormsIds, List? caclForms, List? manifests, List? history, @TimestampOrNullConverter() DateTime? minEta, AtsEtaStatus? etaStatus, List? loadingOrders, @TimestampOrNullConverter() DateTime? terminalEntryAt, @TimestampOrNullConverter() DateTime? terminalExitAt, String? mdfeId, AtsMdfe? mdfe, List? mdfes)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _AtsOperation() when $default != null: -return $default(_that.id,_that.sellerAssetId,_that.transportAssetId,_that.transportCompanyAssetId,_that.purchasedAt,_that.createdAt,_that.finishedAt,_that.pendingToReview,_that.ordersIds,_that.sellerAsset,_that.transportAsset,_that.transportCompanyAsset,_that.sellerInformation,_that.transportInformation,_that.orderStatus,_that.category,_that.deliverCategory,_that.purchaseOrders,_that.statuses,_that.totalQuantity,_that.productsInformation,_that.ctes,_that.caclFormsIds,_that.caclForms,_that.manifests,_that.history,_that.minEta,_that.etaStatus,_that.loadingOrders,_that.terminalEntryAt,_that.terminalExitAt);case _: +return $default(_that.id,_that.sellerAssetId,_that.transportAssetId,_that.transportCompanyAssetId,_that.purchasedAt,_that.createdAt,_that.finishedAt,_that.pendingToReview,_that.ordersIds,_that.sellerAsset,_that.transportAsset,_that.transportCompanyAsset,_that.sellerInformation,_that.transportInformation,_that.orderStatus,_that.category,_that.deliverCategory,_that.purchaseOrders,_that.statuses,_that.totalQuantity,_that.productsInformation,_that.ctes,_that.caclFormsIds,_that.caclForms,_that.manifests,_that.history,_that.minEta,_that.etaStatus,_that.loadingOrders,_that.terminalEntryAt,_that.terminalExitAt,_that.mdfeId,_that.mdfe,_that.mdfes);case _: return orElse(); } @@ -13405,10 +13423,10 @@ return $default(_that.id,_that.sellerAssetId,_that.transportAssetId,_that.transp /// } /// ``` -@optionalTypeArgs TResult when(TResult Function( String? id, String? sellerAssetId, String? transportAssetId, String? transportCompanyAssetId, @TimestampOrNullConverter() DateTime? purchasedAt, @TimestampOrNullConverter() DateTime? createdAt, @TimestampOrNullConverter() DateTime? finishedAt, bool? pendingToReview, List? ordersIds, Asset? sellerAsset, Asset? transportAsset, Asset? transportCompanyAsset, AtsCompanyInformation? sellerInformation, AtsTransportInformation? transportInformation, @JsonKey(unknownEnumValue: AtsPurchaseOrderStatus.generated) AtsPurchaseOrderStatus? orderStatus, @JsonKey(unknownEnumValue: AtsPurchaseOrderCategoriesEntity.notDefined) AtsPurchaseOrderCategoriesEntity? category, @JsonKey(unknownEnumValue: AtsPurchaseOrderSubCategories.notDefined) AtsPurchaseOrderSubCategories? deliverCategory, List? purchaseOrders, List? statuses, double? totalQuantity, List? productsInformation, List? ctes, List? caclFormsIds, List? caclForms, List? manifests, List? history, @TimestampOrNullConverter() DateTime? minEta, AtsEtaStatus? etaStatus, List? loadingOrders, @TimestampOrNullConverter() DateTime? terminalEntryAt, @TimestampOrNullConverter() DateTime? terminalExitAt) $default,) {final _that = this; +@optionalTypeArgs TResult when(TResult Function( String? id, String? sellerAssetId, String? transportAssetId, String? transportCompanyAssetId, @TimestampOrNullConverter() DateTime? purchasedAt, @TimestampOrNullConverter() DateTime? createdAt, @TimestampOrNullConverter() DateTime? finishedAt, bool? pendingToReview, List? ordersIds, Asset? sellerAsset, Asset? transportAsset, Asset? transportCompanyAsset, AtsCompanyInformation? sellerInformation, AtsTransportInformation? transportInformation, @JsonKey(unknownEnumValue: AtsPurchaseOrderStatus.generated) AtsPurchaseOrderStatus? orderStatus, @JsonKey(unknownEnumValue: AtsPurchaseOrderCategoriesEntity.notDefined) AtsPurchaseOrderCategoriesEntity? category, @JsonKey(unknownEnumValue: AtsPurchaseOrderSubCategories.notDefined) AtsPurchaseOrderSubCategories? deliverCategory, List? purchaseOrders, List? statuses, double? totalQuantity, List? productsInformation, List? ctes, List? caclFormsIds, List? caclForms, List? manifests, List? history, @TimestampOrNullConverter() DateTime? minEta, AtsEtaStatus? etaStatus, List? loadingOrders, @TimestampOrNullConverter() DateTime? terminalEntryAt, @TimestampOrNullConverter() DateTime? terminalExitAt, String? mdfeId, AtsMdfe? mdfe, List? mdfes) $default,) {final _that = this; switch (_that) { case _AtsOperation(): -return $default(_that.id,_that.sellerAssetId,_that.transportAssetId,_that.transportCompanyAssetId,_that.purchasedAt,_that.createdAt,_that.finishedAt,_that.pendingToReview,_that.ordersIds,_that.sellerAsset,_that.transportAsset,_that.transportCompanyAsset,_that.sellerInformation,_that.transportInformation,_that.orderStatus,_that.category,_that.deliverCategory,_that.purchaseOrders,_that.statuses,_that.totalQuantity,_that.productsInformation,_that.ctes,_that.caclFormsIds,_that.caclForms,_that.manifests,_that.history,_that.minEta,_that.etaStatus,_that.loadingOrders,_that.terminalEntryAt,_that.terminalExitAt);case _: +return $default(_that.id,_that.sellerAssetId,_that.transportAssetId,_that.transportCompanyAssetId,_that.purchasedAt,_that.createdAt,_that.finishedAt,_that.pendingToReview,_that.ordersIds,_that.sellerAsset,_that.transportAsset,_that.transportCompanyAsset,_that.sellerInformation,_that.transportInformation,_that.orderStatus,_that.category,_that.deliverCategory,_that.purchaseOrders,_that.statuses,_that.totalQuantity,_that.productsInformation,_that.ctes,_that.caclFormsIds,_that.caclForms,_that.manifests,_that.history,_that.minEta,_that.etaStatus,_that.loadingOrders,_that.terminalEntryAt,_that.terminalExitAt,_that.mdfeId,_that.mdfe,_that.mdfes);case _: throw StateError('Unexpected subclass'); } @@ -13425,10 +13443,10 @@ return $default(_that.id,_that.sellerAssetId,_that.transportAssetId,_that.transp /// } /// ``` -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? id, String? sellerAssetId, String? transportAssetId, String? transportCompanyAssetId, @TimestampOrNullConverter() DateTime? purchasedAt, @TimestampOrNullConverter() DateTime? createdAt, @TimestampOrNullConverter() DateTime? finishedAt, bool? pendingToReview, List? ordersIds, Asset? sellerAsset, Asset? transportAsset, Asset? transportCompanyAsset, AtsCompanyInformation? sellerInformation, AtsTransportInformation? transportInformation, @JsonKey(unknownEnumValue: AtsPurchaseOrderStatus.generated) AtsPurchaseOrderStatus? orderStatus, @JsonKey(unknownEnumValue: AtsPurchaseOrderCategoriesEntity.notDefined) AtsPurchaseOrderCategoriesEntity? category, @JsonKey(unknownEnumValue: AtsPurchaseOrderSubCategories.notDefined) AtsPurchaseOrderSubCategories? deliverCategory, List? purchaseOrders, List? statuses, double? totalQuantity, List? productsInformation, List? ctes, List? caclFormsIds, List? caclForms, List? manifests, List? history, @TimestampOrNullConverter() DateTime? minEta, AtsEtaStatus? etaStatus, List? loadingOrders, @TimestampOrNullConverter() DateTime? terminalEntryAt, @TimestampOrNullConverter() DateTime? terminalExitAt)? $default,) {final _that = this; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? id, String? sellerAssetId, String? transportAssetId, String? transportCompanyAssetId, @TimestampOrNullConverter() DateTime? purchasedAt, @TimestampOrNullConverter() DateTime? createdAt, @TimestampOrNullConverter() DateTime? finishedAt, bool? pendingToReview, List? ordersIds, Asset? sellerAsset, Asset? transportAsset, Asset? transportCompanyAsset, AtsCompanyInformation? sellerInformation, AtsTransportInformation? transportInformation, @JsonKey(unknownEnumValue: AtsPurchaseOrderStatus.generated) AtsPurchaseOrderStatus? orderStatus, @JsonKey(unknownEnumValue: AtsPurchaseOrderCategoriesEntity.notDefined) AtsPurchaseOrderCategoriesEntity? category, @JsonKey(unknownEnumValue: AtsPurchaseOrderSubCategories.notDefined) AtsPurchaseOrderSubCategories? deliverCategory, List? purchaseOrders, List? statuses, double? totalQuantity, List? productsInformation, List? ctes, List? caclFormsIds, List? caclForms, List? manifests, List? history, @TimestampOrNullConverter() DateTime? minEta, AtsEtaStatus? etaStatus, List? loadingOrders, @TimestampOrNullConverter() DateTime? terminalEntryAt, @TimestampOrNullConverter() DateTime? terminalExitAt, String? mdfeId, AtsMdfe? mdfe, List? mdfes)? $default,) {final _that = this; switch (_that) { case _AtsOperation() when $default != null: -return $default(_that.id,_that.sellerAssetId,_that.transportAssetId,_that.transportCompanyAssetId,_that.purchasedAt,_that.createdAt,_that.finishedAt,_that.pendingToReview,_that.ordersIds,_that.sellerAsset,_that.transportAsset,_that.transportCompanyAsset,_that.sellerInformation,_that.transportInformation,_that.orderStatus,_that.category,_that.deliverCategory,_that.purchaseOrders,_that.statuses,_that.totalQuantity,_that.productsInformation,_that.ctes,_that.caclFormsIds,_that.caclForms,_that.manifests,_that.history,_that.minEta,_that.etaStatus,_that.loadingOrders,_that.terminalEntryAt,_that.terminalExitAt);case _: +return $default(_that.id,_that.sellerAssetId,_that.transportAssetId,_that.transportCompanyAssetId,_that.purchasedAt,_that.createdAt,_that.finishedAt,_that.pendingToReview,_that.ordersIds,_that.sellerAsset,_that.transportAsset,_that.transportCompanyAsset,_that.sellerInformation,_that.transportInformation,_that.orderStatus,_that.category,_that.deliverCategory,_that.purchaseOrders,_that.statuses,_that.totalQuantity,_that.productsInformation,_that.ctes,_that.caclFormsIds,_that.caclForms,_that.manifests,_that.history,_that.minEta,_that.etaStatus,_that.loadingOrders,_that.terminalEntryAt,_that.terminalExitAt,_that.mdfeId,_that.mdfe,_that.mdfes);case _: return null; } @@ -13440,7 +13458,7 @@ return $default(_that.id,_that.sellerAssetId,_that.transportAssetId,_that.transp @JsonSerializable() class _AtsOperation implements AtsOperation { - const _AtsOperation({this.id, this.sellerAssetId, this.transportAssetId, this.transportCompanyAssetId, @TimestampOrNullConverter() this.purchasedAt, @TimestampOrNullConverter() this.createdAt, @TimestampOrNullConverter() this.finishedAt, this.pendingToReview, final List? ordersIds, this.sellerAsset, this.transportAsset, this.transportCompanyAsset, this.sellerInformation, this.transportInformation, @JsonKey(unknownEnumValue: AtsPurchaseOrderStatus.generated) this.orderStatus, @JsonKey(unknownEnumValue: AtsPurchaseOrderCategoriesEntity.notDefined) this.category, @JsonKey(unknownEnumValue: AtsPurchaseOrderSubCategories.notDefined) this.deliverCategory, final List? purchaseOrders, final List? statuses, this.totalQuantity, final List? productsInformation, final List? ctes, final List? caclFormsIds, final List? caclForms, final List? manifests, final List? history, @TimestampOrNullConverter() this.minEta, this.etaStatus, final List? loadingOrders, @TimestampOrNullConverter() this.terminalEntryAt, @TimestampOrNullConverter() this.terminalExitAt}): _ordersIds = ordersIds,_purchaseOrders = purchaseOrders,_statuses = statuses,_productsInformation = productsInformation,_ctes = ctes,_caclFormsIds = caclFormsIds,_caclForms = caclForms,_manifests = manifests,_history = history,_loadingOrders = loadingOrders; + const _AtsOperation({this.id, this.sellerAssetId, this.transportAssetId, this.transportCompanyAssetId, @TimestampOrNullConverter() this.purchasedAt, @TimestampOrNullConverter() this.createdAt, @TimestampOrNullConverter() this.finishedAt, this.pendingToReview, final List? ordersIds, this.sellerAsset, this.transportAsset, this.transportCompanyAsset, this.sellerInformation, this.transportInformation, @JsonKey(unknownEnumValue: AtsPurchaseOrderStatus.generated) this.orderStatus, @JsonKey(unknownEnumValue: AtsPurchaseOrderCategoriesEntity.notDefined) this.category, @JsonKey(unknownEnumValue: AtsPurchaseOrderSubCategories.notDefined) this.deliverCategory, final List? purchaseOrders, final List? statuses, this.totalQuantity, final List? productsInformation, final List? ctes, final List? caclFormsIds, final List? caclForms, final List? manifests, final List? history, @TimestampOrNullConverter() this.minEta, this.etaStatus, final List? loadingOrders, @TimestampOrNullConverter() this.terminalEntryAt, @TimestampOrNullConverter() this.terminalExitAt, this.mdfeId, this.mdfe, final List? mdfes}): _ordersIds = ordersIds,_purchaseOrders = purchaseOrders,_statuses = statuses,_productsInformation = productsInformation,_ctes = ctes,_caclFormsIds = caclFormsIds,_caclForms = caclForms,_manifests = manifests,_history = history,_loadingOrders = loadingOrders,_mdfes = mdfes; factory _AtsOperation.fromJson(Map json) => _$AtsOperationFromJson(json); /// `id` of the asset entity. This ID is unique. @@ -13595,6 +13613,21 @@ class _AtsOperation implements AtsOperation { @override@TimestampOrNullConverter() final DateTime? terminalEntryAt; /// [terminalExitAt] is the timestamp of the terminal exit. @override@TimestampOrNullConverter() final DateTime? terminalExitAt; +/// [mdfeId] is the ID of the MDF-e linked to the operation. +@override final String? mdfeId; +/// [mdfe] is the MDF-e linked to the operation. +@override final AtsMdfe? mdfe; +/// [mdfes] is the list of MDF-e linked to the operation. + final List? _mdfes; +/// [mdfes] is the list of MDF-e linked to the operation. +@override List? get mdfes { + final value = _mdfes; + if (value == null) return null; + if (_mdfes is EqualUnmodifiableListView) return _mdfes; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + /// Create a copy of AtsOperation /// with the given fields replaced by the non-null parameter values. @@ -13609,16 +13642,16 @@ Map toJson() { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _AtsOperation&&(identical(other.id, id) || other.id == id)&&(identical(other.sellerAssetId, sellerAssetId) || other.sellerAssetId == sellerAssetId)&&(identical(other.transportAssetId, transportAssetId) || other.transportAssetId == transportAssetId)&&(identical(other.transportCompanyAssetId, transportCompanyAssetId) || other.transportCompanyAssetId == transportCompanyAssetId)&&(identical(other.purchasedAt, purchasedAt) || other.purchasedAt == purchasedAt)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.finishedAt, finishedAt) || other.finishedAt == finishedAt)&&(identical(other.pendingToReview, pendingToReview) || other.pendingToReview == pendingToReview)&&const DeepCollectionEquality().equals(other._ordersIds, _ordersIds)&&(identical(other.sellerAsset, sellerAsset) || other.sellerAsset == sellerAsset)&&(identical(other.transportAsset, transportAsset) || other.transportAsset == transportAsset)&&(identical(other.transportCompanyAsset, transportCompanyAsset) || other.transportCompanyAsset == transportCompanyAsset)&&(identical(other.sellerInformation, sellerInformation) || other.sellerInformation == sellerInformation)&&(identical(other.transportInformation, transportInformation) || other.transportInformation == transportInformation)&&(identical(other.orderStatus, orderStatus) || other.orderStatus == orderStatus)&&(identical(other.category, category) || other.category == category)&&(identical(other.deliverCategory, deliverCategory) || other.deliverCategory == deliverCategory)&&const DeepCollectionEquality().equals(other._purchaseOrders, _purchaseOrders)&&const DeepCollectionEquality().equals(other._statuses, _statuses)&&(identical(other.totalQuantity, totalQuantity) || other.totalQuantity == totalQuantity)&&const DeepCollectionEquality().equals(other._productsInformation, _productsInformation)&&const DeepCollectionEquality().equals(other._ctes, _ctes)&&const DeepCollectionEquality().equals(other._caclFormsIds, _caclFormsIds)&&const DeepCollectionEquality().equals(other._caclForms, _caclForms)&&const DeepCollectionEquality().equals(other._manifests, _manifests)&&const DeepCollectionEquality().equals(other._history, _history)&&(identical(other.minEta, minEta) || other.minEta == minEta)&&(identical(other.etaStatus, etaStatus) || other.etaStatus == etaStatus)&&const DeepCollectionEquality().equals(other._loadingOrders, _loadingOrders)&&(identical(other.terminalEntryAt, terminalEntryAt) || other.terminalEntryAt == terminalEntryAt)&&(identical(other.terminalExitAt, terminalExitAt) || other.terminalExitAt == terminalExitAt)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AtsOperation&&(identical(other.id, id) || other.id == id)&&(identical(other.sellerAssetId, sellerAssetId) || other.sellerAssetId == sellerAssetId)&&(identical(other.transportAssetId, transportAssetId) || other.transportAssetId == transportAssetId)&&(identical(other.transportCompanyAssetId, transportCompanyAssetId) || other.transportCompanyAssetId == transportCompanyAssetId)&&(identical(other.purchasedAt, purchasedAt) || other.purchasedAt == purchasedAt)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.finishedAt, finishedAt) || other.finishedAt == finishedAt)&&(identical(other.pendingToReview, pendingToReview) || other.pendingToReview == pendingToReview)&&const DeepCollectionEquality().equals(other._ordersIds, _ordersIds)&&(identical(other.sellerAsset, sellerAsset) || other.sellerAsset == sellerAsset)&&(identical(other.transportAsset, transportAsset) || other.transportAsset == transportAsset)&&(identical(other.transportCompanyAsset, transportCompanyAsset) || other.transportCompanyAsset == transportCompanyAsset)&&(identical(other.sellerInformation, sellerInformation) || other.sellerInformation == sellerInformation)&&(identical(other.transportInformation, transportInformation) || other.transportInformation == transportInformation)&&(identical(other.orderStatus, orderStatus) || other.orderStatus == orderStatus)&&(identical(other.category, category) || other.category == category)&&(identical(other.deliverCategory, deliverCategory) || other.deliverCategory == deliverCategory)&&const DeepCollectionEquality().equals(other._purchaseOrders, _purchaseOrders)&&const DeepCollectionEquality().equals(other._statuses, _statuses)&&(identical(other.totalQuantity, totalQuantity) || other.totalQuantity == totalQuantity)&&const DeepCollectionEquality().equals(other._productsInformation, _productsInformation)&&const DeepCollectionEquality().equals(other._ctes, _ctes)&&const DeepCollectionEquality().equals(other._caclFormsIds, _caclFormsIds)&&const DeepCollectionEquality().equals(other._caclForms, _caclForms)&&const DeepCollectionEquality().equals(other._manifests, _manifests)&&const DeepCollectionEquality().equals(other._history, _history)&&(identical(other.minEta, minEta) || other.minEta == minEta)&&(identical(other.etaStatus, etaStatus) || other.etaStatus == etaStatus)&&const DeepCollectionEquality().equals(other._loadingOrders, _loadingOrders)&&(identical(other.terminalEntryAt, terminalEntryAt) || other.terminalEntryAt == terminalEntryAt)&&(identical(other.terminalExitAt, terminalExitAt) || other.terminalExitAt == terminalExitAt)&&(identical(other.mdfeId, mdfeId) || other.mdfeId == mdfeId)&&(identical(other.mdfe, mdfe) || other.mdfe == mdfe)&&const DeepCollectionEquality().equals(other._mdfes, _mdfes)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hashAll([runtimeType,id,sellerAssetId,transportAssetId,transportCompanyAssetId,purchasedAt,createdAt,finishedAt,pendingToReview,const DeepCollectionEquality().hash(_ordersIds),sellerAsset,transportAsset,transportCompanyAsset,sellerInformation,transportInformation,orderStatus,category,deliverCategory,const DeepCollectionEquality().hash(_purchaseOrders),const DeepCollectionEquality().hash(_statuses),totalQuantity,const DeepCollectionEquality().hash(_productsInformation),const DeepCollectionEquality().hash(_ctes),const DeepCollectionEquality().hash(_caclFormsIds),const DeepCollectionEquality().hash(_caclForms),const DeepCollectionEquality().hash(_manifests),const DeepCollectionEquality().hash(_history),minEta,etaStatus,const DeepCollectionEquality().hash(_loadingOrders),terminalEntryAt,terminalExitAt]); +int get hashCode => Object.hashAll([runtimeType,id,sellerAssetId,transportAssetId,transportCompanyAssetId,purchasedAt,createdAt,finishedAt,pendingToReview,const DeepCollectionEquality().hash(_ordersIds),sellerAsset,transportAsset,transportCompanyAsset,sellerInformation,transportInformation,orderStatus,category,deliverCategory,const DeepCollectionEquality().hash(_purchaseOrders),const DeepCollectionEquality().hash(_statuses),totalQuantity,const DeepCollectionEquality().hash(_productsInformation),const DeepCollectionEquality().hash(_ctes),const DeepCollectionEquality().hash(_caclFormsIds),const DeepCollectionEquality().hash(_caclForms),const DeepCollectionEquality().hash(_manifests),const DeepCollectionEquality().hash(_history),minEta,etaStatus,const DeepCollectionEquality().hash(_loadingOrders),terminalEntryAt,terminalExitAt,mdfeId,mdfe,const DeepCollectionEquality().hash(_mdfes)]); @override String toString() { - return 'AtsOperation(id: $id, sellerAssetId: $sellerAssetId, transportAssetId: $transportAssetId, transportCompanyAssetId: $transportCompanyAssetId, purchasedAt: $purchasedAt, createdAt: $createdAt, finishedAt: $finishedAt, pendingToReview: $pendingToReview, ordersIds: $ordersIds, sellerAsset: $sellerAsset, transportAsset: $transportAsset, transportCompanyAsset: $transportCompanyAsset, sellerInformation: $sellerInformation, transportInformation: $transportInformation, orderStatus: $orderStatus, category: $category, deliverCategory: $deliverCategory, purchaseOrders: $purchaseOrders, statuses: $statuses, totalQuantity: $totalQuantity, productsInformation: $productsInformation, ctes: $ctes, caclFormsIds: $caclFormsIds, caclForms: $caclForms, manifests: $manifests, history: $history, minEta: $minEta, etaStatus: $etaStatus, loadingOrders: $loadingOrders, terminalEntryAt: $terminalEntryAt, terminalExitAt: $terminalExitAt)'; + return 'AtsOperation(id: $id, sellerAssetId: $sellerAssetId, transportAssetId: $transportAssetId, transportCompanyAssetId: $transportCompanyAssetId, purchasedAt: $purchasedAt, createdAt: $createdAt, finishedAt: $finishedAt, pendingToReview: $pendingToReview, ordersIds: $ordersIds, sellerAsset: $sellerAsset, transportAsset: $transportAsset, transportCompanyAsset: $transportCompanyAsset, sellerInformation: $sellerInformation, transportInformation: $transportInformation, orderStatus: $orderStatus, category: $category, deliverCategory: $deliverCategory, purchaseOrders: $purchaseOrders, statuses: $statuses, totalQuantity: $totalQuantity, productsInformation: $productsInformation, ctes: $ctes, caclFormsIds: $caclFormsIds, caclForms: $caclForms, manifests: $manifests, history: $history, minEta: $minEta, etaStatus: $etaStatus, loadingOrders: $loadingOrders, terminalEntryAt: $terminalEntryAt, terminalExitAt: $terminalExitAt, mdfeId: $mdfeId, mdfe: $mdfe, mdfes: $mdfes)'; } @@ -13629,11 +13662,11 @@ abstract mixin class _$AtsOperationCopyWith<$Res> implements $AtsOperationCopyWi factory _$AtsOperationCopyWith(_AtsOperation value, $Res Function(_AtsOperation) _then) = __$AtsOperationCopyWithImpl; @override @useResult $Res call({ - String? id, String? sellerAssetId, String? transportAssetId, String? transportCompanyAssetId,@TimestampOrNullConverter() DateTime? purchasedAt,@TimestampOrNullConverter() DateTime? createdAt,@TimestampOrNullConverter() DateTime? finishedAt, bool? pendingToReview, List? ordersIds, Asset? sellerAsset, Asset? transportAsset, Asset? transportCompanyAsset, AtsCompanyInformation? sellerInformation, AtsTransportInformation? transportInformation,@JsonKey(unknownEnumValue: AtsPurchaseOrderStatus.generated) AtsPurchaseOrderStatus? orderStatus,@JsonKey(unknownEnumValue: AtsPurchaseOrderCategoriesEntity.notDefined) AtsPurchaseOrderCategoriesEntity? category,@JsonKey(unknownEnumValue: AtsPurchaseOrderSubCategories.notDefined) AtsPurchaseOrderSubCategories? deliverCategory, List? purchaseOrders, List? statuses, double? totalQuantity, List? productsInformation, List? ctes, List? caclFormsIds, List? caclForms, List? manifests, List? history,@TimestampOrNullConverter() DateTime? minEta, AtsEtaStatus? etaStatus, List? loadingOrders,@TimestampOrNullConverter() DateTime? terminalEntryAt,@TimestampOrNullConverter() DateTime? terminalExitAt + String? id, String? sellerAssetId, String? transportAssetId, String? transportCompanyAssetId,@TimestampOrNullConverter() DateTime? purchasedAt,@TimestampOrNullConverter() DateTime? createdAt,@TimestampOrNullConverter() DateTime? finishedAt, bool? pendingToReview, List? ordersIds, Asset? sellerAsset, Asset? transportAsset, Asset? transportCompanyAsset, AtsCompanyInformation? sellerInformation, AtsTransportInformation? transportInformation,@JsonKey(unknownEnumValue: AtsPurchaseOrderStatus.generated) AtsPurchaseOrderStatus? orderStatus,@JsonKey(unknownEnumValue: AtsPurchaseOrderCategoriesEntity.notDefined) AtsPurchaseOrderCategoriesEntity? category,@JsonKey(unknownEnumValue: AtsPurchaseOrderSubCategories.notDefined) AtsPurchaseOrderSubCategories? deliverCategory, List? purchaseOrders, List? statuses, double? totalQuantity, List? productsInformation, List? ctes, List? caclFormsIds, List? caclForms, List? manifests, List? history,@TimestampOrNullConverter() DateTime? minEta, AtsEtaStatus? etaStatus, List? loadingOrders,@TimestampOrNullConverter() DateTime? terminalEntryAt,@TimestampOrNullConverter() DateTime? terminalExitAt, String? mdfeId, AtsMdfe? mdfe, List? mdfes }); -@override $AssetCopyWith<$Res>? get sellerAsset;@override $AssetCopyWith<$Res>? get transportAsset;@override $AssetCopyWith<$Res>? get transportCompanyAsset;@override $AtsCompanyInformationCopyWith<$Res>? get sellerInformation;@override $AtsTransportInformationCopyWith<$Res>? get transportInformation; +@override $AssetCopyWith<$Res>? get sellerAsset;@override $AssetCopyWith<$Res>? get transportAsset;@override $AssetCopyWith<$Res>? get transportCompanyAsset;@override $AtsCompanyInformationCopyWith<$Res>? get sellerInformation;@override $AtsTransportInformationCopyWith<$Res>? get transportInformation;@override $AtsMdfeCopyWith<$Res>? get mdfe; } /// @nodoc @@ -13646,7 +13679,7 @@ class __$AtsOperationCopyWithImpl<$Res> /// Create a copy of AtsOperation /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? sellerAssetId = freezed,Object? transportAssetId = freezed,Object? transportCompanyAssetId = freezed,Object? purchasedAt = freezed,Object? createdAt = freezed,Object? finishedAt = freezed,Object? pendingToReview = freezed,Object? ordersIds = freezed,Object? sellerAsset = freezed,Object? transportAsset = freezed,Object? transportCompanyAsset = freezed,Object? sellerInformation = freezed,Object? transportInformation = freezed,Object? orderStatus = freezed,Object? category = freezed,Object? deliverCategory = freezed,Object? purchaseOrders = freezed,Object? statuses = freezed,Object? totalQuantity = freezed,Object? productsInformation = freezed,Object? ctes = freezed,Object? caclFormsIds = freezed,Object? caclForms = freezed,Object? manifests = freezed,Object? history = freezed,Object? minEta = freezed,Object? etaStatus = freezed,Object? loadingOrders = freezed,Object? terminalEntryAt = freezed,Object? terminalExitAt = freezed,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? sellerAssetId = freezed,Object? transportAssetId = freezed,Object? transportCompanyAssetId = freezed,Object? purchasedAt = freezed,Object? createdAt = freezed,Object? finishedAt = freezed,Object? pendingToReview = freezed,Object? ordersIds = freezed,Object? sellerAsset = freezed,Object? transportAsset = freezed,Object? transportCompanyAsset = freezed,Object? sellerInformation = freezed,Object? transportInformation = freezed,Object? orderStatus = freezed,Object? category = freezed,Object? deliverCategory = freezed,Object? purchaseOrders = freezed,Object? statuses = freezed,Object? totalQuantity = freezed,Object? productsInformation = freezed,Object? ctes = freezed,Object? caclFormsIds = freezed,Object? caclForms = freezed,Object? manifests = freezed,Object? history = freezed,Object? minEta = freezed,Object? etaStatus = freezed,Object? loadingOrders = freezed,Object? terminalEntryAt = freezed,Object? terminalExitAt = freezed,Object? mdfeId = freezed,Object? mdfe = freezed,Object? mdfes = freezed,}) { return _then(_AtsOperation( id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as String?,sellerAssetId: freezed == sellerAssetId ? _self.sellerAssetId : sellerAssetId // ignore: cast_nullable_to_non_nullable @@ -13679,7 +13712,10 @@ as DateTime?,etaStatus: freezed == etaStatus ? _self.etaStatus : etaStatus // ig as AtsEtaStatus?,loadingOrders: freezed == loadingOrders ? _self._loadingOrders : loadingOrders // ignore: cast_nullable_to_non_nullable as List?,terminalEntryAt: freezed == terminalEntryAt ? _self.terminalEntryAt : terminalEntryAt // ignore: cast_nullable_to_non_nullable as DateTime?,terminalExitAt: freezed == terminalExitAt ? _self.terminalExitAt : terminalExitAt // ignore: cast_nullable_to_non_nullable -as DateTime?, +as DateTime?,mdfeId: freezed == mdfeId ? _self.mdfeId : mdfeId // ignore: cast_nullable_to_non_nullable +as String?,mdfe: freezed == mdfe ? _self.mdfe : mdfe // ignore: cast_nullable_to_non_nullable +as AtsMdfe?,mdfes: freezed == mdfes ? _self._mdfes : mdfes // ignore: cast_nullable_to_non_nullable +as List?, )); } @@ -13743,6 +13779,18 @@ $AtsTransportInformationCopyWith<$Res>? get transportInformation { return $AtsTransportInformationCopyWith<$Res>(_self.transportInformation!, (value) { return _then(_self.copyWith(transportInformation: value)); }); +}/// Create a copy of AtsOperation +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AtsMdfeCopyWith<$Res>? get mdfe { + if (_self.mdfe == null) { + return null; + } + + return $AtsMdfeCopyWith<$Res>(_self.mdfe!, (value) { + return _then(_self.copyWith(mdfe: value)); + }); } } @@ -14066,6 +14114,315 @@ $AssetCopyWith<$Res>? get asset { } +/// @nodoc +mixin _$AtsMdfe { + +/// The [id] parameter is the id of the ats mdfe entity. + String? get id;/// The [manifestId] parameter is the manifestId of the ats mdfe entity. + String? get manifestId;/// The [createdAt] parameter is the createdAt of the ats mdfe entity. +@TimestampOrNullConverter() DateTime? get createdAt;/// The [updatedAt] parameter is the updatedAt of the ats mdfe entity. +@TimestampOrNullConverter() DateTime? get updatedAt;/// The [operation] parameter is the operation of the ats mdfe entity. + AtsOperation? get operation; +/// Create a copy of AtsMdfe +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AtsMdfeCopyWith get copyWith => _$AtsMdfeCopyWithImpl(this as AtsMdfe, _$identity); + + /// Serializes this AtsMdfe to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AtsMdfe&&(identical(other.id, id) || other.id == id)&&(identical(other.manifestId, manifestId) || other.manifestId == manifestId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.operation, operation) || other.operation == operation)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,manifestId,createdAt,updatedAt,operation); + +@override +String toString() { + return 'AtsMdfe(id: $id, manifestId: $manifestId, createdAt: $createdAt, updatedAt: $updatedAt, operation: $operation)'; +} + + +} + +/// @nodoc +abstract mixin class $AtsMdfeCopyWith<$Res> { + factory $AtsMdfeCopyWith(AtsMdfe value, $Res Function(AtsMdfe) _then) = _$AtsMdfeCopyWithImpl; +@useResult +$Res call({ + String? id, String? manifestId,@TimestampOrNullConverter() DateTime? createdAt,@TimestampOrNullConverter() DateTime? updatedAt, AtsOperation? operation +}); + + +$AtsOperationCopyWith<$Res>? get operation; + +} +/// @nodoc +class _$AtsMdfeCopyWithImpl<$Res> + implements $AtsMdfeCopyWith<$Res> { + _$AtsMdfeCopyWithImpl(this._self, this._then); + + final AtsMdfe _self; + final $Res Function(AtsMdfe) _then; + +/// Create a copy of AtsMdfe +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? manifestId = freezed,Object? createdAt = freezed,Object? updatedAt = freezed,Object? operation = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String?,manifestId: freezed == manifestId ? _self.manifestId : manifestId // ignore: cast_nullable_to_non_nullable +as String?,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as DateTime?,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable +as DateTime?,operation: freezed == operation ? _self.operation : operation // ignore: cast_nullable_to_non_nullable +as AtsOperation?, + )); +} +/// Create a copy of AtsMdfe +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AtsOperationCopyWith<$Res>? get operation { + if (_self.operation == null) { + return null; + } + + return $AtsOperationCopyWith<$Res>(_self.operation!, (value) { + return _then(_self.copyWith(operation: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [AtsMdfe]. +extension AtsMdfePatterns on AtsMdfe { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AtsMdfe value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AtsMdfe() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AtsMdfe value) $default,){ +final _that = this; +switch (_that) { +case _AtsMdfe(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AtsMdfe value)? $default,){ +final _that = this; +switch (_that) { +case _AtsMdfe() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? id, String? manifestId, @TimestampOrNullConverter() DateTime? createdAt, @TimestampOrNullConverter() DateTime? updatedAt, AtsOperation? operation)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AtsMdfe() when $default != null: +return $default(_that.id,_that.manifestId,_that.createdAt,_that.updatedAt,_that.operation);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? id, String? manifestId, @TimestampOrNullConverter() DateTime? createdAt, @TimestampOrNullConverter() DateTime? updatedAt, AtsOperation? operation) $default,) {final _that = this; +switch (_that) { +case _AtsMdfe(): +return $default(_that.id,_that.manifestId,_that.createdAt,_that.updatedAt,_that.operation);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? id, String? manifestId, @TimestampOrNullConverter() DateTime? createdAt, @TimestampOrNullConverter() DateTime? updatedAt, AtsOperation? operation)? $default,) {final _that = this; +switch (_that) { +case _AtsMdfe() when $default != null: +return $default(_that.id,_that.manifestId,_that.createdAt,_that.updatedAt,_that.operation);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _AtsMdfe implements AtsMdfe { + _AtsMdfe({this.id, this.manifestId, @TimestampOrNullConverter() this.createdAt, @TimestampOrNullConverter() this.updatedAt, this.operation}); + factory _AtsMdfe.fromJson(Map json) => _$AtsMdfeFromJson(json); + +/// The [id] parameter is the id of the ats mdfe entity. +@override final String? id; +/// The [manifestId] parameter is the manifestId of the ats mdfe entity. +@override final String? manifestId; +/// The [createdAt] parameter is the createdAt of the ats mdfe entity. +@override@TimestampOrNullConverter() final DateTime? createdAt; +/// The [updatedAt] parameter is the updatedAt of the ats mdfe entity. +@override@TimestampOrNullConverter() final DateTime? updatedAt; +/// The [operation] parameter is the operation of the ats mdfe entity. +@override final AtsOperation? operation; + +/// Create a copy of AtsMdfe +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AtsMdfeCopyWith<_AtsMdfe> get copyWith => __$AtsMdfeCopyWithImpl<_AtsMdfe>(this, _$identity); + +@override +Map toJson() { + return _$AtsMdfeToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AtsMdfe&&(identical(other.id, id) || other.id == id)&&(identical(other.manifestId, manifestId) || other.manifestId == manifestId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.operation, operation) || other.operation == operation)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,manifestId,createdAt,updatedAt,operation); + +@override +String toString() { + return 'AtsMdfe(id: $id, manifestId: $manifestId, createdAt: $createdAt, updatedAt: $updatedAt, operation: $operation)'; +} + + +} + +/// @nodoc +abstract mixin class _$AtsMdfeCopyWith<$Res> implements $AtsMdfeCopyWith<$Res> { + factory _$AtsMdfeCopyWith(_AtsMdfe value, $Res Function(_AtsMdfe) _then) = __$AtsMdfeCopyWithImpl; +@override @useResult +$Res call({ + String? id, String? manifestId,@TimestampOrNullConverter() DateTime? createdAt,@TimestampOrNullConverter() DateTime? updatedAt, AtsOperation? operation +}); + + +@override $AtsOperationCopyWith<$Res>? get operation; + +} +/// @nodoc +class __$AtsMdfeCopyWithImpl<$Res> + implements _$AtsMdfeCopyWith<$Res> { + __$AtsMdfeCopyWithImpl(this._self, this._then); + + final _AtsMdfe _self; + final $Res Function(_AtsMdfe) _then; + +/// Create a copy of AtsMdfe +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? manifestId = freezed,Object? createdAt = freezed,Object? updatedAt = freezed,Object? operation = freezed,}) { + return _then(_AtsMdfe( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String?,manifestId: freezed == manifestId ? _self.manifestId : manifestId // ignore: cast_nullable_to_non_nullable +as String?,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as DateTime?,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable +as DateTime?,operation: freezed == operation ? _self.operation : operation // ignore: cast_nullable_to_non_nullable +as AtsOperation?, + )); +} + +/// Create a copy of AtsMdfe +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AtsOperationCopyWith<$Res>? get operation { + if (_self.operation == null) { + return null; + } + + return $AtsOperationCopyWith<$Res>(_self.operation!, (value) { + return _then(_self.copyWith(operation: value)); + }); +} +} + + /// @nodoc mixin _$Manifest { @@ -26316,28 +26673,28 @@ mixin _$StockClosingInput { @AtsFuelSubTypeOrNullConverter() set product(AtsFuelSubType? value);/// The [description] parameter is the description of the stock closing input. String? get description;/// The [description] parameter is the description of the stock closing input. set description(String? value);/// The [totalVolume20] parameter is the totalVolume20 of the stock closing input. - double? get totalVolume20;/// The [totalVolume20] parameter is the totalVolume20 of the stock closing input. - set totalVolume20(double? value);/// The [volume20Difference] parameter is the volume20Difference of the stock closing input. - double? get volume20Difference;/// The [volume20Difference] parameter is the volume20Difference of the stock closing input. - set volume20Difference(double? value);/// The [accountingVolumeDifference] parameter is the accountingVolumeDifference of the stock closing input. - double? get accountingVolumeDifference;/// The [accountingVolumeDifference] parameter is the accountingVolumeDifference of the stock closing input. - set accountingVolumeDifference(double? value);/// The [openingBalance20] parameter is the openingBalance20 of the stock closing input. - double? get openingBalance20;/// The [openingBalance20] parameter is the openingBalance20 of the stock closing input. - set openingBalance20(double? value);/// The [totalEntries20] parameter is the totalEntries20 of the stock closing input. - double? get totalEntries20;/// The [totalEntries20] parameter is the totalEntries20 of the stock closing input. - set totalEntries20(double? value);/// The [totalWithdrawals20] parameter is the totalWithdrawals20 of the stock closing input. - double? get totalWithdrawals20;/// The [totalWithdrawals20] parameter is the totalWithdrawals20 of the stock closing input. - set totalWithdrawals20(double? value);/// The [closingBalance20] parameter is the closingBalance20 of the stock closing input. - double? get closingBalance20;/// The [closingBalance20] parameter is the closingBalance20 of the stock closing input. - set closingBalance20(double? value);/// The [openingAccountingBalance] parameter is the openingAccountingBalance of the stock closing input. - double? get openingAccountingBalance;/// The [openingAccountingBalance] parameter is the openingAccountingBalance of the stock closing input. - set openingAccountingBalance(double? value);/// The [totalAccountingEntries] parameter is the totalAccountingEntries of the stock closing input. - double? get totalAccountingEntries;/// The [totalAccountingEntries] parameter is the totalAccountingEntries of the stock closing input. - set totalAccountingEntries(double? value);/// The [totalAccountingWithdrawals] parameter is the totalAccountingWithdrawals of the stock closing input. - double? get totalAccountingWithdrawals;/// The [totalAccountingWithdrawals] parameter is the totalAccountingWithdrawals of the stock closing input. - set totalAccountingWithdrawals(double? value);/// The [closingAccountingBalance] parameter is the closingAccountingBalance of the stock closing input. - double? get closingAccountingBalance;/// The [closingAccountingBalance] parameter is the closingAccountingBalance of the stock closing input. - set closingAccountingBalance(double? value);/// The [closingDetails] parameter is the closingDetails of the stock closing input. + double get totalVolume20;/// The [totalVolume20] parameter is the totalVolume20 of the stock closing input. + set totalVolume20(double value);/// The [volume20Difference] parameter is the volume20Difference of the stock closing input. + double get volume20Difference;/// The [volume20Difference] parameter is the volume20Difference of the stock closing input. + set volume20Difference(double value);/// The [accountingVolumeDifference] parameter is the accountingVolumeDifference of the stock closing input. + double get accountingVolumeDifference;/// The [accountingVolumeDifference] parameter is the accountingVolumeDifference of the stock closing input. + set accountingVolumeDifference(double value);/// The [openingBalance20] parameter is the openingBalance20 of the stock closing input. + double get openingBalance20;/// The [openingBalance20] parameter is the openingBalance20 of the stock closing input. + set openingBalance20(double value);/// The [totalEntries20] parameter is the totalEntries20 of the stock closing input. + double get totalEntries20;/// The [totalEntries20] parameter is the totalEntries20 of the stock closing input. + set totalEntries20(double value);/// The [totalWithdrawals20] parameter is the totalWithdrawals20 of the stock closing input. + double get totalWithdrawals20;/// The [totalWithdrawals20] parameter is the totalWithdrawals20 of the stock closing input. + set totalWithdrawals20(double value);/// The [closingBalance20] parameter is the closingBalance20 of the stock closing input. + double get closingBalance20;/// The [closingBalance20] parameter is the closingBalance20 of the stock closing input. + set closingBalance20(double value);/// The [openingAccountingBalance] parameter is the openingAccountingBalance of the stock closing input. + double get openingAccountingBalance;/// The [openingAccountingBalance] parameter is the openingAccountingBalance of the stock closing input. + set openingAccountingBalance(double value);/// The [totalAccountingEntries] parameter is the totalAccountingEntries of the stock closing input. + double get totalAccountingEntries;/// The [totalAccountingEntries] parameter is the totalAccountingEntries of the stock closing input. + set totalAccountingEntries(double value);/// The [totalAccountingWithdrawals] parameter is the totalAccountingWithdrawals of the stock closing input. + double get totalAccountingWithdrawals;/// The [totalAccountingWithdrawals] parameter is the totalAccountingWithdrawals of the stock closing input. + set totalAccountingWithdrawals(double value);/// The [closingAccountingBalance] parameter is the closingAccountingBalance of the stock closing input. + double get closingAccountingBalance;/// The [closingAccountingBalance] parameter is the closingAccountingBalance of the stock closing input. + set closingAccountingBalance(double value);/// The [closingDetails] parameter is the closingDetails of the stock closing input. List get closingDetails;/// The [closingDetails] parameter is the closingDetails of the stock closing input. set closingDetails(List value); /// Create a copy of StockClosingInput @@ -26365,7 +26722,7 @@ abstract mixin class $StockClosingInputCopyWith<$Res> { factory $StockClosingInputCopyWith(StockClosingInput value, $Res Function(StockClosingInput) _then) = _$StockClosingInputCopyWithImpl; @useResult $Res call({ - String? id, String? terminalId,@AtsFuelSubTypeOrNullConverter() AtsFuelSubType? product, String? description, double? totalVolume20, double? volume20Difference, double? accountingVolumeDifference, double? openingBalance20, double? totalEntries20, double? totalWithdrawals20, double? closingBalance20, double? openingAccountingBalance, double? totalAccountingEntries, double? totalAccountingWithdrawals, double? closingAccountingBalance, List closingDetails + String? id, String? terminalId,@AtsFuelSubTypeOrNullConverter() AtsFuelSubType? product, String? description, double totalVolume20, double volume20Difference, double accountingVolumeDifference, double openingBalance20, double totalEntries20, double totalWithdrawals20, double closingBalance20, double openingAccountingBalance, double totalAccountingEntries, double totalAccountingWithdrawals, double closingAccountingBalance, List closingDetails }); @@ -26382,24 +26739,24 @@ class _$StockClosingInputCopyWithImpl<$Res> /// Create a copy of StockClosingInput /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? terminalId = freezed,Object? product = freezed,Object? description = freezed,Object? totalVolume20 = freezed,Object? volume20Difference = freezed,Object? accountingVolumeDifference = freezed,Object? openingBalance20 = freezed,Object? totalEntries20 = freezed,Object? totalWithdrawals20 = freezed,Object? closingBalance20 = freezed,Object? openingAccountingBalance = freezed,Object? totalAccountingEntries = freezed,Object? totalAccountingWithdrawals = freezed,Object? closingAccountingBalance = freezed,Object? closingDetails = null,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? terminalId = freezed,Object? product = freezed,Object? description = freezed,Object? totalVolume20 = null,Object? volume20Difference = null,Object? accountingVolumeDifference = null,Object? openingBalance20 = null,Object? totalEntries20 = null,Object? totalWithdrawals20 = null,Object? closingBalance20 = null,Object? openingAccountingBalance = null,Object? totalAccountingEntries = null,Object? totalAccountingWithdrawals = null,Object? closingAccountingBalance = null,Object? closingDetails = null,}) { return _then(_self.copyWith( id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as String?,terminalId: freezed == terminalId ? _self.terminalId : terminalId // ignore: cast_nullable_to_non_nullable as String?,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable as AtsFuelSubType?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable -as String?,totalVolume20: freezed == totalVolume20 ? _self.totalVolume20 : totalVolume20 // ignore: cast_nullable_to_non_nullable -as double?,volume20Difference: freezed == volume20Difference ? _self.volume20Difference : volume20Difference // ignore: cast_nullable_to_non_nullable -as double?,accountingVolumeDifference: freezed == accountingVolumeDifference ? _self.accountingVolumeDifference : accountingVolumeDifference // ignore: cast_nullable_to_non_nullable -as double?,openingBalance20: freezed == openingBalance20 ? _self.openingBalance20 : openingBalance20 // ignore: cast_nullable_to_non_nullable -as double?,totalEntries20: freezed == totalEntries20 ? _self.totalEntries20 : totalEntries20 // ignore: cast_nullable_to_non_nullable -as double?,totalWithdrawals20: freezed == totalWithdrawals20 ? _self.totalWithdrawals20 : totalWithdrawals20 // ignore: cast_nullable_to_non_nullable -as double?,closingBalance20: freezed == closingBalance20 ? _self.closingBalance20 : closingBalance20 // ignore: cast_nullable_to_non_nullable -as double?,openingAccountingBalance: freezed == openingAccountingBalance ? _self.openingAccountingBalance : openingAccountingBalance // ignore: cast_nullable_to_non_nullable -as double?,totalAccountingEntries: freezed == totalAccountingEntries ? _self.totalAccountingEntries : totalAccountingEntries // ignore: cast_nullable_to_non_nullable -as double?,totalAccountingWithdrawals: freezed == totalAccountingWithdrawals ? _self.totalAccountingWithdrawals : totalAccountingWithdrawals // ignore: cast_nullable_to_non_nullable -as double?,closingAccountingBalance: freezed == closingAccountingBalance ? _self.closingAccountingBalance : closingAccountingBalance // ignore: cast_nullable_to_non_nullable -as double?,closingDetails: null == closingDetails ? _self.closingDetails : closingDetails // ignore: cast_nullable_to_non_nullable +as String?,totalVolume20: null == totalVolume20 ? _self.totalVolume20 : totalVolume20 // ignore: cast_nullable_to_non_nullable +as double,volume20Difference: null == volume20Difference ? _self.volume20Difference : volume20Difference // ignore: cast_nullable_to_non_nullable +as double,accountingVolumeDifference: null == accountingVolumeDifference ? _self.accountingVolumeDifference : accountingVolumeDifference // ignore: cast_nullable_to_non_nullable +as double,openingBalance20: null == openingBalance20 ? _self.openingBalance20 : openingBalance20 // ignore: cast_nullable_to_non_nullable +as double,totalEntries20: null == totalEntries20 ? _self.totalEntries20 : totalEntries20 // ignore: cast_nullable_to_non_nullable +as double,totalWithdrawals20: null == totalWithdrawals20 ? _self.totalWithdrawals20 : totalWithdrawals20 // ignore: cast_nullable_to_non_nullable +as double,closingBalance20: null == closingBalance20 ? _self.closingBalance20 : closingBalance20 // ignore: cast_nullable_to_non_nullable +as double,openingAccountingBalance: null == openingAccountingBalance ? _self.openingAccountingBalance : openingAccountingBalance // ignore: cast_nullable_to_non_nullable +as double,totalAccountingEntries: null == totalAccountingEntries ? _self.totalAccountingEntries : totalAccountingEntries // ignore: cast_nullable_to_non_nullable +as double,totalAccountingWithdrawals: null == totalAccountingWithdrawals ? _self.totalAccountingWithdrawals : totalAccountingWithdrawals // ignore: cast_nullable_to_non_nullable +as double,closingAccountingBalance: null == closingAccountingBalance ? _self.closingAccountingBalance : closingAccountingBalance // ignore: cast_nullable_to_non_nullable +as double,closingDetails: null == closingDetails ? _self.closingDetails : closingDetails // ignore: cast_nullable_to_non_nullable as List, )); } @@ -26485,7 +26842,7 @@ return $default(_that);case _: /// } /// ``` -@optionalTypeArgs TResult maybeWhen(TResult Function( String? id, String? terminalId, @AtsFuelSubTypeOrNullConverter() AtsFuelSubType? product, String? description, double? totalVolume20, double? volume20Difference, double? accountingVolumeDifference, double? openingBalance20, double? totalEntries20, double? totalWithdrawals20, double? closingBalance20, double? openingAccountingBalance, double? totalAccountingEntries, double? totalAccountingWithdrawals, double? closingAccountingBalance, List closingDetails)? $default,{required TResult orElse(),}) {final _that = this; +@optionalTypeArgs TResult maybeWhen(TResult Function( String? id, String? terminalId, @AtsFuelSubTypeOrNullConverter() AtsFuelSubType? product, String? description, double totalVolume20, double volume20Difference, double accountingVolumeDifference, double openingBalance20, double totalEntries20, double totalWithdrawals20, double closingBalance20, double openingAccountingBalance, double totalAccountingEntries, double totalAccountingWithdrawals, double closingAccountingBalance, List closingDetails)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _StockClosingInput() when $default != null: return $default(_that.id,_that.terminalId,_that.product,_that.description,_that.totalVolume20,_that.volume20Difference,_that.accountingVolumeDifference,_that.openingBalance20,_that.totalEntries20,_that.totalWithdrawals20,_that.closingBalance20,_that.openingAccountingBalance,_that.totalAccountingEntries,_that.totalAccountingWithdrawals,_that.closingAccountingBalance,_that.closingDetails);case _: @@ -26506,7 +26863,7 @@ return $default(_that.id,_that.terminalId,_that.product,_that.description,_that. /// } /// ``` -@optionalTypeArgs TResult when(TResult Function( String? id, String? terminalId, @AtsFuelSubTypeOrNullConverter() AtsFuelSubType? product, String? description, double? totalVolume20, double? volume20Difference, double? accountingVolumeDifference, double? openingBalance20, double? totalEntries20, double? totalWithdrawals20, double? closingBalance20, double? openingAccountingBalance, double? totalAccountingEntries, double? totalAccountingWithdrawals, double? closingAccountingBalance, List closingDetails) $default,) {final _that = this; +@optionalTypeArgs TResult when(TResult Function( String? id, String? terminalId, @AtsFuelSubTypeOrNullConverter() AtsFuelSubType? product, String? description, double totalVolume20, double volume20Difference, double accountingVolumeDifference, double openingBalance20, double totalEntries20, double totalWithdrawals20, double closingBalance20, double openingAccountingBalance, double totalAccountingEntries, double totalAccountingWithdrawals, double closingAccountingBalance, List closingDetails) $default,) {final _that = this; switch (_that) { case _StockClosingInput(): return $default(_that.id,_that.terminalId,_that.product,_that.description,_that.totalVolume20,_that.volume20Difference,_that.accountingVolumeDifference,_that.openingBalance20,_that.totalEntries20,_that.totalWithdrawals20,_that.closingBalance20,_that.openingAccountingBalance,_that.totalAccountingEntries,_that.totalAccountingWithdrawals,_that.closingAccountingBalance,_that.closingDetails);case _: @@ -26526,7 +26883,7 @@ return $default(_that.id,_that.terminalId,_that.product,_that.description,_that. /// } /// ``` -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? id, String? terminalId, @AtsFuelSubTypeOrNullConverter() AtsFuelSubType? product, String? description, double? totalVolume20, double? volume20Difference, double? accountingVolumeDifference, double? openingBalance20, double? totalEntries20, double? totalWithdrawals20, double? closingBalance20, double? openingAccountingBalance, double? totalAccountingEntries, double? totalAccountingWithdrawals, double? closingAccountingBalance, List closingDetails)? $default,) {final _that = this; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? id, String? terminalId, @AtsFuelSubTypeOrNullConverter() AtsFuelSubType? product, String? description, double totalVolume20, double volume20Difference, double accountingVolumeDifference, double openingBalance20, double totalEntries20, double totalWithdrawals20, double closingBalance20, double openingAccountingBalance, double totalAccountingEntries, double totalAccountingWithdrawals, double closingAccountingBalance, List closingDetails)? $default,) {final _that = this; switch (_that) { case _StockClosingInput() when $default != null: return $default(_that.id,_that.terminalId,_that.product,_that.description,_that.totalVolume20,_that.volume20Difference,_that.accountingVolumeDifference,_that.openingBalance20,_that.totalEntries20,_that.totalWithdrawals20,_that.closingBalance20,_that.openingAccountingBalance,_that.totalAccountingEntries,_that.totalAccountingWithdrawals,_that.closingAccountingBalance,_that.closingDetails);case _: @@ -26541,7 +26898,7 @@ return $default(_that.id,_that.terminalId,_that.product,_that.description,_that. @JsonSerializable() class _StockClosingInput extends StockClosingInput { - _StockClosingInput({this.id, this.terminalId, @AtsFuelSubTypeOrNullConverter() this.product, this.description, this.totalVolume20, this.volume20Difference, this.accountingVolumeDifference, this.openingBalance20, this.totalEntries20, this.totalWithdrawals20, this.closingBalance20, this.openingAccountingBalance, this.totalAccountingEntries, this.totalAccountingWithdrawals, this.closingAccountingBalance, this.closingDetails = const []}): super._(); + _StockClosingInput({this.id, this.terminalId, @AtsFuelSubTypeOrNullConverter() this.product, this.description, this.totalVolume20 = 0.0, this.volume20Difference = 0.0, this.accountingVolumeDifference = 0.0, this.openingBalance20 = 0.0, this.totalEntries20 = 0.0, this.totalWithdrawals20 = 0.0, this.closingBalance20 = 0.0, this.openingAccountingBalance = 0.0, this.totalAccountingEntries = 0.0, this.totalAccountingWithdrawals = 0.0, this.closingAccountingBalance = 0.0, this.closingDetails = const []}): super._(); factory _StockClosingInput.fromJson(Map json) => _$StockClosingInputFromJson(json); /// The [id] parameter is the id of the stock closing input. @@ -26553,27 +26910,27 @@ class _StockClosingInput extends StockClosingInput { /// The [description] parameter is the description of the stock closing input. @override String? description; /// The [totalVolume20] parameter is the totalVolume20 of the stock closing input. -@override double? totalVolume20; +@override@JsonKey() double totalVolume20; /// The [volume20Difference] parameter is the volume20Difference of the stock closing input. -@override double? volume20Difference; +@override@JsonKey() double volume20Difference; /// The [accountingVolumeDifference] parameter is the accountingVolumeDifference of the stock closing input. -@override double? accountingVolumeDifference; +@override@JsonKey() double accountingVolumeDifference; /// The [openingBalance20] parameter is the openingBalance20 of the stock closing input. -@override double? openingBalance20; +@override@JsonKey() double openingBalance20; /// The [totalEntries20] parameter is the totalEntries20 of the stock closing input. -@override double? totalEntries20; +@override@JsonKey() double totalEntries20; /// The [totalWithdrawals20] parameter is the totalWithdrawals20 of the stock closing input. -@override double? totalWithdrawals20; +@override@JsonKey() double totalWithdrawals20; /// The [closingBalance20] parameter is the closingBalance20 of the stock closing input. -@override double? closingBalance20; +@override@JsonKey() double closingBalance20; /// The [openingAccountingBalance] parameter is the openingAccountingBalance of the stock closing input. -@override double? openingAccountingBalance; +@override@JsonKey() double openingAccountingBalance; /// The [totalAccountingEntries] parameter is the totalAccountingEntries of the stock closing input. -@override double? totalAccountingEntries; +@override@JsonKey() double totalAccountingEntries; /// The [totalAccountingWithdrawals] parameter is the totalAccountingWithdrawals of the stock closing input. -@override double? totalAccountingWithdrawals; +@override@JsonKey() double totalAccountingWithdrawals; /// The [closingAccountingBalance] parameter is the closingAccountingBalance of the stock closing input. -@override double? closingAccountingBalance; +@override@JsonKey() double closingAccountingBalance; /// The [closingDetails] parameter is the closingDetails of the stock closing input. @override@JsonKey() List closingDetails; @@ -26603,7 +26960,7 @@ abstract mixin class _$StockClosingInputCopyWith<$Res> implements $StockClosingI factory _$StockClosingInputCopyWith(_StockClosingInput value, $Res Function(_StockClosingInput) _then) = __$StockClosingInputCopyWithImpl; @override @useResult $Res call({ - String? id, String? terminalId,@AtsFuelSubTypeOrNullConverter() AtsFuelSubType? product, String? description, double? totalVolume20, double? volume20Difference, double? accountingVolumeDifference, double? openingBalance20, double? totalEntries20, double? totalWithdrawals20, double? closingBalance20, double? openingAccountingBalance, double? totalAccountingEntries, double? totalAccountingWithdrawals, double? closingAccountingBalance, List closingDetails + String? id, String? terminalId,@AtsFuelSubTypeOrNullConverter() AtsFuelSubType? product, String? description, double totalVolume20, double volume20Difference, double accountingVolumeDifference, double openingBalance20, double totalEntries20, double totalWithdrawals20, double closingBalance20, double openingAccountingBalance, double totalAccountingEntries, double totalAccountingWithdrawals, double closingAccountingBalance, List closingDetails }); @@ -26620,24 +26977,24 @@ class __$StockClosingInputCopyWithImpl<$Res> /// Create a copy of StockClosingInput /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? terminalId = freezed,Object? product = freezed,Object? description = freezed,Object? totalVolume20 = freezed,Object? volume20Difference = freezed,Object? accountingVolumeDifference = freezed,Object? openingBalance20 = freezed,Object? totalEntries20 = freezed,Object? totalWithdrawals20 = freezed,Object? closingBalance20 = freezed,Object? openingAccountingBalance = freezed,Object? totalAccountingEntries = freezed,Object? totalAccountingWithdrawals = freezed,Object? closingAccountingBalance = freezed,Object? closingDetails = null,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? terminalId = freezed,Object? product = freezed,Object? description = freezed,Object? totalVolume20 = null,Object? volume20Difference = null,Object? accountingVolumeDifference = null,Object? openingBalance20 = null,Object? totalEntries20 = null,Object? totalWithdrawals20 = null,Object? closingBalance20 = null,Object? openingAccountingBalance = null,Object? totalAccountingEntries = null,Object? totalAccountingWithdrawals = null,Object? closingAccountingBalance = null,Object? closingDetails = null,}) { return _then(_StockClosingInput( id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as String?,terminalId: freezed == terminalId ? _self.terminalId : terminalId // ignore: cast_nullable_to_non_nullable as String?,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable as AtsFuelSubType?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable -as String?,totalVolume20: freezed == totalVolume20 ? _self.totalVolume20 : totalVolume20 // ignore: cast_nullable_to_non_nullable -as double?,volume20Difference: freezed == volume20Difference ? _self.volume20Difference : volume20Difference // ignore: cast_nullable_to_non_nullable -as double?,accountingVolumeDifference: freezed == accountingVolumeDifference ? _self.accountingVolumeDifference : accountingVolumeDifference // ignore: cast_nullable_to_non_nullable -as double?,openingBalance20: freezed == openingBalance20 ? _self.openingBalance20 : openingBalance20 // ignore: cast_nullable_to_non_nullable -as double?,totalEntries20: freezed == totalEntries20 ? _self.totalEntries20 : totalEntries20 // ignore: cast_nullable_to_non_nullable -as double?,totalWithdrawals20: freezed == totalWithdrawals20 ? _self.totalWithdrawals20 : totalWithdrawals20 // ignore: cast_nullable_to_non_nullable -as double?,closingBalance20: freezed == closingBalance20 ? _self.closingBalance20 : closingBalance20 // ignore: cast_nullable_to_non_nullable -as double?,openingAccountingBalance: freezed == openingAccountingBalance ? _self.openingAccountingBalance : openingAccountingBalance // ignore: cast_nullable_to_non_nullable -as double?,totalAccountingEntries: freezed == totalAccountingEntries ? _self.totalAccountingEntries : totalAccountingEntries // ignore: cast_nullable_to_non_nullable -as double?,totalAccountingWithdrawals: freezed == totalAccountingWithdrawals ? _self.totalAccountingWithdrawals : totalAccountingWithdrawals // ignore: cast_nullable_to_non_nullable -as double?,closingAccountingBalance: freezed == closingAccountingBalance ? _self.closingAccountingBalance : closingAccountingBalance // ignore: cast_nullable_to_non_nullable -as double?,closingDetails: null == closingDetails ? _self.closingDetails : closingDetails // ignore: cast_nullable_to_non_nullable +as String?,totalVolume20: null == totalVolume20 ? _self.totalVolume20 : totalVolume20 // ignore: cast_nullable_to_non_nullable +as double,volume20Difference: null == volume20Difference ? _self.volume20Difference : volume20Difference // ignore: cast_nullable_to_non_nullable +as double,accountingVolumeDifference: null == accountingVolumeDifference ? _self.accountingVolumeDifference : accountingVolumeDifference // ignore: cast_nullable_to_non_nullable +as double,openingBalance20: null == openingBalance20 ? _self.openingBalance20 : openingBalance20 // ignore: cast_nullable_to_non_nullable +as double,totalEntries20: null == totalEntries20 ? _self.totalEntries20 : totalEntries20 // ignore: cast_nullable_to_non_nullable +as double,totalWithdrawals20: null == totalWithdrawals20 ? _self.totalWithdrawals20 : totalWithdrawals20 // ignore: cast_nullable_to_non_nullable +as double,closingBalance20: null == closingBalance20 ? _self.closingBalance20 : closingBalance20 // ignore: cast_nullable_to_non_nullable +as double,openingAccountingBalance: null == openingAccountingBalance ? _self.openingAccountingBalance : openingAccountingBalance // ignore: cast_nullable_to_non_nullable +as double,totalAccountingEntries: null == totalAccountingEntries ? _self.totalAccountingEntries : totalAccountingEntries // ignore: cast_nullable_to_non_nullable +as double,totalAccountingWithdrawals: null == totalAccountingWithdrawals ? _self.totalAccountingWithdrawals : totalAccountingWithdrawals // ignore: cast_nullable_to_non_nullable +as double,closingAccountingBalance: null == closingAccountingBalance ? _self.closingAccountingBalance : closingAccountingBalance // ignore: cast_nullable_to_non_nullable +as double,closingDetails: null == closingDetails ? _self.closingDetails : closingDetails // 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 0cf2734..cdfccbc 100644 --- a/lib/src/ats/ats.g.dart +++ b/lib/src/ats/ats.g.dart @@ -1547,6 +1547,13 @@ _AtsOperation _$AtsOperationFromJson(Map json) => terminalExitAt: const TimestampOrNullConverter().fromJson( json['terminalExitAt'] as num?, ), + mdfeId: json['mdfeId'] as String?, + mdfe: json['mdfe'] == null + ? null + : AtsMdfe.fromJson(json['mdfe'] as Map), + mdfes: (json['mdfes'] as List?) + ?.map((e) => AtsMdfe.fromJson(e as Map)) + .toList(), ); Map _$AtsOperationToJson( @@ -1589,6 +1596,9 @@ Map _$AtsOperationToJson( 'terminalExitAt': const TimestampOrNullConverter().toJson( instance.terminalExitAt, ), + 'mdfeId': instance.mdfeId, + 'mdfe': instance.mdfe?.toJson(), + 'mdfes': instance.mdfes?.map((e) => e.toJson()).toList(), }; const _$AtsPurchaseOrderCategoriesEntityEnumMap = { @@ -1661,6 +1671,28 @@ Map _$AtsOperationStatusesToJson( 'eta': const TimestampOrNullConverter().toJson(instance.eta), }; +_AtsMdfe _$AtsMdfeFromJson(Map json) => _AtsMdfe( + id: json['id'] as String?, + manifestId: json['manifestId'] as String?, + createdAt: const TimestampOrNullConverter().fromJson( + json['createdAt'] as num?, + ), + updatedAt: const TimestampOrNullConverter().fromJson( + json['updatedAt'] as num?, + ), + operation: json['operation'] == null + ? null + : AtsOperation.fromJson(json['operation'] as Map), +); + +Map _$AtsMdfeToJson(_AtsMdfe instance) => { + 'id': instance.id, + 'manifestId': instance.manifestId, + 'createdAt': const TimestampOrNullConverter().toJson(instance.createdAt), + 'updatedAt': const TimestampOrNullConverter().toJson(instance.updatedAt), + 'operation': instance.operation?.toJson(), +}; + _Manifest _$ManifestFromJson(Map json) => _Manifest( id: json['id'] as String?, assetId: json['assetId'] as String?, @@ -3107,39 +3139,39 @@ Map _$StockClosingTankToJson(_StockClosingTank instance) => 'updatedAt': const TimestampOrNullConverter().toJson(instance.updatedAt), }; -_StockClosingInput _$StockClosingInputFromJson(Map json) => - _StockClosingInput( - id: json['id'] as String?, - terminalId: json['terminalId'] as String?, - product: const AtsFuelSubTypeOrNullConverter().fromJson( - json['product'] as String?, - ), - description: json['description'] as String?, - totalVolume20: (json['totalVolume20'] as num?)?.toDouble(), - volume20Difference: (json['volume20Difference'] as num?)?.toDouble(), - accountingVolumeDifference: (json['accountingVolumeDifference'] as num?) - ?.toDouble(), - openingBalance20: (json['openingBalance20'] as num?)?.toDouble(), - totalEntries20: (json['totalEntries20'] as num?)?.toDouble(), - totalWithdrawals20: (json['totalWithdrawals20'] as num?)?.toDouble(), - closingBalance20: (json['closingBalance20'] as num?)?.toDouble(), - openingAccountingBalance: (json['openingAccountingBalance'] as num?) - ?.toDouble(), - totalAccountingEntries: (json['totalAccountingEntries'] as num?) - ?.toDouble(), - totalAccountingWithdrawals: (json['totalAccountingWithdrawals'] as num?) - ?.toDouble(), - closingAccountingBalance: (json['closingAccountingBalance'] as num?) - ?.toDouble(), - closingDetails: - (json['closingDetails'] as List?) - ?.map( - (e) => - StockClosingTankInput.fromJson(e as Map), - ) - .toList() ?? - const [], - ); +_StockClosingInput _$StockClosingInputFromJson( + Map json, +) => _StockClosingInput( + id: json['id'] as String?, + terminalId: json['terminalId'] as String?, + product: const AtsFuelSubTypeOrNullConverter().fromJson( + json['product'] as String?, + ), + description: json['description'] as String?, + totalVolume20: (json['totalVolume20'] as num?)?.toDouble() ?? 0.0, + volume20Difference: (json['volume20Difference'] as num?)?.toDouble() ?? 0.0, + accountingVolumeDifference: + (json['accountingVolumeDifference'] as num?)?.toDouble() ?? 0.0, + openingBalance20: (json['openingBalance20'] as num?)?.toDouble() ?? 0.0, + totalEntries20: (json['totalEntries20'] as num?)?.toDouble() ?? 0.0, + totalWithdrawals20: (json['totalWithdrawals20'] as num?)?.toDouble() ?? 0.0, + closingBalance20: (json['closingBalance20'] as num?)?.toDouble() ?? 0.0, + openingAccountingBalance: + (json['openingAccountingBalance'] as num?)?.toDouble() ?? 0.0, + totalAccountingEntries: + (json['totalAccountingEntries'] as num?)?.toDouble() ?? 0.0, + totalAccountingWithdrawals: + (json['totalAccountingWithdrawals'] as num?)?.toDouble() ?? 0.0, + closingAccountingBalance: + (json['closingAccountingBalance'] as num?)?.toDouble() ?? 0.0, + closingDetails: + (json['closingDetails'] as List?) + ?.map( + (e) => StockClosingTankInput.fromJson(e as Map), + ) + .toList() ?? + const [], +); Map _$StockClosingInputToJson(_StockClosingInput instance) => { diff --git a/lib/src/ats/src/operations/ats_mdfe.dart b/lib/src/ats/src/operations/ats_mdfe.dart new file mode 100644 index 0000000..fb33e3a --- /dev/null +++ b/lib/src/ats/src/operations/ats_mdfe.dart @@ -0,0 +1,28 @@ +part of '../../ats.dart'; + +/// A model class representing a ats mdfe entity. +@freezed +abstract class AtsMdfe with _$AtsMdfe { + /// Creates a new [AtsMdfe] instance. + factory AtsMdfe({ + /// The [id] parameter is the id of the ats mdfe entity. + String? id, + + /// The [manifestId] parameter is the manifestId of the ats mdfe entity. + String? manifestId, + + /// The [createdAt] parameter is the createdAt of the ats mdfe entity. + @TimestampOrNullConverter() DateTime? createdAt, + + /// The [updatedAt] parameter is the updatedAt of the ats mdfe entity. + @TimestampOrNullConverter() DateTime? updatedAt, + + /// The [operation] parameter is the operation of the ats mdfe entity. + AtsOperation? operation, + }) = _AtsMdfe; + + /// Creates a new [AtsMdfe] instance from a JSON map. + /// + /// The [json] parameter is the JSON map to create the instance from. + factory AtsMdfe.fromJson(Map json) => _$AtsMdfeFromJson(json); +} diff --git a/lib/src/ats/src/operations/operation.dart b/lib/src/ats/src/operations/operation.dart index cf8a3de..4d10838 100644 --- a/lib/src/ats/src/operations/operation.dart +++ b/lib/src/ats/src/operations/operation.dart @@ -117,6 +117,15 @@ abstract class AtsOperation with _$AtsOperation { /// [terminalExitAt] is the timestamp of the terminal exit. @TimestampOrNullConverter() DateTime? terminalExitAt, + + /// [mdfeId] is the ID of the MDF-e linked to the operation. + String? mdfeId, + + /// [mdfe] is the MDF-e linked to the operation. + AtsMdfe? mdfe, + + /// [mdfes] is the list of MDF-e linked to the operation. + List? mdfes, }) = _AtsOperation; factory AtsOperation.fromJson(Map json) => _$AtsOperationFromJson(json); diff --git a/lib/src/ats/src/stock_closing/input/stock_closing_input.dart b/lib/src/ats/src/stock_closing/input/stock_closing_input.dart index 71fa8dc..f2b6397 100644 --- a/lib/src/ats/src/stock_closing/input/stock_closing_input.dart +++ b/lib/src/ats/src/stock_closing/input/stock_closing_input.dart @@ -19,37 +19,37 @@ abstract class StockClosingInput with _$StockClosingInput { String? description, /// The [totalVolume20] parameter is the totalVolume20 of the stock closing input. - double? totalVolume20, + @Default(0.0) double totalVolume20, /// The [volume20Difference] parameter is the volume20Difference of the stock closing input. - double? volume20Difference, + @Default(0.0) double volume20Difference, /// The [accountingVolumeDifference] parameter is the accountingVolumeDifference of the stock closing input. - double? accountingVolumeDifference, + @Default(0.0) double accountingVolumeDifference, /// The [openingBalance20] parameter is the openingBalance20 of the stock closing input. - double? openingBalance20, + @Default(0.0) double openingBalance20, /// The [totalEntries20] parameter is the totalEntries20 of the stock closing input. - double? totalEntries20, + @Default(0.0) double totalEntries20, /// The [totalWithdrawals20] parameter is the totalWithdrawals20 of the stock closing input. - double? totalWithdrawals20, + @Default(0.0) double totalWithdrawals20, /// The [closingBalance20] parameter is the closingBalance20 of the stock closing input. - double? closingBalance20, + @Default(0.0) double closingBalance20, /// The [openingAccountingBalance] parameter is the openingAccountingBalance of the stock closing input. - double? openingAccountingBalance, + @Default(0.0) double openingAccountingBalance, /// The [totalAccountingEntries] parameter is the totalAccountingEntries of the stock closing input. - double? totalAccountingEntries, + @Default(0.0) double totalAccountingEntries, /// The [totalAccountingWithdrawals] parameter is the totalAccountingWithdrawals of the stock closing input. - double? totalAccountingWithdrawals, + @Default(0.0) double totalAccountingWithdrawals, /// The [closingAccountingBalance] parameter is the closingAccountingBalance of the stock closing input. - double? closingAccountingBalance, + @Default(0.0) double closingAccountingBalance, /// The [closingDetails] parameter is the closingDetails of the stock closing input. @Default([]) List closingDetails, diff --git a/lib/src/references/references.g.dart b/lib/src/references/references.g.dart index 51908ab..7dfc321 100644 --- a/lib/src/references/references.g.dart +++ b/lib/src/references/references.g.dart @@ -89,6 +89,7 @@ const _$ReferenceCategoryEnumMap = { 'ATS_PREVENT_CHANGES_IN_CACL_TELEMETRY_INPUTS', ReferenceCategory.atsGetAllTerminals: 'ATS_GET_ALL_TERMINALS', ReferenceCategory.atsStorageReceptionAccess: 'ATS_STORAGE_RECEPTION_ACCESS', + ReferenceCategory.atsInvoiceSwap: 'ATS_INVOICE_SWAP', ReferenceCategory.mappitOperator: 'MAPPIT_OPERATOR', ReferenceCategory.mappitCustomer: 'MAPPIT_CUSTOMER', ReferenceCategory.mappitEmployee: 'MAPPIT_EMPLOYEE', diff --git a/lib/src/references/src/category.dart b/lib/src/references/src/category.dart index fc5d319..e249f32 100644 --- a/lib/src/references/src/category.dart +++ b/lib/src/references/src/category.dart @@ -282,6 +282,12 @@ enum ReferenceCategory { /// Layrz API Reference: ATS_STORAGE_RECEPTION_ACCESS atsStorageReceptionAccess, + /// !ATS Reference + /// [AllTank Systems] Access to swap invoice in purchase order + /// Layrz API Reference: ATS_INVOICE_SWAP + @JsonValue('ATS_INVOICE_SWAP') + atsInvoiceSwap, + /// !Mappit Reference /// Defines the access to the Mappit module as a operator or mappit employee /// Layrz API Reference: MAPPIT_OPERATOR diff --git a/lib/src/workspace/src/model.dart b/lib/src/workspace/src/model.dart index fcb7aad..4fd1ee1 100644 --- a/lib/src/workspace/src/model.dart +++ b/lib/src/workspace/src/model.dart @@ -57,7 +57,7 @@ abstract class Workspace with _$Workspace { @Default(false) bool casesEnabled, @Default([]) List triggers, @Default([]) List triggersIds, - @Default([]) List casesMonitorConfig, + @Default([]) List casesMonitorConfig, /// Is the list of [checkpoints] and their ids [checkpointsIds]. And [checkpointsEnabled] indicates /// if the checkpoints monitor is enabled diff --git a/lib/src/workspace/workspace.freezed.dart b/lib/src/workspace/workspace.freezed.dart index 135b674..b87c184 100644 --- a/lib/src/workspace/workspace.freezed.dart +++ b/lib/src/workspace/workspace.freezed.dart @@ -36,7 +36,7 @@ mixin _$Workspace { /// Is the list of [triggers] and their ids [triggersIds]. And [casesEnabled] indicates /// if the cases monitor is enabled /// Also, [casesMonitorConfig] indicates the configuration of the cases monitor - bool get casesEnabled; List get triggers; List get triggersIds; List get casesMonitorConfig;/// Is the list of [checkpoints] and their ids [checkpointsIds]. And [checkpointsEnabled] indicates + bool get casesEnabled; List get triggers; List get triggersIds; List get casesMonitorConfig;/// Is the list of [checkpoints] and their ids [checkpointsIds]. And [checkpointsEnabled] indicates /// if the checkpoints monitor is enabled bool get checkpointsEnabled; List get checkpoints; List get checkpointsIds;/// Is the list of [geofences] and their ids [geofencesIds]. And [mapEnabled] indicates /// if the map monitor is enabled @@ -85,7 +85,7 @@ abstract mixin class $WorkspaceCopyWith<$Res> { factory $WorkspaceCopyWith(Workspace value, $Res Function(Workspace) _then) = _$WorkspaceCopyWithImpl; @useResult $Res call({ - String id, String name,@JsonKey(unknownEnumValue: AppInternalIdentifier.unknown) AppInternalIdentifier? typeApp,@ColorOrNullConverter() Color? color,@IconOrNullConverter() LayrzIcon? icon, String? background, bool? isFavorite,@JsonKey(unknownEnumValue: WorkspaceMainView.sensors) WorkspaceMainView mainView, List assets, List assetsIds, List inboundServices, List inboundServicesIds, List outboundServices, List outboundServicesIds, bool casesEnabled, List triggers, List triggersIds, List casesMonitorConfig, bool checkpointsEnabled, List checkpoints, List checkpointsIds, bool mapEnabled, List geofences, List geofencesIds, List mapCardCustomization, GeoPoint? mapCenterCoordinates,@JsonKey(unknownEnumValue: MapCenterMode.bounds) MapCenterMode? mapCenterMode, bool analyticsEnabled, List charts, List chartsIds, List analyticsGridStructure, bool sensorsEnabled, List sensorsGridStructure,@JsonKey(unknownEnumValue: MetricSystem.metric) MetricSystem? metricSystem, Timezone? timezone, List? access, bool tableEnabled, TableItem? tableStructure + String id, String name,@JsonKey(unknownEnumValue: AppInternalIdentifier.unknown) AppInternalIdentifier? typeApp,@ColorOrNullConverter() Color? color,@IconOrNullConverter() LayrzIcon? icon, String? background, bool? isFavorite,@JsonKey(unknownEnumValue: WorkspaceMainView.sensors) WorkspaceMainView mainView, List assets, List assetsIds, List inboundServices, List inboundServicesIds, List outboundServices, List outboundServicesIds, bool casesEnabled, List triggers, List triggersIds, List casesMonitorConfig, bool checkpointsEnabled, List checkpoints, List checkpointsIds, bool mapEnabled, List geofences, List geofencesIds, List mapCardCustomization, GeoPoint? mapCenterCoordinates,@JsonKey(unknownEnumValue: MapCenterMode.bounds) MapCenterMode? mapCenterMode, bool analyticsEnabled, List charts, List chartsIds, List analyticsGridStructure, bool sensorsEnabled, List sensorsGridStructure,@JsonKey(unknownEnumValue: MetricSystem.metric) MetricSystem? metricSystem, Timezone? timezone, List? access, bool tableEnabled, TableItem? tableStructure }); @@ -122,7 +122,7 @@ as List,casesEnabled: null == casesEnabled ? _self.casesEnabled : casesE as bool,triggers: null == triggers ? _self.triggers : triggers // ignore: cast_nullable_to_non_nullable as List,triggersIds: null == triggersIds ? _self.triggersIds : triggersIds // ignore: cast_nullable_to_non_nullable as List,casesMonitorConfig: null == casesMonitorConfig ? _self.casesMonitorConfig : casesMonitorConfig // ignore: cast_nullable_to_non_nullable -as List,checkpointsEnabled: null == checkpointsEnabled ? _self.checkpointsEnabled : checkpointsEnabled // ignore: cast_nullable_to_non_nullable +as List,checkpointsEnabled: null == checkpointsEnabled ? _self.checkpointsEnabled : checkpointsEnabled // ignore: cast_nullable_to_non_nullable as bool,checkpoints: null == checkpoints ? _self.checkpoints : checkpoints // ignore: cast_nullable_to_non_nullable as List,checkpointsIds: null == checkpointsIds ? _self.checkpointsIds : checkpointsIds // ignore: cast_nullable_to_non_nullable as List,mapEnabled: null == mapEnabled ? _self.mapEnabled : mapEnabled // ignore: cast_nullable_to_non_nullable @@ -263,7 +263,7 @@ return $default(_that);case _: /// } /// ``` -@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String name, @JsonKey(unknownEnumValue: AppInternalIdentifier.unknown) AppInternalIdentifier? typeApp, @ColorOrNullConverter() Color? color, @IconOrNullConverter() LayrzIcon? icon, String? background, bool? isFavorite, @JsonKey(unknownEnumValue: WorkspaceMainView.sensors) WorkspaceMainView mainView, List assets, List assetsIds, List inboundServices, List inboundServicesIds, List outboundServices, List outboundServicesIds, bool casesEnabled, List triggers, List triggersIds, List casesMonitorConfig, bool checkpointsEnabled, List checkpoints, List checkpointsIds, bool mapEnabled, List geofences, List geofencesIds, List mapCardCustomization, GeoPoint? mapCenterCoordinates, @JsonKey(unknownEnumValue: MapCenterMode.bounds) MapCenterMode? mapCenterMode, bool analyticsEnabled, List charts, List chartsIds, List analyticsGridStructure, bool sensorsEnabled, List sensorsGridStructure, @JsonKey(unknownEnumValue: MetricSystem.metric) MetricSystem? metricSystem, Timezone? timezone, List? access, bool tableEnabled, TableItem? tableStructure)? $default,{required TResult orElse(),}) {final _that = this; +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String name, @JsonKey(unknownEnumValue: AppInternalIdentifier.unknown) AppInternalIdentifier? typeApp, @ColorOrNullConverter() Color? color, @IconOrNullConverter() LayrzIcon? icon, String? background, bool? isFavorite, @JsonKey(unknownEnumValue: WorkspaceMainView.sensors) WorkspaceMainView mainView, List assets, List assetsIds, List inboundServices, List inboundServicesIds, List outboundServices, List outboundServicesIds, bool casesEnabled, List triggers, List triggersIds, List casesMonitorConfig, bool checkpointsEnabled, List checkpoints, List checkpointsIds, bool mapEnabled, List geofences, List geofencesIds, List mapCardCustomization, GeoPoint? mapCenterCoordinates, @JsonKey(unknownEnumValue: MapCenterMode.bounds) MapCenterMode? mapCenterMode, bool analyticsEnabled, List charts, List chartsIds, List analyticsGridStructure, bool sensorsEnabled, List sensorsGridStructure, @JsonKey(unknownEnumValue: MetricSystem.metric) MetricSystem? metricSystem, Timezone? timezone, List? access, bool tableEnabled, TableItem? tableStructure)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _Workspace() when $default != null: return $default(_that.id,_that.name,_that.typeApp,_that.color,_that.icon,_that.background,_that.isFavorite,_that.mainView,_that.assets,_that.assetsIds,_that.inboundServices,_that.inboundServicesIds,_that.outboundServices,_that.outboundServicesIds,_that.casesEnabled,_that.triggers,_that.triggersIds,_that.casesMonitorConfig,_that.checkpointsEnabled,_that.checkpoints,_that.checkpointsIds,_that.mapEnabled,_that.geofences,_that.geofencesIds,_that.mapCardCustomization,_that.mapCenterCoordinates,_that.mapCenterMode,_that.analyticsEnabled,_that.charts,_that.chartsIds,_that.analyticsGridStructure,_that.sensorsEnabled,_that.sensorsGridStructure,_that.metricSystem,_that.timezone,_that.access,_that.tableEnabled,_that.tableStructure);case _: @@ -284,7 +284,7 @@ return $default(_that.id,_that.name,_that.typeApp,_that.color,_that.icon,_that.b /// } /// ``` -@optionalTypeArgs TResult when(TResult Function( String id, String name, @JsonKey(unknownEnumValue: AppInternalIdentifier.unknown) AppInternalIdentifier? typeApp, @ColorOrNullConverter() Color? color, @IconOrNullConverter() LayrzIcon? icon, String? background, bool? isFavorite, @JsonKey(unknownEnumValue: WorkspaceMainView.sensors) WorkspaceMainView mainView, List assets, List assetsIds, List inboundServices, List inboundServicesIds, List outboundServices, List outboundServicesIds, bool casesEnabled, List triggers, List triggersIds, List casesMonitorConfig, bool checkpointsEnabled, List checkpoints, List checkpointsIds, bool mapEnabled, List geofences, List geofencesIds, List mapCardCustomization, GeoPoint? mapCenterCoordinates, @JsonKey(unknownEnumValue: MapCenterMode.bounds) MapCenterMode? mapCenterMode, bool analyticsEnabled, List charts, List chartsIds, List analyticsGridStructure, bool sensorsEnabled, List sensorsGridStructure, @JsonKey(unknownEnumValue: MetricSystem.metric) MetricSystem? metricSystem, Timezone? timezone, List? access, bool tableEnabled, TableItem? tableStructure) $default,) {final _that = this; +@optionalTypeArgs TResult when(TResult Function( String id, String name, @JsonKey(unknownEnumValue: AppInternalIdentifier.unknown) AppInternalIdentifier? typeApp, @ColorOrNullConverter() Color? color, @IconOrNullConverter() LayrzIcon? icon, String? background, bool? isFavorite, @JsonKey(unknownEnumValue: WorkspaceMainView.sensors) WorkspaceMainView mainView, List assets, List assetsIds, List inboundServices, List inboundServicesIds, List outboundServices, List outboundServicesIds, bool casesEnabled, List triggers, List triggersIds, List casesMonitorConfig, bool checkpointsEnabled, List checkpoints, List checkpointsIds, bool mapEnabled, List geofences, List geofencesIds, List mapCardCustomization, GeoPoint? mapCenterCoordinates, @JsonKey(unknownEnumValue: MapCenterMode.bounds) MapCenterMode? mapCenterMode, bool analyticsEnabled, List charts, List chartsIds, List analyticsGridStructure, bool sensorsEnabled, List sensorsGridStructure, @JsonKey(unknownEnumValue: MetricSystem.metric) MetricSystem? metricSystem, Timezone? timezone, List? access, bool tableEnabled, TableItem? tableStructure) $default,) {final _that = this; switch (_that) { case _Workspace(): return $default(_that.id,_that.name,_that.typeApp,_that.color,_that.icon,_that.background,_that.isFavorite,_that.mainView,_that.assets,_that.assetsIds,_that.inboundServices,_that.inboundServicesIds,_that.outboundServices,_that.outboundServicesIds,_that.casesEnabled,_that.triggers,_that.triggersIds,_that.casesMonitorConfig,_that.checkpointsEnabled,_that.checkpoints,_that.checkpointsIds,_that.mapEnabled,_that.geofences,_that.geofencesIds,_that.mapCardCustomization,_that.mapCenterCoordinates,_that.mapCenterMode,_that.analyticsEnabled,_that.charts,_that.chartsIds,_that.analyticsGridStructure,_that.sensorsEnabled,_that.sensorsGridStructure,_that.metricSystem,_that.timezone,_that.access,_that.tableEnabled,_that.tableStructure);case _: @@ -304,7 +304,7 @@ return $default(_that.id,_that.name,_that.typeApp,_that.color,_that.icon,_that.b /// } /// ``` -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String name, @JsonKey(unknownEnumValue: AppInternalIdentifier.unknown) AppInternalIdentifier? typeApp, @ColorOrNullConverter() Color? color, @IconOrNullConverter() LayrzIcon? icon, String? background, bool? isFavorite, @JsonKey(unknownEnumValue: WorkspaceMainView.sensors) WorkspaceMainView mainView, List assets, List assetsIds, List inboundServices, List inboundServicesIds, List outboundServices, List outboundServicesIds, bool casesEnabled, List triggers, List triggersIds, List casesMonitorConfig, bool checkpointsEnabled, List checkpoints, List checkpointsIds, bool mapEnabled, List geofences, List geofencesIds, List mapCardCustomization, GeoPoint? mapCenterCoordinates, @JsonKey(unknownEnumValue: MapCenterMode.bounds) MapCenterMode? mapCenterMode, bool analyticsEnabled, List charts, List chartsIds, List analyticsGridStructure, bool sensorsEnabled, List sensorsGridStructure, @JsonKey(unknownEnumValue: MetricSystem.metric) MetricSystem? metricSystem, Timezone? timezone, List? access, bool tableEnabled, TableItem? tableStructure)? $default,) {final _that = this; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String name, @JsonKey(unknownEnumValue: AppInternalIdentifier.unknown) AppInternalIdentifier? typeApp, @ColorOrNullConverter() Color? color, @IconOrNullConverter() LayrzIcon? icon, String? background, bool? isFavorite, @JsonKey(unknownEnumValue: WorkspaceMainView.sensors) WorkspaceMainView mainView, List assets, List assetsIds, List inboundServices, List inboundServicesIds, List outboundServices, List outboundServicesIds, bool casesEnabled, List triggers, List triggersIds, List casesMonitorConfig, bool checkpointsEnabled, List checkpoints, List checkpointsIds, bool mapEnabled, List geofences, List geofencesIds, List mapCardCustomization, GeoPoint? mapCenterCoordinates, @JsonKey(unknownEnumValue: MapCenterMode.bounds) MapCenterMode? mapCenterMode, bool analyticsEnabled, List charts, List chartsIds, List analyticsGridStructure, bool sensorsEnabled, List sensorsGridStructure, @JsonKey(unknownEnumValue: MetricSystem.metric) MetricSystem? metricSystem, Timezone? timezone, List? access, bool tableEnabled, TableItem? tableStructure)? $default,) {final _that = this; switch (_that) { case _Workspace() when $default != null: return $default(_that.id,_that.name,_that.typeApp,_that.color,_that.icon,_that.background,_that.isFavorite,_that.mainView,_that.assets,_that.assetsIds,_that.inboundServices,_that.inboundServicesIds,_that.outboundServices,_that.outboundServicesIds,_that.casesEnabled,_that.triggers,_that.triggersIds,_that.casesMonitorConfig,_that.checkpointsEnabled,_that.checkpoints,_that.checkpointsIds,_that.mapEnabled,_that.geofences,_that.geofencesIds,_that.mapCardCustomization,_that.mapCenterCoordinates,_that.mapCenterMode,_that.analyticsEnabled,_that.charts,_that.chartsIds,_that.analyticsGridStructure,_that.sensorsEnabled,_that.sensorsGridStructure,_that.metricSystem,_that.timezone,_that.access,_that.tableEnabled,_that.tableStructure);case _: @@ -319,7 +319,7 @@ return $default(_that.id,_that.name,_that.typeApp,_that.color,_that.icon,_that.b @JsonSerializable() class _Workspace implements Workspace { - const _Workspace({required this.id, required this.name, @JsonKey(unknownEnumValue: AppInternalIdentifier.unknown) this.typeApp, @ColorOrNullConverter() this.color, @IconOrNullConverter() this.icon, this.background, this.isFavorite, @JsonKey(unknownEnumValue: WorkspaceMainView.sensors) this.mainView = WorkspaceMainView.sensors, final List assets = const [], final List assetsIds = const [], final List inboundServices = const [], final List inboundServicesIds = const [], final List outboundServices = const [], final List outboundServicesIds = const [], this.casesEnabled = false, final List triggers = const [], final List triggersIds = const [], final List casesMonitorConfig = const [], this.checkpointsEnabled = false, final List checkpoints = const [], final List checkpointsIds = const [], this.mapEnabled = false, final List geofences = const [], final List geofencesIds = const [], final List mapCardCustomization = const [], this.mapCenterCoordinates, @JsonKey(unknownEnumValue: MapCenterMode.bounds) this.mapCenterMode, this.analyticsEnabled = false, final List charts = const [], final List chartsIds = const [], final List analyticsGridStructure = const [], this.sensorsEnabled = false, final List sensorsGridStructure = const [], @JsonKey(unknownEnumValue: MetricSystem.metric) this.metricSystem, this.timezone, final List? access, this.tableEnabled = false, this.tableStructure}): _assets = assets,_assetsIds = assetsIds,_inboundServices = inboundServices,_inboundServicesIds = inboundServicesIds,_outboundServices = outboundServices,_outboundServicesIds = outboundServicesIds,_triggers = triggers,_triggersIds = triggersIds,_casesMonitorConfig = casesMonitorConfig,_checkpoints = checkpoints,_checkpointsIds = checkpointsIds,_geofences = geofences,_geofencesIds = geofencesIds,_mapCardCustomization = mapCardCustomization,_charts = charts,_chartsIds = chartsIds,_analyticsGridStructure = analyticsGridStructure,_sensorsGridStructure = sensorsGridStructure,_access = access; + const _Workspace({required this.id, required this.name, @JsonKey(unknownEnumValue: AppInternalIdentifier.unknown) this.typeApp, @ColorOrNullConverter() this.color, @IconOrNullConverter() this.icon, this.background, this.isFavorite, @JsonKey(unknownEnumValue: WorkspaceMainView.sensors) this.mainView = WorkspaceMainView.sensors, final List assets = const [], final List assetsIds = const [], final List inboundServices = const [], final List inboundServicesIds = const [], final List outboundServices = const [], final List outboundServicesIds = const [], this.casesEnabled = false, final List triggers = const [], final List triggersIds = const [], final List casesMonitorConfig = const [], this.checkpointsEnabled = false, final List checkpoints = const [], final List checkpointsIds = const [], this.mapEnabled = false, final List geofences = const [], final List geofencesIds = const [], final List mapCardCustomization = const [], this.mapCenterCoordinates, @JsonKey(unknownEnumValue: MapCenterMode.bounds) this.mapCenterMode, this.analyticsEnabled = false, final List charts = const [], final List chartsIds = const [], final List analyticsGridStructure = const [], this.sensorsEnabled = false, final List sensorsGridStructure = const [], @JsonKey(unknownEnumValue: MetricSystem.metric) this.metricSystem, this.timezone, final List? access, this.tableEnabled = false, this.tableStructure}): _assets = assets,_assetsIds = assetsIds,_inboundServices = inboundServices,_inboundServicesIds = inboundServicesIds,_outboundServices = outboundServices,_outboundServicesIds = outboundServicesIds,_triggers = triggers,_triggersIds = triggersIds,_casesMonitorConfig = casesMonitorConfig,_checkpoints = checkpoints,_checkpointsIds = checkpointsIds,_geofences = geofences,_geofencesIds = geofencesIds,_mapCardCustomization = mapCardCustomization,_charts = charts,_chartsIds = chartsIds,_analyticsGridStructure = analyticsGridStructure,_sensorsGridStructure = sensorsGridStructure,_access = access; factory _Workspace.fromJson(Map json) => _$WorkspaceFromJson(json); /// Is the ID @@ -414,8 +414,8 @@ class _Workspace implements Workspace { return EqualUnmodifiableListView(_triggersIds); } - final List _casesMonitorConfig; -@override@JsonKey() List get casesMonitorConfig { + final List _casesMonitorConfig; +@override@JsonKey() List get casesMonitorConfig { if (_casesMonitorConfig is EqualUnmodifiableListView) return _casesMonitorConfig; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_casesMonitorConfig); @@ -554,7 +554,7 @@ abstract mixin class _$WorkspaceCopyWith<$Res> implements $WorkspaceCopyWith<$Re factory _$WorkspaceCopyWith(_Workspace value, $Res Function(_Workspace) _then) = __$WorkspaceCopyWithImpl; @override @useResult $Res call({ - String id, String name,@JsonKey(unknownEnumValue: AppInternalIdentifier.unknown) AppInternalIdentifier? typeApp,@ColorOrNullConverter() Color? color,@IconOrNullConverter() LayrzIcon? icon, String? background, bool? isFavorite,@JsonKey(unknownEnumValue: WorkspaceMainView.sensors) WorkspaceMainView mainView, List assets, List assetsIds, List inboundServices, List inboundServicesIds, List outboundServices, List outboundServicesIds, bool casesEnabled, List triggers, List triggersIds, List casesMonitorConfig, bool checkpointsEnabled, List checkpoints, List checkpointsIds, bool mapEnabled, List geofences, List geofencesIds, List mapCardCustomization, GeoPoint? mapCenterCoordinates,@JsonKey(unknownEnumValue: MapCenterMode.bounds) MapCenterMode? mapCenterMode, bool analyticsEnabled, List charts, List chartsIds, List analyticsGridStructure, bool sensorsEnabled, List sensorsGridStructure,@JsonKey(unknownEnumValue: MetricSystem.metric) MetricSystem? metricSystem, Timezone? timezone, List? access, bool tableEnabled, TableItem? tableStructure + String id, String name,@JsonKey(unknownEnumValue: AppInternalIdentifier.unknown) AppInternalIdentifier? typeApp,@ColorOrNullConverter() Color? color,@IconOrNullConverter() LayrzIcon? icon, String? background, bool? isFavorite,@JsonKey(unknownEnumValue: WorkspaceMainView.sensors) WorkspaceMainView mainView, List assets, List assetsIds, List inboundServices, List inboundServicesIds, List outboundServices, List outboundServicesIds, bool casesEnabled, List triggers, List triggersIds, List casesMonitorConfig, bool checkpointsEnabled, List checkpoints, List checkpointsIds, bool mapEnabled, List geofences, List geofencesIds, List mapCardCustomization, GeoPoint? mapCenterCoordinates,@JsonKey(unknownEnumValue: MapCenterMode.bounds) MapCenterMode? mapCenterMode, bool analyticsEnabled, List charts, List chartsIds, List analyticsGridStructure, bool sensorsEnabled, List sensorsGridStructure,@JsonKey(unknownEnumValue: MetricSystem.metric) MetricSystem? metricSystem, Timezone? timezone, List? access, bool tableEnabled, TableItem? tableStructure }); @@ -591,7 +591,7 @@ as List,casesEnabled: null == casesEnabled ? _self.casesEnabled : casesE as bool,triggers: null == triggers ? _self._triggers : triggers // ignore: cast_nullable_to_non_nullable as List,triggersIds: null == triggersIds ? _self._triggersIds : triggersIds // ignore: cast_nullable_to_non_nullable as List,casesMonitorConfig: null == casesMonitorConfig ? _self._casesMonitorConfig : casesMonitorConfig // ignore: cast_nullable_to_non_nullable -as List,checkpointsEnabled: null == checkpointsEnabled ? _self.checkpointsEnabled : checkpointsEnabled // ignore: cast_nullable_to_non_nullable +as List,checkpointsEnabled: null == checkpointsEnabled ? _self.checkpointsEnabled : checkpointsEnabled // ignore: cast_nullable_to_non_nullable as bool,checkpoints: null == checkpoints ? _self._checkpoints : checkpoints // ignore: cast_nullable_to_non_nullable as List,checkpointsIds: null == checkpointsIds ? _self._checkpointsIds : checkpointsIds // ignore: cast_nullable_to_non_nullable as List,mapEnabled: null == mapEnabled ? _self.mapEnabled : mapEnabled // ignore: cast_nullable_to_non_nullable diff --git a/lib/src/workspace/workspace.g.dart b/lib/src/workspace/workspace.g.dart index 15e880b..0d8e818 100644 --- a/lib/src/workspace/workspace.g.dart +++ b/lib/src/workspace/workspace.g.dart @@ -66,7 +66,11 @@ _Workspace _$WorkspaceFromJson(Map json) => _Workspace( const [], casesMonitorConfig: (json['casesMonitorConfig'] as List?) - ?.map((e) => CaseMonitorCard.fromJson(e as Map)) + ?.map( + (e) => e == null + ? null + : CaseMonitorCard.fromJson(e as Map), + ) .toList() ?? const [], checkpointsEnabled: json['checkpointsEnabled'] as bool? ?? false, @@ -162,7 +166,7 @@ Map _$WorkspaceToJson( 'triggers': instance.triggers.map((e) => e.toJson()).toList(), 'triggersIds': instance.triggersIds, 'casesMonitorConfig': instance.casesMonitorConfig - .map((e) => e.toJson()) + .map((e) => e?.toJson()) .toList(), 'checkpointsEnabled': instance.checkpointsEnabled, 'checkpoints': instance.checkpoints.map((e) => e.toJson()).toList(), diff --git a/pubspec.yaml b/pubspec.yaml index 98730ea..a0b1c0d 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.7" +version: "3.8.8" repository: https://github.com/goldenm-software/layrz_models environment: diff --git a/test/workspace_test.dart b/test/workspace_test.dart index eeefdc1..ab6bcff 100644 --- a/test/workspace_test.dart +++ b/test/workspace_test.dart @@ -2,7 +2,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:layrz_models/layrz_models.dart'; void main() { - test('Workspace.fromJson', () { final data = { "__typename": "Workspace", @@ -40,7 +39,7 @@ void main() { "x": 0, "y": 0, "moved": false, - "content": {"sensorId": "4", "disableMask": false} + "content": {"sensorId": "4", "disableMask": false}, }, { "h": 1, @@ -49,7 +48,7 @@ void main() { "x": 2, "y": 0, "moved": false, - "content": {"sensorId": "5", "disableMask": false} + "content": {"sensorId": "5", "disableMask": false}, }, { "h": 1, @@ -58,7 +57,7 @@ void main() { "x": 1, "y": 0, "moved": false, - "content": {"sensorId": "6", "disableMask": false} + "content": {"sensorId": "6", "disableMask": false}, }, { "h": 1, @@ -67,7 +66,7 @@ void main() { "x": 0, "y": 1, "moved": false, - "content": {"sensorId": null, "disableMask": false} + "content": {"sensorId": null, "disableMask": false}, }, { "h": 1, @@ -76,10 +75,10 @@ void main() { "x": 1, "y": 1, "moved": false, - "content": {"sensorId": null, "disableMask": false} - } - ] - } + "content": {"sensorId": null, "disableMask": false}, + }, + ], + }, }, { "h": 3, @@ -99,7 +98,7 @@ void main() { "x": 0, "y": 0, "moved": false, - "content": {"sensorId": "1", "disableMask": false} + "content": {"sensorId": "1", "disableMask": false}, }, { "h": 1, @@ -108,7 +107,7 @@ void main() { "x": 2, "y": 2, "moved": false, - "content": {"sensorId": "2", "disableMask": false} + "content": {"sensorId": "2", "disableMask": false}, }, { "h": 1, @@ -117,7 +116,7 @@ void main() { "x": 2, "y": 0, "moved": false, - "content": {"sensorId": "3", "disableMask": false} + "content": {"sensorId": "3", "disableMask": false}, }, { "h": 1, @@ -126,7 +125,7 @@ void main() { "x": 1, "y": 0, "moved": false, - "content": {"sensorId": "7", "disableMask": false} + "content": {"sensorId": "7", "disableMask": false}, }, { "h": 1, @@ -135,7 +134,7 @@ void main() { "x": 1, "y": 1, "moved": false, - "content": {"sensorId": "8", "disableMask": false} + "content": {"sensorId": "8", "disableMask": false}, }, { "h": 1, @@ -144,7 +143,7 @@ void main() { "x": 2, "y": 1, "moved": false, - "content": {"sensorId": "9", "disableMask": false} + "content": {"sensorId": "9", "disableMask": false}, }, { "h": 1, @@ -153,7 +152,7 @@ void main() { "x": 0, "y": 2, "moved": false, - "content": {"sensorId": "10", "disableMask": false} + "content": {"sensorId": "10", "disableMask": false}, }, { "h": 1, @@ -162,11 +161,11 @@ void main() { "x": 1, "y": 2, "moved": false, - "content": {"sensorId": "12", "disableMask": false} - } - ] - } - } + "content": {"sensorId": "12", "disableMask": false}, + }, + ], + }, + }, ], "mapEnabled": true, "mapCenterMode": "BOUNDS", @@ -177,9 +176,9 @@ void main() { "sensors": { "mode": "GRID", "values": ["8", "9", "10"], - "enabled": true + "enabled": true, }, - "connection": {"time": false, "address": true, "indicator": true} + "connection": {"time": false, "address": true, "indicator": true}, }, { "alerts": {"count": true, "range": "H24", "enabled": true}, @@ -187,10 +186,10 @@ void main() { "sensors": { "mode": "LIST", "values": ["5", "6"], - "enabled": true + "enabled": true, }, - "connection": {"time": false, "address": false, "indicator": false} - } + "connection": {"time": false, "address": false, "indicator": false}, + }, ], "mapCenterCoordinates": {"__typename": "GeocodeCoordinates", "latitude": 0.0, "longitude": 0.0}, "geofencesIds": ["2"], @@ -208,7 +207,7 @@ void main() { "x": 0, "y": 1, "moved": false, - "content": {"chartId": "1"} + "content": {"chartId": "1"}, }, { "h": 1, @@ -217,7 +216,7 @@ void main() { "x": 2, "y": 1, "moved": false, - "content": {"chartId": "2"} + "content": {"chartId": "2"}, }, { "h": 1, @@ -226,7 +225,7 @@ void main() { "x": 2, "y": 2, "moved": false, - "content": {"chartId": "3"} + "content": {"chartId": "3"}, }, { "h": 1, @@ -235,7 +234,7 @@ void main() { "x": 0, "y": 2, "moved": false, - "content": {"chartId": "4"} + "content": {"chartId": "4"}, }, { "h": 1, @@ -244,9 +243,477 @@ void main() { "x": 0, "y": 0, "moved": false, - "content": {"chartId": "5"} - } + "content": {"chartId": "5"}, + }, + ], + }; + + final obj = Workspace.fromJson(data); + + expect(obj, isA()); + }); + + test('Sugoi workspace from JSON', () { + final data = { + "id": "13238", + "name": "Sugoi Brisas del Golf", + "icon": "mdi-briefcase", + "color": "#2196f3", + "background": "https://cdn.layrz.com/avatars/Sugoi_-13238.png", + "isFavorite": false, + "assetsIds": [ + "74347", + "74327", + "74334", + "74321", + "74333", + "74330", + "74338", + "74335", + "74332", + "74326", + "74349", + "74340", + "74337", + ], + "inboundServicesIds": [], + "outboundServicesIds": [], + "mainView": "/Main/Grid", + "sensorsEnabled": true, + "sensorsGridStructure": [ + { + "objectId": "74326", + "kind": "ASSET", + "color": "#ffffff", + "dimensions": {"width": 2, "height": 1}, + "sensors": [ + { + "sensorId": "166685", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "166686", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + ], + }, + { + "objectId": "74327", + "kind": "ASSET", + "color": "#ffffff", + "dimensions": {"width": 2, "height": 1}, + "sensors": [ + { + "sensorId": "166687", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "166688", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + ], + }, + { + "objectId": "74330", + "kind": "ASSET", + "color": "#ffffff", + "dimensions": {"width": 2, "height": 2}, + "sensors": [ + { + "sensorId": "166689", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "166690", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + ], + }, + { + "objectId": "74340", + "kind": "ASSET", + "color": "#ffffff", + "dimensions": {"width": 2, "height": 2}, + "sensors": [ + { + "sensorId": "166723", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 1, "height": 1}, + }, + { + "sensorId": "166724", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 1, "height": 1}, + }, + { + "sensorId": "166729", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 1, "height": 1}, + }, + { + "sensorId": "166730", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 1, "height": 1}, + }, + { + "sensorId": "166731", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "global-169243", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + ], + }, + { + "objectId": "74334", + "kind": "ASSET", + "color": "#ffffff", + "dimensions": {"width": 2, "height": 2}, + "sensors": [ + { + "sensorId": "166717", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "166718", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "166771", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "global-169243", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + ], + }, + { + "objectId": "74347", + "kind": "ASSET", + "color": "#ffffff", + "dimensions": {"width": 2, "height": 2}, + "sensors": [ + { + "sensorId": "166725", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "166726", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + ], + }, + { + "objectId": "74349", + "kind": "ASSET", + "color": "#ffffff", + "dimensions": {"width": 2, "height": 2}, + "sensors": [ + { + "sensorId": "166727", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "166728", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "166772", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "global-169243", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + ], + }, + { + "objectId": "74321", + "kind": "ASSET", + "color": "#ffffff", + "dimensions": {"width": 2, "height": 2}, + "sensors": [ + { + "sensorId": "166683", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "166684", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + ], + }, + { + "objectId": "74335", + "kind": "ASSET", + "color": "#ffffff", + "dimensions": {"width": 1, "height": 1}, + "sensors": [ + { + "sensorId": "166715", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "166716", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + ], + }, + { + "objectId": "74337", + "kind": "ASSET", + "color": "#ffffff", + "dimensions": {"width": 1, "height": 1}, + "sensors": [ + { + "sensorId": "166721", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "166722", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + ], + }, + { + "objectId": "74332", + "kind": "ASSET", + "color": "#ffffff", + "dimensions": {"width": 1, "height": 1}, + "sensors": [ + { + "sensorId": "166701", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "166702", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + ], + }, + { + "objectId": "74338", + "kind": "ASSET", + "color": "#ffffff", + "dimensions": {"width": 1, "height": 1}, + "sensors": [ + { + "sensorId": "166719", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "166720", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + ], + }, + { + "objectId": "74333", + "kind": "ASSET", + "color": "#ffffff", + "dimensions": {"width": 1, "height": 1}, + "sensors": [ + { + "sensorId": "166703", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + { + "sensorId": "166704", + "maskEnabled": true, + "type": "PLAIN", + "minimum": null, + "maximum": null, + "dimensions": {"width": 2, "height": 1}, + }, + ], + }, + ], + "tableEnabled": true, + "tableStructure": { + "assetsIds": [ + "74321", + "74326", + "74327", + "74330", + "74332", + "74333", + "74334", + "74335", + "74337", + "74338", + "74340", + "74347", + "74349", + ], + "sensorsIds": ["temperature.celsius", "humidity.percent", "door.status"], + "attributes": [], + }, + "mapEnabled": false, + "mapCenterMode": "BOUNDS", + "mapCardCustomization": [], + "mapCenterCoordinates": {"latitude": null, "longitude": null}, + "geofencesIds": [], + "casesEnabled": true, + "triggersIds": [], + "casesMonitorConfig": [ + null, + {"type": "SPECIFIC_ASSET", "assetId": null}, + {"type": "PIE_CHART", "assetId": null}, + {"type": "EXPIRED_LAST_24_HOURS", "assetId": null}, + ], + "checkpointsEnabled": false, + "checkpointsIds": [], + "analyticsEnabled": true, + "chartsIds": ["678", "679", "680", "681"], + "analyticsGridStructure": [ + { + "chartId": "678", + "dimensions": {"width": 4, "height": 2}, + }, + { + "chartId": "679", + "dimensions": {"width": 4, "height": 2}, + }, + { + "chartId": "680", + "dimensions": {"width": 8, "height": 2}, + }, + { + "chartId": "681", + "dimensions": {"width": 5, "height": 2}, + }, ], + "access": [], }; final obj = Workspace.fromJson(data);