Operation.legacy constructor

Operation.legacy({
  1. required OperationType type,
  2. required EntityId entityId,
  3. String? attribute,
  4. dynamic value,
  5. dynamic oldValue,
})

Implementation

factory Operation.legacy({
  required OperationType type,
  required EntityId entityId,
  String? attribute,
  dynamic value,
  dynamic oldValue,
}) {
  final data = <String, dynamic>{};
  if (attribute != null && value != null) {
    data[attribute] = value;
  }
  return Operation(
    type: type,
    entityType: 'unknown', // Will be set properly by transaction builder
    entityId: entityId,
    data: data.isEmpty ? null : data,
  );
}