Skip to content

Commit

Permalink
chore(*): merged from dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Omri-Levy committed Nov 20, 2024
2 parents bebb766 + d25cf30 commit 1cf4a19
Show file tree
Hide file tree
Showing 122 changed files with 1,633 additions and 834 deletions.
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"program": "${workspaceFolder}/node_modules/.bin/npx"
},
{
"type": "node",
"request": "launch",
"name": "Debug Workflow Service",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "start:debug"],
"cwd": "${workspaceFolder}/services/workflows-service",
"skipFiles": ["<node_internals>/**"],
"console": "integratedTerminal",
"sourceMaps": true
}
]
}
49 changes: 31 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,37 @@ To set up a local environment, follow these steps:
pnpm kyc-manual-review-example
```
Once the process is complete, _2 tabs_ will open in your browser:
1. http://localhost:5201/ - for the _KYB document collection flow_
OR http://localhost:5202 - for the _KYC document collection flow_
2. http://localhost:5137/ - for the _backoffice_
(See username/password below, It's recommended to have them positioned side-by-side).
<sub>If the required tabs have not opened automatically, please use the links we have provided above.</sub>
**Steps to go over the flow:**
1. Go to the Backoffice tab to review the new user that was created
1.1. Sign-in with the following credentials:
- **Email:** `admin@admin.com`
- **Password:** `admin`
1.2. Under the business menu, choose "KYB with UBOs" to view the list of cases currently undergoing.
2. On the Collection flow, fill in the required fields on each step.
3. Go through and complete the flow. As you go through the collection flow, you should see the progress in the Backoffice case.
4. Once the collection flow is finished, you can see the new state is "manual review," Assign the case to yourself, and then you will be able to choose to Approve, Reject, or Ask to Resubmit.
5. Ask to resubmit a document, go back to the collection flow to re-upload, then go back to the Backoffice to see the updated information.
1. Document Collection Flow:
- KYB: [http://localhost:5201/](http://localhost:5201/)
- KYC: [http://localhost:5202](http://localhost:5202)
2. Back Office: [http://localhost:5137/](http://localhost:5137/)
_(It's recommended to position both tabs side-by-side)_
> **Note:** If the tabs don't open automatically, use the links above.

### Flow Instructions

1. **Access the Back Office**
- Sign in using:
```
Email: admin@admin.com
Password: admin
```
- Navigate to "KYB with UBOs" under the business menu to view ongoing cases

2. **Complete the Collection Flow**
- Fill out all required fields in each step
- The Back Office case will update as you progress

3. **Review & Process**
- Once complete, the case status changes to "manual review"
- Assign the case to yourself
- Choose to: Approve, Reject, or Request Resubmission

4. **Document Resubmission**
- Request a document resubmission
- Return to collection flow to upload new document
- Check Back Office for updated information

* Note: some components are currently in beta, if you run into an issue please ping us on Slack

Expand Down
5 changes: 5 additions & 0 deletions apps/backoffice-v2/src/domains/business-reports/fetchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { toast } from 'sonner';
import { t } from 'i18next';
import {
MERCHANT_REPORT_STATUSES,
MERCHANT_REPORT_STATUSES_MAP,
MERCHANT_REPORT_TYPES,
MERCHANT_REPORT_VERSIONS,
MerchantReportType,
Expand Down Expand Up @@ -43,6 +44,10 @@ export const BusinessReportSchema = z
})
.transform(data => ({
...data,
status:
data.status === MERCHANT_REPORT_STATUSES_MAP.failed
? MERCHANT_REPORT_STATUSES_MAP['quality-control']
: data.status,
companyName:
data?.companyName ??
(data?.data?.websiteCompanyAnalysis as UnknownRecord | undefined)?.companyName ??
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ export const useCreateBusinessReportBatchMutation = ({
merchantSheet,
isExample: customer?.config?.isExample ?? false,
});

// Artificial delay to ensure report is created in Unified API's DB
await new Promise(resolve => setTimeout(resolve, 3000));
},
onSuccess: data => {
void queryClient.invalidateQueries();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ export const useCreateBusinessReportMutation = ({
workflowVersion,
isExample: customer?.config?.isExample ?? false,
});

// Artificial delay to ensure report is created in Unified API's DB
await new Promise(resolve => setTimeout(resolve, 3000));
},
onSuccess: data => {
if (customer?.config?.isExample) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,9 @@ export const MerchantMonitoring: FunctionComponent = () => {
</TooltipProvider>
</div>
</div>
{!!businessReports?.length && (
<div className={`flex`}>
<Search value={search} onChange={onSearch} />
</div>
)}
<div className={`flex`}>
<Search value={search} onChange={onSearch} />
</div>
<div className="flex flex-1 flex-col gap-6 overflow-auto">
{isNonEmptyArray(businessReports) && <MerchantMonitoringTable data={businessReports} />}
{Array.isArray(businessReports) && !businessReports.length && !isLoadingBusinessReports && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export const columns = [
<TextWithNAFallback
className={ctw('font-semibold', {
'text-slate-400': status === MERCHANT_REPORT_STATUSES_MAP.completed,
'text-destructive': status === MERCHANT_REPORT_STATUSES_MAP['failed'],
})}
>
{titleCase(statusToDisplayStatus[status as keyof typeof statusToDisplayStatus] ?? status)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const useMerchantMonitoringBusinessReportLogic = () => {
variant: 'violet',
text: 'Quality Control',
},
[MERCHANT_REPORT_STATUSES_MAP['failed']]: { variant: 'destructive', text: 'Failed' },
} as const;

const websiteWithNoProtocol = safeUrl(businessReport?.website)?.hostname;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const useTransactionMonitoringAlertsAnalysisPageLogic = () => {
// @TODO: Remove
counterpartyId: counterpartyId ?? '',
page: 1,
pageSize: 50,
pageSize: 500,
});
const navigate = useNavigate();
const onNavigateBack = useCallback(() => {
Expand Down
60 changes: 0 additions & 60 deletions apps/kyb-app/DynamicElements/DynamicElements.tsx

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions apps/kyb-app/DynamicElements/context/index.ts

This file was deleted.

12 changes: 0 additions & 12 deletions apps/kyb-app/DynamicElements/context/types.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/kyb-app/DynamicElements/engines.ts

This file was deleted.

5 changes: 0 additions & 5 deletions apps/kyb-app/DynamicElements/helpers/is-event-rule.ts

This file was deleted.

1 change: 0 additions & 1 deletion apps/kyb-app/DynamicElements/hooks/useContext/index.ts

This file was deleted.

37 changes: 0 additions & 37 deletions apps/kyb-app/DynamicElements/hooks/useContext/useContext.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1cf4a19

Please sign in to comment.