Skip to content

Feat: Implemented Message Module Feature - Closing Issue#243#251

Merged
derianrddev merged 4 commits intoKaizenode:mainfrom
Shukazuby:issue243
Apr 25, 2025
Merged

Feat: Implemented Message Module Feature - Closing Issue#243#251
derianrddev merged 4 commits intoKaizenode:mainfrom
Shukazuby:issue243

Conversation

@Shukazuby
Copy link
Contributor

@Shukazuby Shukazuby commented Apr 25, 2025

📝 Pull Request Title

🛠️ Issue

📖 Description

  • Implemented GraphQL support for sending and retrieving messages linked to orders.

✅ Changes made

  • Added CreateMessageInput DTO for message creation input
  • Added Message Model GraphQL object type for message output
  • Created MessageService to handle database logic using Prisma
  • Implemented getMessagesByOrder GraphQL query
  • Implemented sendMessage GraphQL mutation
  • Registered resolver and service in MessageModule

🖼️ Media (screenshots/videos)

Screenshot 2025-04-25 at 08 38 54

📜 Additional Notes

@derianrddev derianrddev added backend ODHack13 This issue will be available ONLY during the ODHack13 labels Apr 25, 2025
Copy link
Contributor

@derianrddev derianrddev left a comment

Choose a reason for hiding this comment

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

Hello @Shukazuby

Just a few small adjustments needed regarding the Prisma model and unnecessary dependencies.
Once those are addressed, everything should be ready to merge!

}


model Message {
Copy link
Contributor

Choose a reason for hiding this comment

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

To keep consistency with other Prisma models, please update the Message model to use camelCase field names with @map for database columns.

Example:

model Message {
  id             String   @id @default(uuid())
  orderId        String   @map("order_id")
  senderAddress  String   @map("sender_address")
  content        String
  createdAt      DateTime @default(now()) @map("created_at")
  updatedAt      DateTime @updatedAt @map("updated_at")

  order  Order @relation(fields: [orderId], references: [id])
  sender User  @relation("UserMessages", fields: [senderAddress], references: [walletAddress])

  @@map("messages")
}

Update the service and tests to match the new field names.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like none of the newly added dependencies in apps/backend/package.json are necessary for this PR:

  • @types/react
  • @types/react-dom
  • @types/lodash
  • @types/trusted-types
  • @types/web

Please remove them to keep the project clean.
If any of them are actually required for the work done, feel free to leave those in.

@Shukazuby
Copy link
Contributor Author

Hi @derianrddev. Thank you, I have effected the changes

@derianrddev derianrddev self-requested a review April 25, 2025 22:16
Copy link
Contributor

@derianrddev derianrddev left a comment

Choose a reason for hiding this comment

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

Great job! Thank you very much!

@derianrddev derianrddev merged commit 2871c4e into Kaizenode:main Apr 25, 2025
2 checks passed
@Shukazuby Shukazuby changed the title Implemented Message Module Feature - Closing Issue#243 Feat: Implemented Message Module Feature - Closing Issue#243 Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend ODHack13 This issue will be available ONLY during the ODHack13

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Implement Messages Module (GraphQL API)

2 participants