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

Ongoing Monitoring #2133

Merged
merged 2 commits into from
Mar 4, 2024
Merged

Ongoing Monitoring #2133

merged 2 commits into from
Mar 4, 2024

Conversation

tomer-shvadron
Copy link
Collaborator

@tomer-shvadron tomer-shvadron commented Feb 26, 2024

Description

  • Fixed unused projectIds in FilterRepository
  • Added config column to Customer table
  • Created new Webhook module, controller and service
  • Added an endpoint for AML webhooks (supports entityType = 'individuals' only for now)
  • Some boyscouting

Copy link

changeset-bot bot commented Feb 26, 2024

⚠️ No Changeset found

Latest commit: 09b4b49

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@tomer-shvadron tomer-shvadron changed the title feat: ongoing monitoring Ongoing Monitoring Feb 26, 2024
@tomer-shvadron tomer-shvadron marked this pull request as draft February 26, 2024 22:06
@github-actions github-actions bot added enhancement New feature or request bug_fix labels Feb 26, 2024
Copy link
Contributor

PR Description updated to latest commit (1e8a6de)

Copy link
Contributor

PR Review

⏱️ Estimated effort to review [1-5]

4, because the PR introduces a significant amount of new functionality across multiple areas of the application, including database schema changes, new modules, and services. The complexity and interdependencies of these changes require a thorough review to ensure quality and maintainability.

🧪 Relevant tests

No

🔍 Possible issues

The handleAmlHit method in WebhooksService does not handle exceptions that may occur during the database operations or the workflow service calls, which could lead to unhandled promise rejections.

The findByIdUnscoped method in EndUserRepository introduces a new pattern that bypasses the existing scoping mechanisms, which could potentially lead to security concerns if not carefully managed.

The WebhooksModule imports a large number of services and repositories, some of which may not be necessary for its operation. This could lead to tighter coupling and harder-to-maintain code.

🔒 Security concerns

No

Code feedback:
relevant fileservices/workflows-service/src/webhooks/webhooks.service.ts
suggestion      

Consider wrapping the database and service calls in handleAmlHit method with try-catch blocks to handle potential exceptions and prevent unhandled promise rejections. This will improve the reliability of the webhook handling. [important]

relevant lineasync handleAmlHit({ entityId }: IndividualAmlWebhookInput) {

relevant fileservices/workflows-service/src/end-user/end-user.repository.ts
suggestion      

Evaluate the security implications of the findByIdUnscoped method to ensure it does not inadvertently expose sensitive user data. Consider implementing additional checks or using existing scoped methods where possible. [important]

relevant lineasync findByIdUnscoped>(

relevant fileservices/workflows-service/src/webhooks/webhooks.module.ts
suggestion      

Review the dependencies imported by WebhooksModule to ensure that only necessary services and repositories are included. Removing unnecessary imports will reduce coupling and improve module isolation. [medium]

relevant lineimport { AuthModule } from '@/auth/auth.module';

relevant fileservices/workflows-service/src/webhooks/webhooks.controller.ts
suggestion      

Implement input validation for the amlHook method to ensure that the received webhook data conforms to expected formats. This can prevent processing of invalid or malicious data. [important]

relevant lineasync amlHook(


✨ Review tool usage guide:

Overview:
The review tool scans the PR code changes, and generates a PR review. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:

/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...

With a configuration file, use the following template:

[pr_reviewer]
some_config1=...
some_config2=...
Utilizing extra instructions

The review tool can be configured with extra instructions, which can be used to guide the model to a feedback tailored to the needs of your project.

Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Specify the relevant sub-tool, and the relevant aspects of the PR that you want to emphasize.

Examples for extra instructions:

[pr_reviewer] # /review #
extra_instructions="""
In the 'possible issues' section, emphasize the following:
- Does the code logic cover relevant edge cases?
- Is the code logic clear and easy to understand?
- Is the code logic efficient?
...
"""

Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.

How to enable\disable automation
  • When you first install PR-Agent app, the default mode for the review tool is:
pr_commands = ["/review", ...]

meaning the review tool will run automatically on every PR, with the default configuration.
Edit this field to enable/disable the tool, or to change the used configurations

Auto-labels

The review tool can auto-generate two specific types of labels for a PR:

  • a possible security issue label, that detects possible security issues (enable_review_labels_security flag)
  • a Review effort [1-5]: x label, where x is the estimated effort to review the PR (enable_review_labels_effort flag)
Extra sub-tools

The review tool provides a collection of possible feedbacks about a PR.
It is recommended to review the possible options, and choose the ones relevant for your use case.
Some of the feature that are disabled by default are quite useful, and should be considered for enabling. For example:
require_score_review, require_soc2_ticket, and more.

Auto-approve PRs

By invoking:

/review auto_approve

The tool will automatically approve the PR, and add a comment with the approval.

To ensure safety, the auto-approval feature is disabled by default. To enable auto-approval, you need to actively set in a pre-defined configuration file the following:

[pr_reviewer]
enable_auto_approval = true

(this specific flag cannot be set with a command line argument, only in the configuration file, committed to the repository)

You can also enable auto-approval only if the PR meets certain requirements, such as that the estimated_review_effort is equal or below a certain threshold, by adjusting the flag:

[pr_reviewer]
maximal_review_effort = 5
More PR-Agent commands

To invoke the PR-Agent, add a comment using one of the following commands:

  • /review: Request a review of your Pull Request.
  • /describe: Update the PR title and description based on the contents of the PR.
  • /improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
  • /ask <QUESTION>: Ask a question about the PR.
  • /update_changelog: Update the changelog based on the PR's contents.
  • /add_docs 💎: Generate docstring for new components introduced in the PR.
  • /generate_labels 💎: Generate labels for the PR based on the PR's contents.
  • /analyze 💎: Automatically analyzes the PR, and presents changes walkthrough for each component.

See the tools guide for more details.
To list the possible configuration parameters, add a /config comment.

See the review usage page for a comprehensive guide on using this tool.

Copy link
Contributor

github-actions bot commented Feb 26, 2024

PR Code Suggestions

Suggestions                                                                                                                                                     
bug
Correct the decorator for apiVersion to match its type.         

The apiVersion property is decorated with @IsString() but it is defined as a Number type.
You should use @IsNumber() decorator to ensure proper validation.

services/workflows-service/src/webhooks/dtos/individual-aml-webhook-input.ts [16-17]

 @ApiProperty({
   required: true,
   type: Number,
 })
-@IsString()
+@IsNumber()
 apiVersion!: number;
 
best practice
Use global or controller-specific exception filters for error handling.      

Consider implementing error handling in a more centralized manner rather than using
try-catch in each controller method. NestJS provides filters like HttpExceptionFilter for
this purpose.

services/workflows-service/src/webhooks/webhooks.controller.ts [39-51]

-try {
-  if (entityType === ENTITY_TYPES.INDIVIDUALS) {
-    const { eventName } = data;
-    if (eventName === WEBHOOKS.AML_HIT) {
-      await this.webhooksService.handleAmlHit(data as IndividualAmlWebhookInput);
-    }
+if (entityType === ENTITY_TYPES.INDIVIDUALS) {
+  const { eventName } = data;
+  if (eventName === WEBHOOKS.AML_HIT) {
+    await this.webhooksService.handleAmlHit(data as IndividualAmlWebhookInput);
   }
-} catch (error) {
-  console.error(error);
-  throw error;
 }
 
enhancement
Remove unnecessary await for cleaner code.                      

Remove the unnecessary await keyword since findByLatestVersion is already returning a
promise and there's no additional asynchronous operation being awaited inside
getLatestVersion.

services/workflows-service/src/workflow-defintion/workflow-definition.service.ts [84]

-return await this.repository.findByLatestVersion(workflowDefinition.name, projectIds);
+return this.repository.findByLatestVersion(workflowDefinition.name, projectIds);
 
maintainability
Remove unused commented-out code.                                            

Consider removing the commented-out code related to ResubmissionReason and WorkflowData if
it's no longer needed, to improve code readability and maintainability.

services/workflows-service/src/workflow/workflow.service.ts [90-92]

-// TODO: TEMP (STUB)
 const policies = {
 

✨ Improve tool usage guide:

Overview:
The improve tool scans the PR code changes, and automatically generates suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.
When commenting, to edit configurations related to the improve tool (pr_code_suggestions section), use the following template:

/improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...

With a configuration file, use the following template:

[pr_code_suggestions]
some_config1=...
some_config2=...
Enabling\disabling automation

When you first install the app, the default mode for the improve tool is:

pr_commands = ["/improve --pr_code_suggestions.summarize=true", ...]

meaning the improve tool will run automatically on every PR, with summarization enabled. Delete this line to disable the tool from running automatically.

Utilizing extra instructions

Extra instructions are very important for the improve tool, since they enable to guide the model to suggestions that are more relevant to the specific needs of the project.

Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Specify relevant aspects that you want the model to focus on.

Examples for extra instructions:

[pr_code_suggestions] # /improve #
extra_instructions="""
Emphasize the following aspects:
- Does the code logic cover relevant edge cases?
- Is the code logic clear and easy to understand?
- Is the code logic efficient?
...
"""

Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.

A note on code suggestions quality
  • While the current AI for code is getting better and better (GPT-4), it's not flawless. Not all the suggestions will be perfect, and a user should not accept all of them automatically.
  • Suggestions are not meant to be simplistic. Instead, they aim to give deep feedback and raise questions, ideas and thoughts to the user, who can then use his judgment, experience, and understanding of the code base.
  • Recommended to use the 'extra_instructions' field to guide the model to suggestions that are more relevant to the specific needs of the project, or use the custom suggestions 💎 tool
  • With large PRs, best quality will be obtained by using 'improve --extended' mode.
More PR-Agent commands

To invoke the PR-Agent, add a comment using one of the following commands:

  • /review: Request a review of your Pull Request.
  • /describe: Update the PR title and description based on the contents of the PR.
  • /improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
  • /ask <QUESTION>: Ask a question about the PR.
  • /update_changelog: Update the changelog based on the PR's contents.
  • /add_docs 💎: Generate docstring for new components introduced in the PR.
  • /generate_labels 💎: Generate labels for the PR based on the PR's contents.
  • /analyze 💎: Automatically analyzes the PR, and presents changes walkthrough for each component.

See the tools guide for more details.
To list the possible configuration parameters, add a /config comment.

See the improve usage page for a more comprehensive guide on using this tool.

@github-actions github-actions bot force-pushed the bal-1343 branch 3 times, most recently from b721973 to 07e4179 Compare February 29, 2024 10:53
@tomer-shvadron tomer-shvadron marked this pull request as ready for review February 29, 2024 11:03
@tomer-shvadron tomer-shvadron changed the base branch from dev to feat/ongoing March 3, 2024 14:51
@tomer-shvadron tomer-shvadron merged commit c3705c6 into feat/ongoing Mar 4, 2024
7 checks passed
@tomer-shvadron tomer-shvadron deleted the bal-1343 branch March 4, 2024 09:17
tomer-shvadron added a commit that referenced this pull request Mar 5, 2024
* feat: ongoing monitoring

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

fix(prisma): update subproject commit hash in data-migrations

feat(prisma): add config column to Customer table

feat(app.module): import WebhooksModule

feat(zod-schemas): add CustomerConfigSchema and TCustomerConfig types

fix(end-user.repository): update import path for PrismaService

feat(end-user.service): add missing line break

fix(filter.repository): update scopeService.scopeFindFirst method call

fix(global.d.ts): add config and subscriptions fields to Customer type

feat(webhooks): add AmlWebhookInput and IndividualAmlWebhookInput DTOs

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* refactor(backoffice-v2): moved aml cells to a re-usable hook

* refactor(backoffice-v2): added an on-going blocks variant

* feat(backoffice-v2): added an actions variant for on-going

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

chore(package.json): add new migration script for adding a config column to the Customer table

chore(schema.prisma): add config field to the Customer model

chore(app.module.ts): import and add WebhooksModule to the AppModule

chore(zod-schemas.ts): add CustomerConfigSchema and TCustomerConfig types

chore(end-user.repository.ts): update import path for PrismaService

chore(end-user.repository.ts): add new method findByIdUnscoped to retrieve end user by id without applying project scope

chore(end-user.service.ts): add missing line break

chore(filter.repository.ts): update scopeService.scopeFindFirst to scopeService.scopeFindFirst with projectIds parameter

chore(global.d.ts): add config field to the Customer type

chore(webhooks/dtos/aml-webhook-input.ts): create AmlWebhookInput class

chore(webhooks/dtos/individual-aml-webhook-input.ts): create IndividualAmlWebhookInput class

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

fix(prisma): update subproject commit hash in data-migrations

feat(prisma): add config column to Customer table

feat(app.module): import WebhooksModule

feat(zod-schemas): add CustomerConfigSchema and TCustomerConfig types

fix(end-user.repository): update import path for PrismaService

feat(end-user.service): add missing line break

fix(filter.repository): update scopeService.scopeFindFirst method call

fix(global.d.ts): add config and subscriptions fields to Customer type

feat(webhooks): add AmlWebhookInput and IndividualAmlWebhookInput DTOs

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* feat: more work

* feat: test fix

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id argument

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id parameter

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id argument

* service

* service

* feat(backoffice-v2): added temporary mocks

* feat: small fixes

* feat: small fix

* Backoffice on-going (#2143)

* refactor(backoffice-v2): moved mocks position

* fix(backoffice-v2): fixed flagged badge variant

* refactor(backoffice-v2): removed aml mocks

* refactor(*): addressed pr comments

---------

Co-authored-by: Alon Peretz <[email protected]>

* Ongoing Monitoring (#2133)

* feat: ts fix

* feat: pr comments fix

* feat: fixes for aml block

---------

Co-authored-by: Omri Levy <[email protected]>
Co-authored-by: Alon Peretz <[email protected]>
Co-authored-by: Omri Levy <[email protected]>
tomer-shvadron added a commit that referenced this pull request Mar 5, 2024
* feat: ongoing monitoring

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

fix(prisma): update subproject commit hash in data-migrations

feat(prisma): add config column to Customer table

feat(app.module): import WebhooksModule

feat(zod-schemas): add CustomerConfigSchema and TCustomerConfig types

fix(end-user.repository): update import path for PrismaService

feat(end-user.service): add missing line break

fix(filter.repository): update scopeService.scopeFindFirst method call

fix(global.d.ts): add config and subscriptions fields to Customer type

feat(webhooks): add AmlWebhookInput and IndividualAmlWebhookInput DTOs

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* refactor(backoffice-v2): moved aml cells to a re-usable hook

* refactor(backoffice-v2): added an on-going blocks variant

* feat(backoffice-v2): added an actions variant for on-going

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

chore(package.json): add new migration script for adding a config column to the Customer table

chore(schema.prisma): add config field to the Customer model

chore(app.module.ts): import and add WebhooksModule to the AppModule

chore(zod-schemas.ts): add CustomerConfigSchema and TCustomerConfig types

chore(end-user.repository.ts): update import path for PrismaService

chore(end-user.repository.ts): add new method findByIdUnscoped to retrieve end user by id without applying project scope

chore(end-user.service.ts): add missing line break

chore(filter.repository.ts): update scopeService.scopeFindFirst to scopeService.scopeFindFirst with projectIds parameter

chore(global.d.ts): add config field to the Customer type

chore(webhooks/dtos/aml-webhook-input.ts): create AmlWebhookInput class

chore(webhooks/dtos/individual-aml-webhook-input.ts): create IndividualAmlWebhookInput class

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

fix(prisma): update subproject commit hash in data-migrations

feat(prisma): add config column to Customer table

feat(app.module): import WebhooksModule

feat(zod-schemas): add CustomerConfigSchema and TCustomerConfig types

fix(end-user.repository): update import path for PrismaService

feat(end-user.service): add missing line break

fix(filter.repository): update scopeService.scopeFindFirst method call

fix(global.d.ts): add config and subscriptions fields to Customer type

feat(webhooks): add AmlWebhookInput and IndividualAmlWebhookInput DTOs

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* feat: more work

* feat: test fix

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id argument

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id parameter

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id argument

* service

* service

* feat(backoffice-v2): added temporary mocks

* feat: small fixes

* feat: small fix

* Backoffice on-going (#2143)

* refactor(backoffice-v2): moved mocks position

* fix(backoffice-v2): fixed flagged badge variant

* refactor(backoffice-v2): removed aml mocks

* refactor(*): addressed pr comments

---------

Co-authored-by: Alon Peretz <[email protected]>

* Ongoing Monitoring (#2133)

* feat: ts fix

* feat: pr comments fix

* Fixes for AML block (#2152)

* feat: ongoing monitoring

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

fix(prisma): update subproject commit hash in data-migrations

feat(prisma): add config column to Customer table

feat(app.module): import WebhooksModule

feat(zod-schemas): add CustomerConfigSchema and TCustomerConfig types

fix(end-user.repository): update import path for PrismaService

feat(end-user.service): add missing line break

fix(filter.repository): update scopeService.scopeFindFirst method call

fix(global.d.ts): add config and subscriptions fields to Customer type

feat(webhooks): add AmlWebhookInput and IndividualAmlWebhookInput DTOs

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* refactor(backoffice-v2): moved aml cells to a re-usable hook

* refactor(backoffice-v2): added an on-going blocks variant

* feat(backoffice-v2): added an actions variant for on-going

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

chore(package.json): add new migration script for adding a config column to the Customer table

chore(schema.prisma): add config field to the Customer model

chore(app.module.ts): import and add WebhooksModule to the AppModule

chore(zod-schemas.ts): add CustomerConfigSchema and TCustomerConfig types

chore(end-user.repository.ts): update import path for PrismaService

chore(end-user.repository.ts): add new method findByIdUnscoped to retrieve end user by id without applying project scope

chore(end-user.service.ts): add missing line break

chore(filter.repository.ts): update scopeService.scopeFindFirst to scopeService.scopeFindFirst with projectIds parameter

chore(global.d.ts): add config field to the Customer type

chore(webhooks/dtos/aml-webhook-input.ts): create AmlWebhookInput class

chore(webhooks/dtos/individual-aml-webhook-input.ts): create IndividualAmlWebhookInput class

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

fix(prisma): update subproject commit hash in data-migrations

feat(prisma): add config column to Customer table

feat(app.module): import WebhooksModule

feat(zod-schemas): add CustomerConfigSchema and TCustomerConfig types

fix(end-user.repository): update import path for PrismaService

feat(end-user.service): add missing line break

fix(filter.repository): update scopeService.scopeFindFirst method call

fix(global.d.ts): add config and subscriptions fields to Customer type

feat(webhooks): add AmlWebhookInput and IndividualAmlWebhookInput DTOs

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* feat: more work

* feat: test fix

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id argument

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id parameter

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id argument

* service

* service

* feat(backoffice-v2): added temporary mocks

* feat: small fixes

* feat: small fix

* Backoffice on-going (#2143)

* refactor(backoffice-v2): moved mocks position

* fix(backoffice-v2): fixed flagged badge variant

* refactor(backoffice-v2): removed aml mocks

* refactor(*): addressed pr comments

---------

Co-authored-by: Alon Peretz <[email protected]>

* Ongoing Monitoring (#2133)

* feat: ts fix

* feat: pr comments fix

* feat: fixes for aml block

---------

Co-authored-by: Omri Levy <[email protected]>
Co-authored-by: Alon Peretz <[email protected]>
Co-authored-by: Omri Levy <[email protected]>

---------

Co-authored-by: Tomer Shvadron <[email protected]>
Co-authored-by: Omri Levy <[email protected]>
Co-authored-by: Omri Levy <[email protected]>
chesterkmr pushed a commit that referenced this pull request Mar 11, 2024
* feat: ongoing monitoring

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

fix(prisma): update subproject commit hash in data-migrations

feat(prisma): add config column to Customer table

feat(app.module): import WebhooksModule

feat(zod-schemas): add CustomerConfigSchema and TCustomerConfig types

fix(end-user.repository): update import path for PrismaService

feat(end-user.service): add missing line break

fix(filter.repository): update scopeService.scopeFindFirst method call

fix(global.d.ts): add config and subscriptions fields to Customer type

feat(webhooks): add AmlWebhookInput and IndividualAmlWebhookInput DTOs

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* refactor(backoffice-v2): moved aml cells to a re-usable hook

* refactor(backoffice-v2): added an on-going blocks variant

* feat(backoffice-v2): added an actions variant for on-going

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

chore(package.json): add new migration script for adding a config column to the Customer table

chore(schema.prisma): add config field to the Customer model

chore(app.module.ts): import and add WebhooksModule to the AppModule

chore(zod-schemas.ts): add CustomerConfigSchema and TCustomerConfig types

chore(end-user.repository.ts): update import path for PrismaService

chore(end-user.repository.ts): add new method findByIdUnscoped to retrieve end user by id without applying project scope

chore(end-user.service.ts): add missing line break

chore(filter.repository.ts): update scopeService.scopeFindFirst to scopeService.scopeFindFirst with projectIds parameter

chore(global.d.ts): add config field to the Customer type

chore(webhooks/dtos/aml-webhook-input.ts): create AmlWebhookInput class

chore(webhooks/dtos/individual-aml-webhook-input.ts): create IndividualAmlWebhookInput class

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

fix(prisma): update subproject commit hash in data-migrations

feat(prisma): add config column to Customer table

feat(app.module): import WebhooksModule

feat(zod-schemas): add CustomerConfigSchema and TCustomerConfig types

fix(end-user.repository): update import path for PrismaService

feat(end-user.service): add missing line break

fix(filter.repository): update scopeService.scopeFindFirst method call

fix(global.d.ts): add config and subscriptions fields to Customer type

feat(webhooks): add AmlWebhookInput and IndividualAmlWebhookInput DTOs

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* feat: more work

* feat: test fix

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id argument

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id parameter

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id argument

* service

* service

* feat(backoffice-v2): added temporary mocks

* feat: small fixes

* feat: small fix

* Backoffice on-going (#2143)

* refactor(backoffice-v2): moved mocks position

* fix(backoffice-v2): fixed flagged badge variant

* refactor(backoffice-v2): removed aml mocks

* refactor(*): addressed pr comments

---------

Co-authored-by: Alon Peretz <[email protected]>

* Ongoing Monitoring (#2133)

* feat: ts fix

* feat: pr comments fix

* Fixes for AML block (#2152)

* feat: ongoing monitoring

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

fix(prisma): update subproject commit hash in data-migrations

feat(prisma): add config column to Customer table

feat(app.module): import WebhooksModule

feat(zod-schemas): add CustomerConfigSchema and TCustomerConfig types

fix(end-user.repository): update import path for PrismaService

feat(end-user.service): add missing line break

fix(filter.repository): update scopeService.scopeFindFirst method call

fix(global.d.ts): add config and subscriptions fields to Customer type

feat(webhooks): add AmlWebhookInput and IndividualAmlWebhookInput DTOs

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* refactor(backoffice-v2): moved aml cells to a re-usable hook

* refactor(backoffice-v2): added an on-going blocks variant

* feat(backoffice-v2): added an actions variant for on-going

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

chore(package.json): add new migration script for adding a config column to the Customer table

chore(schema.prisma): add config field to the Customer model

chore(app.module.ts): import and add WebhooksModule to the AppModule

chore(zod-schemas.ts): add CustomerConfigSchema and TCustomerConfig types

chore(end-user.repository.ts): update import path for PrismaService

chore(end-user.repository.ts): add new method findByIdUnscoped to retrieve end user by id without applying project scope

chore(end-user.service.ts): add missing line break

chore(filter.repository.ts): update scopeService.scopeFindFirst to scopeService.scopeFindFirst with projectIds parameter

chore(global.d.ts): add config field to the Customer type

chore(webhooks/dtos/aml-webhook-input.ts): create AmlWebhookInput class

chore(webhooks/dtos/individual-aml-webhook-input.ts): create IndividualAmlWebhookInput class

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* chore(package.json): update db:reset:dev:with-data script to use db:reset:dev script before running db:data-migration:migrate

fix(prisma): update subproject commit hash in data-migrations

feat(prisma): add config column to Customer table

feat(app.module): import WebhooksModule

feat(zod-schemas): add CustomerConfigSchema and TCustomerConfig types

fix(end-user.repository): update import path for PrismaService

feat(end-user.service): add missing line break

fix(filter.repository): update scopeService.scopeFindFirst method call

fix(global.d.ts): add config and subscriptions fields to Customer type

feat(webhooks): add AmlWebhookInput and IndividualAmlWebhookInput DTOs

feat(webhooks): add webhooks controller, module, and service

- Add a new file `webhooks.controller.ts` to handle webhooks related requests.
- Add a new file `webhooks.module.ts` to define the webhooks module and its dependencies.
- Add a new file `webhooks.service.ts` to handle webhook events.
- Implement the `amlHook` method in the `WebhooksController` to handle AML webhook events.
- Implement the `handleAmlHit` method in the `WebhooksService` to handle AML_HIT events.
- Update the imports and dependencies in the existing files to include the newly added files.

The purpose of these changes is to introduce a new feature that allows handling AML webhook events in the application. This feature will enable the application to respond to AML_HIT events and perform necessary actions based on the event data.

* feat: more work

* feat: test fix

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id argument

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id parameter

* chore(workflows-service): update subproject commit hash in data-migrations
refactor(business.controller.internal): remove unused import of ProjectScopeService
fix(customer.repository): fix import path for PrismaService
test(workflow-definition.service.intg.test): update filterService.getById calls to pass correct project id argument

* service

* service

* feat(backoffice-v2): added temporary mocks

* feat: small fixes

* feat: small fix

* Backoffice on-going (#2143)

* refactor(backoffice-v2): moved mocks position

* fix(backoffice-v2): fixed flagged badge variant

* refactor(backoffice-v2): removed aml mocks

* refactor(*): addressed pr comments

---------

Co-authored-by: Alon Peretz <[email protected]>

* Ongoing Monitoring (#2133)

* feat: ts fix

* feat: pr comments fix

* feat: fixes for aml block

---------

Co-authored-by: Omri Levy <[email protected]>
Co-authored-by: Alon Peretz <[email protected]>
Co-authored-by: Omri Levy <[email protected]>

---------

Co-authored-by: Tomer Shvadron <[email protected]>
Co-authored-by: Omri Levy <[email protected]>
Co-authored-by: Omri Levy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants