feat: add input validation enhancements for DTOs - #362
Merged
EmmanuelOchaje merged 1 commit intoSep 26, 2026
Merged
Conversation
Addresses issues StellarTickets#238, StellarTickets#239, StellarTickets#240, StellarTickets#241: - StellarTickets#241: Add seat format validation with @IsSeat decorator - Validates seat format (1-64 chars, alphanumeric + spaces/hyphens/slashes/periods) - Rejects whitespace-only values - Applied to IssueTicketDto, PurchasePrimaryDto, ConfirmIssueTicketDto, ConfirmPurchasePrimaryDto - StellarTickets#240: Add max-length validators to free-text DTO fields - Added @maxlength to name fields (256 chars) in CreateEventDto, CreateOrganizationDto, CreateTicketTypeDto, CreateGateDto, RegisterScannerDeviceDto, RegisterDto - Added @maxlength to venue (256), slug (128), reason (512), events (512), secret (256) - Documented limits in docs/VALIDATION.md - StellarTickets#239: Add @Transform trimming for string DTO fields - Trim leading/trailing whitespace from name, venue, reason, events, secret fields - Prevents whitespace-only values from passing validation - StellarTickets#238: Add global ValidationPipe config test - New test file: test/validation-pipe.e2e-spec.ts - Tests that unknown fields return 400 - Verifies whitelist and forbidNonWhitelisted options work correctly All tests added for new @IsSeat decorator to cover valid/invalid seat formats.
✅ Deploy Preview for stellarticketsbackend ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@sanmipaul 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive input validation enhancements addressing issues #238, #239, #240, and #241.
Changes
#241: Add seat format validation
@IsSeatdecorator insrc/common/decorators/is-seat.decorator.tsIssueTicketDto,PurchasePrimaryDto,ConfirmIssueTicketDto,ConfirmPurchasePrimaryDto#240: Add max-length validators
@MaxLengthdecorators to all free-text string fields across DTOsnamefields: 256 characters (Events, Organizations, Ticket Types, Gates, Scanner Devices, Users)venue: 256 charactersslug: 128 charactersreason: 512 charactersevents: 512 characterssecret: 256 charactersdocs/VALIDATION.mdwith comprehensive limits table#239: Add string trimming via @Transform
@Transformdecorators to trim leading/trailing whitespacename,venue,reason,events,secretfields#238: Add ValidationPipe config test
test/validation-pipe.e2e-spec.tswhitelist: trueandforbidNonWhitelisted: trueoptions work correctlyDTOs Modified
src/auth/dto/register.dto.tssrc/events/dto/create-event.dto.tssrc/events/dto/create-ticket-type.dto.tssrc/gates/dto/create-gate.dto.tssrc/organizations/dto/create-organization.dto.tssrc/scanner-devices/dto/register-scanner-device.dto.tssrc/tickets/dto/confirm-check-in.dto.tssrc/tickets/dto/confirm-issue-ticket.dto.tssrc/tickets/dto/confirm-purchase-primary.dto.tssrc/tickets/dto/issue-ticket.dto.tssrc/tickets/dto/purchase-primary.dto.tssrc/webhooks/dto/create-webhook-endpoint.dto.tsTest Plan
closes #238
closes #239
closes #240
closes #241