Skip to content

Commit

Permalink
chore(wf-types): config and webhookd examples
Browse files Browse the repository at this point in the history
  • Loading branch information
alonp99 committed Sep 9, 2024
1 parent afd9ddc commit f40549e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions services/workflows-service/src/workflow/dtos/workflow-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ export class WorkflowRunDto {
required: false,
type: 'object',
description: 'Additional configuration for the workflow run.',
example: {
subscriptions: [
{
type: 'webhook',
url: 'https://webhook.site/f82ea191-9d64-424f-887e-f84b8fcf4fe9',
events: ['workflow.completed'],
},
],
},
})
@IsObject()
@IsOptional()
Expand Down
11 changes: 11 additions & 0 deletions services/workflows-service/src/workflow/schemas/zod-schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,14 @@ export const ConfigSchema = z
.optional();

export type WorkflowConfig = z.infer<typeof ConfigSchema>;

export const CustomerConfigSchema = z.object({
ongoingWorkflowDefinitionId: z.string().optional(),
hideCreateMerchantMonitoringButton: z.boolean().optional(),
isExample: z.boolean().optional(),
isMerchantMonitoringEnabled: z.boolean().optional(),
isDemo: z.boolean().optional(),
maxBusinessReports: z.number().optional(),
});

export type TCustomerConfig = z.infer<typeof CustomerConfigSchema>;
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,15 @@ export class WorkflowControllerExternal {
},
},
documents: [],
config: {
subscriptions: [
{
type: 'webhook',
url: 'https://webhook.site/f82ea191-9d64-424f-887e-f8418faf4fe9',
events: ['workflow.completed'],
},
],
},
},
},
},
Expand Down

0 comments on commit f40549e

Please sign in to comment.