feat(events): add Event + User entities, REST API, and MergeAll#373
Closed
mmm-byte wants to merge 2 commits into
Closed
feat(events): add Event + User entities, REST API, and MergeAll#373mmm-byte wants to merge 2 commits into
mmm-byte wants to merge 2 commits into
Conversation
Adds a full Events feature on top of the nestjs/typescript-starter boilerplate: Domain - Event entity (id, title, description?, status, startTime, endTime, timestamps, ManyToMany invitees) - User entity (id, name, events: string[], ManyToMany invitedEvents) - EventStatus enum: TODO | IN_PROGRESS | COMPLETED API - POST /events create an event - GET /events/:id retrieve an event - DELETE /events/:id delete an event - POST /users/:id/merge-events MergeAll for a user * sweeps the user's events, clusters overlaps * creates a single merged event spanning min(start)..max(end) * appends titles/descriptions with ' | ' * picks a 'reasonable' status (IN_PROGRESS > COMPLETED > TODO) * union of invitees is preserved * deletes the originals and rewrites every invitee's events[] list - Global ValidationPipe enforces DTO rules Stack - @nestjs/typeorm + better-sqlite3 (zero-setup local DB) - class-validator / class-transformer - DTO: CreateEventDto, CreateUserDto Tests (per FAQ nestjs#1: both) - 13 unit tests (mocked TypeORM repositories) across 3 suites * events.service.spec.ts * events.controller.spec.ts * users.controller.spec.ts - 3 e2e tests against a real SQLite file * events.e2e-spec.ts boots the full Nest app + supertest * exercises create user, create event, get, merge, delete Docs - README.md rewritten with API table, run instructions, curl recipe, and demo-video script Removes - src/app.controller.ts, src/app.service.ts, src/app.controller.spec.ts (Hello World boilerplate replaced by the events feature) - test/app.e2e-spec.ts (replaced by test/events.e2e-spec.ts)
…c, entity comment, README
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.
Adds a full Events feature on top of the nestjs/typescript-starter boilerplate:
Domain
API
Stack
Tests (per FAQ #1: both)
Docs
Removes