Skip to content
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

Open
wants to merge 7 commits into
base: pandapanda_development
Choose a base branch
from

Conversation

roberttullycarr
Copy link

No description provided.

- added encounterID as foreign key on comments, to add comments directly to ontmoetingsformulier
- added input new input types for games, comments and encounter competitions
Copy link
Contributor

github-actions bot commented Feb 21, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@roberttullycarr
Copy link
Author

ik heb de Contributor Licentie Overeenkomst gelezen en verklaar mij hiermee akkoord

@roberttullycarr
Copy link
Author

recheck

@roberttullycarr roberttullycarr changed the title Pp of changes Ontmoetingsformulier changes Feb 21, 2025
@roberttullycarr roberttullycarr changed the base branch from develop to pandapanda_development February 21, 2025 14:42
@Index
@Field(() => ID, { nullable: true })
@Column(DataType.UUIDV4)
encounterId?: string;
Copy link
Contributor

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),
Copy link
Contributor

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} : {}),
Copy link
Contributor

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,
Copy link
Contributor

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({
Copy link
Contributor

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({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why + 1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants