Reservation constructor

const Reservation({
  1. required String uid,
  2. required String subjectUid,
  3. required String objectType,
  4. required String objectUid,
  5. @JsonKey.new(fromJson: timestampListToDateTimeList, toJson: dateTimeListToTimestampList) @FormArrayAnnotation.new<dynamic>() @Default.new([]) List<DateTime> reservedDateTimes,
  6. @FormControlAnnotation.new<dynamic>() @ReservationStateConverter() ReservationState? reservationState,
  7. @JsonKey.new(fromJson: timestampToDateTime, toJson: dateTimeToTimestamp) required DateTime createdAt,
  8. @JsonKey.new(fromJson: timestampToDateTime, toJson: dateTimeToTimestamp) required DateTime updatedAt,
  9. @FormArrayAnnotation.new<dynamic>() List<String>? filePaths,
})

Implementation

const factory Reservation({
  required String uid,
  required String subjectUid,
  required String objectType,
  required String objectUid,
  @JsonKey(
      fromJson: timestampListToDateTimeList,
      toJson: dateTimeListToTimestampList)
  @RfArray()
  @Default([])
  List<DateTime> reservedDateTimes,
  // @JsonSerializable(
  // explicitToJson: true,
  // converters: [ReservationStateConverter()],
  // )
  @RfControl()
  @ReservationStateConverter()
  ReservationState? reservationState,
  @JsonKey(fromJson: timestampToDateTime, toJson: dateTimeToTimestamp)
  required DateTime createdAt,
  // required String updatedAt,
  @JsonKey(fromJson: timestampToDateTime, toJson: dateTimeToTimestamp)
  required DateTime updatedAt,
  @RfArray() List<String>? filePaths,
}) = _Reservation;