diff --git a/backend/src/graphql/enum/ContributionCycleType.ts b/backend/src/graphql/enum/ContributionCycleType.ts index a3c55aa68..abcb6a477 100644 --- a/backend/src/graphql/enum/ContributionCycleType.ts +++ b/backend/src/graphql/enum/ContributionCycleType.ts @@ -1,27 +1,5 @@ import { registerEnumType } from 'type-graphql' - -// lowercase values are not implemented yet -export enum ContributionCycleType { - ONCE = 'ONCE', - HOUR = 'hour', - TWO_HOURS = 'two_hours', - FOUR_HOURS = 'four_hours', - EIGHT_HOURS = 'eight_hours', - HALF_DAY = 'half_day', - DAILY = 'DAILY', - TWO_DAYS = 'two_days', - THREE_DAYS = 'three_days', - FOUR_DAYS = 'four_days', - FIVE_DAYS = 'five_days', - SIX_DAYS = 'six_days', - WEEK = 'week', - TWO_WEEKS = 'two_weeks', - MONTH = 'month', - TWO_MONTH = 'two_month', - QUARTER = 'quarter', - HALF_YEAR = 'half_year', - YEAR = 'year', -} +import { ContributionCycleType } from 'database' registerEnumType(ContributionCycleType, { name: 'ContributionCycleType', // this one is mandatory diff --git a/backend/src/graphql/enum/ContributionStatus.ts b/backend/src/graphql/enum/ContributionStatus.ts index 67cdf5398..74b1cba47 100644 --- a/backend/src/graphql/enum/ContributionStatus.ts +++ b/backend/src/graphql/enum/ContributionStatus.ts @@ -1,12 +1,5 @@ import { registerEnumType } from 'type-graphql' - -export enum ContributionStatus { - PENDING = 'PENDING', - DELETED = 'DELETED', - IN_PROGRESS = 'IN_PROGRESS', - DENIED = 'DENIED', - CONFIRMED = 'CONFIRMED', -} +import { ContributionStatus } from 'database' registerEnumType(ContributionStatus, { name: 'ContributionStatus', diff --git a/backend/src/graphql/enum/ContributionType.ts b/backend/src/graphql/enum/ContributionType.ts index e8529edc4..3be0b7595 100644 --- a/backend/src/graphql/enum/ContributionType.ts +++ b/backend/src/graphql/enum/ContributionType.ts @@ -1,10 +1,5 @@ import { registerEnumType } from 'type-graphql' - -export enum ContributionType { - ADMIN = 'ADMIN', - USER = 'USER', - LINK = 'LINK', -} +import { ContributionType } from 'database' registerEnumType(ContributionType, { name: 'ContributionType', diff --git a/database/src/enum/ContributionCycleType.ts b/database/src/enum/ContributionCycleType.ts new file mode 100644 index 000000000..6974cb563 --- /dev/null +++ b/database/src/enum/ContributionCycleType.ts @@ -0,0 +1,22 @@ +// lowercase values are not implemented yet +export enum ContributionCycleType { + ONCE = 'ONCE', + HOUR = 'hour', + TWO_HOURS = 'two_hours', + FOUR_HOURS = 'four_hours', + EIGHT_HOURS = 'eight_hours', + HALF_DAY = 'half_day', + DAILY = 'DAILY', + TWO_DAYS = 'two_days', + THREE_DAYS = 'three_days', + FOUR_DAYS = 'four_days', + FIVE_DAYS = 'five_days', + SIX_DAYS = 'six_days', + WEEK = 'week', + TWO_WEEKS = 'two_weeks', + MONTH = 'month', + TWO_MONTH = 'two_month', + QUARTER = 'quarter', + HALF_YEAR = 'half_year', + YEAR = 'year', +} diff --git a/database/src/enum/ContributionStatus.ts b/database/src/enum/ContributionStatus.ts new file mode 100644 index 000000000..a4bbc55f3 --- /dev/null +++ b/database/src/enum/ContributionStatus.ts @@ -0,0 +1,7 @@ +export enum ContributionStatus { + PENDING = 'PENDING', + DELETED = 'DELETED', + IN_PROGRESS = 'IN_PROGRESS', + DENIED = 'DENIED', + CONFIRMED = 'CONFIRMED', +} diff --git a/database/src/enum/ContributionType.ts b/database/src/enum/ContributionType.ts new file mode 100644 index 000000000..3cc15c94c --- /dev/null +++ b/database/src/enum/ContributionType.ts @@ -0,0 +1,5 @@ +export enum ContributionType { + ADMIN = 'ADMIN', + USER = 'USER', + LINK = 'LINK', +} diff --git a/database/src/enum/TransactionTypeId.ts b/database/src/enum/TransactionTypeId.ts new file mode 100644 index 000000000..dc5fc25e0 --- /dev/null +++ b/database/src/enum/TransactionTypeId.ts @@ -0,0 +1,8 @@ +export enum TransactionTypeId { + CREATION = 1, + SEND = 2, + RECEIVE = 3, + // This is a virtual property, never occurring on the database + DECAY = 4, + LINK_SUMMARY = 5, +} diff --git a/database/src/enum/index.ts b/database/src/enum/index.ts index c1d445299..ed629db22 100644 --- a/database/src/enum/index.ts +++ b/database/src/enum/index.ts @@ -1 +1,5 @@ -export * from './CommunityHandshakeStateType' \ No newline at end of file +export * from './CommunityHandshakeStateType' +export * from './ContributionType' +export * from './ContributionStatus' +export * from './TransactionTypeId' +export * from './ContributionCycleType' \ No newline at end of file