-
Notifications
You must be signed in to change notification settings - Fork 71
feat: ledger id null trigger #1526
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
Merged
+380
−127
Merged
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3bfb60a
feat: alert via email while ledgerId gets set to null
GHkrishna c9beeb3
feat: alert via email while ledgerId gets set to null
GHkrishna 3e6f9eb
fix: add pg query listen
GHkrishna cb3bbaa
fix: multiple event listner handle
GHkrishna 41543fd
fix: log enabling of alerts
GHkrishna f1bba47
fix: add env demo and sample events
GHkrishna b0513b4
fix: remove unwanted imports
GHkrishna 7f75778
fix: change toLocaleLowercase to toLowerCase
GHkrishna a86e787
fix: gracefully handle pg connect
GHkrishna 1a56a14
fix: increase try catch scope
GHkrishna 0c0fd05
fix: handle missing env variables gracefully
GHkrishna 699dd5b
fix: handle positive scenario properly
GHkrishna ca1d597
fix: handle positive scenario properly
GHkrishna 92317b9
fix: handle empty org_agents table in alerts
GHkrishna a1228b0
fix: handle retry logic and multiple notifications for send email
GHkrishna 0e8dff2
fix: make pg obj readonly
GHkrishna fe698d0
finally reset flag
GHkrishna 8d17f78
fix: Only initialize PgClient when DB_ALERT_ENABLE is true
GHkrishna 08940e3
fix: toLowerLocaleCase to toLowerCase
GHkrishna d107960
fix: TODOs regarding email from platformconfig
GHkrishna 8c82fc6
fix: cosmetic changes and missing env variable add in sample and demo
GHkrishna ab52155
fix: minor code rabbit changes
GHkrishna d34e792
fix: percentage threshold from common constants
GHkrishna 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,51 +1,60 @@ | ||
| import { PrismaService } from "@credebl/prisma-service"; | ||
| import { Injectable, Logger } from "@nestjs/common"; | ||
| import { PrismaService } from '@credebl/prisma-service'; | ||
| import { Injectable, Logger } from '@nestjs/common'; | ||
| // eslint-disable-next-line camelcase | ||
| import { shortening_url } from "@prisma/client"; | ||
| import { platform_config, shortening_url } from '@prisma/client'; | ||
|
|
||
| @Injectable() | ||
| export class UtilitiesRepository { | ||
| constructor( | ||
| private readonly prisma: PrismaService, | ||
| private readonly logger: Logger | ||
| ) { } | ||
|
|
||
| async saveShorteningUrl( | ||
| payload | ||
| ): Promise<object> { | ||
|
|
||
| try { | ||
|
|
||
| const { referenceId, invitationPayload } = payload; | ||
| const storeShorteningUrl = await this.prisma.shortening_url.upsert({ | ||
| where: { referenceId }, | ||
| update: { invitationPayload }, | ||
| create: { referenceId, invitationPayload } | ||
| }); | ||
|
|
||
| this.logger.log(`[saveShorteningUrl] - shortening url details ${referenceId}`); | ||
| return storeShorteningUrl; | ||
| } catch (error) { | ||
| this.logger.error(`Error in saveShorteningUrl: ${error} `); | ||
| throw error; | ||
| } | ||
| constructor( | ||
| private readonly prisma: PrismaService, | ||
| private readonly logger: Logger | ||
| ) {} | ||
|
|
||
| async saveShorteningUrl(payload): Promise<object> { | ||
| try { | ||
| const { referenceId, invitationPayload } = payload; | ||
| const storeShorteningUrl = await this.prisma.shortening_url.upsert({ | ||
| where: { referenceId }, | ||
| update: { invitationPayload }, | ||
| create: { referenceId, invitationPayload } | ||
| }); | ||
|
|
||
| this.logger.log(`[saveShorteningUrl] - shortening url details ${referenceId}`); | ||
| return storeShorteningUrl; | ||
| } catch (error) { | ||
| this.logger.error(`Error in saveShorteningUrl: ${error} `); | ||
| throw error; | ||
| } | ||
|
|
||
| // eslint-disable-next-line camelcase | ||
| async getShorteningUrl(referenceId): Promise<shortening_url> { | ||
| try { | ||
|
|
||
| const storeShorteningUrl = await this.prisma.shortening_url.findUnique({ | ||
| where: { | ||
| referenceId | ||
| } | ||
| }); | ||
|
|
||
| this.logger.log(`[getShorteningUrl] - shortening url details ${referenceId}`); | ||
| return storeShorteningUrl; | ||
| } catch (error) { | ||
| this.logger.error(`Error in getShorteningUrl: ${error} `); | ||
| throw error; | ||
| } | ||
|
|
||
| // eslint-disable-next-line camelcase | ||
| async getShorteningUrl(referenceId): Promise<shortening_url> { | ||
| try { | ||
| const storeShorteningUrl = await this.prisma.shortening_url.findUnique({ | ||
| where: { | ||
| referenceId | ||
| } | ||
| }); | ||
|
|
||
| this.logger.log(`[getShorteningUrl] - shortening url details ${referenceId}`); | ||
| return storeShorteningUrl; | ||
| } catch (error) { | ||
| this.logger.error(`Error in getShorteningUrl: ${error} `); | ||
| throw error; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Get platform config details | ||
| * @returns | ||
| */ | ||
| // eslint-disable-next-line camelcase | ||
| async getPlatformConfigDetails(): Promise<platform_config> { | ||
| try { | ||
| return this.prisma.platform_config.findFirst(); | ||
| } catch (error) { | ||
| this.logger.error(`[getPlatformConfigDetails] - error: ${JSON.stringify(error)}`); | ||
| throw error; | ||
| } | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.