Solian/lib/models/account.dart

70 lines
1.5 KiB
Dart
Raw Normal View History

import 'package:freezed_annotation/freezed_annotation.dart';
part 'account.g.dart';
@JsonSerializable()
2024-05-18 10:17:16 +00:00
class Account {
int id;
DateTime createdAt;
DateTime updatedAt;
DateTime? deletedAt;
2024-07-13 11:09:04 +00:00
DateTime? confirmedAt;
DateTime? suspendedAt;
2024-05-18 10:17:16 +00:00
String name;
String nick;
dynamic avatar;
dynamic banner;
2024-05-18 10:17:16 +00:00
String description;
2024-06-03 15:36:46 +00:00
List<AccountBadge>? badges;
2024-05-18 10:17:16 +00:00
String? emailAddress;
int? externalId;
Account({
required this.id,
required this.createdAt,
required this.updatedAt,
2024-05-28 16:14:41 +00:00
required this.deletedAt,
2024-07-13 11:09:04 +00:00
required this.confirmedAt,
required this.suspendedAt,
2024-05-18 10:17:16 +00:00
required this.name,
required this.nick,
required this.avatar,
required this.banner,
required this.description,
2024-06-03 15:36:46 +00:00
required this.badges,
2024-05-28 16:14:41 +00:00
required this.emailAddress,
2024-05-18 10:17:16 +00:00
this.externalId,
});
factory Account.fromJson(Map<String, dynamic> json) =>
_$AccountFromJson(json);
2024-05-18 10:17:16 +00:00
Map<String, dynamic> toJson() => _$AccountToJson(this);
2024-05-18 10:17:16 +00:00
}
2024-06-03 15:36:46 +00:00
@JsonSerializable()
2024-06-03 15:36:46 +00:00
class AccountBadge {
int id;
DateTime createdAt;
DateTime updatedAt;
DateTime? deletedAt;
Map<String, dynamic>? metadata;
String type;
int accountId;
AccountBadge({
required this.id,
required this.accountId,
required this.createdAt,
required this.updatedAt,
required this.deletedAt,
required this.metadata,
required this.type,
});
factory AccountBadge.fromJson(Map<String, dynamic> json) =>
_$AccountBadgeFromJson(json);
2024-06-03 15:36:46 +00:00
Map<String, dynamic> toJson() => _$AccountBadgeToJson(this);
2024-06-03 15:36:46 +00:00
}