feat(campaigns): start_date for threat-actor-generated campaigns

Backend:
- campaign_service.generate_campaign_from_threat_actor: accept optional
  start_date kwarg and set it on the Campaign model
- campaigns router: new GenerateFromActorPayload schema, /from-threat-actor
  endpoint now accepts optional body with start_date

Frontend:
- generateCampaignFromThreatActor API: accept optional options param
- Generate Campaign modal: date picker + warning message, same UX as the
  manual create form
This commit is contained in:
kitos
2026-06-04 13:37:40 +02:00
parent f605b52d89
commit 27c67a5f76
4 changed files with 48 additions and 3 deletions
+8 -2
View File
@@ -155,8 +155,14 @@ export async function getCampaignProgress(campaignId: string): Promise<CampaignP
}
/** Generate a campaign from a threat actor. */
export async function generateCampaignFromThreatActor(actorId: string): Promise<Campaign> {
const { data } = await client.post<Campaign>(`/campaigns/from-threat-actor/${actorId}`);
export async function generateCampaignFromThreatActor(
actorId: string,
options?: { start_date?: string },
): Promise<Campaign> {
const { data } = await client.post<Campaign>(
`/campaigns/from-threat-actor/${actorId}`,
options ?? {},
);
return data;
}