Skip to content

Migrate journeys CRUD endpoints to nexus service#81

Merged
jeroenrinzema merged 5 commits intomainfrom
copilot/migrate-journeys-endpoints
Dec 1, 2025
Merged

Migrate journeys CRUD endpoints to nexus service#81
jeroenrinzema merged 5 commits intomainfrom
copilot/migrate-journeys-endpoints

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 30, 2025

  • Analyze existing TypeScript JourneyController endpoints
  • Define Journey CRUD endpoints in OpenAPI spec (resources.yml)
  • Generate Go types from OpenAPI spec using make generate
  • Extend JourneysStore with needed operations
  • Create JourneysController in Go with all endpoints
  • Write comprehensive unit tests using testcontainers
  • Wire JourneysController into main Controller struct
  • Run linting and tests to verify implementation
  • Run CodeQL security scan
  • Request code review
  • Address code review feedback - use COALESCE for partial updates
  • Fix linting error and improve code quality
  • Use embedded Journey type for pagination

Summary

Successfully migrated basic journey CRUD endpoints from the legacy TypeScript platform service to the new Go nexus service with all review feedback addressed.

Latest Changes

  • Used embedded Journey type in journeyWithCount struct (following campaigns/users pattern)
  • Simplified code by using r.Journey instead of manually copying all fields
  • All tests continue to pass (11.9s runtime)
Original prompt

This section details on the original issue you should resolve

<issue_title>Migrate journeys endpoints to nexus service</issue_title>
<issue_description>The journeys endpoints in /services/platform/src/journey/JourneyController.ts have to be migrated to the nexus service. A new controller has to be created within the http package. Please include unit tests using test containers for the newly created endpoints and or store.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Migrate journeys endpoints to nexus service Migrate journeys CRUD endpoints to nexus service Nov 30, 2025
Copilot AI requested a review from jeroenrinzema November 30, 2025 20:43
@jeroenrinzema jeroenrinzema requested review from Copilot and removed request for jeroenrinzema November 30, 2025 20:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the basic CRUD operations for journeys from the legacy Node.js platform service to the Go nexus service, implementing 5 core endpoints for journey management.

Key Changes:

  • Added complete CRUD API endpoints for journey management (list, create, get, update, delete)
  • Implemented database store layer with pagination support and soft delete functionality
  • Created comprehensive test suite using testcontainers for integration testing

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
services/nexus/oapi/resources.yml Defines 5 new journey endpoints with OpenAPI schemas for request/response bodies
services/nexus/oapi/resources_gen.go Generated types and client code from OpenAPI specification
services/nexus/internal/store/journeys.go Implements store methods for CRUD operations with pagination and soft deletes
services/nexus/internal/http/controllers/v1/journeys.go HTTP handlers for journey endpoints with validation and error handling
services/nexus/internal/http/controllers/v1/journeys_test.go Integration tests covering all CRUD operations and edge cases
services/nexus/internal/http/controllers/v1/controller.go Registers journeys controller with main controller

Comment thread services/nexus/internal/store/journeys.go Outdated
Comment thread services/nexus/internal/http/controllers/v1/journeys.go Outdated
Comment thread services/nexus/internal/http/controllers/v1/journeys.go Outdated
Comment thread services/nexus/internal/http/controllers/v1/journeys.go Outdated
Comment thread services/nexus/internal/store/journeys.go Outdated
Comment thread services/nexus/internal/store/journeys.go Outdated
Copilot AI requested a review from jeroenrinzema November 30, 2025 22:04
@jeroenrinzema jeroenrinzema marked this pull request as ready for review December 1, 2025 09:17
Base automatically changed from refactor/projects to main December 1, 2025 10:37
Copilot AI and others added 4 commits December 1, 2025 11:38
- Define Journey CRUD endpoints in OpenAPI spec
- Add CreateJourney and UpdateJourney schemas
- Implement ListJourneys, CreateJourney, GetJourney, UpdateJourney, DeleteJourney store methods
- Create JourneysController with full CRUD operations
- Add comprehensive unit tests using testcontainers
- Wire JourneysController into main Controller struct

Co-authored-by: jeroenrinzema <3440116+jeroenrinzema@users.noreply.github.com>
- Add JourneyUpdate struct with pointer fields for partial updates
- Update UpdateJourney store method to use COALESCE pattern
- Simplify controller to pass update struct directly to store
- Follows existing patterns from campaigns, projects, and admins

Co-authored-by: jeroenrinzema <3440116+jeroenrinzema@users.noreply.github.com>
- Fix unused variable 'journey' at line 156 by using '_' for existence check
- Create named type 'journeyWithCount' instead of anonymous struct
- Improves code clarity and follows Go best practices

Co-authored-by: jeroenrinzema <3440116+jeroenrinzema@users.noreply.github.com>
- Change journeyWithCount to embed Journey type instead of duplicating fields
- Simplify assignment by using r.Journey instead of manual field copying
- Follows the same pattern as campaigns and users stores

Co-authored-by: jeroenrinzema <3440116+jeroenrinzema@users.noreply.github.com>
@jeroenrinzema jeroenrinzema force-pushed the copilot/migrate-journeys-endpoints branch from 2162024 to 4e4fed8 Compare December 1, 2025 10:40
@jeroenrinzema jeroenrinzema merged commit cdfc08c into main Dec 1, 2025
3 checks passed
@jeroenrinzema jeroenrinzema deleted the copilot/migrate-journeys-endpoints branch December 1, 2025 10:40
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.

Migrate journeys endpoints to nexus service

3 participants