import { createEnvelopeEventTrigger } from '../envelope-event-trigger';

export const envelopeCreated = createEnvelopeEventTrigger({
  name: 'envelopeCreated',
  displayName: 'Signing Request Created',
  description:
    'Triggers when a new signing request (envelope) is created in DocuSign — whether sent immediately or saved as a draft.',
  aiMetadata: {
    description:
      'Fires when a new DocuSign envelope (signing request) is created on the account, whether it was sent immediately or saved as a draft. Represents the earliest point in an envelope lifecycle, before any recipient action.',
  },
  docusignEvent: 'envelope-created',
  sampleData: {
    event: 'envelope-created',
    apiVersion: 'v2.1',
    uri: '/restapi/v2.1/accounts/6544471c-xxx-xxx-xxxx-39bb8a61f598/envelopes/b31128f9-xxxx-xxxx-xxx-7835d84310f5',
    retryCount: 0,
    configurationId: 22127522,
    generatedDateTime: '2026-04-17T06:52:37.9980000Z',
    data: {
      accountId: '6544471c-xxx-xxx-xxxx-39bb8a61f598',
      userId: '7063cf65-xxx-xxxx-xxxx-ba5ba6bc213b',
      envelopeId: 'b31128f9-xxxx-xxx-xx-xxxx',
    },
  },
});
