refactor
This commit is contained in:
+2703
File diff suppressed because it is too large
Load Diff
+531
@@ -0,0 +1,531 @@
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'model.dart' as _i1;
|
||||
import 'prisma.dart' as _i2;
|
||||
|
||||
class ProjectTaskDbo {
|
||||
const ProjectTaskDbo({
|
||||
this.id,
|
||||
this.name,
|
||||
this.description,
|
||||
this.projectId,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.project,
|
||||
});
|
||||
|
||||
factory ProjectTaskDbo.fromJson(Map json) => ProjectTaskDbo(
|
||||
id: json['id'],
|
||||
name: json['name'],
|
||||
description: json['description'],
|
||||
projectId: json['projectId'],
|
||||
createdAt: switch (json['createdAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['createdAt']
|
||||
},
|
||||
updatedAt: switch (json['updatedAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['updatedAt']
|
||||
},
|
||||
project: json['project'] is Map
|
||||
? _i1.ProjectDbo.fromJson(json['project'])
|
||||
: null,
|
||||
);
|
||||
|
||||
final String? id;
|
||||
|
||||
final String? name;
|
||||
|
||||
final String? description;
|
||||
|
||||
final String? projectId;
|
||||
|
||||
final DateTime? createdAt;
|
||||
|
||||
final DateTime? updatedAt;
|
||||
|
||||
final _i1.ProjectDbo? project;
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'id': id,
|
||||
'name': name,
|
||||
'description': description,
|
||||
'projectId': projectId,
|
||||
'createdAt': createdAt?.toIso8601String(),
|
||||
'updatedAt': updatedAt?.toIso8601String(),
|
||||
'project': project?.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class TimeEntryDbo {
|
||||
const TimeEntryDbo({
|
||||
this.id,
|
||||
this.startTime,
|
||||
this.endTime,
|
||||
this.description,
|
||||
this.userId,
|
||||
this.projectId,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.user,
|
||||
this.project,
|
||||
});
|
||||
|
||||
factory TimeEntryDbo.fromJson(Map json) => TimeEntryDbo(
|
||||
id: json['id'],
|
||||
startTime: switch (json['startTime']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['startTime']
|
||||
},
|
||||
endTime: switch (json['endTime']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['endTime']
|
||||
},
|
||||
description: json['description'],
|
||||
userId: json['userId'],
|
||||
projectId: json['projectId'],
|
||||
createdAt: switch (json['createdAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['createdAt']
|
||||
},
|
||||
updatedAt: switch (json['updatedAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['updatedAt']
|
||||
},
|
||||
user: json['user'] is Map ? _i1.UserDbo.fromJson(json['user']) : null,
|
||||
project: json['project'] is Map
|
||||
? _i1.ProjectDbo.fromJson(json['project'])
|
||||
: null,
|
||||
);
|
||||
|
||||
final String? id;
|
||||
|
||||
final DateTime? startTime;
|
||||
|
||||
final DateTime? endTime;
|
||||
|
||||
final String? description;
|
||||
|
||||
final String? userId;
|
||||
|
||||
final String? projectId;
|
||||
|
||||
final DateTime? createdAt;
|
||||
|
||||
final DateTime? updatedAt;
|
||||
|
||||
final _i1.UserDbo? user;
|
||||
|
||||
final _i1.ProjectDbo? project;
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'id': id,
|
||||
'startTime': startTime?.toIso8601String(),
|
||||
'endTime': endTime?.toIso8601String(),
|
||||
'description': description,
|
||||
'userId': userId,
|
||||
'projectId': projectId,
|
||||
'createdAt': createdAt?.toIso8601String(),
|
||||
'updatedAt': updatedAt?.toIso8601String(),
|
||||
'user': user?.toJson(),
|
||||
'project': project?.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class ProjectDbo {
|
||||
const ProjectDbo({
|
||||
this.id,
|
||||
this.name,
|
||||
this.description,
|
||||
this.clientId,
|
||||
this.userId,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.tasks,
|
||||
this.timeEntries,
|
||||
this.user,
|
||||
this.$count,
|
||||
});
|
||||
|
||||
factory ProjectDbo.fromJson(Map json) => ProjectDbo(
|
||||
id: json['id'],
|
||||
name: json['name'],
|
||||
description: json['description'],
|
||||
clientId: json['clientId'],
|
||||
userId: json['userId'],
|
||||
createdAt: switch (json['createdAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['createdAt']
|
||||
},
|
||||
updatedAt: switch (json['updatedAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['updatedAt']
|
||||
},
|
||||
tasks: (json['tasks'] as Iterable?)
|
||||
?.map((json) => _i1.ProjectTaskDbo.fromJson(json)),
|
||||
timeEntries: (json['timeEntries'] as Iterable?)
|
||||
?.map((json) => _i1.TimeEntryDbo.fromJson(json)),
|
||||
user: json['user'] is Map ? _i1.UserDbo.fromJson(json['user']) : null,
|
||||
$count: json['_count'] is Map
|
||||
? _i2.ProjectDboCountOutputType.fromJson(json['_count'])
|
||||
: null,
|
||||
);
|
||||
|
||||
final String? id;
|
||||
|
||||
final String? name;
|
||||
|
||||
final String? description;
|
||||
|
||||
final String? clientId;
|
||||
|
||||
final String? userId;
|
||||
|
||||
final DateTime? createdAt;
|
||||
|
||||
final DateTime? updatedAt;
|
||||
|
||||
final Iterable<_i1.ProjectTaskDbo>? tasks;
|
||||
|
||||
final Iterable<_i1.TimeEntryDbo>? timeEntries;
|
||||
|
||||
final _i1.UserDbo? user;
|
||||
|
||||
final _i2.ProjectDboCountOutputType? $count;
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'id': id,
|
||||
'name': name,
|
||||
'description': description,
|
||||
'clientId': clientId,
|
||||
'userId': userId,
|
||||
'createdAt': createdAt?.toIso8601String(),
|
||||
'updatedAt': updatedAt?.toIso8601String(),
|
||||
'tasks': tasks?.map((e) => e.toJson()),
|
||||
'timeEntries': timeEntries?.map((e) => e.toJson()),
|
||||
'user': user?.toJson(),
|
||||
'_count': $count?.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class UserDbo {
|
||||
const UserDbo({
|
||||
this.id,
|
||||
this.name,
|
||||
this.email,
|
||||
this.password,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.projects,
|
||||
this.timeEntries,
|
||||
this.$count,
|
||||
});
|
||||
|
||||
factory UserDbo.fromJson(Map json) => UserDbo(
|
||||
id: json['id'],
|
||||
name: json['name'],
|
||||
email: json['email'],
|
||||
password: json['password'],
|
||||
createdAt: switch (json['createdAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['createdAt']
|
||||
},
|
||||
updatedAt: switch (json['updatedAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['updatedAt']
|
||||
},
|
||||
projects: (json['projects'] as Iterable?)
|
||||
?.map((json) => _i1.ProjectDbo.fromJson(json)),
|
||||
timeEntries: (json['timeEntries'] as Iterable?)
|
||||
?.map((json) => _i1.TimeEntryDbo.fromJson(json)),
|
||||
$count: json['_count'] is Map
|
||||
? _i2.UserDboCountOutputType.fromJson(json['_count'])
|
||||
: null,
|
||||
);
|
||||
|
||||
final String? id;
|
||||
|
||||
final String? name;
|
||||
|
||||
final String? email;
|
||||
|
||||
final String? password;
|
||||
|
||||
final DateTime? createdAt;
|
||||
|
||||
final DateTime? updatedAt;
|
||||
|
||||
final Iterable<_i1.ProjectDbo>? projects;
|
||||
|
||||
final Iterable<_i1.TimeEntryDbo>? timeEntries;
|
||||
|
||||
final _i2.UserDboCountOutputType? $count;
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'id': id,
|
||||
'name': name,
|
||||
'email': email,
|
||||
'password': password,
|
||||
'createdAt': createdAt?.toIso8601String(),
|
||||
'updatedAt': updatedAt?.toIso8601String(),
|
||||
'projects': projects?.map((e) => e.toJson()),
|
||||
'timeEntries': timeEntries?.map((e) => e.toJson()),
|
||||
'_count': $count?.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class CreateManyUserDboAndReturnOutputType {
|
||||
const CreateManyUserDboAndReturnOutputType({
|
||||
this.id,
|
||||
this.name,
|
||||
this.email,
|
||||
this.password,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
factory CreateManyUserDboAndReturnOutputType.fromJson(Map json) =>
|
||||
CreateManyUserDboAndReturnOutputType(
|
||||
id: json['id'],
|
||||
name: json['name'],
|
||||
email: json['email'],
|
||||
password: json['password'],
|
||||
createdAt: switch (json['createdAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['createdAt']
|
||||
},
|
||||
updatedAt: switch (json['updatedAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['updatedAt']
|
||||
},
|
||||
);
|
||||
|
||||
final String? id;
|
||||
|
||||
final String? name;
|
||||
|
||||
final String? email;
|
||||
|
||||
final String? password;
|
||||
|
||||
final DateTime? createdAt;
|
||||
|
||||
final DateTime? updatedAt;
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'id': id,
|
||||
'name': name,
|
||||
'email': email,
|
||||
'password': password,
|
||||
'createdAt': createdAt?.toIso8601String(),
|
||||
'updatedAt': updatedAt?.toIso8601String(),
|
||||
};
|
||||
}
|
||||
|
||||
class CreateManyProjectDboAndReturnOutputType {
|
||||
const CreateManyProjectDboAndReturnOutputType({
|
||||
this.id,
|
||||
this.name,
|
||||
this.description,
|
||||
this.clientId,
|
||||
this.userId,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.user,
|
||||
});
|
||||
|
||||
factory CreateManyProjectDboAndReturnOutputType.fromJson(Map json) =>
|
||||
CreateManyProjectDboAndReturnOutputType(
|
||||
id: json['id'],
|
||||
name: json['name'],
|
||||
description: json['description'],
|
||||
clientId: json['clientId'],
|
||||
userId: json['userId'],
|
||||
createdAt: switch (json['createdAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['createdAt']
|
||||
},
|
||||
updatedAt: switch (json['updatedAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['updatedAt']
|
||||
},
|
||||
user: json['user'] is Map ? _i1.UserDbo.fromJson(json['user']) : null,
|
||||
);
|
||||
|
||||
final String? id;
|
||||
|
||||
final String? name;
|
||||
|
||||
final String? description;
|
||||
|
||||
final String? clientId;
|
||||
|
||||
final String? userId;
|
||||
|
||||
final DateTime? createdAt;
|
||||
|
||||
final DateTime? updatedAt;
|
||||
|
||||
final _i1.UserDbo? user;
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'id': id,
|
||||
'name': name,
|
||||
'description': description,
|
||||
'clientId': clientId,
|
||||
'userId': userId,
|
||||
'createdAt': createdAt?.toIso8601String(),
|
||||
'updatedAt': updatedAt?.toIso8601String(),
|
||||
'user': user?.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class CreateManyTimeEntryDboAndReturnOutputType {
|
||||
const CreateManyTimeEntryDboAndReturnOutputType({
|
||||
this.id,
|
||||
this.startTime,
|
||||
this.endTime,
|
||||
this.description,
|
||||
this.userId,
|
||||
this.projectId,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.user,
|
||||
this.project,
|
||||
});
|
||||
|
||||
factory CreateManyTimeEntryDboAndReturnOutputType.fromJson(Map json) =>
|
||||
CreateManyTimeEntryDboAndReturnOutputType(
|
||||
id: json['id'],
|
||||
startTime: switch (json['startTime']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['startTime']
|
||||
},
|
||||
endTime: switch (json['endTime']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['endTime']
|
||||
},
|
||||
description: json['description'],
|
||||
userId: json['userId'],
|
||||
projectId: json['projectId'],
|
||||
createdAt: switch (json['createdAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['createdAt']
|
||||
},
|
||||
updatedAt: switch (json['updatedAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['updatedAt']
|
||||
},
|
||||
user: json['user'] is Map ? _i1.UserDbo.fromJson(json['user']) : null,
|
||||
project: json['project'] is Map
|
||||
? _i1.ProjectDbo.fromJson(json['project'])
|
||||
: null,
|
||||
);
|
||||
|
||||
final String? id;
|
||||
|
||||
final DateTime? startTime;
|
||||
|
||||
final DateTime? endTime;
|
||||
|
||||
final String? description;
|
||||
|
||||
final String? userId;
|
||||
|
||||
final String? projectId;
|
||||
|
||||
final DateTime? createdAt;
|
||||
|
||||
final DateTime? updatedAt;
|
||||
|
||||
final _i1.UserDbo? user;
|
||||
|
||||
final _i1.ProjectDbo? project;
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'id': id,
|
||||
'startTime': startTime?.toIso8601String(),
|
||||
'endTime': endTime?.toIso8601String(),
|
||||
'description': description,
|
||||
'userId': userId,
|
||||
'projectId': projectId,
|
||||
'createdAt': createdAt?.toIso8601String(),
|
||||
'updatedAt': updatedAt?.toIso8601String(),
|
||||
'user': user?.toJson(),
|
||||
'project': project?.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class CreateManyProjectTaskDboAndReturnOutputType {
|
||||
const CreateManyProjectTaskDboAndReturnOutputType({
|
||||
this.id,
|
||||
this.name,
|
||||
this.description,
|
||||
this.projectId,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.project,
|
||||
});
|
||||
|
||||
factory CreateManyProjectTaskDboAndReturnOutputType.fromJson(Map json) =>
|
||||
CreateManyProjectTaskDboAndReturnOutputType(
|
||||
id: json['id'],
|
||||
name: json['name'],
|
||||
description: json['description'],
|
||||
projectId: json['projectId'],
|
||||
createdAt: switch (json['createdAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['createdAt']
|
||||
},
|
||||
updatedAt: switch (json['updatedAt']) {
|
||||
DateTime value => value,
|
||||
String value => DateTime.parse(value),
|
||||
_ => json['updatedAt']
|
||||
},
|
||||
project: json['project'] is Map
|
||||
? _i1.ProjectDbo.fromJson(json['project'])
|
||||
: null,
|
||||
);
|
||||
|
||||
final String? id;
|
||||
|
||||
final String? name;
|
||||
|
||||
final String? description;
|
||||
|
||||
final String? projectId;
|
||||
|
||||
final DateTime? createdAt;
|
||||
|
||||
final DateTime? updatedAt;
|
||||
|
||||
final _i1.ProjectDbo? project;
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'id': id,
|
||||
'name': name,
|
||||
'description': description,
|
||||
'projectId': projectId,
|
||||
'createdAt': createdAt?.toIso8601String(),
|
||||
'updatedAt': updatedAt?.toIso8601String(),
|
||||
'project': project?.toJson(),
|
||||
};
|
||||
}
|
||||
+10566
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user