Ferish Wheel and Music

This commit is contained in:
efrilm
2025-09-18 14:53:39 +07:00
parent 73918430b2
commit 909c312af0
28 changed files with 970 additions and 1422 deletions
@@ -6,12 +6,7 @@ class GamePrizeDto with _$GamePrizeDto {
@JsonKey(name: 'id') String? id,
@JsonKey(name: 'game_id') String? gameId,
@JsonKey(name: 'name') String? name,
@JsonKey(name: 'weight') int? weight,
@JsonKey(name: 'stock') int? stock,
@JsonKey(name: 'max_stock') int? maxStock,
@JsonKey(name: 'threshold') int? threshold,
@JsonKey(name: 'metadata') Map<String, dynamic>? metadata,
@JsonKey(name: 'game') GameDto? game,
@JsonKey(name: 'created_at') String? createdAt,
@JsonKey(name: 'updated_at') String? updatedAt,
}) = _GamePrizeDto;
@@ -21,17 +16,11 @@ class GamePrizeDto with _$GamePrizeDto {
const GamePrizeDto._();
/// mapping ke domain
GamePrize toDomain() => GamePrize(
id: id ?? '',
gameId: gameId ?? '',
name: name ?? '',
weight: weight ?? 0,
stock: stock ?? 0,
maxStock: maxStock ?? 0,
threshold: threshold ?? 0,
metadata: metadata ?? const {},
game: game?.toDomain() ?? Game.empty(),
metadata: metadata ?? {},
createdAt: createdAt ?? '',
updatedAt: updatedAt ?? '',
);