[go: up one dir, main page]

Skip to content
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

refactor(api, application-generic): Encapsulate preference mutations in workflow use-cases #7005

Merged
merged 39 commits into from
Nov 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a7806b7
feat(workflow): add user preference management
rifont Nov 13, 2024
8af47b2
refactor(workflow): streamline preferences handling
rifont Nov 13, 2024
c403e6c
refactor(create-workflow): remove unused imports
rifont Nov 13, 2024
5c76727
docs(create-workflow): mark as deprecated
rifont Nov 14, 2024
b0a5077
refactor(preferences): simplify preference handling
rifont Nov 14, 2024
7f95b0c
Merge branch 'next' into nv-4752-start-writing-to-v2-preferences-for-all
rifont Nov 14, 2024
3512c76
chore: update subproject commit reference
rifont Nov 14, 2024
282e7db
Update apps/api/src/app/workflows-v1/workflow-v1.controller.ts
rifont Nov 14, 2024
5c3aa09
Update apps/api/src/app/workflows-v1/workflow-v1.controller.ts
rifont Nov 14, 2024
07b5606
Update libs/application-generic/src/usecases/upsert-preferences/upser…
rifont Nov 14, 2024
865f4f2
feat: Add preferences support to notifications
rifont Nov 14, 2024
368a172
feat(promote): update workflow preferences on promote
rifont Nov 14, 2024
90f226b
feat(notification): add user workflow preferences creation
rifont Nov 14, 2024
80ebfac
feat(workflow): Add critical flag to workflow updates
rifont Nov 14, 2024
59b9566
test: skip tests due to tenant flag issue
rifont Nov 14, 2024
1e0ade0
refactor(get-subscriber-template): update preference logic
rifont Nov 14, 2024
24fbc13
Merge branch 'next' into nv-4752-start-writing-to-v2-preferences-for-all
rifont Nov 14, 2024
10fbfa0
refactor(workflow): use default preferences if undefined
rifont Nov 14, 2024
6b01992
Merge branch 'nv-4752-start-writing-to-v2-preferences-for-all' of ssh…
rifont Nov 14, 2024
71a43d6
style: Update comment style for consistency
rifont Nov 14, 2024
712a64a
fix(preference): correct email source override logic
rifont Nov 14, 2024
7fb272b
refactor(controller): remove redundant null coalescing
rifont Nov 15, 2024
d70f044
refactor(update-workflow): remove unused import
rifont Nov 15, 2024
f7b91c1
refactor(workflow): update response dto class name
rifont Nov 15, 2024
fcc27bc
refactor(workflow): rename GetWorkflowResponseDto
rifont Nov 15, 2024
3e7804e
refactor(update-workflow): simplify workflow retrieval
rifont Nov 15, 2024
a02da71
Update libs/application-generic/src/usecases/get-subscriber-template-…
rifont Nov 15, 2024
d105e72
feat(preferences): Add delete preferences use case
rifont Nov 15, 2024
5054a79
Merge branch 'next' into nv-4752-start-writing-to-v2-preferences-for-all
rifont Nov 15, 2024
4fd8cd8
refactor(workflows-v2): update workflow type definition
rifont Nov 15, 2024
79d4784
test(delete-notification): fix assertion message text
rifont Nov 15, 2024
b3281dc
refactor(delete-template): use NotificationTemplateEntity
rifont Nov 15, 2024
599b011
Merge branch 'next' into nv-4752-start-writing-to-v2-preferences-for-all
rifont Nov 15, 2024
528e440
Merge branch 'next' into nv-4752-start-writing-to-v2-preferences-for-all
rifont Nov 15, 2024
7b6a57f
refactor(upsert-workflow): update persist logic parameters
rifont Nov 16, 2024
76c2f07
refactor: remove unused import in usecase file
rifont Nov 16, 2024
2bff10a
refactor(upsert-preferences): remove null checks
rifont Nov 16, 2024
92a922d
fix: handle null userPreferences in workflow creation
rifont Nov 16, 2024
e20ad04
feat(workflow): add issues and status handling
rifont Nov 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(upsert-workflow): update persist logic parameters
  • Loading branch information
rifont committed Nov 16, 2024
commit 7b6a57faf4c6b3deb7af628783b9f9b73d04d927
Copy link
Contributor Author
@rifont rifont Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UpsertWorkflow stops dealing with preferences now, leaving it to the downstream CreateWorkflow and UpdateWorkflow use-cases.

Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class UpsertWorkflowUseCase {
user: command.user,
workflow: persistedWorkflow,
});
await this.persistWorkflow(validatedWorkflowWithIssues, command);
await this.persistWorkflow(validatedWorkflowWithIssues);
persistedWorkflow = await this.getWorkflow(validatedWorkflowWithIssues._id, command);

return toResponseWorkflowDto(persistedWorkflow);
Expand All @@ -67,7 +67,16 @@ export class UpsertWorkflowUseCase {
}

private async persistWorkflow(workflowWithIssues: WorkflowInternalResponseDto) {
await this.updateWorkflowUsecase.execute(UpdateWorkflowCommand.create(workflowWithIssues));
await this.updateWorkflowUsecase.execute(
UpdateWorkflowCommand.create({
id: workflowWithIssues._id,
environmentId: workflowWithIssues._environmentId,
organizationId: workflowWithIssues._organizationId,
userId: workflowWithIssues._creatorId,
type: workflowWithIssues.type!,
...workflowWithIssues,
})
);
}

private async queryWorkflow(command: UpsertWorkflowCommand): Promise<WorkflowInternalResponseDto | null> {
Expand Down
Loading