This repository was archived by the owner on Jun 9, 2026. It is now read-only.
ENG-6856: Add test seed endpoint for E2E campaign data seeding - #1336
Draft
dealvz wants to merge 3 commits into
Draft
ENG-6856: Add test seed endpoint for E2E campaign data seeding#1336dealvz wants to merge 3 commits into
dealvz wants to merge 3 commits into
Conversation
Contributor
|
Task linked: ENG-6856 Webapp E2E Tests for All Peerly Flows |
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
📊 Overall Test Coverage39.52% (average of lines, statements, functions, and branches) |
Contributor
Infrastructure DiffThis PR makes infrastructure changes in at least one environment.
|
Contributor
Preview EnvironmentYour preview environment is ready!
|
dealvz
commented
Mar 20, 2026
| update: { status: dto.tcrComplianceStatus }, | ||
| create: { | ||
| campaignId: campaign.id, | ||
| ein: '00-0000000', |
Collaborator
Author
There was a problem hiding this comment.
will this be okay when we hit peerly? the ein always being 00-0000000? or does it need to be dynamic
…CR_COMPLIANCE_BACKDOOR_ENABLED references
dealvz
marked this pull request as draft
March 27, 2026 14:20
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Adds a gated
POST /v1/test/seed/campaignendpoint that seeds campaign data (Pro status, free texts offer, TCR compliance) for E2E testing.Changes
src/testSeed/— NewTestSeedModulewith controller, service, Zod schema, and unit testsPOST /v1/test/seed/campaign— AcceptscampaignId, optionalisPro,hasFreeTextsOffer,tcrComplianceStatussrc/app.module.ts— Conditionally registersTestSeedModulewhenTCR_COMPLIANCE_BACKDOOR_ENABLED=truedeploy/index.ts— SetsTCR_COMPLIANCE_BACKDOOR_ENABLEDto'false'for prod,'true'for all other environmentsSecurity
TCR_COMPLIANCE_BACKDOOR_ENABLEDis'false'in prod)Related
e2e-peerly-outreachbranch (Playwright E2E tests that consume this endpoint)Note
Medium Risk
Introduces a test-only data mutation endpoint that can change campaign and TCR compliance state; while gated behind
TCR_COMPLIANCE_BACKDOOR_ENABLEDand ownership checks, misconfiguration could expose it in non-test environments.Overview
Adds a test-only seeding endpoint (
POST /test/seed/campaign) to update an authenticated user’s campaign (isPro,hasFreeTextsOffer) and optionally upserttcrCompliance.status, with Zod request validation and unit coverage for ownership enforcement.Wires the new
TestSeedModuleintoAppModuleonly whenTCR_COMPLIANCE_BACKDOOR_ENABLED=true, and sets that env var via Pulumi to disabled in prod and enabled in non-prod deployments.Written by Cursor Bugbot for commit cd0c65a. Configure here.