-
Notifications
You must be signed in to change notification settings - Fork 199
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
Bal 1644 - report in case management #2343
Closed
Changes from 100 commits
Commits
Show all changes
109 commits
Select commit
Hold shift + click to select a range
a229547
feat: add new controller for busniess report get api
liorzblrn 6fe5693
feat: add seed and new get alerts api
liorzblrn 1888d2e
fix: remove executionDetails from alert reponse
liorzblrn d657ee4
feat: added initial onboarding alerts table & implemented Filters com…
chesterkmr 2c03c6e
feat: updated callback to ongoing to format response for each report
Blokh fa0dd21
Merge branch 'dev' into blokh/feat/add-business-report-report-id
Blokh e849d29
feat: updated report return logic
Blokh 9de6f37
Merge branch 'blokh/feat/add-business-report-report-id' of github.com…
Blokh 35abd78
feat: added validation via zod
Blokh 89d3169
feat: removed optional report id
Blokh fa8935c
feat(backoffice): business ongoing monitoring
alonp99 cfe515d
feat(backoffice): business ongoing monitoring
alonp99 dc05878
merged with dev
Blokh 924ccaf
Merge branch 'dev' into blokh/feat/add-business-report-report-id
Blokh 0d1ed0b
updated ongoing service
Blokh 76cefc9
feat: updated business report logic and added business list fetching
Blokh 549cb7d
updated callback handler hook
Blokh 1d15b8c
Merge branch 'dev' into blokh/feat/add-business-report-report-id
Blokh e72ae5f
merged with dev
Blokh 203f583
updated previousReport to previousReportSummary
Blokh 0af4256
updated ongoing formats
Blokh 5c21784
Merge branch 'dev' into blokh/feat/add-business-report-report-id
Blokh 8d32745
merged with dev
Blokh 8344bf7
feat: fixed generating filesync
Blokh 1e976f2
fix: horrible merge
liorzblrn 7b6347d
fix: merge
liorzblrn 51cfc96
fix: merge 2
liorzblrn b5f36b4
fix: merge - fix lint
liorzblrn ae9c95f
fix: merge - fix tests
liorzblrn a8e1a1b
fix: rename config for jest
liorzblrn 8ed47e5
chore(tm): adding mappings, brand names
alonp99 ba93150
Merge pull request #2330 from ballerine-io/bal-1880-ongoing-moitoring…
liorzam 9f8d3c5
Merge branch 'dev' into blokh/feat/add-business-report-report-id
Blokh 7c4055a
fix: alert def for ongoing merchant _ merge
liorzblrn a6eca5b
Merge branch 'bal-1880-ongoing-moitoring-alerts-merge' into bal-1880-…
liorzblrn 13f68bb
fix: eslint
liorzblrn e2f6810
Merge branch 'dev' into bal-1880-ongoing-moitoring-alerts
Blokh 610d9f7
added additionalInfo to Data analytics
Blokh 36361bc
Merge branch 'dev' into blokh/feat/add-business-report-report-id
Blokh 55cfca6
Merge branch 'dev' into bal-1644
chesterkmr 4828e8c
Merge branch 'bal-1644-ongoing-alon' into bal-1644
chesterkmr ca2c60e
feat: update business report logic
Blokh 7b672f3
Merge branch 'blokh/feat/add-business-report-report-id' into feature/…
Blokh b19d4a7
merged with blokh/feat/add-business-report-report-id
Blokh 3fee08e
fix: cleanup & fixed layout
chesterkmr 2c43c5d
feat: finished logic of merchant monitoring creation
Blokh 5e7d0da
feat: business alerts boilerplate
chesterkmr 9b843c2
Merge branch 'bal-1656-epic-reports-in-case-management' into bal-1644
chesterkmr 41ce263
fix: types
chesterkmr 11dd0f5
Merge remote-tracking branch 'origin' into bal-1656-epic-reports-in-c…
liorzblrn 4cb5e8e
Merge branch 'bal-1656-epic-reports-in-case-management' into bal-1644
chesterkmr 49ec5b6
feat: added business reports seed & ongoing monitoring table
chesterkmr 6b303a9
feat: sync
chesterkmr 4d68f6a
Merge branch 'dev' into blokh/feat/add-business-report-report-id
Blokh abcb568
Merge branch 'blokh/feat/add-business-report-report-id' into feature/…
Blokh e4edf2c
feat: finalized hook callback handler
Blokh 5a309a3
feat: fixed ts issues
Blokh f14efa1
Merge branch 'dev' into blokh/feat/add-business-report-report-id
Blokh 07be97d
Merge branch 'blokh/feat/add-business-report-report-id' into feature/…
Blokh 0dc86f6
feat: updated alert logic and added testing
Blokh d73bcb0
Merge branch 'dev' into blokh/feat/add-business-report-report-id
Blokh 7bf63b7
Merge branch 'blokh/feat/add-business-report-report-id' into feature/…
Blokh 7fb50ab
fix(workflows-service): fixed bad import in zod-schemas.ts
Omri-Levy ff572dc
feat: revereted jest changes
Blokh 6a1cc16
feat: added nest requirements and updated tests
Blokh 1f65d71
feat: updated controller logic for processing
Blokh 6e0bf69
feat: added zod validation and changes in alert logic
Blokh 6da9f1d
Merge remote-tracking branch 'origin/feature/implement_ongoing_report…
chesterkmr 5b8e07f
Feature/implement ongoing report alert #1959 #1656 (#2341)
Blokh ce8bf38
feat: finalized business alerts table
chesterkmr 7443d11
feat: fixed alert service intg test
Blokh 5181498
Merge branch 'dev' into blokh/feat/add-business-report-report-id
Blokh 066f538
feat: merged wit hdev
Blokh 4a34fe1
Merge branch 'dev' into blokh/feat/add-business-report-report-id
Blokh 26aefad
Merge branch 'blokh/feat/add-business-report-report-id' into bal-1644
chesterkmr b1e4392
fixed imports
Blokh d0844c9
fix: post merge fixes
chesterkmr bce1800
feat: fix onboarding completion
Blokh 330341d
fix: removed log
chesterkmr 7ef11bb
fix: fixed missing alerts analysis page
chesterkmr 33be864
feat: added on clear to useFilter
chesterkmr ab45535
feat: refactorted filters context
chesterkmr a0f7969
feat: refactored filters
chesterkmr 6f4b1aa
fix: removed ts ignore
chesterkmr f074b33
feat: reverted filters
chesterkmr 30ac7f4
feat: added transaction to handle pglocking
Blokh b721fa6
Merge branch 'bal-1644' of github.com:ballerine-io/ballerine into bal…
Blokh 5fca5b1
fix: cleaned code duplicates & refactor
chesterkmr e0df50f
feat: refactored business alerts table
chesterkmr 9452a57
fix: div to p
chesterkmr 419de02
feat: merged with dev - fixed conflicts
Blokh 05aaf9e
Merge branch 'dev' into blokh/feat/add-business-report-report-id
Blokh 8747e79
feat: merged with dev
Blokh 2a47598
feat: updated check alerts logic
Blokh fcbcca3
feat: updated executin details
Blokh 2030bdb
Merge branch 'blokh/feat/add-business-report-report-id' into bal-1644
Blokh c446fc8
feat: fixed merge conflicts
Blokh 5b02205
Merge remote-tracking branch 'origin/dev' into bal-1644
Blokh 48bf1d3
feat: fixed conflicts with dev
Blokh 410de81
feat: fixed report generation logic
Blokh 45f1ebb
feat: updated create alert logic
Blokh 521c48f
fix(*): pr comments
Omri-Levy c6c998d
fix(*): resolved conflicts
Omri-Levy ced6237
fix(backoffice-v2): wrong props type name
Omri-Levy 4d9660b
fix(backoffice-v2): fixed type
Omri-Levy 842ac68
refactor(*): removed uintentional commited code
Omri-Levy 6aaceaf
refactor(backoffice-v2): no longer using the same accessor multiple t…
Omri-Levy fb9810b
fix(*): small fixes
Omri-Levy c6a0f23
fix: seed
chesterkmr 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
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
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
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: 8 additions & 0 deletions
8
apps/backoffice-v2/src/common/utils/save-base64-as-file/save-base64-as-file.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const saveBase64AsFile = (base64: string, fileName?: string) => { | ||
const link = document.createElement('a'); | ||
|
||
link.download = fileName || 'file'; | ||
link.href = base64; | ||
|
||
link.click(); | ||
}; |
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,12 +1,12 @@ | ||||||||||||||||||||||||||
import qs from 'qs'; | ||||||||||||||||||||||||||
import { apiClient } from '@/common/api-client/api-client'; | ||||||||||||||||||||||||||
import { Method } from '@/common/enums'; | ||||||||||||||||||||||||||
import { z } from 'zod'; | ||||||||||||||||||||||||||
import { ObjectWithIdSchema } from '@/lib/zod/utils/object-with-id/object-with-id'; | ||||||||||||||||||||||||||
import { handleZodError } from '@/common/utils/handle-zod-error/handle-zod-error'; | ||||||||||||||||||||||||||
import { env } from '@/common/env/env'; | ||||||||||||||||||||||||||
import { TObjectValues } from '@/common/types'; | ||||||||||||||||||||||||||
import { getOriginUrl } from '@/common/utils/get-origin-url/get-url-origin'; | ||||||||||||||||||||||||||
import { env } from '@/common/env/env'; | ||||||||||||||||||||||||||
import { handleZodError } from '@/common/utils/handle-zod-error/handle-zod-error'; | ||||||||||||||||||||||||||
import { ObjectWithIdSchema } from '@/lib/zod/utils/object-with-id/object-with-id'; | ||||||||||||||||||||||||||
import qs from 'qs'; | ||||||||||||||||||||||||||
import { z } from 'zod'; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
export const AlertSeverity = { | ||||||||||||||||||||||||||
CRITICAL: 'critical', | ||||||||||||||||||||||||||
|
@@ -72,32 +72,34 @@ export type TAlertState = (typeof AlertStates)[number]; | |||||||||||||||||||||||||
|
||||||||||||||||||||||||||
export type TAlertStates = typeof AlertStates; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
export const AlertsListSchema = z.array( | ||||||||||||||||||||||||||
ObjectWithIdSchema.extend({ | ||||||||||||||||||||||||||
dataTimestamp: z.string().datetime(), | ||||||||||||||||||||||||||
updatedAt: z.string().datetime(), | ||||||||||||||||||||||||||
subject: ObjectWithIdSchema.extend({ | ||||||||||||||||||||||||||
name: z.string(), | ||||||||||||||||||||||||||
correlationId: z.string(), | ||||||||||||||||||||||||||
type: z.enum(['business', 'counterparty']), | ||||||||||||||||||||||||||
}), | ||||||||||||||||||||||||||
severity: z.enum(AlertSeverities), | ||||||||||||||||||||||||||
export const AlertItemSchema = ObjectWithIdSchema.extend({ | ||||||||||||||||||||||||||
dataTimestamp: z.string().datetime(), | ||||||||||||||||||||||||||
updatedAt: z.string().datetime(), | ||||||||||||||||||||||||||
subject: ObjectWithIdSchema.extend({ | ||||||||||||||||||||||||||
name: z.string(), | ||||||||||||||||||||||||||
correlationId: z.string(), | ||||||||||||||||||||||||||
alertDetails: z.string(), | ||||||||||||||||||||||||||
// amountOfTxs: z.number(), | ||||||||||||||||||||||||||
assignee: ObjectWithIdSchema.extend({ | ||||||||||||||||||||||||||
fullName: z.string(), | ||||||||||||||||||||||||||
avatarUrl: z.string().nullable().optional(), | ||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||
.nullable() | ||||||||||||||||||||||||||
.default(null), | ||||||||||||||||||||||||||
status: z.enum(AlertStatuses), | ||||||||||||||||||||||||||
decision: z.enum(AlertStates).nullable().default(null), | ||||||||||||||||||||||||||
counterpartyId: z.string().nullable().default(null), | ||||||||||||||||||||||||||
type: z.enum(['business', 'counterparty']), | ||||||||||||||||||||||||||
}), | ||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||
severity: z.enum(AlertSeverities), | ||||||||||||||||||||||||||
correlationId: z.string(), | ||||||||||||||||||||||||||
alertDetails: z.string(), | ||||||||||||||||||||||||||
// amountOfTxs: z.number(), | ||||||||||||||||||||||||||
assignee: ObjectWithIdSchema.extend({ | ||||||||||||||||||||||||||
fullName: z.string(), | ||||||||||||||||||||||||||
avatarUrl: z.string().nullable().optional(), | ||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||
.nullable() | ||||||||||||||||||||||||||
.default(null), | ||||||||||||||||||||||||||
status: z.enum(AlertStatuses), | ||||||||||||||||||||||||||
decision: z.enum(AlertStates).nullable().default(null), | ||||||||||||||||||||||||||
counterpartyId: z.string().nullable().default(null), | ||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
export const AlertsListSchema = z.array(AlertItemSchema); | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
export type TAlertItem = z.output<typeof AlertItemSchema>; | ||||||||||||||||||||||||||
export type TAlertsList = z.output<typeof AlertsListSchema>; | ||||||||||||||||||||||||||
export type AlertEntityType = 'transaction' | 'business'; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
export const fetchAlerts = async (params: { | ||||||||||||||||||||||||||
orderBy: string; | ||||||||||||||||||||||||||
|
@@ -106,11 +108,17 @@ export const fetchAlerts = async (params: { | |||||||||||||||||||||||||
size: number; | ||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||
filter: Record<string, unknown>; | ||||||||||||||||||||||||||
entityType: AlertEntityType; | ||||||||||||||||||||||||||
}) => { | ||||||||||||||||||||||||||
const queryParams = qs.stringify(params, { encode: false }); | ||||||||||||||||||||||||||
let url = `${getOriginUrl(env.VITE_API_URL)}/api/v1/external/alerts?${queryParams}`; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
if (params.entityType === 'business') { | ||||||||||||||||||||||||||
url = `${getOriginUrl(env.VITE_API_URL)}/api/v1/external/alerts/business-report?${queryParams}`; | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
const [alerts, error] = await apiClient({ | ||||||||||||||||||||||||||
url: `${getOriginUrl(env.VITE_API_URL)}/api/v1/external/alerts?${queryParams}`, | ||||||||||||||||||||||||||
url, | ||||||||||||||||||||||||||
method: Method.GET, | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add error handling for the - const [alerts, error] = await apiClient({
+ try {
+ const [alerts, error] = await apiClient({
+ url,
+ method: Method.GET,
+ schema: AlertsListSchema,
+ });
+ return handleZodError(error, alerts);
+ } catch (e) {
+ console.error('Failed to fetch alerts:', e);
+ throw e;
+ } Committable suggestion
Suggested change
|
||||||||||||||||||||||||||
schema: AlertsListSchema, | ||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||
|
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
Oops, something went wrong.
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.
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.
Should be broken down to 2 fetchers