-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ontmoetingsformulier changes #611
base: pandapanda_development
Are you sure you want to change the base?
Conversation
- added encounterID as foreign key on comments, to add comments directly to ontmoetingsformulier - added input new input types for games, comments and encounter competitions
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
ik heb de Contributor Licentie Overeenkomst gelezen en verklaar mij hiermee akkoord |
recheck |
@Index | ||
@Field(() => ID, { nullable: true }) | ||
@Column(DataType.UUIDV4) | ||
encounterId?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field isn't needed, this is handeled by the linkId
and linkType
|
||
@InputType() | ||
export class GameNewInput extends PartialType( | ||
OmitType(Game, ['id', 'visualCode', "rankingPoints", "players", 'competition','linkId', 'linkType', "tournament", "createdAt", "updatedAt"] as const), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually take the updatemodel as base so:
OmitType(GameUpdateInput, ['id'] as const),
@@ -75,7 +75,8 @@ export class CommentResolver { | |||
playerId: user.id, | |||
linkId: newCommentData.linkId, | |||
linkType: newCommentData.linkType, | |||
clubId: newCommentData.clubId, | |||
...(newCommentData.clubId ? {clubId: newCommentData.clubId} : {}), | |||
...(newCommentData.encounterId ? {encounterId: newCommentData.encounterId} : {}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, this value should be filled in on linkId
gameId: game.id, | ||
team: player.team, | ||
player: player.player, | ||
systemId: player.systemId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
system can be globally, and maybe even fetched here (so not passed from the client)
|
||
if (gameData.players) { | ||
for (const player of gameData.players) { | ||
await GamePlayerMembership.create({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ranking for singles,doubles,mix are missing in the membership
|
||
// if game is not a draw, update the score of the encounter | ||
if (gameData.winner !== 0){ | ||
await encounter.update({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why + 1
?
No description provided.