Skip to content

The open alternative to Salesforce, designed for AI.

v1.8.4 — Partners app: keep the company name out of marketplace brief names (#26143)

Marie4f2e51fed2ec
diff --git a/packages/twenty-apps/internal/twenty-partners/package.json b/packages/twenty-apps/internal/twenty-partners/package.json
index 004af8537a1..acb6c9d7ae8 100644
--- a/packages/twenty-apps/internal/twenty-partners/package.json
+++ b/packages/twenty-apps/internal/twenty-partners/package.json
@@ -1,6 +1,6 @@
{
"name": "twenty-partners",
- "version": "1.8.3",
+ "version": "1.8.4",
"license": "MIT",
"engines": {
"node": "^24.5.0",
diff --git a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/mappers/build-brief-name.mapper.test.ts b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/mappers/build-brief-name.mapper.test.ts
new file mode 100644
index 00000000000..ee248619b51
--- /dev/null
+++ b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/mappers/build-brief-name.mapper.test.ts
@@ -0,0 +1,16 @@
+import { describe, expect, it } from 'vitest';
+
+import { buildBriefName } from './build-brief-name.mapper';
+
+describe('buildBriefName', () => {
+ it('names the brief after the need', () => {
+ expect(buildBriefName(' Migrate from HubSpot ')).toBe(
+ 'Migrate from HubSpot — marketplace brief',
+ );
+ });
+
+ it('shortens a long need', () => {
+ const name = buildBriefName(`${'a'.repeat(59)} ${'b'.repeat(40)}`);
+ expect(name).toBe(`${'a'.repeat(59)}… — marketplace brief`);
+ });
+});
diff --git a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/mappers/build-brief-name.mapper.ts b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/mappers/build-brief-name.mapper.ts
new file mode 100644
index 00000000000..c94359a937e
--- /dev/null
+++ b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/mappers/build-brief-name.mapper.ts
@@ -0,0 +1,13 @@
+const MAX_NEED_LENGTH = 60;
+
+const MARKETPLACE_BRIEF_NAME_SUFFIX = '— marketplace brief';
+
+// Listed briefs are visible to every partner, so the name must not carry the prospect's company.
+export function buildBriefName(need: string): string {
+ const trimmedNeed = need.trim();
+ const shortNeed =
+ trimmedNeed.length > MAX_NEED_LENGTH
+ ? `${trimmedNeed.slice(0, MAX_NEED_LENGTH).trimEnd()}…`
+ : trimmedNeed;
+ return `${shortNeed} ${MARKETPLACE_BRIEF_NAME_SUFFIX}`;
+}
diff --git a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/services/submit-client-brief.service.ts b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/services/submit-client-brief.service.ts
index d501a2f8b71..c2ea1fbc7ca 100644
--- a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/services/submit-client-brief.service.ts
+++ b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/services/submit-client-brief.service.ts
@@ -5,6 +5,7 @@ import {
findOrCreatePersonByEmail,
} from 'src/modules/shared/services/find-or-create-company-and-person.service';
import { createOpportunity } from 'src/modules/opportunity/intake/graphql/mutations/create-opportunity';
+import { buildBriefName } from 'src/modules/opportunity/intake/mappers/build-brief-name.mapper';
import { findPartnerIdBySlug } from 'src/modules/opportunity/intake/graphql/queries/find-partner-id-by-slug';
import {
buildRequirementsText,
@@ -37,7 +38,7 @@ export async function submitClientBrief(
): Promise<SubmitClientBriefResult> {
try {
const client = new CoreApiClient();
- const name = `${input.companyName.trim()} — marketplace brief`;
+ const name = buildBriefName(input.need);
const requirements = buildRequirementsText(input);
const companyId = await findOrCreateCompanyByName(
diff --git a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/submit-client-brief.integration-test.ts b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/submit-client-brief.integration-test.ts
index 9acf0af8d4e..5661b8d6080 100644
--- a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/submit-client-brief.integration-test.ts
+++ b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/submit-client-brief.integration-test.ts
@@ -108,7 +108,8 @@ describe('submit-client-brief handler', () => {
});
const opp = fetched.opportunity;
- expect(opp?.name).toBe(`${input.companyName} — marketplace brief`);
+ expect(opp?.name).toBe(`${input.need} — marketplace brief`);
+ expect(opp?.name).not.toContain(input.companyName);
expect(opp?.need).toBe(input.need);
expect(opp?.requirements).toContain('French UI');
expect(opp?.requirements).toContain('Additional context:');
diff --git a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/submit-client-brief.logic-function.ts b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/submit-client-brief.logic-function.ts
index f45395fe3fe..31406a0cb7b 100644
--- a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/submit-client-brief.logic-function.ts
+++ b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/intake/submit-client-brief.logic-function.ts
@@ -22,7 +22,7 @@ export const handler = async (event: unknown): Promise<SubmitClientBriefResult>
export default defineLogicFunction({
universalIdentifier: SUBMIT_CLIENT_BRIEF_LOGIC_FUNCTION_ID,
name: 'submit-client-brief',
- description: 'Create an unlisted Opportunity from the public marketplace brief form.',
+ description: 'Create a listed Opportunity from the public marketplace brief form.',
timeoutSeconds: 15,
handler,
httpRouteTriggerSettings: {