mirror of
https://github.com/immich-app/immich.git
synced 2026-07-04 03:45:59 -07:00
f29f86542c
* feat: partner actions # Conflicts: # i18n/en.json * cleanup * fix tests * ci fix --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
46 lines
1.0 KiB
Dart
46 lines
1.0 KiB
Dart
import 'package:immich_mobile/domain/models/user.model.dart';
|
|
|
|
import '../../utils.dart';
|
|
|
|
class UserFactory {
|
|
const UserFactory();
|
|
|
|
static User create({
|
|
String? id,
|
|
String? name,
|
|
String? email,
|
|
DateTime? profileChangedAt,
|
|
bool? hasProfileImage,
|
|
AvatarColor? avatarColor,
|
|
}) {
|
|
id = TestUtils.uuid(id);
|
|
return User(
|
|
id: id,
|
|
name: name ?? 'user_$id',
|
|
email: email ?? '$id@test.com',
|
|
profileChangedAt: TestUtils.date(profileChangedAt),
|
|
hasProfileImage: hasProfileImage ?? false,
|
|
avatarColor: avatarColor ?? .primary,
|
|
);
|
|
}
|
|
|
|
static UserDto createDto({
|
|
String? id,
|
|
String? name,
|
|
String? email,
|
|
DateTime? profileChangedAt,
|
|
bool? hasProfileImage,
|
|
AvatarColor? avatarColor,
|
|
}) {
|
|
id = TestUtils.uuid(id);
|
|
return UserDto(
|
|
id: id,
|
|
name: name ?? 'user_$id',
|
|
email: email ?? '$id@test.com',
|
|
profileChangedAt: TestUtils.date(profileChangedAt),
|
|
hasProfileImage: hasProfileImage ?? false,
|
|
avatarColor: avatarColor ?? .primary,
|
|
);
|
|
}
|
|
}
|