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 AML #2144

Merged
merged 29 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2cb7c77
feat: ongoing monitoring
tomer-shvadron Feb 26, 2024
1e8a6de
chore(package.json): update db:reset:dev:with-data script to use db:r…
tomer-shvadron Feb 26, 2024
540f796
refactor(backoffice-v2): moved aml cells to a re-usable hook
Omri-Levy Feb 28, 2024
58820fd
refactor(backoffice-v2): added an on-going blocks variant
Omri-Levy Feb 28, 2024
a14ce74
feat(backoffice-v2): added an actions variant for on-going
Omri-Levy Feb 28, 2024
cd42783
Merge branch 'bal-1343' of https://github.com/ballerine-io/ballerine …
tomer-shvadron Feb 29, 2024
85685ab
chore(package.json): update db:reset:dev:with-data script to use db:r…
tomer-shvadron Feb 26, 2024
8b41f98
chore(package.json): update db:reset:dev:with-data script to use db:r…
tomer-shvadron Feb 26, 2024
4e95cc4
feat: more work
tomer-shvadron Feb 29, 2024
08031e3
Merge branch 'bal-1343' of https://github.com/ballerine-io/ballerine …
tomer-shvadron Feb 29, 2024
0e32e39
feat: test fix
tomer-shvadron Feb 29, 2024
9e703c3
chore(workflows-service): update subproject commit hash in data-migra…
tomer-shvadron Feb 29, 2024
b721973
Merge branch 'bal-1343' of https://github.com/ballerine-io/ballerine …
tomer-shvadron Feb 29, 2024
c615cce
chore(workflows-service): update subproject commit hash in data-migra…
tomer-shvadron Feb 29, 2024
07e4179
chore(workflows-service): update subproject commit hash in data-migra…
tomer-shvadron Feb 29, 2024
83a2db4
service
alonp99 Feb 29, 2024
ac610a6
service
alonp99 Feb 29, 2024
3c744ae
service
alonp99 Feb 29, 2024
104faf2
feat(backoffice-v2): added temporary mocks
Omri-Levy Feb 29, 2024
b717e3a
chore(*): merged dev into local branch
Omri-Levy Feb 29, 2024
ca32438
Merge branch 'bal-1343' of https://github.com/ballerine-io/ballerine …
tomer-shvadron Feb 29, 2024
1ae872b
feat: small fixes
tomer-shvadron Feb 29, 2024
23f7051
Merge branch 'dev' into bal-1343
tomer-shvadron Feb 29, 2024
347247f
Merge branch 'bal-1343' into feat/ongoing
alonp99 Feb 29, 2024
0dcfc3f
feat: small fix
tomer-shvadron Feb 29, 2024
0753ecd
Backoffice on-going (#2143)
Omri-Levy Mar 4, 2024
c3705c6
Ongoing Monitoring (#2133)
tomer-shvadron Mar 4, 2024
254a068
Fixes for AML block (#2152)
tomer-shvadron Mar 5, 2024
2a58b49
Merge branch 'dev' into feat/ongoing
tomer-shvadron Mar 5, 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
12 changes: 12 additions & 0 deletions apps/backoffice-v2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @ballerine/backoffice-v2

## 0.5.52

### Patch Changes

- version bump
- Updated dependencies
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]

## 0.5.51

### Patch Changes
Expand Down
16 changes: 8 additions & 8 deletions apps/backoffice-v2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ballerine/backoffice-v2",
"version": "0.5.51",
"version": "0.5.52",
"description": "Ballerine - Backoffice",
"homepage": "https://github.com/ballerine-io/ballerine",
"repository": {
Expand Down Expand Up @@ -50,11 +50,11 @@
"preview": "vite preview"
},
"dependencies": {
"@ballerine/blocks": "0.1.27",
"@ballerine/common": "0.7.45",
"@ballerine/ui": "^0.3.29",
"@ballerine/workflow-browser-sdk": "0.5.45",
"@ballerine/workflow-node-sdk": "0.5.45",
"@ballerine/blocks": "0.1.28",
"@ballerine/common": "0.7.46",
"@ballerine/ui": "^0.3.30",
"@ballerine/workflow-browser-sdk": "0.5.46",
"@ballerine/workflow-node-sdk": "0.5.46",
"@fontsource/inter": "^4.5.15",
"@formkit/auto-animate": "1.0.0-beta.5",
"@hookform/resolvers": "^3.1.0",
Expand Down Expand Up @@ -109,8 +109,8 @@
"zod": "^3.22.3"
},
"devDependencies": {
"@ballerine/config": "^1.0.6",
"@ballerine/eslint-config-react": "^1.0.7",
"@ballerine/config": "^1.0.7",
"@ballerine/eslint-config-react": "^1.0.8",
"@cspell/cspell-types": "^6.31.1",
"@faker-js/faker": "^7.6.0",
"@playwright/test": "^1.32.1",
Expand Down
8 changes: 8 additions & 0 deletions apps/backoffice-v2/public/locales/en/toast.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"dismiss_case": {
"success": "The case has been dismissed successfully.",
"error": "Error occurred while dismissing the case."
},
"flag_case": {
"success": "The case has been flagged successfully.",
"error": "Error occurred while flagging the case."
},
"approve_case": {
"success": "The case has been approved successfully.",
"error": "Error occurred while approving the case."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Collapsible } from '@/common/components/molecules/Collapsible/Collapsib
import { CollapsibleTrigger } from '@/common/components/molecules/Collapsible/Collapsible.Trigger';
import { CollapsibleContent } from '@/common/components/molecules/Collapsible/Collapsible.Content';
import { useNavbarLogic } from '@/common/components/organisms/Header/hooks/useNavbarLogic/useNavbarLogic';
import { Fragment } from 'react';

/**
* @description A nav element which wraps {@link NavItem} components of the app's routes. Supports nested routes.
Expand All @@ -23,13 +24,9 @@ export const Navbar: FunctionComponent = () => {
const isActiveFilterGroup = checkIsActiveFilterGroup(navItem);

return (
<>
<Fragment key={`${navItem.key}-${isActiveFilterGroup}`}>
{!!navItem.children && (
<Collapsible
key={`${navItem.key}-${isActiveFilterGroup}`}
defaultOpen={isActiveFilterGroup}
className={`space-y-2`}
>
<Collapsible defaultOpen={isActiveFilterGroup} className={`space-y-2`}>
<CollapsibleTrigger
className={ctw(
`flex w-full items-center gap-x-2 rounded-lg p-2 text-sm font-semibold text-[#8D93A5] [&[data-state=open]>svg]:rotate-0`,
Expand Down Expand Up @@ -95,7 +92,7 @@ export const Navbar: FunctionComponent = () => {
</NavItem>
</ul>
)}
</>
</Fragment>
);
})}
</nav>
Expand Down
2 changes: 2 additions & 0 deletions apps/backoffice-v2/src/common/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export const Action = {
APPROVE: 'approve',
REVISION: 'revision',
CASE_REVIEWED: 'CASE_REVIEWED',
DISMISS: 'dismiss',
FLAG: 'flag',
} as const;
export const Resource = {
INDIVIDUAL: 'INDIVIDUAL',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { Action } from '../../../../../common/enums';
// @TODO: Refactor to be under cases/workflows domain
export const useApproveCaseMutation = ({
workflowId,
onSelectNextEntity,
onSelectNextCase,
}: {
workflowId: string;
onSelectNextEntity?: VoidFunction;
onSelectNextCase?: VoidFunction;
}) => {
const queryClient = useQueryClient();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import toast from 'react-hot-toast';
import { t } from 'i18next';
import { fetchWorkflowEvent } from '../../../../workflows/fetchers';
import { workflowsQueryKeys } from '../../../../workflows/query-keys';
import { Action } from '../../../../../common/enums';

export const useDismissCaseMutation = ({
workflowId,
onSelectNextCase,
}: {
workflowId: string;
onSelectNextCase?: VoidFunction;
}) => {
const queryClient = useQueryClient();

return useMutation({
mutationFn: () =>
fetchWorkflowEvent({
workflowId,
body: {
name: Action.DISMISS,
},
}),
onSuccess: () => {
// workflowsQueryKeys._def is the base key for all workflows queries
void queryClient.invalidateQueries(workflowsQueryKeys._def);

toast.success(t('toast:dismiss_case.success'));

// TODO: Re-implement
// onSelectNextEntity();
tomer-shvadron marked this conversation as resolved.
Show resolved Hide resolved
},
onError: () => {
toast.error(t('toast:dismiss_case.error'));
},
});
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import toast from 'react-hot-toast';
import { t } from 'i18next';
import { fetchWorkflowEvent } from '../../../../workflows/fetchers';
import { workflowsQueryKeys } from '../../../../workflows/query-keys';
import { Action } from '../../../../../common/enums';

export const useFlagCaseMutation = ({
workflowId,
onSelectNextCase,
}: {
workflowId: string;
onSelectNextCase?: VoidFunction;
}) => {
const queryClient = useQueryClient();

return useMutation({
mutationFn: () =>
fetchWorkflowEvent({
workflowId,
body: {
name: Action.FLAG,
},
}),
onSuccess: () => {
// workflowsQueryKeys._def is the base key for all workflows queries
void queryClient.invalidateQueries(workflowsQueryKeys._def);

toast.success(t('toast:flag_case.success'));

// TODO: Re-implement
// onSelectNextEntity();
},
onError: () => {
toast.error(t('toast:flag_case.error'));
},
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { fetchWorkflowEvent } from '../../../../workflows/fetchers';
import { workflowsQueryKeys } from '../../../../workflows/query-keys';

// @TODO: Refactor to be under cases/workflows domain
export const useRejectEntityMutation = ({
export const useRejectCaseMutation = ({
workflowId,
onSelectNextEntity,
onSelectNextCase,
}: {
workflowId: string;
onSelectNextEntity?: VoidFunction;
onSelectNextCase?: VoidFunction;
}) => {
const queryClient = useQueryClient();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback } from 'react';

export const useSelectNextEntity = () => {
export const useSelectNextCase = () => {
return useCallback(() => {
// @TODO: Implement
throw new Error('Not implemented');
Expand Down
2 changes: 2 additions & 0 deletions apps/backoffice-v2/src/domains/workflows/fetchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { zPropertyKey } from '@/lib/zod/utils/z-property-key/z-property-key';
import { IWorkflowId } from './interfaces';
import { getOriginUrl } from '@/common/utils/get-origin-url/get-url-origin';
import { WorkflowDefinitionByIdSchema } from '@/domains/workflow-definitions/fetchers';
import { AmlSchema } from '@/lib/blocks/components/AmlBlock/utils/aml-adapter';

export const fetchWorkflows = async (params: {
filterId: string;
Expand Down Expand Up @@ -65,6 +66,7 @@ export const BaseWorkflowByIdSchema = z.object({
workflowDefinition: WorkflowDefinitionByIdSchema,
createdAt: z.string().datetime(),
context: z.object({
aml: AmlSchema.optional(),
documents: z.array(z.any()).default([]),
entity: z.record(z.any(), z.any()),
parentMachine: ObjectWithIdSchema.extend({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { fetchWorkflowEvent } from '../../../fetchers';
import { workflowsQueryKeys } from '../../../query-keys';

export const useRevisionCaseMutation = ({
onSelectNextEntity,
onSelectNextCase,
}: {
onSelectNextEntity?: VoidFunction;
onSelectNextCase?: VoidFunction;
}) => {
const queryClient = useQueryClient();

Expand Down
Loading
Loading