Skip to content

Conversation

@smarcet
Copy link
Collaborator

@smarcet smarcet commented Sep 15, 2025

feat: add new endppint to resend
PUT api/v1/summits/{id}/events/{event_id}/rsvps/resend

ref : https://tipit.avaza.com/project/view/386030#!tab=task-pane&groupby=ProjectSection&view=vertical&task=3866136&stafilter=NotComplete&fileview=grid

@smarcet smarcet requested a review from Copilot September 15, 2025 14:55
Copy link
Contributor

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 implements a new API endpoint to resend RSVP confirmation emails for a specific summit event. The implementation includes backend services, job processing, email templates, and frontend integration through a new PUT endpoint at api/v1/summits/{id}/events/{event_id}/rsvps/resend.

  • Adds new RSVP resend functionality with email job processing and excerpt reports
  • Implements API controller methods with proper validation and authorization
  • Updates database schema with new email flow events and migration scripts

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
routes/api_v1.php Adds the new PUT /rsvps/resend endpoint routing
database/seeders/ApiEndpointsSeeder.php Seeds the new API endpoint with proper authorization groups
database/migrations/model/Version20250915143011.php Migration to seed default email flow events for all summits
database/migrations/model/Version20250915143007.php Migration to add RSVP confirmation excerpt email flow type
create_migration.sh Updates entity manager reference for migrations
app/Swagger/schemas.php Defines schema for the resend RSVP confirmation request
app/Services/Model/Imp/SummitRSVPService.php Implements core resend logic and email processing
app/Services/Model/ISummitRSVPService.php Adds interface methods for resend functionality
app/Models/Foundation/Summit/Events/RSVP/RSVP.php Adds isActive method to RSVP model
app/Jobs/Emails/Schedule/RSVP/RSVPConfirmationExcerptEmail.php Email job for confirmation excerpts
app/Jobs/Emails/Schedule/RSVP/ProcessRSVPConfirmationEmailsJob.php Background job to process RSVP confirmation emails
app/Http/Controllers/Apis/Protected/Summit/OAuth2RSVPApiController.php Controller implementation for the resend endpoint
tests/SummitRSVPInvitationServiceTest.php Updates test to use correct filter name and adds event mocking

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@smarcet smarcet requested a review from Copilot September 15, 2025 15:12
Copy link
Contributor

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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


],
[
'name' => 'resend-rsvp-confirmation-by-event',
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

The PR title and description contains 'endppint' which is a typo. The endpoint name should be consistent with this correction - consider 'resend-rsvp-confirmation-by-event' vs the typo in the PR metadata.

Copilot uses AI. Check for mistakes.
Comment on lines +519 to +535
$rsvp = $this->tx_service->transaction(function () use ($flow_event, $invitation_id) {

Log::debug(sprintf("SummitRSVPService::resend processing rsvp id %s", $invitation_id));

$rsvp = $this->rsvp_repository->getById(intval($invitation_id));

if (!$rsvp instanceof RSVP)
return null;

if (!$rsvp->isActive()) {
Log::warning(sprintf("SummitRSVPService::resend rsvp %s is not active", $invitation_id));
return null;
}
return $rsvp;
});

Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

Nested transaction within another transaction can cause performance issues and potential deadlocks. The inner transaction on line 519 is unnecessary since it's already within the outer transaction starting on line 509.

Suggested change
$rsvp = $this->tx_service->transaction(function () use ($flow_event, $invitation_id) {
Log::debug(sprintf("SummitRSVPService::resend processing rsvp id %s", $invitation_id));
$rsvp = $this->rsvp_repository->getById(intval($invitation_id));
if (!$rsvp instanceof RSVP)
return null;
if (!$rsvp->isActive()) {
Log::warning(sprintf("SummitRSVPService::resend rsvp %s is not active", $invitation_id));
return null;
}
return $rsvp;
});
Log::debug(sprintf("SummitRSVPService::resend processing rsvp id %s", $invitation_id));
$rsvp = $this->rsvp_repository->getById(intval($invitation_id));
if (!$rsvp instanceof RSVP)
return;
if (!$rsvp->isActive()) {
Log::warning(sprintf("SummitRSVPService::resend rsvp %s is not active", $invitation_id));
return;
}

Copilot uses AI. Check for mistakes.
Comment on lines +546 to +555
if ($add_excerpt) {
$onDispatchSuccess(
$rsvp->getOwnerEmail(), IEmailExcerptService::EmailLineType, $flow_event
);
}
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

The variable $add_excerpt is hardcoded to false on line 535 but is still used in this conditional. This code block will never execute, making the excerpt functionality non-functional.

Copilot uses AI. Check for mistakes.
@smarcet smarcet changed the title feat: add new endppint to resend feat: add new endpoint to resend Sep 15, 2025
@smarcet smarcet force-pushed the feature/resend-rsvp-confirmation-emails branch from 30f4591 to fe3c7cf Compare September 15, 2025 19:34
@smarcet smarcet force-pushed the feature/resend-rsvp-confirmation-emails branch from fe3c7cf to da1c378 Compare September 16, 2025 15:24
@smarcet smarcet merged commit c070afa into main Sep 16, 2025
1 check passed
smarcet added a commit that referenced this pull request Sep 19, 2025
* feat: add new endppint to resend

PUT api/v1/summits/{id}/events/{event_id}/rsvps/resend

* Update app/Http/Controllers/Apis/Protected/Summit/OAuth2RSVPApiController.php

Co-authored-by: Copilot <[email protected]>

* Update database/seeders/ApiEndpointsSeeder.php

Co-authored-by: Copilot <[email protected]>

* Update app/Services/Model/Imp/SummitRSVPService.php

Co-authored-by: Copilot <[email protected]>

* Update app/Http/Controllers/Apis/Protected/Summit/OAuth2RSVPApiController.php

Co-authored-by: Copilot <[email protected]>

* Update app/Http/Controllers/Apis/Protected/Summit/OAuth2RSVPApiController.php

Co-authored-by: Copilot <[email protected]>

* chore: added missing flag

* chore: add debug info

* chore: fix missing email_flow_event

---------

Co-authored-by: Copilot <[email protected]>
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