fdsg
This commit is contained in:
@@ -3,7 +3,7 @@ import 'package:equatable/equatable.dart';
|
||||
class ShipmentDocumentModel extends Equatable {
|
||||
final String? id;
|
||||
final String companyId;
|
||||
final String ticketId;
|
||||
final List<String> ticketIds;
|
||||
final String providerId;
|
||||
final String destinationLocationId;
|
||||
final String docNumber;
|
||||
@@ -16,7 +16,7 @@ class ShipmentDocumentModel extends Equatable {
|
||||
const ShipmentDocumentModel({
|
||||
this.id,
|
||||
required this.companyId,
|
||||
required this.ticketId,
|
||||
required this.ticketIds,
|
||||
required this.providerId,
|
||||
required this.destinationLocationId,
|
||||
required this.docNumber,
|
||||
@@ -27,11 +27,40 @@ class ShipmentDocumentModel extends Equatable {
|
||||
this.notes,
|
||||
});
|
||||
|
||||
ShipmentDocumentModel copyWith({
|
||||
String? id,
|
||||
String? companyId,
|
||||
List<String>? ticketIds,
|
||||
String? providerId,
|
||||
String? destinationLocationId,
|
||||
String? docNumber,
|
||||
DateTime? docDate,
|
||||
int? packageCount,
|
||||
double? weight,
|
||||
String? shippingReason,
|
||||
String? notes,
|
||||
}) {
|
||||
return ShipmentDocumentModel(
|
||||
id: id ?? this.id,
|
||||
companyId: companyId ?? this.companyId,
|
||||
ticketIds: ticketIds ?? this.ticketIds,
|
||||
providerId: providerId ?? this.providerId,
|
||||
destinationLocationId:
|
||||
destinationLocationId ?? this.destinationLocationId,
|
||||
docNumber: docNumber ?? this.docNumber,
|
||||
docDate: docDate ?? this.docDate,
|
||||
packageCount: packageCount ?? this.packageCount,
|
||||
weight: weight ?? this.weight,
|
||||
shippingReason: shippingReason ?? this.shippingReason,
|
||||
notes: notes ?? this.notes,
|
||||
);
|
||||
}
|
||||
|
||||
factory ShipmentDocumentModel.fromMap(Map<String, dynamic> map) {
|
||||
return ShipmentDocumentModel(
|
||||
id: map['id'],
|
||||
companyId: map['company_id'],
|
||||
ticketId: map['ticket_id'],
|
||||
ticketIds: List<String>.from(map['ticket_ids']),
|
||||
providerId: map['provider_id'],
|
||||
destinationLocationId: map['destination_location_id'],
|
||||
docNumber: map['doc_number'],
|
||||
@@ -47,7 +76,7 @@ class ShipmentDocumentModel extends Equatable {
|
||||
return {
|
||||
if (id != null) 'id': id,
|
||||
'company_id': companyId,
|
||||
'ticket_id': ticketId,
|
||||
'ticket_ids': ticketIds,
|
||||
'provider_id': providerId,
|
||||
'destination_location_id': destinationLocationId,
|
||||
'doc_number': docNumber,
|
||||
@@ -60,5 +89,5 @@ class ShipmentDocumentModel extends Equatable {
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, docNumber, ticketId];
|
||||
List<Object?> get props => [id, docNumber, ticketIds];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user