Files
Kifi/kifi-app/lib/features/inventory/domain/inventory_movement.dart
2026-08-16 22:51:34 +05:30

76 lines
1.6 KiB
Dart

class InventoryMovementItem {
final int? id;
final int? movementId;
final int productId;
final double quantity;
final double? unitPrice;
InventoryMovementItem({
this.id,
this.movementId,
required this.productId,
required this.quantity,
this.unitPrice,
});
factory InventoryMovementItem.fromJson(Map<String, dynamic> json) {
return InventoryMovementItem(
id: json['id'],
movementId: json['movementId'],
productId: json['productId'],
quantity: (json['quantity'] as num).toDouble(),
unitPrice: (json['unitPrice'] as num?)?.toDouble(),
);
}
Map<String, dynamic> toJson() {
return {
'id': id,
'movementId': movementId,
'productId': productId,
'quantity': quantity,
'unitPrice': unitPrice,
};
}
}
class InventoryMovement {
final int? id;
final int? userId;
final int locationId;
final String type;
final int? referenceTransactionId;
final String? notes;
InventoryMovement({
this.id,
this.userId,
required this.locationId,
required this.type,
this.referenceTransactionId,
this.notes,
});
factory InventoryMovement.fromJson(Map<String, dynamic> json) {
return InventoryMovement(
id: json['id'],
userId: json['userId'],
locationId: json['locationId'],
type: json['type'],
referenceTransactionId: json['referenceTransactionId'],
notes: json['notes'],
);
}
Map<String, dynamic> toJson() {
return {
'id': id,
'userId': userId,
'locationId': locationId,
'type': type,
'referenceTransactionId': referenceTransactionId,
'notes': notes,
};
}
}