class Smena {
  final int? id;
  final DateTime? startedAt;
  final DateTime? endedAt;
  final String? message;

  Smena({this.id, this.startedAt, this.endedAt, this.message});

  static Smena fromJson(Map<String, dynamic> data) => Smena(
        id: data['id'],
        message: data['message'],
        startedAt:
            data['started_at'] != null
            ? DateTime.parse(data['started_at'])
            : null,
        endedAt:
            data['ended_at'] != null
            ? DateTime.parse(data['ended_at'])
            : null,
      );
}
