Skip to content

Feat/scan#663

Merged
BigBen-7 merged 10 commits into
Lead-Studios:devfrom
nafiuishaaq:feat/scan
Apr 24, 2026
Merged

Feat/scan#663
BigBen-7 merged 10 commits into
Lead-Studios:devfrom
nafiuishaaq:feat/scan

Conversation

@nafiuishaaq
Copy link
Copy Markdown
Contributor

I have successfully implemented the orders functionality as requested. Here's a summary of the changes made:

Changes Made

1. Created Order Entity (order.entity.ts)

  • Includes fields: id (UUID), userId (FK), status (enum with PENDING, PAID, CANCELLED, REFUNDED), totalAmount, createdAt, updatedAt
  • Has OneToMany relation to OrderItem
  • Has ManyToOne relation to User

2. Created OrderItem Entity (order-item.entity.ts)

  • Includes fields: id (UUID), orderId (FK), ticketTypeId (FK), quantity, price
  • Has ManyToOne relations to Order and TicketTier

3. Created OrdersService (orders.service.ts)

  • Implemented findByUser(userId, query) method with:
    • Pagination support (page, limit)
    • Optional status filtering
    • Joins OrderItem and TicketType as requested
    • Returns paginated results with metadata (total, totalPages, etc.)

4. Created OrdersController (orders.controller.ts)

  • Added GET /orders/my endpoint
  • Protected by JwtAuthGuard
  • Accepts query parameters: page, limit, status
  • Calls the service's findByUser method with the authenticated user's ID

5. Created OrdersModule (orders.module.ts)

  • Registers Order and OrderItem entities with TypeOrmModule
  • Provides OrdersService and OrdersController

6. Updated AppModule (app.module.ts)

  • Imported and added OrdersModule to the imports array

7. Updated DataSource (data-source.ts)

  • Added Order and OrderItem entity imports
  • Added entities to the entities array

8. Created Migration (1700000000001-CreateOrdersEntities.ts)

  • Creates orders and order_items tables
  • Adds appropriate foreign key constraints
  • Includes up/down migration methods

The implementation allows buyers to view their orders with pagination and optional status filtering, joining the related order items and ticket types as specified. The endpoint is properly secured with JWT authentication.

Made changes.

Closes #582
Closes #579
Closes #588
Closes #585

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 24, 2026

@nafiuishaaq Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@BigBen-7 BigBen-7 merged commit 9f352a8 into Lead-Studios:dev Apr 24, 2026
1 check passed
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