import 'package:json_annotation/json_annotation.dart';

part 'staff_cancel_reason.g.dart';

@JsonEnum(fieldRename: FieldRename.snake)
enum StaffCancelReasonType {
  cancelShift,
  declineShift,
  noBreak
}

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

@JsonSerializable(fieldRename: FieldRename.snake)
class StaffCancelReason {
  @JsonKey(unknownEnumValue: StaffCancelReasonType.cancelShift)
  final StaffCancelReasonType? type;
  @JsonKey(unknownEnumValue: ShiftCancelReason.sickLeave)
  final ShiftCancelReason? reason;
  final String? details;

  StaffCancelReason(
      {required this.type, required this.reason, required this.details});
  
  factory StaffCancelReason.fromJson(Map<String, dynamic> json) {
      return _$StaffCancelReasonFromJson(json);
    }
  
  Map<String, dynamic> toJson() => _$StaffCancelReasonToJson(this);
}
