toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() => {
      'id': id,
      'name': name,
      'startedAt': startedAt.toIso8601String(),
      if (endedAt != null) 'endedAt': endedAt!.toIso8601String(),
      'firstSeq': firstSeq,
      if (lastSeq != null) 'lastSeq': lastSeq,
      'isActive': isActive,
      if (notes.isNotEmpty) 'notes': notes.map((n) => n.toJson()).toList(),
    };