11b9f708d6
## Summary - Adds `twenty-partners`, a Twenty app that manages the partner matching pipeline: intake partner-eligible deals, assign vetted marketplace partners, and track the full funnel - Custom `Partner` object with availability, geo/language coverage, deployment expertise, and Calendly link - `matchStatus` SELECT field on Opportunity — 10 non-nullable states from `TO_BE_MATCHED` through `WON`/`LOST`, replacing a legacy boolean approach - Auto-match logic function: when `matchStatus` → `AUTO_MATCH`, assigns the longest-idle available partner and advances to `MATCHED`; falls back to `MANUAL_MATCH` with an audit note if no partner is free - Views: Waiting for match, Matches overview (Kanban by `matchStatus`), All matched deals, Partners, Opportunities - Roles: Partner Ops (internal, full CRUD) and Partner (external placeholder) - Idempotent seed scripts for demo partners and pipeline data ## Test plan - [ ] App installs cleanly on a fresh workspace (`yarn twenty dev`) - [ ] `matchStatus` Kanban grouping renders correctly in Matches overview - [ ] Waiting for match view filters to `TO_BE_MATCHED` and `MANUAL_MATCH` only - [ ] Auto-match logic assigns a partner and advances status - [ ] Seed scripts run without errors and are safe to re-run
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import { loadEnv } from 'vite';
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
// Integration tests authenticate to a local Twenty server. Credentials are
|
|
// resolved from the shell env, then a gitignored .env.local in this directory
|
|
// (see .env.example). No API key is committed; if none is found, global-setup
|
|
// fails with a clear message.
|
|
const fileEnv = loadEnv('test', process.cwd(), 'TWENTY_');
|
|
|
|
const TWENTY_API_URL =
|
|
process.env.TWENTY_API_URL ?? fileEnv.TWENTY_API_URL ?? 'http://localhost:2020';
|
|
const TWENTY_API_KEY = process.env.TWENTY_API_KEY ?? fileEnv.TWENTY_API_KEY;
|
|
|
|
// Make env available to globalSetup (runs in the main process); test.env below
|
|
// covers the worker processes.
|
|
process.env.TWENTY_API_URL = TWENTY_API_URL;
|
|
if (TWENTY_API_KEY) {
|
|
process.env.TWENTY_API_KEY = TWENTY_API_KEY;
|
|
}
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
tsconfigPaths({
|
|
projects: ['tsconfig.spec.json'],
|
|
ignoreConfigErrors: true,
|
|
}),
|
|
],
|
|
test: {
|
|
testTimeout: 120_000,
|
|
hookTimeout: 120_000,
|
|
fileParallelism: false,
|
|
include: ['src/**/*.integration-test.ts'],
|
|
globalSetup: ['src/__tests__/global-setup.ts'],
|
|
env: {
|
|
TWENTY_API_URL,
|
|
...(TWENTY_API_KEY ? { TWENTY_API_KEY } : {}),
|
|
},
|
|
},
|
|
});
|