made end time optional on time entry

This commit is contained in:
2025-01-01 22:00:26 +00:00
parent ac0a5e994f
commit bdbf4659e0
13 changed files with 374 additions and 148 deletions
@@ -37,7 +37,6 @@ class ProjectCreateDto with _$ProjectCreateDto {
@freezed
class ProjectUpdateDto with _$ProjectUpdateDto {
const factory ProjectUpdateDto({
required String id,
String? name,
String? description,
String? clientId,
@@ -509,7 +509,6 @@ ProjectUpdateDto _$ProjectUpdateDtoFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$ProjectUpdateDto {
String get id => throw _privateConstructorUsedError;
String? get name => throw _privateConstructorUsedError;
String? get description => throw _privateConstructorUsedError;
String? get clientId => throw _privateConstructorUsedError;
@@ -532,11 +531,7 @@ abstract class $ProjectUpdateDtoCopyWith<$Res> {
_$ProjectUpdateDtoCopyWithImpl<$Res, ProjectUpdateDto>;
@useResult
$Res call(
{String id,
String? name,
String? description,
String? clientId,
String? userId});
{String? name, String? description, String? clientId, String? userId});
}
/// @nodoc
@@ -554,17 +549,12 @@ class _$ProjectUpdateDtoCopyWithImpl<$Res, $Val extends ProjectUpdateDto>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? name = freezed,
Object? description = freezed,
Object? clientId = freezed,
Object? userId = freezed,
}) {
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
name: freezed == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
@@ -594,11 +584,7 @@ abstract class _$$ProjectUpdateDtoImplCopyWith<$Res>
@override
@useResult
$Res call(
{String id,
String? name,
String? description,
String? clientId,
String? userId});
{String? name, String? description, String? clientId, String? userId});
}
/// @nodoc
@@ -614,17 +600,12 @@ class __$$ProjectUpdateDtoImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? name = freezed,
Object? description = freezed,
Object? clientId = freezed,
Object? userId = freezed,
}) {
return _then(_$ProjectUpdateDtoImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
name: freezed == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
@@ -649,17 +630,11 @@ class __$$ProjectUpdateDtoImplCopyWithImpl<$Res>
@JsonSerializable()
class _$ProjectUpdateDtoImpl implements _ProjectUpdateDto {
const _$ProjectUpdateDtoImpl(
{required this.id,
this.name,
this.description,
this.clientId,
this.userId});
{this.name, this.description, this.clientId, this.userId});
factory _$ProjectUpdateDtoImpl.fromJson(Map<String, dynamic> json) =>
_$$ProjectUpdateDtoImplFromJson(json);
@override
final String id;
@override
final String? name;
@override
@@ -671,7 +646,7 @@ class _$ProjectUpdateDtoImpl implements _ProjectUpdateDto {
@override
String toString() {
return 'ProjectUpdateDto(id: $id, name: $name, description: $description, clientId: $clientId, userId: $userId)';
return 'ProjectUpdateDto(name: $name, description: $description, clientId: $clientId, userId: $userId)';
}
@override
@@ -679,7 +654,6 @@ class _$ProjectUpdateDtoImpl implements _ProjectUpdateDto {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ProjectUpdateDtoImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.description, description) ||
other.description == description) &&
@@ -691,7 +665,7 @@ class _$ProjectUpdateDtoImpl implements _ProjectUpdateDto {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, id, name, description, clientId, userId);
Object.hash(runtimeType, name, description, clientId, userId);
/// Create a copy of ProjectUpdateDto
/// with the given fields replaced by the non-null parameter values.
@@ -712,8 +686,7 @@ class _$ProjectUpdateDtoImpl implements _ProjectUpdateDto {
abstract class _ProjectUpdateDto implements ProjectUpdateDto {
const factory _ProjectUpdateDto(
{required final String id,
final String? name,
{final String? name,
final String? description,
final String? clientId,
final String? userId}) = _$ProjectUpdateDtoImpl;
@@ -721,8 +694,6 @@ abstract class _ProjectUpdateDto implements ProjectUpdateDto {
factory _ProjectUpdateDto.fromJson(Map<String, dynamic> json) =
_$ProjectUpdateDtoImpl.fromJson;
@override
String get id;
@override
String? get name;
@override
@@ -49,7 +49,6 @@ Map<String, dynamic> _$$ProjectCreateDtoImplToJson(
_$ProjectUpdateDtoImpl _$$ProjectUpdateDtoImplFromJson(
Map<String, dynamic> json) =>
_$ProjectUpdateDtoImpl(
id: json['id'] as String,
name: json['name'] as String?,
description: json['description'] as String?,
clientId: json['clientId'] as String?,
@@ -59,7 +58,6 @@ _$ProjectUpdateDtoImpl _$$ProjectUpdateDtoImplFromJson(
Map<String, dynamic> _$$ProjectUpdateDtoImplToJson(
_$ProjectUpdateDtoImpl instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
'description': instance.description,
'clientId': instance.clientId,
@@ -8,7 +8,7 @@ class TimeEntryDto with _$TimeEntryDto {
const factory TimeEntryDto({
required String id,
required DateTime startTime,
required DateTime endTime,
required DateTime? endTime,
String? description,
required String userId,
required String projectId,
@@ -25,7 +25,7 @@ class TimeEntryDto with _$TimeEntryDto {
class TimeEntryCreateDto with _$TimeEntryCreateDto {
const factory TimeEntryCreateDto({
required DateTime startTime,
required DateTime endTime,
DateTime? endTime,
String? description,
required String userId,
required String projectId,
@@ -22,7 +22,7 @@ TimeEntryDto _$TimeEntryDtoFromJson(Map<String, dynamic> json) {
mixin _$TimeEntryDto {
String get id => throw _privateConstructorUsedError;
DateTime get startTime => throw _privateConstructorUsedError;
DateTime get endTime => throw _privateConstructorUsedError;
DateTime? get endTime => throw _privateConstructorUsedError;
String? get description => throw _privateConstructorUsedError;
String get userId => throw _privateConstructorUsedError;
String get projectId => throw _privateConstructorUsedError;
@@ -48,7 +48,7 @@ abstract class $TimeEntryDtoCopyWith<$Res> {
$Res call(
{String id,
DateTime startTime,
DateTime endTime,
DateTime? endTime,
String? description,
String userId,
String projectId,
@@ -73,7 +73,7 @@ class _$TimeEntryDtoCopyWithImpl<$Res, $Val extends TimeEntryDto>
$Res call({
Object? id = null,
Object? startTime = null,
Object? endTime = null,
Object? endTime = freezed,
Object? description = freezed,
Object? userId = null,
Object? projectId = null,
@@ -89,10 +89,10 @@ class _$TimeEntryDtoCopyWithImpl<$Res, $Val extends TimeEntryDto>
? _value.startTime
: startTime // ignore: cast_nullable_to_non_nullable
as DateTime,
endTime: null == endTime
endTime: freezed == endTime
? _value.endTime
: endTime // ignore: cast_nullable_to_non_nullable
as DateTime,
as DateTime?,
description: freezed == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
@@ -128,7 +128,7 @@ abstract class _$$TimeEntryDtoImplCopyWith<$Res>
$Res call(
{String id,
DateTime startTime,
DateTime endTime,
DateTime? endTime,
String? description,
String userId,
String projectId,
@@ -151,7 +151,7 @@ class __$$TimeEntryDtoImplCopyWithImpl<$Res>
$Res call({
Object? id = null,
Object? startTime = null,
Object? endTime = null,
Object? endTime = freezed,
Object? description = freezed,
Object? userId = null,
Object? projectId = null,
@@ -167,10 +167,10 @@ class __$$TimeEntryDtoImplCopyWithImpl<$Res>
? _value.startTime
: startTime // ignore: cast_nullable_to_non_nullable
as DateTime,
endTime: null == endTime
endTime: freezed == endTime
? _value.endTime
: endTime // ignore: cast_nullable_to_non_nullable
as DateTime,
as DateTime?,
description: freezed == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
@@ -216,7 +216,7 @@ class _$TimeEntryDtoImpl implements _TimeEntryDto {
@override
final DateTime startTime;
@override
final DateTime endTime;
final DateTime? endTime;
@override
final String? description;
@override
@@ -278,7 +278,7 @@ abstract class _TimeEntryDto implements TimeEntryDto {
const factory _TimeEntryDto(
{required final String id,
required final DateTime startTime,
required final DateTime endTime,
required final DateTime? endTime,
final String? description,
required final String userId,
required final String projectId,
@@ -293,7 +293,7 @@ abstract class _TimeEntryDto implements TimeEntryDto {
@override
DateTime get startTime;
@override
DateTime get endTime;
DateTime? get endTime;
@override
String? get description;
@override
@@ -320,7 +320,7 @@ TimeEntryCreateDto _$TimeEntryCreateDtoFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$TimeEntryCreateDto {
DateTime get startTime => throw _privateConstructorUsedError;
DateTime get endTime => throw _privateConstructorUsedError;
DateTime? get endTime => throw _privateConstructorUsedError;
String? get description => throw _privateConstructorUsedError;
String get userId => throw _privateConstructorUsedError;
String get projectId => throw _privateConstructorUsedError;
@@ -343,7 +343,7 @@ abstract class $TimeEntryCreateDtoCopyWith<$Res> {
@useResult
$Res call(
{DateTime startTime,
DateTime endTime,
DateTime? endTime,
String? description,
String userId,
String projectId});
@@ -365,7 +365,7 @@ class _$TimeEntryCreateDtoCopyWithImpl<$Res, $Val extends TimeEntryCreateDto>
@override
$Res call({
Object? startTime = null,
Object? endTime = null,
Object? endTime = freezed,
Object? description = freezed,
Object? userId = null,
Object? projectId = null,
@@ -375,10 +375,10 @@ class _$TimeEntryCreateDtoCopyWithImpl<$Res, $Val extends TimeEntryCreateDto>
? _value.startTime
: startTime // ignore: cast_nullable_to_non_nullable
as DateTime,
endTime: null == endTime
endTime: freezed == endTime
? _value.endTime
: endTime // ignore: cast_nullable_to_non_nullable
as DateTime,
as DateTime?,
description: freezed == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
@@ -405,7 +405,7 @@ abstract class _$$TimeEntryCreateDtoImplCopyWith<$Res>
@useResult
$Res call(
{DateTime startTime,
DateTime endTime,
DateTime? endTime,
String? description,
String userId,
String projectId});
@@ -425,7 +425,7 @@ class __$$TimeEntryCreateDtoImplCopyWithImpl<$Res>
@override
$Res call({
Object? startTime = null,
Object? endTime = null,
Object? endTime = freezed,
Object? description = freezed,
Object? userId = null,
Object? projectId = null,
@@ -435,10 +435,10 @@ class __$$TimeEntryCreateDtoImplCopyWithImpl<$Res>
? _value.startTime
: startTime // ignore: cast_nullable_to_non_nullable
as DateTime,
endTime: null == endTime
endTime: freezed == endTime
? _value.endTime
: endTime // ignore: cast_nullable_to_non_nullable
as DateTime,
as DateTime?,
description: freezed == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
@@ -460,7 +460,7 @@ class __$$TimeEntryCreateDtoImplCopyWithImpl<$Res>
class _$TimeEntryCreateDtoImpl implements _TimeEntryCreateDto {
const _$TimeEntryCreateDtoImpl(
{required this.startTime,
required this.endTime,
this.endTime,
this.description,
required this.userId,
required this.projectId});
@@ -471,7 +471,7 @@ class _$TimeEntryCreateDtoImpl implements _TimeEntryCreateDto {
@override
final DateTime startTime;
@override
final DateTime endTime;
final DateTime? endTime;
@override
final String? description;
@override
@@ -524,7 +524,7 @@ class _$TimeEntryCreateDtoImpl implements _TimeEntryCreateDto {
abstract class _TimeEntryCreateDto implements TimeEntryCreateDto {
const factory _TimeEntryCreateDto(
{required final DateTime startTime,
required final DateTime endTime,
final DateTime? endTime,
final String? description,
required final String userId,
required final String projectId}) = _$TimeEntryCreateDtoImpl;
@@ -535,7 +535,7 @@ abstract class _TimeEntryCreateDto implements TimeEntryCreateDto {
@override
DateTime get startTime;
@override
DateTime get endTime;
DateTime? get endTime;
@override
String? get description;
@override
@@ -10,7 +10,9 @@ _$TimeEntryDtoImpl _$$TimeEntryDtoImplFromJson(Map<String, dynamic> json) =>
_$TimeEntryDtoImpl(
id: json['id'] as String,
startTime: DateTime.parse(json['startTime'] as String),
endTime: DateTime.parse(json['endTime'] as String),
endTime: json['endTime'] == null
? null
: DateTime.parse(json['endTime'] as String),
description: json['description'] as String?,
userId: json['userId'] as String,
projectId: json['projectId'] as String,
@@ -22,7 +24,7 @@ Map<String, dynamic> _$$TimeEntryDtoImplToJson(_$TimeEntryDtoImpl instance) =>
<String, dynamic>{
'id': instance.id,
'startTime': instance.startTime.toIso8601String(),
'endTime': instance.endTime.toIso8601String(),
'endTime': instance.endTime?.toIso8601String(),
'description': instance.description,
'userId': instance.userId,
'projectId': instance.projectId,
@@ -34,7 +36,9 @@ _$TimeEntryCreateDtoImpl _$$TimeEntryCreateDtoImplFromJson(
Map<String, dynamic> json) =>
_$TimeEntryCreateDtoImpl(
startTime: DateTime.parse(json['startTime'] as String),
endTime: DateTime.parse(json['endTime'] as String),
endTime: json['endTime'] == null
? null
: DateTime.parse(json['endTime'] as String),
description: json['description'] as String?,
userId: json['userId'] as String,
projectId: json['projectId'] as String,
@@ -44,7 +48,7 @@ Map<String, dynamic> _$$TimeEntryCreateDtoImplToJson(
_$TimeEntryCreateDtoImpl instance) =>
<String, dynamic>{
'startTime': instance.startTime.toIso8601String(),
'endTime': instance.endTime.toIso8601String(),
'endTime': instance.endTime?.toIso8601String(),
'description': instance.description,
'userId': instance.userId,
'projectId': instance.projectId,