feat: Streamlines product data and stock picking API

Refactors the product data model to primarily store `id`, `barcode`, and `displayName`. This simplifies the product structure, focusing on essential attributes for inventory and scanning operations.

Optimizes API calls for stock picking to fetch more relevant product details. Unnecessary fields are removed, and specific product attributes like `barcode` and `quantity` are now explicitly requested for stock moves.

Moves `StockPickingRecordModel` to its own dedicated file for improved code organization and maintainability. Updates all affected UI components and scanner logic to align with the revised product model.
This commit is contained in:
mandreshope 2025-07-30 12:47:08 +03:00
parent d09d8ace8c
commit 1d331acc54
20 changed files with 984 additions and 727 deletions

View File

@ -1,5 +1,6 @@
import 'package:e_scan/backend/schema/auth/auth_model.dart';
import 'package:e_scan/backend/schema/stock_picking/stock_picking_model.dart';
import 'package:e_scan/backend/schema/stock_picking/stock_picking_record_model.dart';
import 'package:e_scan/provider_container.dart';
import 'package:e_scan/services/dio_service.dart';
import 'package:e_scan/services/token_provider.dart';
@ -180,7 +181,6 @@ class ApiCalls {
final response = await dioService.post(
path: '/web/dataset/call_kw/stock.picking/web_read',
data: {
"id": id,
"jsonrpc": "2.0",
"method": "call",
"params": {
@ -233,47 +233,21 @@ class ApiCalls {
"date_done": {},
"origin": {},
"picking_properties": {},
"move_line_ids_without_package": {
"fields": {
"product_id": {
"fields": {"display_name": {}, "barcode": {}},
},
"quantity": {}, // quantité
},
},
"move_ids_without_package": {
"fields": {
"company_id": {"fields": {}},
"picking_id": {"fields": {}},
"name": {},
"state": {},
"picking_type_id": {"fields": {}},
"move_line_ids": {},
"location_id": {"fields": {}},
"location_dest_id": {"fields": {}},
"partner_id": {"fields": {}},
"scrapped": {},
"picking_code": {},
"show_details_visible": {},
"additional": {},
"move_lines_count": {},
"is_locked": {},
"product_uom_category_id": {"fields": {}},
"is_storable": {},
"has_tracking": {},
"product_id": {
"fields": {"display_name": {}},
"context": {"default_is_storable": true},
"fields": {"display_name": {}, "barcode": {}},
},
"description_picking": {},
"date": {},
"date_deadline": {},
"is_quantity_done_editable": {},
"show_quant": {},
"show_lots_text": {},
"show_lots_m2o": {},
"is_initial_demand_editable": {},
"display_import_lot": {},
"picking_type_entire_packs": {},
"product_uom_qty": {},
"forecast_expected_date": {},
"forecast_availability": {},
"product_qty": {},
"quantity": {},
"product_uom": {"fields": {}},
"picked": {},
"quantity": {}, // quantité
"product_uom_qty": {}, //quantité demandé
},
"context": {
"form_view_ref": "stock.view_stock_move_operations",
@ -289,7 +263,7 @@ class ApiCalls {
"package_id": {
"fields": {"display_name": {}},
},
"state": {},
"state": {}, //done, ready, waiting,
"is_done": {},
},
"limit": 40,

View File

@ -4,48 +4,24 @@ import 'package:objectbox/objectbox.dart';
/// Modèle de base de données ObjectBox
@Entity()
class ProductEntity {
ProductEntity({
this.id = 0,
this.code,
this.name,
this.description,
this.price,
this.quantity,
this.image,
});
ProductEntity({this.id = 0, this.barcode, this.displayName});
@Id(assignable: true)
int id;
String? code;
String? name;
String? description;
String? price;
String? quantity;
String? image;
String? barcode;
String? displayName;
/// Convertir vers ProductModel
ProductModel toStruct() {
return ProductModel(
id: id,
code: code,
name: name,
description: description,
price: price,
quantity: quantity,
image: image,
);
return ProductModel(id: id, barcode: barcode, displayName: displayName);
}
/// Créer une instance de ProductEntity à partir de ProductStruct
static ProductEntity fromStruct(ProductModel struct) {
return ProductEntity(
id: struct.id,
code: struct.code,
name: struct.name,
description: struct.description,
price: struct.price,
quantity: struct.quantity,
image: struct.image,
id: struct.id ?? 0,
barcode: struct.barcode,
displayName: struct.displayName,
);
}
}

View File

@ -5,7 +5,7 @@
"entities": [
{
"id": "1:6757833172062715556",
"lastPropertyId": "7:1825580906382154543",
"lastPropertyId": "9:7701820943545445010",
"name": "ProductEntity",
"properties": [
{
@ -15,33 +15,13 @@
"flags": 129
},
{
"id": "2:4521897043130066476",
"name": "code",
"id": "8:6901756236330116550",
"name": "barcode",
"type": 9
},
{
"id": "3:2561289170534233438",
"name": "name",
"type": 9
},
{
"id": "4:6084891210993334692",
"name": "description",
"type": 9
},
{
"id": "5:883454706727408240",
"name": "price",
"type": 9
},
{
"id": "6:7033704955625644592",
"name": "quantity",
"type": 9
},
{
"id": "7:1825580906382154543",
"name": "image",
"id": "9:7701820943545445010",
"name": "displayName",
"type": 9
}
],
@ -56,7 +36,14 @@
"modelVersionParserMinimum": 5,
"retiredEntityUids": [],
"retiredIndexUids": [],
"retiredPropertyUids": [],
"retiredPropertyUids": [
4521897043130066476,
2561289170534233438,
6084891210993334692,
883454706727408240,
7033704955625644592,
1825580906382154543
],
"retiredRelationUids": [],
"version": 1
}

View File

@ -22,7 +22,7 @@ final _entities = <obx_int.ModelEntity>[
obx_int.ModelEntity(
id: const obx_int.IdUid(1, 6757833172062715556),
name: 'ProductEntity',
lastPropertyId: const obx_int.IdUid(7, 1825580906382154543),
lastPropertyId: const obx_int.IdUid(9, 7701820943545445010),
flags: 0,
properties: <obx_int.ModelProperty>[
obx_int.ModelProperty(
@ -32,38 +32,14 @@ final _entities = <obx_int.ModelEntity>[
flags: 129,
),
obx_int.ModelProperty(
id: const obx_int.IdUid(2, 4521897043130066476),
name: 'code',
id: const obx_int.IdUid(8, 6901756236330116550),
name: 'barcode',
type: 9,
flags: 0,
),
obx_int.ModelProperty(
id: const obx_int.IdUid(3, 2561289170534233438),
name: 'name',
type: 9,
flags: 0,
),
obx_int.ModelProperty(
id: const obx_int.IdUid(4, 6084891210993334692),
name: 'description',
type: 9,
flags: 0,
),
obx_int.ModelProperty(
id: const obx_int.IdUid(5, 883454706727408240),
name: 'price',
type: 9,
flags: 0,
),
obx_int.ModelProperty(
id: const obx_int.IdUid(6, 7033704955625644592),
name: 'quantity',
type: 9,
flags: 0,
),
obx_int.ModelProperty(
id: const obx_int.IdUid(7, 1825580906382154543),
name: 'image',
id: const obx_int.IdUid(9, 7701820943545445010),
name: 'displayName',
type: 9,
flags: 0,
),
@ -117,7 +93,14 @@ obx_int.ModelDefinition getObjectBoxModel() {
lastSequenceId: const obx_int.IdUid(0, 0),
retiredEntityUids: const [],
retiredIndexUids: const [],
retiredPropertyUids: const [],
retiredPropertyUids: const [
4521897043130066476,
2561289170534233438,
6084891210993334692,
883454706727408240,
7033704955625644592,
1825580906382154543,
],
retiredRelationUids: const [],
modelVersion: 5,
modelVersionParserMinimum: 5,
@ -134,32 +117,16 @@ obx_int.ModelDefinition getObjectBoxModel() {
object.id = id;
},
objectToFB: (ProductEntity object, fb.Builder fbb) {
final codeOffset = object.code == null
final barcodeOffset = object.barcode == null
? null
: fbb.writeString(object.code!);
final nameOffset = object.name == null
: fbb.writeString(object.barcode!);
final displayNameOffset = object.displayName == null
? null
: fbb.writeString(object.name!);
final descriptionOffset = object.description == null
? null
: fbb.writeString(object.description!);
final priceOffset = object.price == null
? null
: fbb.writeString(object.price!);
final quantityOffset = object.quantity == null
? null
: fbb.writeString(object.quantity!);
final imageOffset = object.image == null
? null
: fbb.writeString(object.image!);
fbb.startTable(8);
: fbb.writeString(object.displayName!);
fbb.startTable(10);
fbb.addInt64(0, object.id);
fbb.addOffset(1, codeOffset);
fbb.addOffset(2, nameOffset);
fbb.addOffset(3, descriptionOffset);
fbb.addOffset(4, priceOffset);
fbb.addOffset(5, quantityOffset);
fbb.addOffset(6, imageOffset);
fbb.addOffset(7, barcodeOffset);
fbb.addOffset(8, displayNameOffset);
fbb.finish(fbb.endTable());
return object.id;
},
@ -172,32 +139,16 @@ obx_int.ModelDefinition getObjectBoxModel() {
4,
0,
);
final codeParam = const fb.StringReader(
final barcodeParam = const fb.StringReader(
asciiOptimization: true,
).vTableGetNullable(buffer, rootOffset, 6);
final nameParam = const fb.StringReader(
).vTableGetNullable(buffer, rootOffset, 18);
final displayNameParam = const fb.StringReader(
asciiOptimization: true,
).vTableGetNullable(buffer, rootOffset, 8);
final descriptionParam = const fb.StringReader(
asciiOptimization: true,
).vTableGetNullable(buffer, rootOffset, 10);
final priceParam = const fb.StringReader(
asciiOptimization: true,
).vTableGetNullable(buffer, rootOffset, 12);
final quantityParam = const fb.StringReader(
asciiOptimization: true,
).vTableGetNullable(buffer, rootOffset, 14);
final imageParam = const fb.StringReader(
asciiOptimization: true,
).vTableGetNullable(buffer, rootOffset, 16);
).vTableGetNullable(buffer, rootOffset, 20);
final object = ProductEntity(
id: idParam,
code: codeParam,
name: nameParam,
description: descriptionParam,
price: priceParam,
quantity: quantityParam,
image: imageParam,
barcode: barcodeParam,
displayName: displayNameParam,
);
return object;
@ -215,33 +166,13 @@ class ProductEntity_ {
_entities[0].properties[0],
);
/// See [ProductEntity.code].
static final code = obx.QueryStringProperty<ProductEntity>(
/// See [ProductEntity.barcode].
static final barcode = obx.QueryStringProperty<ProductEntity>(
_entities[0].properties[1],
);
/// See [ProductEntity.name].
static final name = obx.QueryStringProperty<ProductEntity>(
/// See [ProductEntity.displayName].
static final displayName = obx.QueryStringProperty<ProductEntity>(
_entities[0].properties[2],
);
/// See [ProductEntity.description].
static final description = obx.QueryStringProperty<ProductEntity>(
_entities[0].properties[3],
);
/// See [ProductEntity.price].
static final price = obx.QueryStringProperty<ProductEntity>(
_entities[0].properties[4],
);
/// See [ProductEntity.quantity].
static final quantity = obx.QueryStringProperty<ProductEntity>(
_entities[0].properties[5],
);
/// See [ProductEntity.image].
static final image = obx.QueryStringProperty<ProductEntity>(
_entities[0].properties[6],
);
}

View File

@ -6,27 +6,14 @@ part 'product_model.g.dart';
@Freezed(toJson: true)
abstract class ProductModel with _$ProductModel {
factory ProductModel({
@Default(0) int id,
String? code,
String? name,
String? description,
String? price,
String? quantity,
String? image,
}) = _ProductModel;
factory ProductModel({int? id, String? barcode, String? displayName}) =
_ProductModel;
factory ProductModel.fromJson(Map<String, dynamic> json) =>
_$ProductModelFromJson(json);
}
extension ProductModelExt on ProductModel {
ProductEntity get toEntity => ProductEntity(
id: id,
name: name,
description: description,
price: price,
quantity: quantity,
image: image,
);
ProductEntity get toEntity =>
ProductEntity(id: id ?? 0, displayName: displayName, barcode: barcode);
}

View File

@ -16,7 +16,7 @@ T _$identity<T>(T value) => value;
/// @nodoc
mixin _$ProductModel {
int get id; String? get code; String? get name; String? get description; String? get price; String? get quantity; String? get image;
int? get id; String? get barcode; String? get displayName;
/// Create a copy of ProductModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@ -29,16 +29,16 @@ $ProductModelCopyWith<ProductModel> get copyWith => _$ProductModelCopyWithImpl<P
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ProductModel&&(identical(other.id, id) || other.id == id)&&(identical(other.code, code) || other.code == code)&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.price, price) || other.price == price)&&(identical(other.quantity, quantity) || other.quantity == quantity)&&(identical(other.image, image) || other.image == image));
return identical(this, other) || (other.runtimeType == runtimeType&&other is ProductModel&&(identical(other.id, id) || other.id == id)&&(identical(other.barcode, barcode) || other.barcode == barcode)&&(identical(other.displayName, displayName) || other.displayName == displayName));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,code,name,description,price,quantity,image);
int get hashCode => Object.hash(runtimeType,id,barcode,displayName);
@override
String toString() {
return 'ProductModel(id: $id, code: $code, name: $name, description: $description, price: $price, quantity: $quantity, image: $image)';
return 'ProductModel(id: $id, barcode: $barcode, displayName: $displayName)';
}
@ -49,7 +49,7 @@ abstract mixin class $ProductModelCopyWith<$Res> {
factory $ProductModelCopyWith(ProductModel value, $Res Function(ProductModel) _then) = _$ProductModelCopyWithImpl;
@useResult
$Res call({
int id, String? code, String? name, String? description, String? price, String? quantity, String? image
int? id, String? barcode, String? displayName
});
@ -66,15 +66,11 @@ class _$ProductModelCopyWithImpl<$Res>
/// Create a copy of ProductModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? code = freezed,Object? name = freezed,Object? description = freezed,Object? price = freezed,Object? quantity = freezed,Object? image = freezed,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? barcode = freezed,Object? displayName = freezed,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int,code: freezed == code ? _self.code : code // ignore: cast_nullable_to_non_nullable
as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String?,price: freezed == price ? _self.price : price // ignore: cast_nullable_to_non_nullable
as String?,quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,barcode: freezed == barcode ? _self.barcode : barcode // ignore: cast_nullable_to_non_nullable
as String?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
@ -86,16 +82,12 @@ as String?,
@JsonSerializable()
class _ProductModel implements ProductModel {
_ProductModel({this.id = 0, this.code, this.name, this.description, this.price, this.quantity, this.image});
_ProductModel({this.id, this.barcode, this.displayName});
factory _ProductModel.fromJson(Map<String, dynamic> json) => _$ProductModelFromJson(json);
@override@JsonKey() final int id;
@override final String? code;
@override final String? name;
@override final String? description;
@override final String? price;
@override final String? quantity;
@override final String? image;
@override final int? id;
@override final String? barcode;
@override final String? displayName;
/// Create a copy of ProductModel
/// with the given fields replaced by the non-null parameter values.
@ -110,16 +102,16 @@ Map<String, dynamic> toJson() {
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ProductModel&&(identical(other.id, id) || other.id == id)&&(identical(other.code, code) || other.code == code)&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.price, price) || other.price == price)&&(identical(other.quantity, quantity) || other.quantity == quantity)&&(identical(other.image, image) || other.image == image));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ProductModel&&(identical(other.id, id) || other.id == id)&&(identical(other.barcode, barcode) || other.barcode == barcode)&&(identical(other.displayName, displayName) || other.displayName == displayName));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,code,name,description,price,quantity,image);
int get hashCode => Object.hash(runtimeType,id,barcode,displayName);
@override
String toString() {
return 'ProductModel(id: $id, code: $code, name: $name, description: $description, price: $price, quantity: $quantity, image: $image)';
return 'ProductModel(id: $id, barcode: $barcode, displayName: $displayName)';
}
@ -130,7 +122,7 @@ abstract mixin class _$ProductModelCopyWith<$Res> implements $ProductModelCopyWi
factory _$ProductModelCopyWith(_ProductModel value, $Res Function(_ProductModel) _then) = __$ProductModelCopyWithImpl;
@override @useResult
$Res call({
int id, String? code, String? name, String? description, String? price, String? quantity, String? image
int? id, String? barcode, String? displayName
});
@ -147,15 +139,11 @@ class __$ProductModelCopyWithImpl<$Res>
/// Create a copy of ProductModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? code = freezed,Object? name = freezed,Object? description = freezed,Object? price = freezed,Object? quantity = freezed,Object? image = freezed,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? barcode = freezed,Object? displayName = freezed,}) {
return _then(_ProductModel(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int,code: freezed == code ? _self.code : code // ignore: cast_nullable_to_non_nullable
as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String?,price: freezed == price ? _self.price : price // ignore: cast_nullable_to_non_nullable
as String?,quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,barcode: freezed == barcode ? _self.barcode : barcode // ignore: cast_nullable_to_non_nullable
as String?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable
as String?,
));
}

View File

@ -8,22 +8,14 @@ part of 'product_model.dart';
_ProductModel _$ProductModelFromJson(Map<String, dynamic> json) =>
_ProductModel(
id: (json['id'] as num?)?.toInt() ?? 0,
code: json['code'] as String?,
name: json['name'] as String?,
description: json['description'] as String?,
price: json['price'] as String?,
quantity: json['quantity'] as String?,
image: json['image'] as String?,
id: (json['id'] as num?)?.toInt(),
barcode: json['barcode'] as String?,
displayName: json['displayName'] as String?,
);
Map<String, dynamic> _$ProductModelToJson(_ProductModel instance) =>
<String, dynamic>{
'id': instance.id,
'code': instance.code,
'name': instance.name,
'description': instance.description,
'price': instance.price,
'quantity': instance.quantity,
'image': instance.image,
'barcode': instance.barcode,
'displayName': instance.displayName,
};

View File

@ -1,3 +1,4 @@
import 'package:e_scan/backend/schema/stock_picking/stock_picking_record_model.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'stock_picking_model.freezed.dart';
@ -26,39 +27,6 @@ abstract class StockPickingResultModel with _$StockPickingResultModel {
_$StockPickingResultModelFromJson(json);
}
@freezed
abstract class StockPickingRecordModel with _$StockPickingRecordModel {
const factory StockPickingRecordModel({
int? id,
@JsonKey(name: 'company_id') StockPickingCompanyModel? companyId,
@JsonKey(name: 'priority') String? priority,
@JsonKey(name: 'name') String? name,
@JsonKey(name: 'partner_id') StockPickingPartnerModel? partnerId,
@JsonKey(name: 'location_dest_id')
StockPickingLocationModel? locationDestId,
@JsonKey(name: 'location_id') StockPickingLocationModel? locationId,
@JsonKey(name: 'user_id') dynamic userId,
@JsonKey(name: 'scheduled_date') String? scheduledDate,
@JsonKey(name: 'picking_type_code') String? pickingTypeCode,
@JsonKey(name: 'products_availability_state')
dynamic productsAvailabilityState,
@JsonKey(name: 'products_availability') dynamic productsAvailability,
@JsonKey(name: 'date_deadline') String? dateDeadline,
@JsonKey(name: 'date_done') dynamic dateDone,
@JsonKey(name: 'origin') String? origin,
@JsonKey(name: 'backorder_id') dynamic backorderId,
@JsonKey(name: 'picking_type_id') StockPickingTypeModel? pickingTypeId,
@JsonKey(name: 'state') String? state,
@JsonKey(name: 'activity_exception_decoration')
dynamic activityExceptionDecoration,
@JsonKey(name: 'activity_exception_icon') dynamic activityExceptionIcon,
@JsonKey(name: 'json_popover') dynamic jsonPopover,
}) = _StockPickingRecordModel;
factory StockPickingRecordModel.fromJson(Map<String, dynamic> json) =>
_$StockPickingRecordModelFromJson(json);
}
@freezed
abstract class StockPickingCompanyModel with _$StockPickingCompanyModel {
const factory StockPickingCompanyModel({@JsonKey(name: 'id') int? id}) =
@ -101,6 +69,3 @@ abstract class StockPickingTypeModel with _$StockPickingTypeModel {
_$StockPickingTypeModelFromJson(json);
}
extension StockPickingRecordModelExt on StockPickingRecordModel {
bool get isDone => state == "done";
}

View File

@ -320,319 +320,6 @@ as List<StockPickingRecordModel>?,
}
/// @nodoc
mixin _$StockPickingRecordModel {
int? get id;@JsonKey(name: 'company_id') StockPickingCompanyModel? get companyId;@JsonKey(name: 'priority') String? get priority;@JsonKey(name: 'name') String? get name;@JsonKey(name: 'partner_id') StockPickingPartnerModel? get partnerId;@JsonKey(name: 'location_dest_id') StockPickingLocationModel? get locationDestId;@JsonKey(name: 'location_id') StockPickingLocationModel? get locationId;@JsonKey(name: 'user_id') dynamic get userId;@JsonKey(name: 'scheduled_date') String? get scheduledDate;@JsonKey(name: 'picking_type_code') String? get pickingTypeCode;@JsonKey(name: 'products_availability_state') dynamic get productsAvailabilityState;@JsonKey(name: 'products_availability') dynamic get productsAvailability;@JsonKey(name: 'date_deadline') String? get dateDeadline;@JsonKey(name: 'date_done') dynamic get dateDone;@JsonKey(name: 'origin') String? get origin;@JsonKey(name: 'backorder_id') dynamic get backorderId;@JsonKey(name: 'picking_type_id') StockPickingTypeModel? get pickingTypeId;@JsonKey(name: 'state') String? get state;@JsonKey(name: 'activity_exception_decoration') dynamic get activityExceptionDecoration;@JsonKey(name: 'activity_exception_icon') dynamic get activityExceptionIcon;@JsonKey(name: 'json_popover') dynamic get jsonPopover;
/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$StockPickingRecordModelCopyWith<StockPickingRecordModel> get copyWith => _$StockPickingRecordModelCopyWithImpl<StockPickingRecordModel>(this as StockPickingRecordModel, _$identity);
/// Serializes this StockPickingRecordModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingRecordModel&&(identical(other.id, id) || other.id == id)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.priority, priority) || other.priority == priority)&&(identical(other.name, name) || other.name == name)&&(identical(other.partnerId, partnerId) || other.partnerId == partnerId)&&(identical(other.locationDestId, locationDestId) || other.locationDestId == locationDestId)&&(identical(other.locationId, locationId) || other.locationId == locationId)&&const DeepCollectionEquality().equals(other.userId, userId)&&(identical(other.scheduledDate, scheduledDate) || other.scheduledDate == scheduledDate)&&(identical(other.pickingTypeCode, pickingTypeCode) || other.pickingTypeCode == pickingTypeCode)&&const DeepCollectionEquality().equals(other.productsAvailabilityState, productsAvailabilityState)&&const DeepCollectionEquality().equals(other.productsAvailability, productsAvailability)&&(identical(other.dateDeadline, dateDeadline) || other.dateDeadline == dateDeadline)&&const DeepCollectionEquality().equals(other.dateDone, dateDone)&&(identical(other.origin, origin) || other.origin == origin)&&const DeepCollectionEquality().equals(other.backorderId, backorderId)&&(identical(other.pickingTypeId, pickingTypeId) || other.pickingTypeId == pickingTypeId)&&(identical(other.state, state) || other.state == state)&&const DeepCollectionEquality().equals(other.activityExceptionDecoration, activityExceptionDecoration)&&const DeepCollectionEquality().equals(other.activityExceptionIcon, activityExceptionIcon)&&const DeepCollectionEquality().equals(other.jsonPopover, jsonPopover));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([runtimeType,id,companyId,priority,name,partnerId,locationDestId,locationId,const DeepCollectionEquality().hash(userId),scheduledDate,pickingTypeCode,const DeepCollectionEquality().hash(productsAvailabilityState),const DeepCollectionEquality().hash(productsAvailability),dateDeadline,const DeepCollectionEquality().hash(dateDone),origin,const DeepCollectionEquality().hash(backorderId),pickingTypeId,state,const DeepCollectionEquality().hash(activityExceptionDecoration),const DeepCollectionEquality().hash(activityExceptionIcon),const DeepCollectionEquality().hash(jsonPopover)]);
@override
String toString() {
return 'StockPickingRecordModel(id: $id, companyId: $companyId, priority: $priority, name: $name, partnerId: $partnerId, locationDestId: $locationDestId, locationId: $locationId, userId: $userId, scheduledDate: $scheduledDate, pickingTypeCode: $pickingTypeCode, productsAvailabilityState: $productsAvailabilityState, productsAvailability: $productsAvailability, dateDeadline: $dateDeadline, dateDone: $dateDone, origin: $origin, backorderId: $backorderId, pickingTypeId: $pickingTypeId, state: $state, activityExceptionDecoration: $activityExceptionDecoration, activityExceptionIcon: $activityExceptionIcon, jsonPopover: $jsonPopover)';
}
}
/// @nodoc
abstract mixin class $StockPickingRecordModelCopyWith<$Res> {
factory $StockPickingRecordModelCopyWith(StockPickingRecordModel value, $Res Function(StockPickingRecordModel) _then) = _$StockPickingRecordModelCopyWithImpl;
@useResult
$Res call({
int? id,@JsonKey(name: 'company_id') StockPickingCompanyModel? companyId,@JsonKey(name: 'priority') String? priority,@JsonKey(name: 'name') String? name,@JsonKey(name: 'partner_id') StockPickingPartnerModel? partnerId,@JsonKey(name: 'location_dest_id') StockPickingLocationModel? locationDestId,@JsonKey(name: 'location_id') StockPickingLocationModel? locationId,@JsonKey(name: 'user_id') dynamic userId,@JsonKey(name: 'scheduled_date') String? scheduledDate,@JsonKey(name: 'picking_type_code') String? pickingTypeCode,@JsonKey(name: 'products_availability_state') dynamic productsAvailabilityState,@JsonKey(name: 'products_availability') dynamic productsAvailability,@JsonKey(name: 'date_deadline') String? dateDeadline,@JsonKey(name: 'date_done') dynamic dateDone,@JsonKey(name: 'origin') String? origin,@JsonKey(name: 'backorder_id') dynamic backorderId,@JsonKey(name: 'picking_type_id') StockPickingTypeModel? pickingTypeId,@JsonKey(name: 'state') String? state,@JsonKey(name: 'activity_exception_decoration') dynamic activityExceptionDecoration,@JsonKey(name: 'activity_exception_icon') dynamic activityExceptionIcon,@JsonKey(name: 'json_popover') dynamic jsonPopover
});
$StockPickingCompanyModelCopyWith<$Res>? get companyId;$StockPickingPartnerModelCopyWith<$Res>? get partnerId;$StockPickingLocationModelCopyWith<$Res>? get locationDestId;$StockPickingLocationModelCopyWith<$Res>? get locationId;$StockPickingTypeModelCopyWith<$Res>? get pickingTypeId;
}
/// @nodoc
class _$StockPickingRecordModelCopyWithImpl<$Res>
implements $StockPickingRecordModelCopyWith<$Res> {
_$StockPickingRecordModelCopyWithImpl(this._self, this._then);
final StockPickingRecordModel _self;
final $Res Function(StockPickingRecordModel) _then;
/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? companyId = freezed,Object? priority = freezed,Object? name = freezed,Object? partnerId = freezed,Object? locationDestId = freezed,Object? locationId = freezed,Object? userId = freezed,Object? scheduledDate = freezed,Object? pickingTypeCode = freezed,Object? productsAvailabilityState = freezed,Object? productsAvailability = freezed,Object? dateDeadline = freezed,Object? dateDone = freezed,Object? origin = freezed,Object? backorderId = freezed,Object? pickingTypeId = freezed,Object? state = freezed,Object? activityExceptionDecoration = freezed,Object? activityExceptionIcon = freezed,Object? jsonPopover = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,companyId: freezed == companyId ? _self.companyId : companyId // ignore: cast_nullable_to_non_nullable
as StockPickingCompanyModel?,priority: freezed == priority ? _self.priority : priority // ignore: cast_nullable_to_non_nullable
as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String?,partnerId: freezed == partnerId ? _self.partnerId : partnerId // ignore: cast_nullable_to_non_nullable
as StockPickingPartnerModel?,locationDestId: freezed == locationDestId ? _self.locationDestId : locationDestId // ignore: cast_nullable_to_non_nullable
as StockPickingLocationModel?,locationId: freezed == locationId ? _self.locationId : locationId // ignore: cast_nullable_to_non_nullable
as StockPickingLocationModel?,userId: freezed == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
as dynamic,scheduledDate: freezed == scheduledDate ? _self.scheduledDate : scheduledDate // ignore: cast_nullable_to_non_nullable
as String?,pickingTypeCode: freezed == pickingTypeCode ? _self.pickingTypeCode : pickingTypeCode // ignore: cast_nullable_to_non_nullable
as String?,productsAvailabilityState: freezed == productsAvailabilityState ? _self.productsAvailabilityState : productsAvailabilityState // ignore: cast_nullable_to_non_nullable
as dynamic,productsAvailability: freezed == productsAvailability ? _self.productsAvailability : productsAvailability // ignore: cast_nullable_to_non_nullable
as dynamic,dateDeadline: freezed == dateDeadline ? _self.dateDeadline : dateDeadline // ignore: cast_nullable_to_non_nullable
as String?,dateDone: freezed == dateDone ? _self.dateDone : dateDone // ignore: cast_nullable_to_non_nullable
as dynamic,origin: freezed == origin ? _self.origin : origin // ignore: cast_nullable_to_non_nullable
as String?,backorderId: freezed == backorderId ? _self.backorderId : backorderId // ignore: cast_nullable_to_non_nullable
as dynamic,pickingTypeId: freezed == pickingTypeId ? _self.pickingTypeId : pickingTypeId // ignore: cast_nullable_to_non_nullable
as StockPickingTypeModel?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as String?,activityExceptionDecoration: freezed == activityExceptionDecoration ? _self.activityExceptionDecoration : activityExceptionDecoration // ignore: cast_nullable_to_non_nullable
as dynamic,activityExceptionIcon: freezed == activityExceptionIcon ? _self.activityExceptionIcon : activityExceptionIcon // ignore: cast_nullable_to_non_nullable
as dynamic,jsonPopover: freezed == jsonPopover ? _self.jsonPopover : jsonPopover // ignore: cast_nullable_to_non_nullable
as dynamic,
));
}
/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingCompanyModelCopyWith<$Res>? get companyId {
if (_self.companyId == null) {
return null;
}
return $StockPickingCompanyModelCopyWith<$Res>(_self.companyId!, (value) {
return _then(_self.copyWith(companyId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingPartnerModelCopyWith<$Res>? get partnerId {
if (_self.partnerId == null) {
return null;
}
return $StockPickingPartnerModelCopyWith<$Res>(_self.partnerId!, (value) {
return _then(_self.copyWith(partnerId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingLocationModelCopyWith<$Res>? get locationDestId {
if (_self.locationDestId == null) {
return null;
}
return $StockPickingLocationModelCopyWith<$Res>(_self.locationDestId!, (value) {
return _then(_self.copyWith(locationDestId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingLocationModelCopyWith<$Res>? get locationId {
if (_self.locationId == null) {
return null;
}
return $StockPickingLocationModelCopyWith<$Res>(_self.locationId!, (value) {
return _then(_self.copyWith(locationId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingTypeModelCopyWith<$Res>? get pickingTypeId {
if (_self.pickingTypeId == null) {
return null;
}
return $StockPickingTypeModelCopyWith<$Res>(_self.pickingTypeId!, (value) {
return _then(_self.copyWith(pickingTypeId: value));
});
}
}
/// @nodoc
@JsonSerializable()
class _StockPickingRecordModel implements StockPickingRecordModel {
const _StockPickingRecordModel({this.id, @JsonKey(name: 'company_id') this.companyId, @JsonKey(name: 'priority') this.priority, @JsonKey(name: 'name') this.name, @JsonKey(name: 'partner_id') this.partnerId, @JsonKey(name: 'location_dest_id') this.locationDestId, @JsonKey(name: 'location_id') this.locationId, @JsonKey(name: 'user_id') this.userId, @JsonKey(name: 'scheduled_date') this.scheduledDate, @JsonKey(name: 'picking_type_code') this.pickingTypeCode, @JsonKey(name: 'products_availability_state') this.productsAvailabilityState, @JsonKey(name: 'products_availability') this.productsAvailability, @JsonKey(name: 'date_deadline') this.dateDeadline, @JsonKey(name: 'date_done') this.dateDone, @JsonKey(name: 'origin') this.origin, @JsonKey(name: 'backorder_id') this.backorderId, @JsonKey(name: 'picking_type_id') this.pickingTypeId, @JsonKey(name: 'state') this.state, @JsonKey(name: 'activity_exception_decoration') this.activityExceptionDecoration, @JsonKey(name: 'activity_exception_icon') this.activityExceptionIcon, @JsonKey(name: 'json_popover') this.jsonPopover});
factory _StockPickingRecordModel.fromJson(Map<String, dynamic> json) => _$StockPickingRecordModelFromJson(json);
@override final int? id;
@override@JsonKey(name: 'company_id') final StockPickingCompanyModel? companyId;
@override@JsonKey(name: 'priority') final String? priority;
@override@JsonKey(name: 'name') final String? name;
@override@JsonKey(name: 'partner_id') final StockPickingPartnerModel? partnerId;
@override@JsonKey(name: 'location_dest_id') final StockPickingLocationModel? locationDestId;
@override@JsonKey(name: 'location_id') final StockPickingLocationModel? locationId;
@override@JsonKey(name: 'user_id') final dynamic userId;
@override@JsonKey(name: 'scheduled_date') final String? scheduledDate;
@override@JsonKey(name: 'picking_type_code') final String? pickingTypeCode;
@override@JsonKey(name: 'products_availability_state') final dynamic productsAvailabilityState;
@override@JsonKey(name: 'products_availability') final dynamic productsAvailability;
@override@JsonKey(name: 'date_deadline') final String? dateDeadline;
@override@JsonKey(name: 'date_done') final dynamic dateDone;
@override@JsonKey(name: 'origin') final String? origin;
@override@JsonKey(name: 'backorder_id') final dynamic backorderId;
@override@JsonKey(name: 'picking_type_id') final StockPickingTypeModel? pickingTypeId;
@override@JsonKey(name: 'state') final String? state;
@override@JsonKey(name: 'activity_exception_decoration') final dynamic activityExceptionDecoration;
@override@JsonKey(name: 'activity_exception_icon') final dynamic activityExceptionIcon;
@override@JsonKey(name: 'json_popover') final dynamic jsonPopover;
/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$StockPickingRecordModelCopyWith<_StockPickingRecordModel> get copyWith => __$StockPickingRecordModelCopyWithImpl<_StockPickingRecordModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$StockPickingRecordModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingRecordModel&&(identical(other.id, id) || other.id == id)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.priority, priority) || other.priority == priority)&&(identical(other.name, name) || other.name == name)&&(identical(other.partnerId, partnerId) || other.partnerId == partnerId)&&(identical(other.locationDestId, locationDestId) || other.locationDestId == locationDestId)&&(identical(other.locationId, locationId) || other.locationId == locationId)&&const DeepCollectionEquality().equals(other.userId, userId)&&(identical(other.scheduledDate, scheduledDate) || other.scheduledDate == scheduledDate)&&(identical(other.pickingTypeCode, pickingTypeCode) || other.pickingTypeCode == pickingTypeCode)&&const DeepCollectionEquality().equals(other.productsAvailabilityState, productsAvailabilityState)&&const DeepCollectionEquality().equals(other.productsAvailability, productsAvailability)&&(identical(other.dateDeadline, dateDeadline) || other.dateDeadline == dateDeadline)&&const DeepCollectionEquality().equals(other.dateDone, dateDone)&&(identical(other.origin, origin) || other.origin == origin)&&const DeepCollectionEquality().equals(other.backorderId, backorderId)&&(identical(other.pickingTypeId, pickingTypeId) || other.pickingTypeId == pickingTypeId)&&(identical(other.state, state) || other.state == state)&&const DeepCollectionEquality().equals(other.activityExceptionDecoration, activityExceptionDecoration)&&const DeepCollectionEquality().equals(other.activityExceptionIcon, activityExceptionIcon)&&const DeepCollectionEquality().equals(other.jsonPopover, jsonPopover));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([runtimeType,id,companyId,priority,name,partnerId,locationDestId,locationId,const DeepCollectionEquality().hash(userId),scheduledDate,pickingTypeCode,const DeepCollectionEquality().hash(productsAvailabilityState),const DeepCollectionEquality().hash(productsAvailability),dateDeadline,const DeepCollectionEquality().hash(dateDone),origin,const DeepCollectionEquality().hash(backorderId),pickingTypeId,state,const DeepCollectionEquality().hash(activityExceptionDecoration),const DeepCollectionEquality().hash(activityExceptionIcon),const DeepCollectionEquality().hash(jsonPopover)]);
@override
String toString() {
return 'StockPickingRecordModel(id: $id, companyId: $companyId, priority: $priority, name: $name, partnerId: $partnerId, locationDestId: $locationDestId, locationId: $locationId, userId: $userId, scheduledDate: $scheduledDate, pickingTypeCode: $pickingTypeCode, productsAvailabilityState: $productsAvailabilityState, productsAvailability: $productsAvailability, dateDeadline: $dateDeadline, dateDone: $dateDone, origin: $origin, backorderId: $backorderId, pickingTypeId: $pickingTypeId, state: $state, activityExceptionDecoration: $activityExceptionDecoration, activityExceptionIcon: $activityExceptionIcon, jsonPopover: $jsonPopover)';
}
}
/// @nodoc
abstract mixin class _$StockPickingRecordModelCopyWith<$Res> implements $StockPickingRecordModelCopyWith<$Res> {
factory _$StockPickingRecordModelCopyWith(_StockPickingRecordModel value, $Res Function(_StockPickingRecordModel) _then) = __$StockPickingRecordModelCopyWithImpl;
@override @useResult
$Res call({
int? id,@JsonKey(name: 'company_id') StockPickingCompanyModel? companyId,@JsonKey(name: 'priority') String? priority,@JsonKey(name: 'name') String? name,@JsonKey(name: 'partner_id') StockPickingPartnerModel? partnerId,@JsonKey(name: 'location_dest_id') StockPickingLocationModel? locationDestId,@JsonKey(name: 'location_id') StockPickingLocationModel? locationId,@JsonKey(name: 'user_id') dynamic userId,@JsonKey(name: 'scheduled_date') String? scheduledDate,@JsonKey(name: 'picking_type_code') String? pickingTypeCode,@JsonKey(name: 'products_availability_state') dynamic productsAvailabilityState,@JsonKey(name: 'products_availability') dynamic productsAvailability,@JsonKey(name: 'date_deadline') String? dateDeadline,@JsonKey(name: 'date_done') dynamic dateDone,@JsonKey(name: 'origin') String? origin,@JsonKey(name: 'backorder_id') dynamic backorderId,@JsonKey(name: 'picking_type_id') StockPickingTypeModel? pickingTypeId,@JsonKey(name: 'state') String? state,@JsonKey(name: 'activity_exception_decoration') dynamic activityExceptionDecoration,@JsonKey(name: 'activity_exception_icon') dynamic activityExceptionIcon,@JsonKey(name: 'json_popover') dynamic jsonPopover
});
@override $StockPickingCompanyModelCopyWith<$Res>? get companyId;@override $StockPickingPartnerModelCopyWith<$Res>? get partnerId;@override $StockPickingLocationModelCopyWith<$Res>? get locationDestId;@override $StockPickingLocationModelCopyWith<$Res>? get locationId;@override $StockPickingTypeModelCopyWith<$Res>? get pickingTypeId;
}
/// @nodoc
class __$StockPickingRecordModelCopyWithImpl<$Res>
implements _$StockPickingRecordModelCopyWith<$Res> {
__$StockPickingRecordModelCopyWithImpl(this._self, this._then);
final _StockPickingRecordModel _self;
final $Res Function(_StockPickingRecordModel) _then;
/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? companyId = freezed,Object? priority = freezed,Object? name = freezed,Object? partnerId = freezed,Object? locationDestId = freezed,Object? locationId = freezed,Object? userId = freezed,Object? scheduledDate = freezed,Object? pickingTypeCode = freezed,Object? productsAvailabilityState = freezed,Object? productsAvailability = freezed,Object? dateDeadline = freezed,Object? dateDone = freezed,Object? origin = freezed,Object? backorderId = freezed,Object? pickingTypeId = freezed,Object? state = freezed,Object? activityExceptionDecoration = freezed,Object? activityExceptionIcon = freezed,Object? jsonPopover = freezed,}) {
return _then(_StockPickingRecordModel(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,companyId: freezed == companyId ? _self.companyId : companyId // ignore: cast_nullable_to_non_nullable
as StockPickingCompanyModel?,priority: freezed == priority ? _self.priority : priority // ignore: cast_nullable_to_non_nullable
as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String?,partnerId: freezed == partnerId ? _self.partnerId : partnerId // ignore: cast_nullable_to_non_nullable
as StockPickingPartnerModel?,locationDestId: freezed == locationDestId ? _self.locationDestId : locationDestId // ignore: cast_nullable_to_non_nullable
as StockPickingLocationModel?,locationId: freezed == locationId ? _self.locationId : locationId // ignore: cast_nullable_to_non_nullable
as StockPickingLocationModel?,userId: freezed == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
as dynamic,scheduledDate: freezed == scheduledDate ? _self.scheduledDate : scheduledDate // ignore: cast_nullable_to_non_nullable
as String?,pickingTypeCode: freezed == pickingTypeCode ? _self.pickingTypeCode : pickingTypeCode // ignore: cast_nullable_to_non_nullable
as String?,productsAvailabilityState: freezed == productsAvailabilityState ? _self.productsAvailabilityState : productsAvailabilityState // ignore: cast_nullable_to_non_nullable
as dynamic,productsAvailability: freezed == productsAvailability ? _self.productsAvailability : productsAvailability // ignore: cast_nullable_to_non_nullable
as dynamic,dateDeadline: freezed == dateDeadline ? _self.dateDeadline : dateDeadline // ignore: cast_nullable_to_non_nullable
as String?,dateDone: freezed == dateDone ? _self.dateDone : dateDone // ignore: cast_nullable_to_non_nullable
as dynamic,origin: freezed == origin ? _self.origin : origin // ignore: cast_nullable_to_non_nullable
as String?,backorderId: freezed == backorderId ? _self.backorderId : backorderId // ignore: cast_nullable_to_non_nullable
as dynamic,pickingTypeId: freezed == pickingTypeId ? _self.pickingTypeId : pickingTypeId // ignore: cast_nullable_to_non_nullable
as StockPickingTypeModel?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as String?,activityExceptionDecoration: freezed == activityExceptionDecoration ? _self.activityExceptionDecoration : activityExceptionDecoration // ignore: cast_nullable_to_non_nullable
as dynamic,activityExceptionIcon: freezed == activityExceptionIcon ? _self.activityExceptionIcon : activityExceptionIcon // ignore: cast_nullable_to_non_nullable
as dynamic,jsonPopover: freezed == jsonPopover ? _self.jsonPopover : jsonPopover // ignore: cast_nullable_to_non_nullable
as dynamic,
));
}
/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingCompanyModelCopyWith<$Res>? get companyId {
if (_self.companyId == null) {
return null;
}
return $StockPickingCompanyModelCopyWith<$Res>(_self.companyId!, (value) {
return _then(_self.copyWith(companyId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingPartnerModelCopyWith<$Res>? get partnerId {
if (_self.partnerId == null) {
return null;
}
return $StockPickingPartnerModelCopyWith<$Res>(_self.partnerId!, (value) {
return _then(_self.copyWith(partnerId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingLocationModelCopyWith<$Res>? get locationDestId {
if (_self.locationDestId == null) {
return null;
}
return $StockPickingLocationModelCopyWith<$Res>(_self.locationDestId!, (value) {
return _then(_self.copyWith(locationDestId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingLocationModelCopyWith<$Res>? get locationId {
if (_self.locationId == null) {
return null;
}
return $StockPickingLocationModelCopyWith<$Res>(_self.locationId!, (value) {
return _then(_self.copyWith(locationId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingTypeModelCopyWith<$Res>? get pickingTypeId {
if (_self.pickingTypeId == null) {
return null;
}
return $StockPickingTypeModelCopyWith<$Res>(_self.pickingTypeId!, (value) {
return _then(_self.copyWith(pickingTypeId: value));
});
}
}
/// @nodoc
mixin _$StockPickingCompanyModel {

View File

@ -39,78 +39,6 @@ Map<String, dynamic> _$StockPickingResultModelToJson(
_StockPickingResultModel instance,
) => <String, dynamic>{'length': instance.length, 'records': instance.records};
_StockPickingRecordModel _$StockPickingRecordModelFromJson(
Map<String, dynamic> json,
) => _StockPickingRecordModel(
id: (json['id'] as num?)?.toInt(),
companyId: json['company_id'] == null
? null
: StockPickingCompanyModel.fromJson(
json['company_id'] as Map<String, dynamic>,
),
priority: json['priority'] as String?,
name: json['name'] as String?,
partnerId: json['partner_id'] == null
? null
: StockPickingPartnerModel.fromJson(
json['partner_id'] as Map<String, dynamic>,
),
locationDestId: json['location_dest_id'] == null
? null
: StockPickingLocationModel.fromJson(
json['location_dest_id'] as Map<String, dynamic>,
),
locationId: json['location_id'] == null
? null
: StockPickingLocationModel.fromJson(
json['location_id'] as Map<String, dynamic>,
),
userId: json['user_id'],
scheduledDate: json['scheduled_date'] as String?,
pickingTypeCode: json['picking_type_code'] as String?,
productsAvailabilityState: json['products_availability_state'],
productsAvailability: json['products_availability'],
dateDeadline: json['date_deadline'] as String?,
dateDone: json['date_done'],
origin: json['origin'] as String?,
backorderId: json['backorder_id'],
pickingTypeId: json['picking_type_id'] == null
? null
: StockPickingTypeModel.fromJson(
json['picking_type_id'] as Map<String, dynamic>,
),
state: json['state'] as String?,
activityExceptionDecoration: json['activity_exception_decoration'],
activityExceptionIcon: json['activity_exception_icon'],
jsonPopover: json['json_popover'],
);
Map<String, dynamic> _$StockPickingRecordModelToJson(
_StockPickingRecordModel instance,
) => <String, dynamic>{
'id': instance.id,
'company_id': instance.companyId,
'priority': instance.priority,
'name': instance.name,
'partner_id': instance.partnerId,
'location_dest_id': instance.locationDestId,
'location_id': instance.locationId,
'user_id': instance.userId,
'scheduled_date': instance.scheduledDate,
'picking_type_code': instance.pickingTypeCode,
'products_availability_state': instance.productsAvailabilityState,
'products_availability': instance.productsAvailability,
'date_deadline': instance.dateDeadline,
'date_done': instance.dateDone,
'origin': instance.origin,
'backorder_id': instance.backorderId,
'picking_type_id': instance.pickingTypeId,
'state': instance.state,
'activity_exception_decoration': instance.activityExceptionDecoration,
'activity_exception_icon': instance.activityExceptionIcon,
'json_popover': instance.jsonPopover,
};
_StockPickingCompanyModel _$StockPickingCompanyModelFromJson(
Map<String, dynamic> json,
) => _StockPickingCompanyModel(id: (json['id'] as num?)?.toInt());

View File

@ -0,0 +1,72 @@
import 'package:e_scan/backend/schema/product/product_model.dart';
import 'package:e_scan/backend/schema/stock_picking/stock_picking_model.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'stock_picking_record_model.freezed.dart';
part 'stock_picking_record_model.g.dart';
@freezed
abstract class StockPickingRecordModel with _$StockPickingRecordModel {
const factory StockPickingRecordModel({
int? id,
@JsonKey(name: 'company_id') StockPickingCompanyModel? companyId,
@JsonKey(name: 'priority') String? priority,
@JsonKey(name: 'name') String? name,
@JsonKey(name: 'partner_id') StockPickingPartnerModel? partnerId,
@JsonKey(name: 'location_dest_id')
StockPickingLocationModel? locationDestId,
@JsonKey(name: 'location_id') StockPickingLocationModel? locationId,
@JsonKey(name: 'user_id') dynamic userId,
@JsonKey(name: 'scheduled_date') String? scheduledDate,
@JsonKey(name: 'picking_type_code') String? pickingTypeCode,
@JsonKey(name: 'products_availability_state')
dynamic productsAvailabilityState,
@JsonKey(name: 'products_availability') dynamic productsAvailability,
@JsonKey(name: 'date_deadline') String? dateDeadline,
@JsonKey(name: 'date_done') dynamic dateDone,
@JsonKey(name: 'origin') String? origin,
@JsonKey(name: 'backorder_id') dynamic backorderId,
@JsonKey(name: 'picking_type_id') StockPickingTypeModel? pickingTypeId,
@JsonKey(name: 'state') String? state,
@JsonKey(name: 'activity_exception_decoration')
dynamic activityExceptionDecoration,
@JsonKey(name: 'activity_exception_icon') dynamic activityExceptionIcon,
@JsonKey(name: 'json_popover') dynamic jsonPopover,
@JsonKey(name: 'move_line_ids_without_package')
List<MoveLineWithoutPackageModel>? moveLineIdsWithoutPackage,
@JsonKey(name: 'move_ids_without_package')
List<MoveWithoutPackageModel>? moveIdsWithoutPackage,
}) = _StockPickingRecordModel;
factory StockPickingRecordModel.fromJson(Map<String, dynamic> json) =>
_$StockPickingRecordModelFromJson(json);
}
@freezed
abstract class MoveLineWithoutPackageModel with _$MoveLineWithoutPackageModel {
const factory MoveLineWithoutPackageModel({
int? id,
ProductModel? productId,
double? quantity,
}) = _MoveLineWithoutPackageModel;
factory MoveLineWithoutPackageModel.fromJson(Map<String, dynamic> json) =>
_$MoveLineWithoutPackageModelFromJson(json);
}
@freezed
abstract class MoveWithoutPackageModel with _$MoveWithoutPackageModel {
const factory MoveWithoutPackageModel({
int? id,
ProductModel? productId,
double? quantity,
double? productUomQty,
}) = _MoveWithoutPackageModel;
factory MoveWithoutPackageModel.fromJson(Map<String, dynamic> json) =>
_$MoveWithoutPackageModelFromJson(json);
}
extension StockPickingRecordModelExt on StockPickingRecordModel {
bool get isDone => state == "done";
}

View File

@ -0,0 +1,679 @@
// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'stock_picking_record_model.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$StockPickingRecordModel {
int? get id;@JsonKey(name: 'company_id') StockPickingCompanyModel? get companyId;@JsonKey(name: 'priority') String? get priority;@JsonKey(name: 'name') String? get name;@JsonKey(name: 'partner_id') StockPickingPartnerModel? get partnerId;@JsonKey(name: 'location_dest_id') StockPickingLocationModel? get locationDestId;@JsonKey(name: 'location_id') StockPickingLocationModel? get locationId;@JsonKey(name: 'user_id') dynamic get userId;@JsonKey(name: 'scheduled_date') String? get scheduledDate;@JsonKey(name: 'picking_type_code') String? get pickingTypeCode;@JsonKey(name: 'products_availability_state') dynamic get productsAvailabilityState;@JsonKey(name: 'products_availability') dynamic get productsAvailability;@JsonKey(name: 'date_deadline') String? get dateDeadline;@JsonKey(name: 'date_done') dynamic get dateDone;@JsonKey(name: 'origin') String? get origin;@JsonKey(name: 'backorder_id') dynamic get backorderId;@JsonKey(name: 'picking_type_id') StockPickingTypeModel? get pickingTypeId;@JsonKey(name: 'state') String? get state;@JsonKey(name: 'activity_exception_decoration') dynamic get activityExceptionDecoration;@JsonKey(name: 'activity_exception_icon') dynamic get activityExceptionIcon;@JsonKey(name: 'json_popover') dynamic get jsonPopover;@JsonKey(name: 'move_line_ids_without_package') List<MoveLineWithoutPackageModel>? get moveLineIdsWithoutPackage;@JsonKey(name: 'move_ids_without_package') List<MoveWithoutPackageModel>? get moveIdsWithoutPackage;
/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$StockPickingRecordModelCopyWith<StockPickingRecordModel> get copyWith => _$StockPickingRecordModelCopyWithImpl<StockPickingRecordModel>(this as StockPickingRecordModel, _$identity);
/// Serializes this StockPickingRecordModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingRecordModel&&(identical(other.id, id) || other.id == id)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.priority, priority) || other.priority == priority)&&(identical(other.name, name) || other.name == name)&&(identical(other.partnerId, partnerId) || other.partnerId == partnerId)&&(identical(other.locationDestId, locationDestId) || other.locationDestId == locationDestId)&&(identical(other.locationId, locationId) || other.locationId == locationId)&&const DeepCollectionEquality().equals(other.userId, userId)&&(identical(other.scheduledDate, scheduledDate) || other.scheduledDate == scheduledDate)&&(identical(other.pickingTypeCode, pickingTypeCode) || other.pickingTypeCode == pickingTypeCode)&&const DeepCollectionEquality().equals(other.productsAvailabilityState, productsAvailabilityState)&&const DeepCollectionEquality().equals(other.productsAvailability, productsAvailability)&&(identical(other.dateDeadline, dateDeadline) || other.dateDeadline == dateDeadline)&&const DeepCollectionEquality().equals(other.dateDone, dateDone)&&(identical(other.origin, origin) || other.origin == origin)&&const DeepCollectionEquality().equals(other.backorderId, backorderId)&&(identical(other.pickingTypeId, pickingTypeId) || other.pickingTypeId == pickingTypeId)&&(identical(other.state, state) || other.state == state)&&const DeepCollectionEquality().equals(other.activityExceptionDecoration, activityExceptionDecoration)&&const DeepCollectionEquality().equals(other.activityExceptionIcon, activityExceptionIcon)&&const DeepCollectionEquality().equals(other.jsonPopover, jsonPopover)&&const DeepCollectionEquality().equals(other.moveLineIdsWithoutPackage, moveLineIdsWithoutPackage)&&const DeepCollectionEquality().equals(other.moveIdsWithoutPackage, moveIdsWithoutPackage));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([runtimeType,id,companyId,priority,name,partnerId,locationDestId,locationId,const DeepCollectionEquality().hash(userId),scheduledDate,pickingTypeCode,const DeepCollectionEquality().hash(productsAvailabilityState),const DeepCollectionEquality().hash(productsAvailability),dateDeadline,const DeepCollectionEquality().hash(dateDone),origin,const DeepCollectionEquality().hash(backorderId),pickingTypeId,state,const DeepCollectionEquality().hash(activityExceptionDecoration),const DeepCollectionEquality().hash(activityExceptionIcon),const DeepCollectionEquality().hash(jsonPopover),const DeepCollectionEquality().hash(moveLineIdsWithoutPackage),const DeepCollectionEquality().hash(moveIdsWithoutPackage)]);
@override
String toString() {
return 'StockPickingRecordModel(id: $id, companyId: $companyId, priority: $priority, name: $name, partnerId: $partnerId, locationDestId: $locationDestId, locationId: $locationId, userId: $userId, scheduledDate: $scheduledDate, pickingTypeCode: $pickingTypeCode, productsAvailabilityState: $productsAvailabilityState, productsAvailability: $productsAvailability, dateDeadline: $dateDeadline, dateDone: $dateDone, origin: $origin, backorderId: $backorderId, pickingTypeId: $pickingTypeId, state: $state, activityExceptionDecoration: $activityExceptionDecoration, activityExceptionIcon: $activityExceptionIcon, jsonPopover: $jsonPopover, moveLineIdsWithoutPackage: $moveLineIdsWithoutPackage, moveIdsWithoutPackage: $moveIdsWithoutPackage)';
}
}
/// @nodoc
abstract mixin class $StockPickingRecordModelCopyWith<$Res> {
factory $StockPickingRecordModelCopyWith(StockPickingRecordModel value, $Res Function(StockPickingRecordModel) _then) = _$StockPickingRecordModelCopyWithImpl;
@useResult
$Res call({
int? id,@JsonKey(name: 'company_id') StockPickingCompanyModel? companyId,@JsonKey(name: 'priority') String? priority,@JsonKey(name: 'name') String? name,@JsonKey(name: 'partner_id') StockPickingPartnerModel? partnerId,@JsonKey(name: 'location_dest_id') StockPickingLocationModel? locationDestId,@JsonKey(name: 'location_id') StockPickingLocationModel? locationId,@JsonKey(name: 'user_id') dynamic userId,@JsonKey(name: 'scheduled_date') String? scheduledDate,@JsonKey(name: 'picking_type_code') String? pickingTypeCode,@JsonKey(name: 'products_availability_state') dynamic productsAvailabilityState,@JsonKey(name: 'products_availability') dynamic productsAvailability,@JsonKey(name: 'date_deadline') String? dateDeadline,@JsonKey(name: 'date_done') dynamic dateDone,@JsonKey(name: 'origin') String? origin,@JsonKey(name: 'backorder_id') dynamic backorderId,@JsonKey(name: 'picking_type_id') StockPickingTypeModel? pickingTypeId,@JsonKey(name: 'state') String? state,@JsonKey(name: 'activity_exception_decoration') dynamic activityExceptionDecoration,@JsonKey(name: 'activity_exception_icon') dynamic activityExceptionIcon,@JsonKey(name: 'json_popover') dynamic jsonPopover,@JsonKey(name: 'move_line_ids_without_package') List<MoveLineWithoutPackageModel>? moveLineIdsWithoutPackage,@JsonKey(name: 'move_ids_without_package') List<MoveWithoutPackageModel>? moveIdsWithoutPackage
});
$StockPickingCompanyModelCopyWith<$Res>? get companyId;$StockPickingPartnerModelCopyWith<$Res>? get partnerId;$StockPickingLocationModelCopyWith<$Res>? get locationDestId;$StockPickingLocationModelCopyWith<$Res>? get locationId;$StockPickingTypeModelCopyWith<$Res>? get pickingTypeId;
}
/// @nodoc
class _$StockPickingRecordModelCopyWithImpl<$Res>
implements $StockPickingRecordModelCopyWith<$Res> {
_$StockPickingRecordModelCopyWithImpl(this._self, this._then);
final StockPickingRecordModel _self;
final $Res Function(StockPickingRecordModel) _then;
/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? companyId = freezed,Object? priority = freezed,Object? name = freezed,Object? partnerId = freezed,Object? locationDestId = freezed,Object? locationId = freezed,Object? userId = freezed,Object? scheduledDate = freezed,Object? pickingTypeCode = freezed,Object? productsAvailabilityState = freezed,Object? productsAvailability = freezed,Object? dateDeadline = freezed,Object? dateDone = freezed,Object? origin = freezed,Object? backorderId = freezed,Object? pickingTypeId = freezed,Object? state = freezed,Object? activityExceptionDecoration = freezed,Object? activityExceptionIcon = freezed,Object? jsonPopover = freezed,Object? moveLineIdsWithoutPackage = freezed,Object? moveIdsWithoutPackage = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,companyId: freezed == companyId ? _self.companyId : companyId // ignore: cast_nullable_to_non_nullable
as StockPickingCompanyModel?,priority: freezed == priority ? _self.priority : priority // ignore: cast_nullable_to_non_nullable
as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String?,partnerId: freezed == partnerId ? _self.partnerId : partnerId // ignore: cast_nullable_to_non_nullable
as StockPickingPartnerModel?,locationDestId: freezed == locationDestId ? _self.locationDestId : locationDestId // ignore: cast_nullable_to_non_nullable
as StockPickingLocationModel?,locationId: freezed == locationId ? _self.locationId : locationId // ignore: cast_nullable_to_non_nullable
as StockPickingLocationModel?,userId: freezed == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
as dynamic,scheduledDate: freezed == scheduledDate ? _self.scheduledDate : scheduledDate // ignore: cast_nullable_to_non_nullable
as String?,pickingTypeCode: freezed == pickingTypeCode ? _self.pickingTypeCode : pickingTypeCode // ignore: cast_nullable_to_non_nullable
as String?,productsAvailabilityState: freezed == productsAvailabilityState ? _self.productsAvailabilityState : productsAvailabilityState // ignore: cast_nullable_to_non_nullable
as dynamic,productsAvailability: freezed == productsAvailability ? _self.productsAvailability : productsAvailability // ignore: cast_nullable_to_non_nullable
as dynamic,dateDeadline: freezed == dateDeadline ? _self.dateDeadline : dateDeadline // ignore: cast_nullable_to_non_nullable
as String?,dateDone: freezed == dateDone ? _self.dateDone : dateDone // ignore: cast_nullable_to_non_nullable
as dynamic,origin: freezed == origin ? _self.origin : origin // ignore: cast_nullable_to_non_nullable
as String?,backorderId: freezed == backorderId ? _self.backorderId : backorderId // ignore: cast_nullable_to_non_nullable
as dynamic,pickingTypeId: freezed == pickingTypeId ? _self.pickingTypeId : pickingTypeId // ignore: cast_nullable_to_non_nullable
as StockPickingTypeModel?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as String?,activityExceptionDecoration: freezed == activityExceptionDecoration ? _self.activityExceptionDecoration : activityExceptionDecoration // ignore: cast_nullable_to_non_nullable
as dynamic,activityExceptionIcon: freezed == activityExceptionIcon ? _self.activityExceptionIcon : activityExceptionIcon // ignore: cast_nullable_to_non_nullable
as dynamic,jsonPopover: freezed == jsonPopover ? _self.jsonPopover : jsonPopover // ignore: cast_nullable_to_non_nullable
as dynamic,moveLineIdsWithoutPackage: freezed == moveLineIdsWithoutPackage ? _self.moveLineIdsWithoutPackage : moveLineIdsWithoutPackage // ignore: cast_nullable_to_non_nullable
as List<MoveLineWithoutPackageModel>?,moveIdsWithoutPackage: freezed == moveIdsWithoutPackage ? _self.moveIdsWithoutPackage : moveIdsWithoutPackage // ignore: cast_nullable_to_non_nullable
as List<MoveWithoutPackageModel>?,
));
}
/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingCompanyModelCopyWith<$Res>? get companyId {
if (_self.companyId == null) {
return null;
}
return $StockPickingCompanyModelCopyWith<$Res>(_self.companyId!, (value) {
return _then(_self.copyWith(companyId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingPartnerModelCopyWith<$Res>? get partnerId {
if (_self.partnerId == null) {
return null;
}
return $StockPickingPartnerModelCopyWith<$Res>(_self.partnerId!, (value) {
return _then(_self.copyWith(partnerId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingLocationModelCopyWith<$Res>? get locationDestId {
if (_self.locationDestId == null) {
return null;
}
return $StockPickingLocationModelCopyWith<$Res>(_self.locationDestId!, (value) {
return _then(_self.copyWith(locationDestId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingLocationModelCopyWith<$Res>? get locationId {
if (_self.locationId == null) {
return null;
}
return $StockPickingLocationModelCopyWith<$Res>(_self.locationId!, (value) {
return _then(_self.copyWith(locationId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingTypeModelCopyWith<$Res>? get pickingTypeId {
if (_self.pickingTypeId == null) {
return null;
}
return $StockPickingTypeModelCopyWith<$Res>(_self.pickingTypeId!, (value) {
return _then(_self.copyWith(pickingTypeId: value));
});
}
}
/// @nodoc
@JsonSerializable()
class _StockPickingRecordModel implements StockPickingRecordModel {
const _StockPickingRecordModel({this.id, @JsonKey(name: 'company_id') this.companyId, @JsonKey(name: 'priority') this.priority, @JsonKey(name: 'name') this.name, @JsonKey(name: 'partner_id') this.partnerId, @JsonKey(name: 'location_dest_id') this.locationDestId, @JsonKey(name: 'location_id') this.locationId, @JsonKey(name: 'user_id') this.userId, @JsonKey(name: 'scheduled_date') this.scheduledDate, @JsonKey(name: 'picking_type_code') this.pickingTypeCode, @JsonKey(name: 'products_availability_state') this.productsAvailabilityState, @JsonKey(name: 'products_availability') this.productsAvailability, @JsonKey(name: 'date_deadline') this.dateDeadline, @JsonKey(name: 'date_done') this.dateDone, @JsonKey(name: 'origin') this.origin, @JsonKey(name: 'backorder_id') this.backorderId, @JsonKey(name: 'picking_type_id') this.pickingTypeId, @JsonKey(name: 'state') this.state, @JsonKey(name: 'activity_exception_decoration') this.activityExceptionDecoration, @JsonKey(name: 'activity_exception_icon') this.activityExceptionIcon, @JsonKey(name: 'json_popover') this.jsonPopover, @JsonKey(name: 'move_line_ids_without_package') final List<MoveLineWithoutPackageModel>? moveLineIdsWithoutPackage, @JsonKey(name: 'move_ids_without_package') final List<MoveWithoutPackageModel>? moveIdsWithoutPackage}): _moveLineIdsWithoutPackage = moveLineIdsWithoutPackage,_moveIdsWithoutPackage = moveIdsWithoutPackage;
factory _StockPickingRecordModel.fromJson(Map<String, dynamic> json) => _$StockPickingRecordModelFromJson(json);
@override final int? id;
@override@JsonKey(name: 'company_id') final StockPickingCompanyModel? companyId;
@override@JsonKey(name: 'priority') final String? priority;
@override@JsonKey(name: 'name') final String? name;
@override@JsonKey(name: 'partner_id') final StockPickingPartnerModel? partnerId;
@override@JsonKey(name: 'location_dest_id') final StockPickingLocationModel? locationDestId;
@override@JsonKey(name: 'location_id') final StockPickingLocationModel? locationId;
@override@JsonKey(name: 'user_id') final dynamic userId;
@override@JsonKey(name: 'scheduled_date') final String? scheduledDate;
@override@JsonKey(name: 'picking_type_code') final String? pickingTypeCode;
@override@JsonKey(name: 'products_availability_state') final dynamic productsAvailabilityState;
@override@JsonKey(name: 'products_availability') final dynamic productsAvailability;
@override@JsonKey(name: 'date_deadline') final String? dateDeadline;
@override@JsonKey(name: 'date_done') final dynamic dateDone;
@override@JsonKey(name: 'origin') final String? origin;
@override@JsonKey(name: 'backorder_id') final dynamic backorderId;
@override@JsonKey(name: 'picking_type_id') final StockPickingTypeModel? pickingTypeId;
@override@JsonKey(name: 'state') final String? state;
@override@JsonKey(name: 'activity_exception_decoration') final dynamic activityExceptionDecoration;
@override@JsonKey(name: 'activity_exception_icon') final dynamic activityExceptionIcon;
@override@JsonKey(name: 'json_popover') final dynamic jsonPopover;
final List<MoveLineWithoutPackageModel>? _moveLineIdsWithoutPackage;
@override@JsonKey(name: 'move_line_ids_without_package') List<MoveLineWithoutPackageModel>? get moveLineIdsWithoutPackage {
final value = _moveLineIdsWithoutPackage;
if (value == null) return null;
if (_moveLineIdsWithoutPackage is EqualUnmodifiableListView) return _moveLineIdsWithoutPackage;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}
final List<MoveWithoutPackageModel>? _moveIdsWithoutPackage;
@override@JsonKey(name: 'move_ids_without_package') List<MoveWithoutPackageModel>? get moveIdsWithoutPackage {
final value = _moveIdsWithoutPackage;
if (value == null) return null;
if (_moveIdsWithoutPackage is EqualUnmodifiableListView) return _moveIdsWithoutPackage;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}
/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$StockPickingRecordModelCopyWith<_StockPickingRecordModel> get copyWith => __$StockPickingRecordModelCopyWithImpl<_StockPickingRecordModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$StockPickingRecordModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingRecordModel&&(identical(other.id, id) || other.id == id)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.priority, priority) || other.priority == priority)&&(identical(other.name, name) || other.name == name)&&(identical(other.partnerId, partnerId) || other.partnerId == partnerId)&&(identical(other.locationDestId, locationDestId) || other.locationDestId == locationDestId)&&(identical(other.locationId, locationId) || other.locationId == locationId)&&const DeepCollectionEquality().equals(other.userId, userId)&&(identical(other.scheduledDate, scheduledDate) || other.scheduledDate == scheduledDate)&&(identical(other.pickingTypeCode, pickingTypeCode) || other.pickingTypeCode == pickingTypeCode)&&const DeepCollectionEquality().equals(other.productsAvailabilityState, productsAvailabilityState)&&const DeepCollectionEquality().equals(other.productsAvailability, productsAvailability)&&(identical(other.dateDeadline, dateDeadline) || other.dateDeadline == dateDeadline)&&const DeepCollectionEquality().equals(other.dateDone, dateDone)&&(identical(other.origin, origin) || other.origin == origin)&&const DeepCollectionEquality().equals(other.backorderId, backorderId)&&(identical(other.pickingTypeId, pickingTypeId) || other.pickingTypeId == pickingTypeId)&&(identical(other.state, state) || other.state == state)&&const DeepCollectionEquality().equals(other.activityExceptionDecoration, activityExceptionDecoration)&&const DeepCollectionEquality().equals(other.activityExceptionIcon, activityExceptionIcon)&&const DeepCollectionEquality().equals(other.jsonPopover, jsonPopover)&&const DeepCollectionEquality().equals(other._moveLineIdsWithoutPackage, _moveLineIdsWithoutPackage)&&const DeepCollectionEquality().equals(other._moveIdsWithoutPackage, _moveIdsWithoutPackage));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([runtimeType,id,companyId,priority,name,partnerId,locationDestId,locationId,const DeepCollectionEquality().hash(userId),scheduledDate,pickingTypeCode,const DeepCollectionEquality().hash(productsAvailabilityState),const DeepCollectionEquality().hash(productsAvailability),dateDeadline,const DeepCollectionEquality().hash(dateDone),origin,const DeepCollectionEquality().hash(backorderId),pickingTypeId,state,const DeepCollectionEquality().hash(activityExceptionDecoration),const DeepCollectionEquality().hash(activityExceptionIcon),const DeepCollectionEquality().hash(jsonPopover),const DeepCollectionEquality().hash(_moveLineIdsWithoutPackage),const DeepCollectionEquality().hash(_moveIdsWithoutPackage)]);
@override
String toString() {
return 'StockPickingRecordModel(id: $id, companyId: $companyId, priority: $priority, name: $name, partnerId: $partnerId, locationDestId: $locationDestId, locationId: $locationId, userId: $userId, scheduledDate: $scheduledDate, pickingTypeCode: $pickingTypeCode, productsAvailabilityState: $productsAvailabilityState, productsAvailability: $productsAvailability, dateDeadline: $dateDeadline, dateDone: $dateDone, origin: $origin, backorderId: $backorderId, pickingTypeId: $pickingTypeId, state: $state, activityExceptionDecoration: $activityExceptionDecoration, activityExceptionIcon: $activityExceptionIcon, jsonPopover: $jsonPopover, moveLineIdsWithoutPackage: $moveLineIdsWithoutPackage, moveIdsWithoutPackage: $moveIdsWithoutPackage)';
}
}
/// @nodoc
abstract mixin class _$StockPickingRecordModelCopyWith<$Res> implements $StockPickingRecordModelCopyWith<$Res> {
factory _$StockPickingRecordModelCopyWith(_StockPickingRecordModel value, $Res Function(_StockPickingRecordModel) _then) = __$StockPickingRecordModelCopyWithImpl;
@override @useResult
$Res call({
int? id,@JsonKey(name: 'company_id') StockPickingCompanyModel? companyId,@JsonKey(name: 'priority') String? priority,@JsonKey(name: 'name') String? name,@JsonKey(name: 'partner_id') StockPickingPartnerModel? partnerId,@JsonKey(name: 'location_dest_id') StockPickingLocationModel? locationDestId,@JsonKey(name: 'location_id') StockPickingLocationModel? locationId,@JsonKey(name: 'user_id') dynamic userId,@JsonKey(name: 'scheduled_date') String? scheduledDate,@JsonKey(name: 'picking_type_code') String? pickingTypeCode,@JsonKey(name: 'products_availability_state') dynamic productsAvailabilityState,@JsonKey(name: 'products_availability') dynamic productsAvailability,@JsonKey(name: 'date_deadline') String? dateDeadline,@JsonKey(name: 'date_done') dynamic dateDone,@JsonKey(name: 'origin') String? origin,@JsonKey(name: 'backorder_id') dynamic backorderId,@JsonKey(name: 'picking_type_id') StockPickingTypeModel? pickingTypeId,@JsonKey(name: 'state') String? state,@JsonKey(name: 'activity_exception_decoration') dynamic activityExceptionDecoration,@JsonKey(name: 'activity_exception_icon') dynamic activityExceptionIcon,@JsonKey(name: 'json_popover') dynamic jsonPopover,@JsonKey(name: 'move_line_ids_without_package') List<MoveLineWithoutPackageModel>? moveLineIdsWithoutPackage,@JsonKey(name: 'move_ids_without_package') List<MoveWithoutPackageModel>? moveIdsWithoutPackage
});
@override $StockPickingCompanyModelCopyWith<$Res>? get companyId;@override $StockPickingPartnerModelCopyWith<$Res>? get partnerId;@override $StockPickingLocationModelCopyWith<$Res>? get locationDestId;@override $StockPickingLocationModelCopyWith<$Res>? get locationId;@override $StockPickingTypeModelCopyWith<$Res>? get pickingTypeId;
}
/// @nodoc
class __$StockPickingRecordModelCopyWithImpl<$Res>
implements _$StockPickingRecordModelCopyWith<$Res> {
__$StockPickingRecordModelCopyWithImpl(this._self, this._then);
final _StockPickingRecordModel _self;
final $Res Function(_StockPickingRecordModel) _then;
/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? companyId = freezed,Object? priority = freezed,Object? name = freezed,Object? partnerId = freezed,Object? locationDestId = freezed,Object? locationId = freezed,Object? userId = freezed,Object? scheduledDate = freezed,Object? pickingTypeCode = freezed,Object? productsAvailabilityState = freezed,Object? productsAvailability = freezed,Object? dateDeadline = freezed,Object? dateDone = freezed,Object? origin = freezed,Object? backorderId = freezed,Object? pickingTypeId = freezed,Object? state = freezed,Object? activityExceptionDecoration = freezed,Object? activityExceptionIcon = freezed,Object? jsonPopover = freezed,Object? moveLineIdsWithoutPackage = freezed,Object? moveIdsWithoutPackage = freezed,}) {
return _then(_StockPickingRecordModel(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,companyId: freezed == companyId ? _self.companyId : companyId // ignore: cast_nullable_to_non_nullable
as StockPickingCompanyModel?,priority: freezed == priority ? _self.priority : priority // ignore: cast_nullable_to_non_nullable
as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String?,partnerId: freezed == partnerId ? _self.partnerId : partnerId // ignore: cast_nullable_to_non_nullable
as StockPickingPartnerModel?,locationDestId: freezed == locationDestId ? _self.locationDestId : locationDestId // ignore: cast_nullable_to_non_nullable
as StockPickingLocationModel?,locationId: freezed == locationId ? _self.locationId : locationId // ignore: cast_nullable_to_non_nullable
as StockPickingLocationModel?,userId: freezed == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
as dynamic,scheduledDate: freezed == scheduledDate ? _self.scheduledDate : scheduledDate // ignore: cast_nullable_to_non_nullable
as String?,pickingTypeCode: freezed == pickingTypeCode ? _self.pickingTypeCode : pickingTypeCode // ignore: cast_nullable_to_non_nullable
as String?,productsAvailabilityState: freezed == productsAvailabilityState ? _self.productsAvailabilityState : productsAvailabilityState // ignore: cast_nullable_to_non_nullable
as dynamic,productsAvailability: freezed == productsAvailability ? _self.productsAvailability : productsAvailability // ignore: cast_nullable_to_non_nullable
as dynamic,dateDeadline: freezed == dateDeadline ? _self.dateDeadline : dateDeadline // ignore: cast_nullable_to_non_nullable
as String?,dateDone: freezed == dateDone ? _self.dateDone : dateDone // ignore: cast_nullable_to_non_nullable
as dynamic,origin: freezed == origin ? _self.origin : origin // ignore: cast_nullable_to_non_nullable
as String?,backorderId: freezed == backorderId ? _self.backorderId : backorderId // ignore: cast_nullable_to_non_nullable
as dynamic,pickingTypeId: freezed == pickingTypeId ? _self.pickingTypeId : pickingTypeId // ignore: cast_nullable_to_non_nullable
as StockPickingTypeModel?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as String?,activityExceptionDecoration: freezed == activityExceptionDecoration ? _self.activityExceptionDecoration : activityExceptionDecoration // ignore: cast_nullable_to_non_nullable
as dynamic,activityExceptionIcon: freezed == activityExceptionIcon ? _self.activityExceptionIcon : activityExceptionIcon // ignore: cast_nullable_to_non_nullable
as dynamic,jsonPopover: freezed == jsonPopover ? _self.jsonPopover : jsonPopover // ignore: cast_nullable_to_non_nullable
as dynamic,moveLineIdsWithoutPackage: freezed == moveLineIdsWithoutPackage ? _self._moveLineIdsWithoutPackage : moveLineIdsWithoutPackage // ignore: cast_nullable_to_non_nullable
as List<MoveLineWithoutPackageModel>?,moveIdsWithoutPackage: freezed == moveIdsWithoutPackage ? _self._moveIdsWithoutPackage : moveIdsWithoutPackage // ignore: cast_nullable_to_non_nullable
as List<MoveWithoutPackageModel>?,
));
}
/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingCompanyModelCopyWith<$Res>? get companyId {
if (_self.companyId == null) {
return null;
}
return $StockPickingCompanyModelCopyWith<$Res>(_self.companyId!, (value) {
return _then(_self.copyWith(companyId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingPartnerModelCopyWith<$Res>? get partnerId {
if (_self.partnerId == null) {
return null;
}
return $StockPickingPartnerModelCopyWith<$Res>(_self.partnerId!, (value) {
return _then(_self.copyWith(partnerId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingLocationModelCopyWith<$Res>? get locationDestId {
if (_self.locationDestId == null) {
return null;
}
return $StockPickingLocationModelCopyWith<$Res>(_self.locationDestId!, (value) {
return _then(_self.copyWith(locationDestId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingLocationModelCopyWith<$Res>? get locationId {
if (_self.locationId == null) {
return null;
}
return $StockPickingLocationModelCopyWith<$Res>(_self.locationId!, (value) {
return _then(_self.copyWith(locationId: value));
});
}/// Create a copy of StockPickingRecordModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingTypeModelCopyWith<$Res>? get pickingTypeId {
if (_self.pickingTypeId == null) {
return null;
}
return $StockPickingTypeModelCopyWith<$Res>(_self.pickingTypeId!, (value) {
return _then(_self.copyWith(pickingTypeId: value));
});
}
}
/// @nodoc
mixin _$MoveLineWithoutPackageModel {
int? get id; ProductModel? get productId; double? get quantity;
/// Create a copy of MoveLineWithoutPackageModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$MoveLineWithoutPackageModelCopyWith<MoveLineWithoutPackageModel> get copyWith => _$MoveLineWithoutPackageModelCopyWithImpl<MoveLineWithoutPackageModel>(this as MoveLineWithoutPackageModel, _$identity);
/// Serializes this MoveLineWithoutPackageModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is MoveLineWithoutPackageModel&&(identical(other.id, id) || other.id == id)&&(identical(other.productId, productId) || other.productId == productId)&&(identical(other.quantity, quantity) || other.quantity == quantity));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,productId,quantity);
@override
String toString() {
return 'MoveLineWithoutPackageModel(id: $id, productId: $productId, quantity: $quantity)';
}
}
/// @nodoc
abstract mixin class $MoveLineWithoutPackageModelCopyWith<$Res> {
factory $MoveLineWithoutPackageModelCopyWith(MoveLineWithoutPackageModel value, $Res Function(MoveLineWithoutPackageModel) _then) = _$MoveLineWithoutPackageModelCopyWithImpl;
@useResult
$Res call({
int? id, ProductModel? productId, double? quantity
});
$ProductModelCopyWith<$Res>? get productId;
}
/// @nodoc
class _$MoveLineWithoutPackageModelCopyWithImpl<$Res>
implements $MoveLineWithoutPackageModelCopyWith<$Res> {
_$MoveLineWithoutPackageModelCopyWithImpl(this._self, this._then);
final MoveLineWithoutPackageModel _self;
final $Res Function(MoveLineWithoutPackageModel) _then;
/// Create a copy of MoveLineWithoutPackageModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? productId = freezed,Object? quantity = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,productId: freezed == productId ? _self.productId : productId // ignore: cast_nullable_to_non_nullable
as ProductModel?,quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable
as double?,
));
}
/// Create a copy of MoveLineWithoutPackageModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ProductModelCopyWith<$Res>? get productId {
if (_self.productId == null) {
return null;
}
return $ProductModelCopyWith<$Res>(_self.productId!, (value) {
return _then(_self.copyWith(productId: value));
});
}
}
/// @nodoc
@JsonSerializable()
class _MoveLineWithoutPackageModel implements MoveLineWithoutPackageModel {
const _MoveLineWithoutPackageModel({this.id, this.productId, this.quantity});
factory _MoveLineWithoutPackageModel.fromJson(Map<String, dynamic> json) => _$MoveLineWithoutPackageModelFromJson(json);
@override final int? id;
@override final ProductModel? productId;
@override final double? quantity;
/// Create a copy of MoveLineWithoutPackageModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$MoveLineWithoutPackageModelCopyWith<_MoveLineWithoutPackageModel> get copyWith => __$MoveLineWithoutPackageModelCopyWithImpl<_MoveLineWithoutPackageModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$MoveLineWithoutPackageModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _MoveLineWithoutPackageModel&&(identical(other.id, id) || other.id == id)&&(identical(other.productId, productId) || other.productId == productId)&&(identical(other.quantity, quantity) || other.quantity == quantity));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,productId,quantity);
@override
String toString() {
return 'MoveLineWithoutPackageModel(id: $id, productId: $productId, quantity: $quantity)';
}
}
/// @nodoc
abstract mixin class _$MoveLineWithoutPackageModelCopyWith<$Res> implements $MoveLineWithoutPackageModelCopyWith<$Res> {
factory _$MoveLineWithoutPackageModelCopyWith(_MoveLineWithoutPackageModel value, $Res Function(_MoveLineWithoutPackageModel) _then) = __$MoveLineWithoutPackageModelCopyWithImpl;
@override @useResult
$Res call({
int? id, ProductModel? productId, double? quantity
});
@override $ProductModelCopyWith<$Res>? get productId;
}
/// @nodoc
class __$MoveLineWithoutPackageModelCopyWithImpl<$Res>
implements _$MoveLineWithoutPackageModelCopyWith<$Res> {
__$MoveLineWithoutPackageModelCopyWithImpl(this._self, this._then);
final _MoveLineWithoutPackageModel _self;
final $Res Function(_MoveLineWithoutPackageModel) _then;
/// Create a copy of MoveLineWithoutPackageModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? productId = freezed,Object? quantity = freezed,}) {
return _then(_MoveLineWithoutPackageModel(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,productId: freezed == productId ? _self.productId : productId // ignore: cast_nullable_to_non_nullable
as ProductModel?,quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable
as double?,
));
}
/// Create a copy of MoveLineWithoutPackageModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ProductModelCopyWith<$Res>? get productId {
if (_self.productId == null) {
return null;
}
return $ProductModelCopyWith<$Res>(_self.productId!, (value) {
return _then(_self.copyWith(productId: value));
});
}
}
/// @nodoc
mixin _$MoveWithoutPackageModel {
int? get id; ProductModel? get productId; double? get quantity; double? get productUomQty;
/// Create a copy of MoveWithoutPackageModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$MoveWithoutPackageModelCopyWith<MoveWithoutPackageModel> get copyWith => _$MoveWithoutPackageModelCopyWithImpl<MoveWithoutPackageModel>(this as MoveWithoutPackageModel, _$identity);
/// Serializes this MoveWithoutPackageModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is MoveWithoutPackageModel&&(identical(other.id, id) || other.id == id)&&(identical(other.productId, productId) || other.productId == productId)&&(identical(other.quantity, quantity) || other.quantity == quantity)&&(identical(other.productUomQty, productUomQty) || other.productUomQty == productUomQty));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,productId,quantity,productUomQty);
@override
String toString() {
return 'MoveWithoutPackageModel(id: $id, productId: $productId, quantity: $quantity, productUomQty: $productUomQty)';
}
}
/// @nodoc
abstract mixin class $MoveWithoutPackageModelCopyWith<$Res> {
factory $MoveWithoutPackageModelCopyWith(MoveWithoutPackageModel value, $Res Function(MoveWithoutPackageModel) _then) = _$MoveWithoutPackageModelCopyWithImpl;
@useResult
$Res call({
int? id, ProductModel? productId, double? quantity, double? productUomQty
});
$ProductModelCopyWith<$Res>? get productId;
}
/// @nodoc
class _$MoveWithoutPackageModelCopyWithImpl<$Res>
implements $MoveWithoutPackageModelCopyWith<$Res> {
_$MoveWithoutPackageModelCopyWithImpl(this._self, this._then);
final MoveWithoutPackageModel _self;
final $Res Function(MoveWithoutPackageModel) _then;
/// Create a copy of MoveWithoutPackageModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? productId = freezed,Object? quantity = freezed,Object? productUomQty = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,productId: freezed == productId ? _self.productId : productId // ignore: cast_nullable_to_non_nullable
as ProductModel?,quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable
as double?,productUomQty: freezed == productUomQty ? _self.productUomQty : productUomQty // ignore: cast_nullable_to_non_nullable
as double?,
));
}
/// Create a copy of MoveWithoutPackageModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ProductModelCopyWith<$Res>? get productId {
if (_self.productId == null) {
return null;
}
return $ProductModelCopyWith<$Res>(_self.productId!, (value) {
return _then(_self.copyWith(productId: value));
});
}
}
/// @nodoc
@JsonSerializable()
class _MoveWithoutPackageModel implements MoveWithoutPackageModel {
const _MoveWithoutPackageModel({this.id, this.productId, this.quantity, this.productUomQty});
factory _MoveWithoutPackageModel.fromJson(Map<String, dynamic> json) => _$MoveWithoutPackageModelFromJson(json);
@override final int? id;
@override final ProductModel? productId;
@override final double? quantity;
@override final double? productUomQty;
/// Create a copy of MoveWithoutPackageModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$MoveWithoutPackageModelCopyWith<_MoveWithoutPackageModel> get copyWith => __$MoveWithoutPackageModelCopyWithImpl<_MoveWithoutPackageModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$MoveWithoutPackageModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _MoveWithoutPackageModel&&(identical(other.id, id) || other.id == id)&&(identical(other.productId, productId) || other.productId == productId)&&(identical(other.quantity, quantity) || other.quantity == quantity)&&(identical(other.productUomQty, productUomQty) || other.productUomQty == productUomQty));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,productId,quantity,productUomQty);
@override
String toString() {
return 'MoveWithoutPackageModel(id: $id, productId: $productId, quantity: $quantity, productUomQty: $productUomQty)';
}
}
/// @nodoc
abstract mixin class _$MoveWithoutPackageModelCopyWith<$Res> implements $MoveWithoutPackageModelCopyWith<$Res> {
factory _$MoveWithoutPackageModelCopyWith(_MoveWithoutPackageModel value, $Res Function(_MoveWithoutPackageModel) _then) = __$MoveWithoutPackageModelCopyWithImpl;
@override @useResult
$Res call({
int? id, ProductModel? productId, double? quantity, double? productUomQty
});
@override $ProductModelCopyWith<$Res>? get productId;
}
/// @nodoc
class __$MoveWithoutPackageModelCopyWithImpl<$Res>
implements _$MoveWithoutPackageModelCopyWith<$Res> {
__$MoveWithoutPackageModelCopyWithImpl(this._self, this._then);
final _MoveWithoutPackageModel _self;
final $Res Function(_MoveWithoutPackageModel) _then;
/// Create a copy of MoveWithoutPackageModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? productId = freezed,Object? quantity = freezed,Object? productUomQty = freezed,}) {
return _then(_MoveWithoutPackageModel(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,productId: freezed == productId ? _self.productId : productId // ignore: cast_nullable_to_non_nullable
as ProductModel?,quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable
as double?,productUomQty: freezed == productUomQty ? _self.productUomQty : productUomQty // ignore: cast_nullable_to_non_nullable
as double?,
));
}
/// Create a copy of MoveWithoutPackageModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ProductModelCopyWith<$Res>? get productId {
if (_self.productId == null) {
return null;
}
return $ProductModelCopyWith<$Res>(_self.productId!, (value) {
return _then(_self.copyWith(productId: value));
});
}
}
// dart format on

View File

@ -0,0 +1,129 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'stock_picking_record_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_StockPickingRecordModel _$StockPickingRecordModelFromJson(
Map<String, dynamic> json,
) => _StockPickingRecordModel(
id: (json['id'] as num?)?.toInt(),
companyId: json['company_id'] == null
? null
: StockPickingCompanyModel.fromJson(
json['company_id'] as Map<String, dynamic>,
),
priority: json['priority'] as String?,
name: json['name'] as String?,
partnerId: json['partner_id'] == null
? null
: StockPickingPartnerModel.fromJson(
json['partner_id'] as Map<String, dynamic>,
),
locationDestId: json['location_dest_id'] == null
? null
: StockPickingLocationModel.fromJson(
json['location_dest_id'] as Map<String, dynamic>,
),
locationId: json['location_id'] == null
? null
: StockPickingLocationModel.fromJson(
json['location_id'] as Map<String, dynamic>,
),
userId: json['user_id'],
scheduledDate: json['scheduled_date'] as String?,
pickingTypeCode: json['picking_type_code'] as String?,
productsAvailabilityState: json['products_availability_state'],
productsAvailability: json['products_availability'],
dateDeadline: json['date_deadline'] as String?,
dateDone: json['date_done'],
origin: json['origin'] as String?,
backorderId: json['backorder_id'],
pickingTypeId: json['picking_type_id'] == null
? null
: StockPickingTypeModel.fromJson(
json['picking_type_id'] as Map<String, dynamic>,
),
state: json['state'] as String?,
activityExceptionDecoration: json['activity_exception_decoration'],
activityExceptionIcon: json['activity_exception_icon'],
jsonPopover: json['json_popover'],
moveLineIdsWithoutPackage:
(json['move_line_ids_without_package'] as List<dynamic>?)
?.map(
(e) =>
MoveLineWithoutPackageModel.fromJson(e as Map<String, dynamic>),
)
.toList(),
moveIdsWithoutPackage: (json['move_ids_without_package'] as List<dynamic>?)
?.map((e) => MoveWithoutPackageModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$StockPickingRecordModelToJson(
_StockPickingRecordModel instance,
) => <String, dynamic>{
'id': instance.id,
'company_id': instance.companyId,
'priority': instance.priority,
'name': instance.name,
'partner_id': instance.partnerId,
'location_dest_id': instance.locationDestId,
'location_id': instance.locationId,
'user_id': instance.userId,
'scheduled_date': instance.scheduledDate,
'picking_type_code': instance.pickingTypeCode,
'products_availability_state': instance.productsAvailabilityState,
'products_availability': instance.productsAvailability,
'date_deadline': instance.dateDeadline,
'date_done': instance.dateDone,
'origin': instance.origin,
'backorder_id': instance.backorderId,
'picking_type_id': instance.pickingTypeId,
'state': instance.state,
'activity_exception_decoration': instance.activityExceptionDecoration,
'activity_exception_icon': instance.activityExceptionIcon,
'json_popover': instance.jsonPopover,
'move_line_ids_without_package': instance.moveLineIdsWithoutPackage,
'move_ids_without_package': instance.moveIdsWithoutPackage,
};
_MoveLineWithoutPackageModel _$MoveLineWithoutPackageModelFromJson(
Map<String, dynamic> json,
) => _MoveLineWithoutPackageModel(
id: (json['id'] as num?)?.toInt(),
productId: json['productId'] == null
? null
: ProductModel.fromJson(json['productId'] as Map<String, dynamic>),
quantity: (json['quantity'] as num?)?.toDouble(),
);
Map<String, dynamic> _$MoveLineWithoutPackageModelToJson(
_MoveLineWithoutPackageModel instance,
) => <String, dynamic>{
'id': instance.id,
'productId': instance.productId,
'quantity': instance.quantity,
};
_MoveWithoutPackageModel _$MoveWithoutPackageModelFromJson(
Map<String, dynamic> json,
) => _MoveWithoutPackageModel(
id: (json['id'] as num?)?.toInt(),
productId: json['productId'] == null
? null
: ProductModel.fromJson(json['productId'] as Map<String, dynamic>),
quantity: (json['quantity'] as num?)?.toDouble(),
productUomQty: (json['productUomQty'] as num?)?.toDouble(),
);
Map<String, dynamic> _$MoveWithoutPackageModelToJson(
_MoveWithoutPackageModel instance,
) => <String, dynamic>{
'id': instance.id,
'productId': instance.productId,
'quantity': instance.quantity,
'productUomQty': instance.productUomQty,
};

View File

@ -69,13 +69,6 @@ class _ProductScannedComponentState extends State<ProductScannedComponent> {
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 8,
children: [
Align(
alignment: Alignment.topCenter,
child: Image.network(
widget.productStruct.image ?? '',
height: MediaQuery.sizeOf(context).height * .12,
),
),
SizedBox(height: 15),
Divider(
height: 1.0,
@ -102,7 +95,7 @@ class _ProductScannedComponentState extends State<ProductScannedComponent> {
Text('Produit: '),
Expanded(
child: Text(
widget.productStruct.name ?? '',
widget.productStruct.displayName ?? '',
textAlign: TextAlign.end,
),
),
@ -113,14 +106,6 @@ class _ProductScannedComponentState extends State<ProductScannedComponent> {
thickness: 1.0,
color: Colors.grey.shade300,
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('Quantité:'),
Text(widget.productStruct.quantity ?? ''),
],
),
Divider(
height: 1.0,
thickness: 1.0,

View File

@ -1,4 +1,4 @@
import 'package:e_scan/backend/schema/stock_picking/stock_picking_model.dart';
import 'package:e_scan/backend/schema/stock_picking/stock_picking_record_model.dart';
import 'package:e_scan/components/components.dart';
import 'package:e_scan/pages/operation/reception/reception_details_page_model.dart';
import 'package:e_scan/router/go_secure_router_builder.dart';

View File

@ -1,5 +1,5 @@
import 'package:e_scan/backend/api/api_calls.dart';
import 'package:e_scan/backend/schema/stock_picking/stock_picking_model.dart';
import 'package:e_scan/backend/schema/stock_picking/stock_picking_record_model.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

View File

@ -1,4 +1,4 @@
import 'package:e_scan/backend/schema/stock_picking/stock_picking_model.dart';
import 'package:e_scan/backend/schema/stock_picking/stock_picking_record_model.dart';
import 'package:e_scan/components/components.dart';
import 'package:e_scan/pages/operation/reception/reception_page_model.dart';
import 'package:e_scan/router/go_secure_router_builder.dart';

View File

@ -33,11 +33,8 @@ class _ProductFormPageState extends ConsumerState<ProductFormPage> {
.getProductLocal(
id: widget.id,
onSuccess: (value) {
name.text = value?.name ?? '';
name.text = value?.displayName ?? '';
code.text = value?.id.toString() ?? '';
description.text = value?.description ?? '';
price.text = value?.price ?? '';
quantity.text = value?.quantity ?? '';
},
);
});

View File

@ -62,18 +62,8 @@ class _ProductListPageState extends ConsumerState<ProductListPage> {
onTap: () {
ProductFormRoute(id: product.id).push(context);
},
leading: Container(
height: 60,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(60),
image: DecorationImage(
image: NetworkImage(product.image ?? ''),
),
),
),
title: Text(
product.name ?? '',
product.displayName ?? '',
style: AppTheme.of(context).titleMedium,
),
subtitle: Column(
@ -83,10 +73,6 @@ class _ProductListPageState extends ConsumerState<ProductListPage> {
"Code: ${product.id}",
style: AppTheme.of(context).bodyMedium,
),
Text(
"Quatité: ${product.quantity ?? ''}",
style: AppTheme.of(context).bodyMedium,
),
],
),
trailing: IconButton(

View File

@ -110,10 +110,7 @@ class _ScannerPageState extends ConsumerState<ScannerPage>
debugPrint('Image : ${product["image_url"]}');
final productStruct = ProductModel(
id: int.parse(product["id"]),
image: product["image_thumb_url"],
name: product["generic_name"],
description: product["product_name"],
quantity: product["quantity"],
displayName: product["generic_name"],
);
Box<ProductEntity> productStore = objectboxManager.store
.box<ProductEntity>();
@ -150,7 +147,7 @@ class _ScannerPageState extends ConsumerState<ScannerPage>
unawaited(_subscription?.cancel());
_subscription = null;
unawaited(mobileScannerController.stop());
ProductFormRoute(id: productStruct.id).push(context);
ProductFormRoute(id: productStruct.id ?? 0).push(context);
},
),
),
@ -184,10 +181,7 @@ class _ScannerPageState extends ConsumerState<ScannerPage>
debugPrint('Image : ${product["image_url"]}');
final productStruct = ProductModel(
id: int.parse(product["id"]),
image: product["image_thumb_url"],
name: product["generic_name"],
description: product["product_name"],
quantity: product["quantity"],
displayName: product["generic_name"],
);
Box<ProductEntity> productStore = objectboxManager.store
.box<ProductEntity>();
@ -224,7 +218,7 @@ class _ScannerPageState extends ConsumerState<ScannerPage>
unawaited(_subscription?.cancel());
_subscription = null;
unawaited(mobileScannerController.stop());
ProductFormRoute(id: productStruct.id).push(context);
ProductFormRoute(id: productStruct.id ?? 0).push(context);
},
),
),