-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api-service): Usage insights email #7346
Draft
scopsy
wants to merge
34
commits into
next
Choose a base branch
from
insights-email
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
9f7b9dc
feat: insights
scopsy 5728669
feat: wip
scopsy 6eb853e
fix: hello world
scopsy 099fea9
fix: email
scopsy 8fb84e3
fix: email style
scopsy 60a85a3
fix: add marketing section
scopsy a49b625
fix: upload
scopsy d56c811
fix: logo
scopsy 8a89c1b
Merge branch 'next' into insights-email
scopsy 747dffd
fix: items
scopsy 5ee4ad9
fix: workflows
scopsy 6d7c867
fix: items
scopsy 63ef939
fix: items
scopsy 836c44f
fix: items
scopsy 0dd5361
fix: refactor
scopsy 9570eff
fix: review
scopsy 2be2bf1
fix: items
scopsy 5464b96
fix: items
scopsy 2945749
fix: bugs
scopsy 4c9bd12
fix: working state
scopsy 3b4e5a9
feat: add controller
scopsy 4a4f6bc
feat: add insights tester
scopsy 88f0530
fix: mixpanel
scopsy 510860a
fix: remove cache
scopsy efc2df7
fix: remove unused import
scopsy bd7e05f
fix: trigger
scopsy 65c3d67
fix: empty state
scopsy 9ea8c3c
fix: refactpr
scopsy 69a10f8
fix: r emov unused
scopsy 3173273
fix: validation
scopsy 465427d
fix: remove pr info
scopsy 2c39098
Merge branch 'next' into insights-email
scopsy ed1d443
Merge branch 'next' into insights-email
scopsy 325762b
fix: import
scopsy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: add controller
- Loading branch information
commit 3b4e5a9c50826f1c1650b7946fa58ba9f520ed68
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Controller, Get, Query } from '@nestjs/common'; | ||
import { ApiOperation, ApiQuery } from '@nestjs/swagger'; | ||
import { UsageInsights } from './usecases/usage-insights/usage-insights.usecase'; | ||
import { UsageInsightsCommand } from './usecases/usage-insights/usage-insights.command'; | ||
|
||
@Controller({ | ||
path: 'insights', | ||
}) | ||
export class InsightsController { | ||
constructor(private usageInsights: UsageInsights) {} | ||
|
||
@Get('/execute') | ||
@ApiOperation({ | ||
summary: 'Execute insights for a specific organization', | ||
}) | ||
@ApiQuery({ | ||
name: 'organizationId', | ||
type: String, | ||
required: true, | ||
description: 'The ID of the organization to execute insights for', | ||
}) | ||
async executeInsights(@Query('organizationId') organizationId: string) { | ||
const command = new UsageInsightsCommand({ organizationId }); | ||
|
||
return this.usageInsights.execute(command); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
apps/api/src/app/insights/usecases/usage-insights/usage-insights.command.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
export class UsageInsightsCommand {} | ||
export class UsageInsightsCommand { | ||
organizationId?: string; | ||
|
||
constructor(data: { organizationId?: string } = {}) { | ||
this.organizationId = data.organizationId; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a temporary controller protected allowed to be triggered by novu admins (protected by LD) to trigger individual insight emails during testing period