diff --git a/lib/backend/objectbox/entities/stock_picking/stock_picking_record_entity.dart b/lib/backend/objectbox/entities/stock_picking/stock_picking_record_entity.dart new file mode 100644 index 0000000..10c363d --- /dev/null +++ b/lib/backend/objectbox/entities/stock_picking/stock_picking_record_entity.dart @@ -0,0 +1 @@ +import 'package:objectbox/objectbox.dart'; \ No newline at end of file diff --git a/lib/backend/schema/stock_picking/stock_picking_model.dart b/lib/backend/schema/stock_picking/stock_picking_model.dart index 51f94c7..29a1528 100644 --- a/lib/backend/schema/stock_picking/stock_picking_model.dart +++ b/lib/backend/schema/stock_picking/stock_picking_model.dart @@ -26,46 +26,3 @@ abstract class StockPickingResultModel with _$StockPickingResultModel { factory StockPickingResultModel.fromJson(Map json) => _$StockPickingResultModelFromJson(json); } - -@freezed -abstract class StockPickingCompanyModel with _$StockPickingCompanyModel { - const factory StockPickingCompanyModel({@JsonKey(name: 'id') int? id}) = - _StockPickingCompanyModel; - - factory StockPickingCompanyModel.fromJson(Map json) => - _$StockPickingCompanyModelFromJson(json); -} - -@freezed -abstract class StockPickingPartnerModel with _$StockPickingPartnerModel { - const factory StockPickingPartnerModel({ - int? id, - @JsonKey(name: 'display_name') String? displayName, - }) = _StockPickingPartnerModel; - - factory StockPickingPartnerModel.fromJson(Map json) => - _$StockPickingPartnerModelFromJson(json); -} - -@freezed -abstract class StockPickingLocationModel with _$StockPickingLocationModel { - const factory StockPickingLocationModel({ - int? id, - @JsonKey(name: 'complete_name') String? completeName, - }) = _StockPickingLocationModel; - - factory StockPickingLocationModel.fromJson(Map json) => - _$StockPickingLocationModelFromJson(json); -} - -@freezed -abstract class StockPickingTypeModel with _$StockPickingTypeModel { - const factory StockPickingTypeModel({ - int? id, - @JsonKey(name: 'display_name') String? displayName, - }) = _StockPickingTypeModel; - - factory StockPickingTypeModel.fromJson(Map json) => - _$StockPickingTypeModelFromJson(json); -} - diff --git a/lib/backend/schema/stock_picking/stock_picking_model.freezed.dart b/lib/backend/schema/stock_picking/stock_picking_model.freezed.dart index 1640110..bdcbdd8 100644 --- a/lib/backend/schema/stock_picking/stock_picking_model.freezed.dart +++ b/lib/backend/schema/stock_picking/stock_picking_model.freezed.dart @@ -317,547 +317,6 @@ as List?, } -} - - -/// @nodoc -mixin _$StockPickingCompanyModel { - -@JsonKey(name: 'id') int? get id; -/// Create a copy of StockPickingCompanyModel -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$StockPickingCompanyModelCopyWith get copyWith => _$StockPickingCompanyModelCopyWithImpl(this as StockPickingCompanyModel, _$identity); - - /// Serializes this StockPickingCompanyModel to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingCompanyModel&&(identical(other.id, id) || other.id == id)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id); - -@override -String toString() { - return 'StockPickingCompanyModel(id: $id)'; -} - - -} - -/// @nodoc -abstract mixin class $StockPickingCompanyModelCopyWith<$Res> { - factory $StockPickingCompanyModelCopyWith(StockPickingCompanyModel value, $Res Function(StockPickingCompanyModel) _then) = _$StockPickingCompanyModelCopyWithImpl; -@useResult -$Res call({ -@JsonKey(name: 'id') int? id -}); - - - - -} -/// @nodoc -class _$StockPickingCompanyModelCopyWithImpl<$Res> - implements $StockPickingCompanyModelCopyWith<$Res> { - _$StockPickingCompanyModelCopyWithImpl(this._self, this._then); - - final StockPickingCompanyModel _self; - final $Res Function(StockPickingCompanyModel) _then; - -/// Create a copy of StockPickingCompanyModel -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,}) { - return _then(_self.copyWith( -id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int?, - )); -} - -} - - -/// @nodoc -@JsonSerializable() - -class _StockPickingCompanyModel implements StockPickingCompanyModel { - const _StockPickingCompanyModel({@JsonKey(name: 'id') this.id}); - factory _StockPickingCompanyModel.fromJson(Map json) => _$StockPickingCompanyModelFromJson(json); - -@override@JsonKey(name: 'id') final int? id; - -/// Create a copy of StockPickingCompanyModel -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$StockPickingCompanyModelCopyWith<_StockPickingCompanyModel> get copyWith => __$StockPickingCompanyModelCopyWithImpl<_StockPickingCompanyModel>(this, _$identity); - -@override -Map toJson() { - return _$StockPickingCompanyModelToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingCompanyModel&&(identical(other.id, id) || other.id == id)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id); - -@override -String toString() { - return 'StockPickingCompanyModel(id: $id)'; -} - - -} - -/// @nodoc -abstract mixin class _$StockPickingCompanyModelCopyWith<$Res> implements $StockPickingCompanyModelCopyWith<$Res> { - factory _$StockPickingCompanyModelCopyWith(_StockPickingCompanyModel value, $Res Function(_StockPickingCompanyModel) _then) = __$StockPickingCompanyModelCopyWithImpl; -@override @useResult -$Res call({ -@JsonKey(name: 'id') int? id -}); - - - - -} -/// @nodoc -class __$StockPickingCompanyModelCopyWithImpl<$Res> - implements _$StockPickingCompanyModelCopyWith<$Res> { - __$StockPickingCompanyModelCopyWithImpl(this._self, this._then); - - final _StockPickingCompanyModel _self; - final $Res Function(_StockPickingCompanyModel) _then; - -/// Create a copy of StockPickingCompanyModel -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,}) { - return _then(_StockPickingCompanyModel( -id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int?, - )); -} - - -} - - -/// @nodoc -mixin _$StockPickingPartnerModel { - - int? get id;@JsonKey(name: 'display_name') String? get displayName; -/// Create a copy of StockPickingPartnerModel -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$StockPickingPartnerModelCopyWith get copyWith => _$StockPickingPartnerModelCopyWithImpl(this as StockPickingPartnerModel, _$identity); - - /// Serializes this StockPickingPartnerModel to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingPartnerModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id,displayName); - -@override -String toString() { - return 'StockPickingPartnerModel(id: $id, displayName: $displayName)'; -} - - -} - -/// @nodoc -abstract mixin class $StockPickingPartnerModelCopyWith<$Res> { - factory $StockPickingPartnerModelCopyWith(StockPickingPartnerModel value, $Res Function(StockPickingPartnerModel) _then) = _$StockPickingPartnerModelCopyWithImpl; -@useResult -$Res call({ - int? id,@JsonKey(name: 'display_name') String? displayName -}); - - - - -} -/// @nodoc -class _$StockPickingPartnerModelCopyWithImpl<$Res> - implements $StockPickingPartnerModelCopyWith<$Res> { - _$StockPickingPartnerModelCopyWithImpl(this._self, this._then); - - final StockPickingPartnerModel _self; - final $Res Function(StockPickingPartnerModel) _then; - -/// Create a copy of StockPickingPartnerModel -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? displayName = freezed,}) { - return _then(_self.copyWith( -id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable -as String?, - )); -} - -} - - -/// @nodoc -@JsonSerializable() - -class _StockPickingPartnerModel implements StockPickingPartnerModel { - const _StockPickingPartnerModel({this.id, @JsonKey(name: 'display_name') this.displayName}); - factory _StockPickingPartnerModel.fromJson(Map json) => _$StockPickingPartnerModelFromJson(json); - -@override final int? id; -@override@JsonKey(name: 'display_name') final String? displayName; - -/// Create a copy of StockPickingPartnerModel -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$StockPickingPartnerModelCopyWith<_StockPickingPartnerModel> get copyWith => __$StockPickingPartnerModelCopyWithImpl<_StockPickingPartnerModel>(this, _$identity); - -@override -Map toJson() { - return _$StockPickingPartnerModelToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingPartnerModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id,displayName); - -@override -String toString() { - return 'StockPickingPartnerModel(id: $id, displayName: $displayName)'; -} - - -} - -/// @nodoc -abstract mixin class _$StockPickingPartnerModelCopyWith<$Res> implements $StockPickingPartnerModelCopyWith<$Res> { - factory _$StockPickingPartnerModelCopyWith(_StockPickingPartnerModel value, $Res Function(_StockPickingPartnerModel) _then) = __$StockPickingPartnerModelCopyWithImpl; -@override @useResult -$Res call({ - int? id,@JsonKey(name: 'display_name') String? displayName -}); - - - - -} -/// @nodoc -class __$StockPickingPartnerModelCopyWithImpl<$Res> - implements _$StockPickingPartnerModelCopyWith<$Res> { - __$StockPickingPartnerModelCopyWithImpl(this._self, this._then); - - final _StockPickingPartnerModel _self; - final $Res Function(_StockPickingPartnerModel) _then; - -/// Create a copy of StockPickingPartnerModel -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? displayName = freezed,}) { - return _then(_StockPickingPartnerModel( -id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable -as String?, - )); -} - - -} - - -/// @nodoc -mixin _$StockPickingLocationModel { - - int? get id;@JsonKey(name: 'complete_name') String? get completeName; -/// Create a copy of StockPickingLocationModel -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$StockPickingLocationModelCopyWith get copyWith => _$StockPickingLocationModelCopyWithImpl(this as StockPickingLocationModel, _$identity); - - /// Serializes this StockPickingLocationModel to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingLocationModel&&(identical(other.id, id) || other.id == id)&&(identical(other.completeName, completeName) || other.completeName == completeName)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id,completeName); - -@override -String toString() { - return 'StockPickingLocationModel(id: $id, completeName: $completeName)'; -} - - -} - -/// @nodoc -abstract mixin class $StockPickingLocationModelCopyWith<$Res> { - factory $StockPickingLocationModelCopyWith(StockPickingLocationModel value, $Res Function(StockPickingLocationModel) _then) = _$StockPickingLocationModelCopyWithImpl; -@useResult -$Res call({ - int? id,@JsonKey(name: 'complete_name') String? completeName -}); - - - - -} -/// @nodoc -class _$StockPickingLocationModelCopyWithImpl<$Res> - implements $StockPickingLocationModelCopyWith<$Res> { - _$StockPickingLocationModelCopyWithImpl(this._self, this._then); - - final StockPickingLocationModel _self; - final $Res Function(StockPickingLocationModel) _then; - -/// Create a copy of StockPickingLocationModel -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? completeName = freezed,}) { - return _then(_self.copyWith( -id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int?,completeName: freezed == completeName ? _self.completeName : completeName // ignore: cast_nullable_to_non_nullable -as String?, - )); -} - -} - - -/// @nodoc -@JsonSerializable() - -class _StockPickingLocationModel implements StockPickingLocationModel { - const _StockPickingLocationModel({this.id, @JsonKey(name: 'complete_name') this.completeName}); - factory _StockPickingLocationModel.fromJson(Map json) => _$StockPickingLocationModelFromJson(json); - -@override final int? id; -@override@JsonKey(name: 'complete_name') final String? completeName; - -/// Create a copy of StockPickingLocationModel -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$StockPickingLocationModelCopyWith<_StockPickingLocationModel> get copyWith => __$StockPickingLocationModelCopyWithImpl<_StockPickingLocationModel>(this, _$identity); - -@override -Map toJson() { - return _$StockPickingLocationModelToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingLocationModel&&(identical(other.id, id) || other.id == id)&&(identical(other.completeName, completeName) || other.completeName == completeName)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id,completeName); - -@override -String toString() { - return 'StockPickingLocationModel(id: $id, completeName: $completeName)'; -} - - -} - -/// @nodoc -abstract mixin class _$StockPickingLocationModelCopyWith<$Res> implements $StockPickingLocationModelCopyWith<$Res> { - factory _$StockPickingLocationModelCopyWith(_StockPickingLocationModel value, $Res Function(_StockPickingLocationModel) _then) = __$StockPickingLocationModelCopyWithImpl; -@override @useResult -$Res call({ - int? id,@JsonKey(name: 'complete_name') String? completeName -}); - - - - -} -/// @nodoc -class __$StockPickingLocationModelCopyWithImpl<$Res> - implements _$StockPickingLocationModelCopyWith<$Res> { - __$StockPickingLocationModelCopyWithImpl(this._self, this._then); - - final _StockPickingLocationModel _self; - final $Res Function(_StockPickingLocationModel) _then; - -/// Create a copy of StockPickingLocationModel -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? completeName = freezed,}) { - return _then(_StockPickingLocationModel( -id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int?,completeName: freezed == completeName ? _self.completeName : completeName // ignore: cast_nullable_to_non_nullable -as String?, - )); -} - - -} - - -/// @nodoc -mixin _$StockPickingTypeModel { - - int? get id;@JsonKey(name: 'display_name') String? get displayName; -/// Create a copy of StockPickingTypeModel -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$StockPickingTypeModelCopyWith get copyWith => _$StockPickingTypeModelCopyWithImpl(this as StockPickingTypeModel, _$identity); - - /// Serializes this StockPickingTypeModel to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingTypeModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id,displayName); - -@override -String toString() { - return 'StockPickingTypeModel(id: $id, displayName: $displayName)'; -} - - -} - -/// @nodoc -abstract mixin class $StockPickingTypeModelCopyWith<$Res> { - factory $StockPickingTypeModelCopyWith(StockPickingTypeModel value, $Res Function(StockPickingTypeModel) _then) = _$StockPickingTypeModelCopyWithImpl; -@useResult -$Res call({ - int? id,@JsonKey(name: 'display_name') String? displayName -}); - - - - -} -/// @nodoc -class _$StockPickingTypeModelCopyWithImpl<$Res> - implements $StockPickingTypeModelCopyWith<$Res> { - _$StockPickingTypeModelCopyWithImpl(this._self, this._then); - - final StockPickingTypeModel _self; - final $Res Function(StockPickingTypeModel) _then; - -/// Create a copy of StockPickingTypeModel -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? displayName = freezed,}) { - return _then(_self.copyWith( -id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable -as String?, - )); -} - -} - - -/// @nodoc -@JsonSerializable() - -class _StockPickingTypeModel implements StockPickingTypeModel { - const _StockPickingTypeModel({this.id, @JsonKey(name: 'display_name') this.displayName}); - factory _StockPickingTypeModel.fromJson(Map json) => _$StockPickingTypeModelFromJson(json); - -@override final int? id; -@override@JsonKey(name: 'display_name') final String? displayName; - -/// Create a copy of StockPickingTypeModel -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$StockPickingTypeModelCopyWith<_StockPickingTypeModel> get copyWith => __$StockPickingTypeModelCopyWithImpl<_StockPickingTypeModel>(this, _$identity); - -@override -Map toJson() { - return _$StockPickingTypeModelToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingTypeModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id,displayName); - -@override -String toString() { - return 'StockPickingTypeModel(id: $id, displayName: $displayName)'; -} - - -} - -/// @nodoc -abstract mixin class _$StockPickingTypeModelCopyWith<$Res> implements $StockPickingTypeModelCopyWith<$Res> { - factory _$StockPickingTypeModelCopyWith(_StockPickingTypeModel value, $Res Function(_StockPickingTypeModel) _then) = __$StockPickingTypeModelCopyWithImpl; -@override @useResult -$Res call({ - int? id,@JsonKey(name: 'display_name') String? displayName -}); - - - - -} -/// @nodoc -class __$StockPickingTypeModelCopyWithImpl<$Res> - implements _$StockPickingTypeModelCopyWith<$Res> { - __$StockPickingTypeModelCopyWithImpl(this._self, this._then); - - final _StockPickingTypeModel _self; - final $Res Function(_StockPickingTypeModel) _then; - -/// Create a copy of StockPickingTypeModel -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? displayName = freezed,}) { - return _then(_StockPickingTypeModel( -id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable -as String?, - )); -} - - } // dart format on diff --git a/lib/backend/schema/stock_picking/stock_picking_model.g.dart b/lib/backend/schema/stock_picking/stock_picking_model.g.dart index 23feca1..4767427 100644 --- a/lib/backend/schema/stock_picking/stock_picking_model.g.dart +++ b/lib/backend/schema/stock_picking/stock_picking_model.g.dart @@ -38,47 +38,3 @@ _StockPickingResultModel _$StockPickingResultModelFromJson( Map _$StockPickingResultModelToJson( _StockPickingResultModel instance, ) => {'length': instance.length, 'records': instance.records}; - -_StockPickingCompanyModel _$StockPickingCompanyModelFromJson( - Map json, -) => _StockPickingCompanyModel(id: (json['id'] as num?)?.toInt()); - -Map _$StockPickingCompanyModelToJson( - _StockPickingCompanyModel instance, -) => {'id': instance.id}; - -_StockPickingPartnerModel _$StockPickingPartnerModelFromJson( - Map json, -) => _StockPickingPartnerModel( - id: (json['id'] as num?)?.toInt(), - displayName: json['display_name'] as String?, -); - -Map _$StockPickingPartnerModelToJson( - _StockPickingPartnerModel instance, -) => {'id': instance.id, 'display_name': instance.displayName}; - -_StockPickingLocationModel _$StockPickingLocationModelFromJson( - Map json, -) => _StockPickingLocationModel( - id: (json['id'] as num?)?.toInt(), - completeName: json['complete_name'] as String?, -); - -Map _$StockPickingLocationModelToJson( - _StockPickingLocationModel instance, -) => { - 'id': instance.id, - 'complete_name': instance.completeName, -}; - -_StockPickingTypeModel _$StockPickingTypeModelFromJson( - Map json, -) => _StockPickingTypeModel( - id: (json['id'] as num?)?.toInt(), - displayName: json['display_name'] as String?, -); - -Map _$StockPickingTypeModelToJson( - _StockPickingTypeModel instance, -) => {'id': instance.id, 'display_name': instance.displayName}; diff --git a/lib/backend/schema/stock_picking/stock_picking_record_model.dart b/lib/backend/schema/stock_picking/stock_picking_record_model.dart index d1f9343..14a1bb5 100644 --- a/lib/backend/schema/stock_picking/stock_picking_record_model.dart +++ b/lib/backend/schema/stock_picking/stock_picking_record_model.dart @@ -1,5 +1,4 @@ import 'package:e_scan/backend/schema/product/product_model.dart'; -import 'package:e_scan/backend/schema/stock_picking/stock_picking_model.dart'; import 'package:e_scan/utils/utils.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; @@ -68,6 +67,48 @@ List? _moveLineIdsWithoutPackageFromJson( List? _moveIdsWithoutPackageFromJson(dynamic json) => listFromJson(json, MoveWithoutPackageModel.fromJson); +@freezed +abstract class StockPickingCompanyModel with _$StockPickingCompanyModel { + const factory StockPickingCompanyModel({@JsonKey(name: 'id') int? id}) = + _StockPickingCompanyModel; + + factory StockPickingCompanyModel.fromJson(Map json) => + _$StockPickingCompanyModelFromJson(json); +} + +@freezed +abstract class StockPickingPartnerModel with _$StockPickingPartnerModel { + const factory StockPickingPartnerModel({ + int? id, + @JsonKey(name: 'display_name') String? displayName, + }) = _StockPickingPartnerModel; + + factory StockPickingPartnerModel.fromJson(Map json) => + _$StockPickingPartnerModelFromJson(json); +} + +@freezed +abstract class StockPickingLocationModel with _$StockPickingLocationModel { + const factory StockPickingLocationModel({ + int? id, + @JsonKey(name: 'complete_name') String? completeName, + }) = _StockPickingLocationModel; + + factory StockPickingLocationModel.fromJson(Map json) => + _$StockPickingLocationModelFromJson(json); +} + +@freezed +abstract class StockPickingTypeModel with _$StockPickingTypeModel { + const factory StockPickingTypeModel({ + int? id, + @JsonKey(name: 'display_name') String? displayName, + }) = _StockPickingTypeModel; + + factory StockPickingTypeModel.fromJson(Map json) => + _$StockPickingTypeModelFromJson(json); +} + @freezed abstract class MoveLineWithoutPackageModel with _$MoveLineWithoutPackageModel { const factory MoveLineWithoutPackageModel({ diff --git a/lib/backend/schema/stock_picking/stock_picking_record_model.freezed.dart b/lib/backend/schema/stock_picking/stock_picking_record_model.freezed.dart index c6786d6..2e8c437 100644 --- a/lib/backend/schema/stock_picking/stock_picking_record_model.freezed.dart +++ b/lib/backend/schema/stock_picking/stock_picking_record_model.freezed.dart @@ -347,6 +347,547 @@ $StockPickingTypeModelCopyWith<$Res>? get pickingTypeId { } +/// @nodoc +mixin _$StockPickingCompanyModel { + +@JsonKey(name: 'id') int? get id; +/// Create a copy of StockPickingCompanyModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StockPickingCompanyModelCopyWith get copyWith => _$StockPickingCompanyModelCopyWithImpl(this as StockPickingCompanyModel, _$identity); + + /// Serializes this StockPickingCompanyModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingCompanyModel&&(identical(other.id, id) || other.id == id)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id); + +@override +String toString() { + return 'StockPickingCompanyModel(id: $id)'; +} + + +} + +/// @nodoc +abstract mixin class $StockPickingCompanyModelCopyWith<$Res> { + factory $StockPickingCompanyModelCopyWith(StockPickingCompanyModel value, $Res Function(StockPickingCompanyModel) _then) = _$StockPickingCompanyModelCopyWithImpl; +@useResult +$Res call({ +@JsonKey(name: 'id') int? id +}); + + + + +} +/// @nodoc +class _$StockPickingCompanyModelCopyWithImpl<$Res> + implements $StockPickingCompanyModelCopyWith<$Res> { + _$StockPickingCompanyModelCopyWithImpl(this._self, this._then); + + final StockPickingCompanyModel _self; + final $Res Function(StockPickingCompanyModel) _then; + +/// Create a copy of StockPickingCompanyModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// @nodoc +@JsonSerializable() + +class _StockPickingCompanyModel implements StockPickingCompanyModel { + const _StockPickingCompanyModel({@JsonKey(name: 'id') this.id}); + factory _StockPickingCompanyModel.fromJson(Map json) => _$StockPickingCompanyModelFromJson(json); + +@override@JsonKey(name: 'id') final int? id; + +/// Create a copy of StockPickingCompanyModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StockPickingCompanyModelCopyWith<_StockPickingCompanyModel> get copyWith => __$StockPickingCompanyModelCopyWithImpl<_StockPickingCompanyModel>(this, _$identity); + +@override +Map toJson() { + return _$StockPickingCompanyModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingCompanyModel&&(identical(other.id, id) || other.id == id)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id); + +@override +String toString() { + return 'StockPickingCompanyModel(id: $id)'; +} + + +} + +/// @nodoc +abstract mixin class _$StockPickingCompanyModelCopyWith<$Res> implements $StockPickingCompanyModelCopyWith<$Res> { + factory _$StockPickingCompanyModelCopyWith(_StockPickingCompanyModel value, $Res Function(_StockPickingCompanyModel) _then) = __$StockPickingCompanyModelCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(name: 'id') int? id +}); + + + + +} +/// @nodoc +class __$StockPickingCompanyModelCopyWithImpl<$Res> + implements _$StockPickingCompanyModelCopyWith<$Res> { + __$StockPickingCompanyModelCopyWithImpl(this._self, this._then); + + final _StockPickingCompanyModel _self; + final $Res Function(_StockPickingCompanyModel) _then; + +/// Create a copy of StockPickingCompanyModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,}) { + return _then(_StockPickingCompanyModel( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + + +/// @nodoc +mixin _$StockPickingPartnerModel { + + int? get id;@JsonKey(name: 'display_name') String? get displayName; +/// Create a copy of StockPickingPartnerModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StockPickingPartnerModelCopyWith get copyWith => _$StockPickingPartnerModelCopyWithImpl(this as StockPickingPartnerModel, _$identity); + + /// Serializes this StockPickingPartnerModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingPartnerModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,displayName); + +@override +String toString() { + return 'StockPickingPartnerModel(id: $id, displayName: $displayName)'; +} + + +} + +/// @nodoc +abstract mixin class $StockPickingPartnerModelCopyWith<$Res> { + factory $StockPickingPartnerModelCopyWith(StockPickingPartnerModel value, $Res Function(StockPickingPartnerModel) _then) = _$StockPickingPartnerModelCopyWithImpl; +@useResult +$Res call({ + int? id,@JsonKey(name: 'display_name') String? displayName +}); + + + + +} +/// @nodoc +class _$StockPickingPartnerModelCopyWithImpl<$Res> + implements $StockPickingPartnerModelCopyWith<$Res> { + _$StockPickingPartnerModelCopyWithImpl(this._self, this._then); + + final StockPickingPartnerModel _self; + final $Res Function(StockPickingPartnerModel) _then; + +/// Create a copy of StockPickingPartnerModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? displayName = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// @nodoc +@JsonSerializable() + +class _StockPickingPartnerModel implements StockPickingPartnerModel { + const _StockPickingPartnerModel({this.id, @JsonKey(name: 'display_name') this.displayName}); + factory _StockPickingPartnerModel.fromJson(Map json) => _$StockPickingPartnerModelFromJson(json); + +@override final int? id; +@override@JsonKey(name: 'display_name') final String? displayName; + +/// Create a copy of StockPickingPartnerModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StockPickingPartnerModelCopyWith<_StockPickingPartnerModel> get copyWith => __$StockPickingPartnerModelCopyWithImpl<_StockPickingPartnerModel>(this, _$identity); + +@override +Map toJson() { + return _$StockPickingPartnerModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingPartnerModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,displayName); + +@override +String toString() { + return 'StockPickingPartnerModel(id: $id, displayName: $displayName)'; +} + + +} + +/// @nodoc +abstract mixin class _$StockPickingPartnerModelCopyWith<$Res> implements $StockPickingPartnerModelCopyWith<$Res> { + factory _$StockPickingPartnerModelCopyWith(_StockPickingPartnerModel value, $Res Function(_StockPickingPartnerModel) _then) = __$StockPickingPartnerModelCopyWithImpl; +@override @useResult +$Res call({ + int? id,@JsonKey(name: 'display_name') String? displayName +}); + + + + +} +/// @nodoc +class __$StockPickingPartnerModelCopyWithImpl<$Res> + implements _$StockPickingPartnerModelCopyWith<$Res> { + __$StockPickingPartnerModelCopyWithImpl(this._self, this._then); + + final _StockPickingPartnerModel _self; + final $Res Function(_StockPickingPartnerModel) _then; + +/// Create a copy of StockPickingPartnerModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? displayName = freezed,}) { + return _then(_StockPickingPartnerModel( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$StockPickingLocationModel { + + int? get id;@JsonKey(name: 'complete_name') String? get completeName; +/// Create a copy of StockPickingLocationModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StockPickingLocationModelCopyWith get copyWith => _$StockPickingLocationModelCopyWithImpl(this as StockPickingLocationModel, _$identity); + + /// Serializes this StockPickingLocationModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingLocationModel&&(identical(other.id, id) || other.id == id)&&(identical(other.completeName, completeName) || other.completeName == completeName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,completeName); + +@override +String toString() { + return 'StockPickingLocationModel(id: $id, completeName: $completeName)'; +} + + +} + +/// @nodoc +abstract mixin class $StockPickingLocationModelCopyWith<$Res> { + factory $StockPickingLocationModelCopyWith(StockPickingLocationModel value, $Res Function(StockPickingLocationModel) _then) = _$StockPickingLocationModelCopyWithImpl; +@useResult +$Res call({ + int? id,@JsonKey(name: 'complete_name') String? completeName +}); + + + + +} +/// @nodoc +class _$StockPickingLocationModelCopyWithImpl<$Res> + implements $StockPickingLocationModelCopyWith<$Res> { + _$StockPickingLocationModelCopyWithImpl(this._self, this._then); + + final StockPickingLocationModel _self; + final $Res Function(StockPickingLocationModel) _then; + +/// Create a copy of StockPickingLocationModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? completeName = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,completeName: freezed == completeName ? _self.completeName : completeName // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// @nodoc +@JsonSerializable() + +class _StockPickingLocationModel implements StockPickingLocationModel { + const _StockPickingLocationModel({this.id, @JsonKey(name: 'complete_name') this.completeName}); + factory _StockPickingLocationModel.fromJson(Map json) => _$StockPickingLocationModelFromJson(json); + +@override final int? id; +@override@JsonKey(name: 'complete_name') final String? completeName; + +/// Create a copy of StockPickingLocationModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StockPickingLocationModelCopyWith<_StockPickingLocationModel> get copyWith => __$StockPickingLocationModelCopyWithImpl<_StockPickingLocationModel>(this, _$identity); + +@override +Map toJson() { + return _$StockPickingLocationModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingLocationModel&&(identical(other.id, id) || other.id == id)&&(identical(other.completeName, completeName) || other.completeName == completeName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,completeName); + +@override +String toString() { + return 'StockPickingLocationModel(id: $id, completeName: $completeName)'; +} + + +} + +/// @nodoc +abstract mixin class _$StockPickingLocationModelCopyWith<$Res> implements $StockPickingLocationModelCopyWith<$Res> { + factory _$StockPickingLocationModelCopyWith(_StockPickingLocationModel value, $Res Function(_StockPickingLocationModel) _then) = __$StockPickingLocationModelCopyWithImpl; +@override @useResult +$Res call({ + int? id,@JsonKey(name: 'complete_name') String? completeName +}); + + + + +} +/// @nodoc +class __$StockPickingLocationModelCopyWithImpl<$Res> + implements _$StockPickingLocationModelCopyWith<$Res> { + __$StockPickingLocationModelCopyWithImpl(this._self, this._then); + + final _StockPickingLocationModel _self; + final $Res Function(_StockPickingLocationModel) _then; + +/// Create a copy of StockPickingLocationModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? completeName = freezed,}) { + return _then(_StockPickingLocationModel( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,completeName: freezed == completeName ? _self.completeName : completeName // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$StockPickingTypeModel { + + int? get id;@JsonKey(name: 'display_name') String? get displayName; +/// Create a copy of StockPickingTypeModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StockPickingTypeModelCopyWith get copyWith => _$StockPickingTypeModelCopyWithImpl(this as StockPickingTypeModel, _$identity); + + /// Serializes this StockPickingTypeModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingTypeModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,displayName); + +@override +String toString() { + return 'StockPickingTypeModel(id: $id, displayName: $displayName)'; +} + + +} + +/// @nodoc +abstract mixin class $StockPickingTypeModelCopyWith<$Res> { + factory $StockPickingTypeModelCopyWith(StockPickingTypeModel value, $Res Function(StockPickingTypeModel) _then) = _$StockPickingTypeModelCopyWithImpl; +@useResult +$Res call({ + int? id,@JsonKey(name: 'display_name') String? displayName +}); + + + + +} +/// @nodoc +class _$StockPickingTypeModelCopyWithImpl<$Res> + implements $StockPickingTypeModelCopyWith<$Res> { + _$StockPickingTypeModelCopyWithImpl(this._self, this._then); + + final StockPickingTypeModel _self; + final $Res Function(StockPickingTypeModel) _then; + +/// Create a copy of StockPickingTypeModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? displayName = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// @nodoc +@JsonSerializable() + +class _StockPickingTypeModel implements StockPickingTypeModel { + const _StockPickingTypeModel({this.id, @JsonKey(name: 'display_name') this.displayName}); + factory _StockPickingTypeModel.fromJson(Map json) => _$StockPickingTypeModelFromJson(json); + +@override final int? id; +@override@JsonKey(name: 'display_name') final String? displayName; + +/// Create a copy of StockPickingTypeModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StockPickingTypeModelCopyWith<_StockPickingTypeModel> get copyWith => __$StockPickingTypeModelCopyWithImpl<_StockPickingTypeModel>(this, _$identity); + +@override +Map toJson() { + return _$StockPickingTypeModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingTypeModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,displayName); + +@override +String toString() { + return 'StockPickingTypeModel(id: $id, displayName: $displayName)'; +} + + +} + +/// @nodoc +abstract mixin class _$StockPickingTypeModelCopyWith<$Res> implements $StockPickingTypeModelCopyWith<$Res> { + factory _$StockPickingTypeModelCopyWith(_StockPickingTypeModel value, $Res Function(_StockPickingTypeModel) _then) = __$StockPickingTypeModelCopyWithImpl; +@override @useResult +$Res call({ + int? id,@JsonKey(name: 'display_name') String? displayName +}); + + + + +} +/// @nodoc +class __$StockPickingTypeModelCopyWithImpl<$Res> + implements _$StockPickingTypeModelCopyWith<$Res> { + __$StockPickingTypeModelCopyWithImpl(this._self, this._then); + + final _StockPickingTypeModel _self; + final $Res Function(_StockPickingTypeModel) _then; + +/// Create a copy of StockPickingTypeModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? displayName = freezed,}) { + return _then(_StockPickingTypeModel( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + /// @nodoc mixin _$MoveLineWithoutPackageModel { diff --git a/lib/backend/schema/stock_picking/stock_picking_record_model.g.dart b/lib/backend/schema/stock_picking/stock_picking_record_model.g.dart index 700f7a6..4dbe75c 100644 --- a/lib/backend/schema/stock_picking/stock_picking_record_model.g.dart +++ b/lib/backend/schema/stock_picking/stock_picking_record_model.g.dart @@ -72,6 +72,50 @@ Map _$StockPickingRecordModelToJson( 'move_ids_without_package': instance.moveIdsWithoutPackage, }; +_StockPickingCompanyModel _$StockPickingCompanyModelFromJson( + Map json, +) => _StockPickingCompanyModel(id: (json['id'] as num?)?.toInt()); + +Map _$StockPickingCompanyModelToJson( + _StockPickingCompanyModel instance, +) => {'id': instance.id}; + +_StockPickingPartnerModel _$StockPickingPartnerModelFromJson( + Map json, +) => _StockPickingPartnerModel( + id: (json['id'] as num?)?.toInt(), + displayName: json['display_name'] as String?, +); + +Map _$StockPickingPartnerModelToJson( + _StockPickingPartnerModel instance, +) => {'id': instance.id, 'display_name': instance.displayName}; + +_StockPickingLocationModel _$StockPickingLocationModelFromJson( + Map json, +) => _StockPickingLocationModel( + id: (json['id'] as num?)?.toInt(), + completeName: json['complete_name'] as String?, +); + +Map _$StockPickingLocationModelToJson( + _StockPickingLocationModel instance, +) => { + 'id': instance.id, + 'complete_name': instance.completeName, +}; + +_StockPickingTypeModel _$StockPickingTypeModelFromJson( + Map json, +) => _StockPickingTypeModel( + id: (json['id'] as num?)?.toInt(), + displayName: json['display_name'] as String?, +); + +Map _$StockPickingTypeModelToJson( + _StockPickingTypeModel instance, +) => {'id': instance.id, 'display_name': instance.displayName}; + _MoveLineWithoutPackageModel _$MoveLineWithoutPackageModelFromJson( Map json, ) => _MoveLineWithoutPackageModel( diff --git a/lib/pages/operation/reception/reception_details_page.dart b/lib/pages/operation/reception/reception_details_page.dart index c4c0a86..bf04c1b 100644 --- a/lib/pages/operation/reception/reception_details_page.dart +++ b/lib/pages/operation/reception/reception_details_page.dart @@ -137,7 +137,9 @@ class _ReceptionDetailsPageState extends ConsumerState { floatingActionButton: reception?.isDone == false ? FloatingActionButton( backgroundColor: AppTheme.of(context).primary, - onPressed: () {}, + onPressed: () { + ScannerRoute().push(context); + }, child: Icon(Icons.qr_code, color: AppTheme.of(context).white), ) : null,