inmemory to postgres
This commit is contained in:
@@ -58,6 +58,26 @@ export class LeagueWallet implements IEntity<LeagueWalletId> {
|
||||
});
|
||||
}
|
||||
|
||||
static rehydrate(props: {
|
||||
id: string;
|
||||
leagueId: string;
|
||||
balance: Money;
|
||||
transactionIds: string[];
|
||||
createdAt: Date;
|
||||
}): LeagueWallet {
|
||||
const id = LeagueWalletId.create(props.id);
|
||||
const leagueId = LeagueId.create(props.leagueId);
|
||||
const transactionIds = props.transactionIds.map(tid => TransactionId.create(tid));
|
||||
|
||||
return new LeagueWallet({
|
||||
id,
|
||||
leagueId,
|
||||
balance: props.balance,
|
||||
transactionIds,
|
||||
createdAt: props.createdAt,
|
||||
});
|
||||
}
|
||||
|
||||
private static validate(props: {
|
||||
id: string;
|
||||
leagueId: string;
|
||||
|
||||
Reference in New Issue
Block a user