Skip to content

Commit

Permalink
fix: circular dependency (#2696)
Browse files Browse the repository at this point in the history
Co-authored-by: Lior Zamir <liorz@ballerine.com>
  • Loading branch information
liorzam and liorzblrn committed Sep 10, 2024
1 parent 94b226f commit 829c50a
Show file tree
Hide file tree
Showing 12 changed files with 1,664 additions and 78 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
auto-install-peers = true
strict-peer-dependencies = false
save-workspace-protocol = false
link-workspace-packages = true
12 changes: 1 addition & 11 deletions packages/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,7 @@ export type {
ObjectValues,
} from './types';

export {
WorkflowDefinitionConfigThemeSchema,
defaultContextSchema,
findDocumentSchemaByTypeAndCategory,
getDocumentId,
getDocumentSchemaByCountry,
getDocumentsByCountry,
getGhanaDocuments,
DocumentsSchema,
DocumentInsertSchema,
} from './schemas';
export * from './schemas';

export * from './consts';

Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/rule-engine/operators/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { EndUserAmlHitsSchema } from './../../../../../services/workflows-service/src/end-user/end-user.schema';
import get from 'lodash.get';
import isEmpty from 'lodash.isempty';

Expand All @@ -18,6 +17,7 @@ import { BetweenSchema, LastYearsSchema, PrimitiveArraySchema, PrimitiveSchema }
import { ValidationFailedError, DataValueNotFoundError } from '../errors';
import { OperationHelpers } from './constants';
import { Rule } from '../rules/types';
import { EndUserAmlHitsSchema } from '@/schemas';

export abstract class BaseOperator<T = Primitive> {
operator: string;
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export {
} from './documents/workflow/documents/schemas/index';
export { type TAvailableDocuments, type TDocument } from './documents/workflow/documents/types';
export { WorkflowDefinitionConfigThemeSchema } from './workflow/workflow-config-theme';
export * from './workflow/end-user.schema';
export { DocumentsSchema, DocumentInsertSchema } from './documents/schemas/documents-schema';
1,709 changes: 1,650 additions & 59 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion services/workflows-service/prisma/data-migrations
3 changes: 1 addition & 2 deletions services/workflows-service/scripts/generate-end-user.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { faker } from '@faker-js/faker';
import { Prisma } from '@prisma/client';
import { StateTag } from '@ballerine/common';
import { EndUserAmlHitsSchema, StateTag } from '@ballerine/common';
import { z } from 'zod';
import { EndUserAmlHitsSchema } from '@/end-user/end-user.schema';

export const endUserIds = [
'ckkt3qnv40001qxtt7nmj9r2r',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { AlertService } from '@/alert/alert.service';
import { ZodValidationPipe } from '@/common/pipes/zod.pipe';
import { ListIndividualsProfilesSchema } from '@/case-management/dtos/list-individuals-profiles.dto';
import { z } from 'zod';
import { EndUserAmlHitsSchema } from '@/end-user/end-user.schema';
import { EndUserAmlHitsSchema } from '@ballerine/common';
import { Business, EndUsersOnBusinesses } from '@prisma/client';

@Controller('case-management')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export const CustomerSubscriptionSchema = z.object({ subscriptions: z.array(Subs

export type TCustomerSubscription = z.infer<typeof CustomerSubscriptionSchema>;

const CustomerConfigSchema = z.object({ ongoingWorkflowDefinitionId: z.string() });
const CustomerConfigSchema = z.object({
ongoingWorkflowDefinitionId: z.string(),
isDemo: z.boolean().default(false),
hideCreateMerchantMonitoringButton: z.boolean().default(true),
});

export type TCustomerConfig = z.infer<typeof CustomerConfigSchema>;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { EndUserCreateDto } from '@/end-user/dtos/end-user-create';
import type { TProjectId, TProjectIds } from '@/types';
import { ProjectScopeService } from '@/project/project-scope.service';
import { Business, BusinessPosition, EndUser, Prisma } from '@prisma/client';
import { EndUserActiveMonitoringsSchema, EndUserAmlHitsSchema } from '@/end-user/end-user.schema';
import { EndUserActiveMonitoringsSchema, EndUserAmlHitsSchema } from '@ballerine/common';

@Injectable()
export class EndUserService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import * as tmp from 'tmp';
import { AlertService } from '@/alert/alert.service';
import { EndUserService } from '@/end-user/end-user.service';
import { z } from 'zod';
import { EndUserActiveMonitoringsSchema } from '@/end-user/end-user.schema';
import { EndUserActiveMonitoringsSchema } from '@ballerine/common';

export const ReportWithRiskScoreSchema = z
.object({
Expand Down

0 comments on commit 829c50a

Please sign in to comment.