import 'package:json_annotation/json_annotation.dart';

part 'cancellation_reason.g.dart';

@JsonEnum(fieldRename: FieldRename.snake)
enum CancellationReason {
  sickLeave,
  vacation,
  other,
  health,
  transportation,
  personal,
  scheduleConflict,
}

@JsonSerializable(fieldRename: FieldRename.snake)
class CancellationReasonModel {
  final String type;
  final CancellationReason? reason;
  final String? details;

  CancellationReasonModel({
    required this.type,
    required this.reason,
    required this.details,
  });

  factory CancellationReasonModel.fromJson(Map<String, dynamic> json) {
      return _$CancellationReasonModelFromJson(json);
    }

  Map<String, dynamic> toJson() => _$CancellationReasonModelToJson(this);
}
