fix: paste guests, form errors, send feedback, check-in errors, invite recipients

Found by the manual e2e of the production build:
- paste guests preview counted an array, so it read "[object Object]"
  and never offered Save guests;
- New event and Add user errors now clear when the field is fixed;
- "Send to all unsent" says when nothing was unsent;
- the check-in lookup shows an error on an empty submit and carries the
  typed email or mobile into the walk-in form;
- invitation emails sent over Pub/Sub now save their recipient's link,
  so the Emails page shows the recipient.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
ngqileandClaude Opus 5.5 committed 2026-12-02 01:38:37 +08:00
1 parent 4b1645ff64
commit b4d36175d3
13 files changed
+206 -18

No files matched your search

@@ -0,0 +1,39 @@
package com.solvway.services.email.service;
import com.solvway.services.email.model.Email;
import com.solvway.services.email.model.Recipient;
import com.solvway.services.email.repo.EmailRepository;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.test.util.ReflectionTestUtils;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
/** Found live: invitation emails arrive over Pub/Sub with recipients not linked to the email, so email_id was saved as NULL. */
@ExtendWith(MockitoExtension.class)
class EmailServiceRecipientLinkTest {
@Mock private EmailRepository emailRepository;
@InjectMocks private EmailService service;
@Test
void savedRecipientsPointBackAtTheEmail() {
when(emailRepository.save(any(Email.class))).thenAnswer(i -> i.getArgument(0));
Recipient recipient = new Recipient();
recipient.setRecipient("a@example.test");
Email email = new Email();
email.setRecipients(List.of(recipient));
service.save(email);
assertThat(ReflectionTestUtils.getField(recipient, "email")).isSameAs(email);
}
}