From 933171d2082a28aa08b3e5523464935d111aca11 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Fri, 28 Nov 2025 18:59:46 +0100 Subject: [PATCH] move some code from core into shared --- core/src/graphql/enum/TransactionTypeId.ts | 10 +--------- core/src/util/utilities.ts | 3 --- shared/src/index.ts | 1 + shared/src/util/index.ts | 1 + shared/src/util/utilities.ts | 2 ++ 5 files changed, 5 insertions(+), 12 deletions(-) create mode 100644 shared/src/util/index.ts create mode 100644 shared/src/util/utilities.ts diff --git a/core/src/graphql/enum/TransactionTypeId.ts b/core/src/graphql/enum/TransactionTypeId.ts index a7e39eebc..740a93d5b 100644 --- a/core/src/graphql/enum/TransactionTypeId.ts +++ b/core/src/graphql/enum/TransactionTypeId.ts @@ -1,13 +1,5 @@ import { registerEnumType } from 'type-graphql' - -export enum TransactionTypeId { - CREATION = 1, - SEND = 2, - RECEIVE = 3, - // This is a virtual property, never occurring on the database - DECAY = 4, - LINK_SUMMARY = 5, -} +import { TransactionTypeId } from 'database' registerEnumType(TransactionTypeId, { name: 'TransactionTypeId', // this one is mandatory diff --git a/core/src/util/utilities.ts b/core/src/util/utilities.ts index be9e3d898..09fd2f343 100644 --- a/core/src/util/utilities.ts +++ b/core/src/util/utilities.ts @@ -14,9 +14,6 @@ export const decimalSeparatorByLanguage = (a: Decimal, language: string): string return result } -export const fullName = (firstName: string, lastName: string): string => - [firstName, lastName].filter(Boolean).join(' ') - // Function to reset an interface by chatGPT export function resetInterface>(obj: T): T { diff --git a/shared/src/index.ts b/shared/src/index.ts index 1e44e2c48..9eb6655c5 100644 --- a/shared/src/index.ts +++ b/shared/src/index.ts @@ -3,6 +3,7 @@ export * from './enum' export * from './const' export * from './helper' export * from './logic/decay' +export * from './util' export * from './jwt/JWT' export * from './jwt/payloadtypes/AuthenticationJwtPayloadType' export * from './jwt/payloadtypes/AuthenticationResponseJwtPayloadType' diff --git a/shared/src/util/index.ts b/shared/src/util/index.ts new file mode 100644 index 000000000..c2a905916 --- /dev/null +++ b/shared/src/util/index.ts @@ -0,0 +1 @@ +export * from './utilities' \ No newline at end of file diff --git a/shared/src/util/utilities.ts b/shared/src/util/utilities.ts new file mode 100644 index 000000000..7473f5ed0 --- /dev/null +++ b/shared/src/util/utilities.ts @@ -0,0 +1,2 @@ +export const fullName = (firstName: string, lastName: string): string => + [firstName, lastName].filter(Boolean).join(' ')