mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into vscode-intellisense-fixes
This commit is contained in:
commit
1a0edb08c5
@ -57,7 +57,7 @@ module.exports = {
|
|||||||
'import/named': 'error',
|
'import/named': 'error',
|
||||||
'import/namespace': 'error',
|
'import/namespace': 'error',
|
||||||
'import/no-absolute-path': 'error',
|
'import/no-absolute-path': 'error',
|
||||||
'import/no-cycle': 'off',
|
'import/no-cycle': 'error',
|
||||||
'import/no-dynamic-require': 'error',
|
'import/no-dynamic-require': 'error',
|
||||||
'import/no-internal-modules': 'off',
|
'import/no-internal-modules': 'off',
|
||||||
'import/no-relative-packages': 'error',
|
'import/no-relative-packages': 'error',
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { Event as DbEvent } from '@entity/Event'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_CONFIRM = async (
|
export const EVENT_ADMIN_CONTRIBUTION_CONFIRM = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { Event as DbEvent } from '@entity/Event'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_CREATE = async (
|
export const EVENT_ADMIN_CONTRIBUTION_CREATE = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { Event as DbEvent } from '@entity/Event'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_DELETE = async (
|
export const EVENT_ADMIN_CONTRIBUTION_DELETE = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { Event as DbEvent } from '@entity/Event'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_DENY = async (
|
export const EVENT_ADMIN_CONTRIBUTION_DENY = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { Event as DbEvent } from '@entity/Event'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_LINK_CREATE = async (
|
export const EVENT_ADMIN_CONTRIBUTION_LINK_CREATE = async (
|
||||||
moderator: DbUser,
|
moderator: DbUser,
|
||||||
|
|||||||
@ -2,7 +2,8 @@ import { ContributionLink as DbContributionLink } from '@entity/ContributionLink
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_LINK_DELETE = async (
|
export const EVENT_ADMIN_CONTRIBUTION_LINK_DELETE = async (
|
||||||
moderator: DbUser,
|
moderator: DbUser,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { Event as DbEvent } from '@entity/Event'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE = async (
|
export const EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE = async (
|
||||||
moderator: DbUser,
|
moderator: DbUser,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { ContributionMessage as DbContributionMessage } from '@entity/Contributi
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE = async (
|
export const EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { Event as DbEvent } from '@entity/Event'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_UPDATE = async (
|
export const EVENT_ADMIN_CONTRIBUTION_UPDATE = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_ADMIN_USER_DELETE = async (user: DbUser, moderator: DbUser): Promise<DbEvent> =>
|
export const EVENT_ADMIN_USER_DELETE = async (user: DbUser, moderator: DbUser): Promise<DbEvent> =>
|
||||||
Event(EventType.ADMIN_USER_DELETE, user, moderator).save()
|
Event(EventType.ADMIN_USER_DELETE, user, moderator).save()
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_ADMIN_USER_ROLE_SET = async (
|
export const EVENT_ADMIN_USER_ROLE_SET = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_ADMIN_USER_UNDELETE = async (
|
export const EVENT_ADMIN_USER_UNDELETE = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { Event as DbEvent } from '@entity/Event'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_CONTRIBUTION_CREATE = async (
|
export const EVENT_CONTRIBUTION_CREATE = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { Event as DbEvent } from '@entity/Event'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_CONTRIBUTION_DELETE = async (
|
export const EVENT_CONTRIBUTION_DELETE = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -5,7 +5,8 @@ import { Transaction as DbTransaction } from '@entity/Transaction'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_CONTRIBUTION_LINK_REDEEM = async (
|
export const EVENT_CONTRIBUTION_LINK_REDEEM = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { ContributionMessage as DbContributionMessage } from '@entity/Contributi
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_CONTRIBUTION_MESSAGE_CREATE = async (
|
export const EVENT_CONTRIBUTION_MESSAGE_CREATE = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { Event as DbEvent } from '@entity/Event'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_CONTRIBUTION_UPDATE = async (
|
export const EVENT_CONTRIBUTION_UPDATE = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_EMAIL_ACCOUNT_MULTIREGISTRATION = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_EMAIL_ACCOUNT_MULTIREGISTRATION = async (user: DbUser): Promise<DbEvent> =>
|
||||||
Event(EventType.EMAIL_ACCOUNT_MULTIREGISTRATION, user, { id: 0 } as DbUser).save()
|
Event(EventType.EMAIL_ACCOUNT_MULTIREGISTRATION, user, { id: 0 } as DbUser).save()
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_EMAIL_ADMIN_CONFIRMATION = async (
|
export const EVENT_EMAIL_ADMIN_CONFIRMATION = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_EMAIL_CONFIRMATION = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_EMAIL_CONFIRMATION = async (user: DbUser): Promise<DbEvent> =>
|
||||||
Event(EventType.EMAIL_CONFIRMATION, user, user).save()
|
Event(EventType.EMAIL_CONFIRMATION, user, user).save()
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_EMAIL_FORGOT_PASSWORD = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_EMAIL_FORGOT_PASSWORD = async (user: DbUser): Promise<DbEvent> =>
|
||||||
Event(EventType.EMAIL_FORGOT_PASSWORD, user, { id: 0 } as DbUser).save()
|
Event(EventType.EMAIL_FORGOT_PASSWORD, user, { id: 0 } as DbUser).save()
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_TRANSACTION_LINK_CREATE = async (
|
export const EVENT_TRANSACTION_LINK_CREATE = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -2,7 +2,8 @@ import { Event as DbEvent } from '@entity/Event'
|
|||||||
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_TRANSACTION_LINK_DELETE = async (
|
export const EVENT_TRANSACTION_LINK_DELETE = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_TRANSACTION_LINK_REDEEM = async (
|
export const EVENT_TRANSACTION_LINK_REDEEM = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { Transaction as DbTransaction } from '@entity/Transaction'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_TRANSACTION_RECEIVE = async (
|
export const EVENT_TRANSACTION_RECEIVE = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import { Transaction as DbTransaction } from '@entity/Transaction'
|
|||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_TRANSACTION_SEND = async (
|
export const EVENT_TRANSACTION_SEND = async (
|
||||||
user: DbUser,
|
user: DbUser,
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_USER_ACTIVATE_ACCOUNT = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_USER_ACTIVATE_ACCOUNT = async (user: DbUser): Promise<DbEvent> =>
|
||||||
Event(EventType.USER_ACTIVATE_ACCOUNT, user, user).save()
|
Event(EventType.USER_ACTIVATE_ACCOUNT, user, user).save()
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_USER_INFO_UPDATE = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_USER_INFO_UPDATE = async (user: DbUser): Promise<DbEvent> =>
|
||||||
Event(EventType.USER_INFO_UPDATE, user, user).save()
|
Event(EventType.USER_INFO_UPDATE, user, user).save()
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_USER_LOGIN = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_USER_LOGIN = async (user: DbUser): Promise<DbEvent> =>
|
||||||
Event(EventType.USER_LOGIN, user, user).save()
|
Event(EventType.USER_LOGIN, user, user).save()
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_USER_LOGOUT = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_USER_LOGOUT = async (user: DbUser): Promise<DbEvent> =>
|
||||||
Event(EventType.USER_LOGOUT, user, user).save()
|
Event(EventType.USER_LOGOUT, user, user).save()
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event } from './Event'
|
||||||
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const EVENT_USER_REGISTER = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_USER_REGISTER = async (user: DbUser): Promise<DbEvent> =>
|
||||||
Event(EventType.USER_REGISTER, user, user).save()
|
Event(EventType.USER_REGISTER, user, user).save()
|
||||||
|
|||||||
@ -34,37 +34,3 @@ export const Event = (
|
|||||||
event.amount = amount
|
event.amount = amount
|
||||||
return event
|
return event
|
||||||
}
|
}
|
||||||
|
|
||||||
export { EventType }
|
|
||||||
|
|
||||||
export { EVENT_ADMIN_CONTRIBUTION_CONFIRM } from './EVENT_ADMIN_CONTRIBUTION_CONFIRM'
|
|
||||||
export { EVENT_ADMIN_CONTRIBUTION_CREATE } from './EVENT_ADMIN_CONTRIBUTION_CREATE'
|
|
||||||
export { EVENT_ADMIN_CONTRIBUTION_DELETE } from './EVENT_ADMIN_CONTRIBUTION_DELETE'
|
|
||||||
export { EVENT_ADMIN_CONTRIBUTION_DENY } from './EVENT_ADMIN_CONTRIBUTION_DENY'
|
|
||||||
export { EVENT_ADMIN_CONTRIBUTION_UPDATE } from './EVENT_ADMIN_CONTRIBUTION_UPDATE'
|
|
||||||
export { EVENT_ADMIN_CONTRIBUTION_LINK_CREATE } from './EVENT_ADMIN_CONTRIBUTION_LINK_CREATE'
|
|
||||||
export { EVENT_ADMIN_CONTRIBUTION_LINK_DELETE } from './EVENT_ADMIN_CONTRIBUTION_LINK_DELETE'
|
|
||||||
export { EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE } from './EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE'
|
|
||||||
export { EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE } from './EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE'
|
|
||||||
export { EVENT_ADMIN_USER_DELETE } from './EVENT_ADMIN_USER_DELETE'
|
|
||||||
export { EVENT_ADMIN_USER_UNDELETE } from './EVENT_ADMIN_USER_UNDELETE'
|
|
||||||
export { EVENT_ADMIN_USER_ROLE_SET } from './EVENT_ADMIN_USER_ROLE_SET'
|
|
||||||
export { EVENT_CONTRIBUTION_CREATE } from './EVENT_CONTRIBUTION_CREATE'
|
|
||||||
export { EVENT_CONTRIBUTION_DELETE } from './EVENT_CONTRIBUTION_DELETE'
|
|
||||||
export { EVENT_CONTRIBUTION_UPDATE } from './EVENT_CONTRIBUTION_UPDATE'
|
|
||||||
export { EVENT_CONTRIBUTION_MESSAGE_CREATE } from './EVENT_CONTRIBUTION_MESSAGE_CREATE'
|
|
||||||
export { EVENT_CONTRIBUTION_LINK_REDEEM } from './EVENT_CONTRIBUTION_LINK_REDEEM'
|
|
||||||
export { EVENT_EMAIL_ACCOUNT_MULTIREGISTRATION } from './EVENT_EMAIL_ACCOUNT_MULTIREGISTRATION'
|
|
||||||
export { EVENT_EMAIL_ADMIN_CONFIRMATION } from './EVENT_EMAIL_ADMIN_CONFIRMATION'
|
|
||||||
export { EVENT_EMAIL_CONFIRMATION } from './EVENT_EMAIL_CONFIRMATION'
|
|
||||||
export { EVENT_EMAIL_FORGOT_PASSWORD } from './EVENT_EMAIL_FORGOT_PASSWORD'
|
|
||||||
export { EVENT_TRANSACTION_SEND } from './EVENT_TRANSACTION_SEND'
|
|
||||||
export { EVENT_TRANSACTION_RECEIVE } from './EVENT_TRANSACTION_RECEIVE'
|
|
||||||
export { EVENT_TRANSACTION_LINK_CREATE } from './EVENT_TRANSACTION_LINK_CREATE'
|
|
||||||
export { EVENT_TRANSACTION_LINK_DELETE } from './EVENT_TRANSACTION_LINK_DELETE'
|
|
||||||
export { EVENT_TRANSACTION_LINK_REDEEM } from './EVENT_TRANSACTION_LINK_REDEEM'
|
|
||||||
export { EVENT_USER_ACTIVATE_ACCOUNT } from './EVENT_USER_ACTIVATE_ACCOUNT'
|
|
||||||
export { EVENT_USER_INFO_UPDATE } from './EVENT_USER_INFO_UPDATE'
|
|
||||||
export { EVENT_USER_LOGIN } from './EVENT_USER_LOGIN'
|
|
||||||
export { EVENT_USER_LOGOUT } from './EVENT_USER_LOGOUT'
|
|
||||||
export { EVENT_USER_REGISTER } from './EVENT_USER_REGISTER'
|
|
||||||
|
|||||||
33
backend/src/event/Events.ts
Normal file
33
backend/src/event/Events.ts
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
export { EventType } from './EventType'
|
||||||
|
export { Event } from './Event'
|
||||||
|
export { EVENT_ADMIN_CONTRIBUTION_CONFIRM } from './EVENT_ADMIN_CONTRIBUTION_CONFIRM'
|
||||||
|
export { EVENT_ADMIN_CONTRIBUTION_CREATE } from './EVENT_ADMIN_CONTRIBUTION_CREATE'
|
||||||
|
export { EVENT_ADMIN_CONTRIBUTION_DELETE } from './EVENT_ADMIN_CONTRIBUTION_DELETE'
|
||||||
|
export { EVENT_ADMIN_CONTRIBUTION_DENY } from './EVENT_ADMIN_CONTRIBUTION_DENY'
|
||||||
|
export { EVENT_ADMIN_CONTRIBUTION_UPDATE } from './EVENT_ADMIN_CONTRIBUTION_UPDATE'
|
||||||
|
export { EVENT_ADMIN_CONTRIBUTION_LINK_CREATE } from './EVENT_ADMIN_CONTRIBUTION_LINK_CREATE'
|
||||||
|
export { EVENT_ADMIN_CONTRIBUTION_LINK_DELETE } from './EVENT_ADMIN_CONTRIBUTION_LINK_DELETE'
|
||||||
|
export { EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE } from './EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE'
|
||||||
|
export { EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE } from './EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE'
|
||||||
|
export { EVENT_ADMIN_USER_DELETE } from './EVENT_ADMIN_USER_DELETE'
|
||||||
|
export { EVENT_ADMIN_USER_UNDELETE } from './EVENT_ADMIN_USER_UNDELETE'
|
||||||
|
export { EVENT_ADMIN_USER_ROLE_SET } from './EVENT_ADMIN_USER_ROLE_SET'
|
||||||
|
export { EVENT_CONTRIBUTION_CREATE } from './EVENT_CONTRIBUTION_CREATE'
|
||||||
|
export { EVENT_CONTRIBUTION_DELETE } from './EVENT_CONTRIBUTION_DELETE'
|
||||||
|
export { EVENT_CONTRIBUTION_UPDATE } from './EVENT_CONTRIBUTION_UPDATE'
|
||||||
|
export { EVENT_CONTRIBUTION_MESSAGE_CREATE } from './EVENT_CONTRIBUTION_MESSAGE_CREATE'
|
||||||
|
export { EVENT_CONTRIBUTION_LINK_REDEEM } from './EVENT_CONTRIBUTION_LINK_REDEEM'
|
||||||
|
export { EVENT_EMAIL_ACCOUNT_MULTIREGISTRATION } from './EVENT_EMAIL_ACCOUNT_MULTIREGISTRATION'
|
||||||
|
export { EVENT_EMAIL_ADMIN_CONFIRMATION } from './EVENT_EMAIL_ADMIN_CONFIRMATION'
|
||||||
|
export { EVENT_EMAIL_CONFIRMATION } from './EVENT_EMAIL_CONFIRMATION'
|
||||||
|
export { EVENT_EMAIL_FORGOT_PASSWORD } from './EVENT_EMAIL_FORGOT_PASSWORD'
|
||||||
|
export { EVENT_TRANSACTION_SEND } from './EVENT_TRANSACTION_SEND'
|
||||||
|
export { EVENT_TRANSACTION_RECEIVE } from './EVENT_TRANSACTION_RECEIVE'
|
||||||
|
export { EVENT_TRANSACTION_LINK_CREATE } from './EVENT_TRANSACTION_LINK_CREATE'
|
||||||
|
export { EVENT_TRANSACTION_LINK_DELETE } from './EVENT_TRANSACTION_LINK_DELETE'
|
||||||
|
export { EVENT_TRANSACTION_LINK_REDEEM } from './EVENT_TRANSACTION_LINK_REDEEM'
|
||||||
|
export { EVENT_USER_ACTIVATE_ACCOUNT } from './EVENT_USER_ACTIVATE_ACCOUNT'
|
||||||
|
export { EVENT_USER_INFO_UPDATE } from './EVENT_USER_INFO_UPDATE'
|
||||||
|
export { EVENT_USER_LOGIN } from './EVENT_USER_LOGIN'
|
||||||
|
export { EVENT_USER_LOGOUT } from './EVENT_USER_LOGOUT'
|
||||||
|
export { EVENT_USER_REGISTER } from './EVENT_USER_REGISTER'
|
||||||
@ -47,6 +47,10 @@ export class Transaction {
|
|||||||
this.linkId = transaction.contribution
|
this.linkId = transaction.contribution
|
||||||
? transaction.contribution.contributionLinkId
|
? transaction.contribution.contributionLinkId
|
||||||
: transaction.transactionLinkId || null
|
: transaction.transactionLinkId || null
|
||||||
|
this.previousBalance =
|
||||||
|
(transaction.previousTransaction &&
|
||||||
|
transaction.previousTransaction.balance.toDecimalPlaces(2, Decimal.ROUND_DOWN)) ||
|
||||||
|
new Decimal(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Field(() => Int)
|
@Field(() => Int)
|
||||||
@ -70,6 +74,9 @@ export class Transaction {
|
|||||||
@Field(() => Date)
|
@Field(() => Date)
|
||||||
balanceDate: Date
|
balanceDate: Date
|
||||||
|
|
||||||
|
@Field(() => Decimal)
|
||||||
|
previousBalance: Decimal
|
||||||
|
|
||||||
@Field(() => Decay)
|
@Field(() => Decay)
|
||||||
decay: Decay
|
decay: Decay
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import { GraphQLError } from 'graphql'
|
|||||||
import { cleanDB, testEnvironment, resetToken } from '@test/helpers'
|
import { cleanDB, testEnvironment, resetToken } from '@test/helpers'
|
||||||
import { logger } from '@test/testSetup'
|
import { logger } from '@test/testSetup'
|
||||||
|
|
||||||
import { EventType } from '@/event/Event'
|
import { EventType } from '@/event/Events'
|
||||||
import { userFactory } from '@/seeds/factory/user'
|
import { userFactory } from '@/seeds/factory/user'
|
||||||
import {
|
import {
|
||||||
login,
|
login,
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import {
|
|||||||
EVENT_ADMIN_CONTRIBUTION_LINK_CREATE,
|
EVENT_ADMIN_CONTRIBUTION_LINK_CREATE,
|
||||||
EVENT_ADMIN_CONTRIBUTION_LINK_DELETE,
|
EVENT_ADMIN_CONTRIBUTION_LINK_DELETE,
|
||||||
EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE,
|
EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE,
|
||||||
} from '@/event/Event'
|
} from '@/event/Events'
|
||||||
import { Context, getUser } from '@/server/context'
|
import { Context, getUser } from '@/server/context'
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import { cleanDB, resetToken, testEnvironment } from '@test/helpers'
|
|||||||
import { logger, i18n as localization } from '@test/testSetup'
|
import { logger, i18n as localization } from '@test/testSetup'
|
||||||
|
|
||||||
import { sendAddedContributionMessageEmail } from '@/emails/sendEmailVariants'
|
import { sendAddedContributionMessageEmail } from '@/emails/sendEmailVariants'
|
||||||
import { EventType } from '@/event/Event'
|
import { EventType } from '@/event/Events'
|
||||||
import { userFactory } from '@/seeds/factory/user'
|
import { userFactory } from '@/seeds/factory/user'
|
||||||
import {
|
import {
|
||||||
adminCreateContributionMessage,
|
adminCreateContributionMessage,
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import { sendAddedContributionMessageEmail } from '@/emails/sendEmailVariants'
|
|||||||
import {
|
import {
|
||||||
EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE,
|
EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE,
|
||||||
EVENT_CONTRIBUTION_MESSAGE_CREATE,
|
EVENT_CONTRIBUTION_MESSAGE_CREATE,
|
||||||
} from '@/event/Event'
|
} from '@/event/Events'
|
||||||
import { Context, getUser } from '@/server/context'
|
import { Context, getUser } from '@/server/context'
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ import {
|
|||||||
sendContributionDeletedEmail,
|
sendContributionDeletedEmail,
|
||||||
sendContributionDeniedEmail,
|
sendContributionDeniedEmail,
|
||||||
} from '@/emails/sendEmailVariants'
|
} from '@/emails/sendEmailVariants'
|
||||||
import { EventType } from '@/event/Event'
|
import { EventType } from '@/event/Events'
|
||||||
import { creations } from '@/seeds/creation/index'
|
import { creations } from '@/seeds/creation/index'
|
||||||
import { creationFactory } from '@/seeds/factory/creation'
|
import { creationFactory } from '@/seeds/factory/creation'
|
||||||
import { userFactory } from '@/seeds/factory/user'
|
import { userFactory } from '@/seeds/factory/user'
|
||||||
|
|||||||
@ -38,7 +38,7 @@ import {
|
|||||||
EVENT_ADMIN_CONTRIBUTION_DELETE,
|
EVENT_ADMIN_CONTRIBUTION_DELETE,
|
||||||
EVENT_ADMIN_CONTRIBUTION_CONFIRM,
|
EVENT_ADMIN_CONTRIBUTION_CONFIRM,
|
||||||
EVENT_ADMIN_CONTRIBUTION_DENY,
|
EVENT_ADMIN_CONTRIBUTION_DENY,
|
||||||
} from '@/event/Event'
|
} from '@/event/Events'
|
||||||
import { Context, getUser, getClientTimezoneOffset } from '@/server/context'
|
import { Context, getUser, getClientTimezoneOffset } from '@/server/context'
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import { UnconfirmedContribution } from '@model/UnconfirmedContribution'
|
|||||||
import { cleanDB, testEnvironment, resetToken, resetEntity } from '@test/helpers'
|
import { cleanDB, testEnvironment, resetToken, resetEntity } from '@test/helpers'
|
||||||
import { logger } from '@test/testSetup'
|
import { logger } from '@test/testSetup'
|
||||||
|
|
||||||
import { EventType } from '@/event/Event'
|
import { EventType } from '@/event/Events'
|
||||||
import { creations } from '@/seeds/creation/index'
|
import { creations } from '@/seeds/creation/index'
|
||||||
import { creationFactory } from '@/seeds/factory/creation'
|
import { creationFactory } from '@/seeds/factory/creation'
|
||||||
import { transactionLinkFactory } from '@/seeds/factory/transactionLink'
|
import { transactionLinkFactory } from '@/seeds/factory/transactionLink'
|
||||||
|
|||||||
@ -28,7 +28,7 @@ import {
|
|||||||
EVENT_TRANSACTION_LINK_CREATE,
|
EVENT_TRANSACTION_LINK_CREATE,
|
||||||
EVENT_TRANSACTION_LINK_DELETE,
|
EVENT_TRANSACTION_LINK_DELETE,
|
||||||
EVENT_TRANSACTION_LINK_REDEEM,
|
EVENT_TRANSACTION_LINK_REDEEM,
|
||||||
} from '@/event/Event'
|
} from '@/event/Events'
|
||||||
import { Context, getUser, getClientTimezoneOffset } from '@/server/context'
|
import { Context, getUser, getClientTimezoneOffset } from '@/server/context'
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import { GraphQLError } from 'graphql'
|
|||||||
import { cleanDB, testEnvironment } from '@test/helpers'
|
import { cleanDB, testEnvironment } from '@test/helpers'
|
||||||
import { logger } from '@test/testSetup'
|
import { logger } from '@test/testSetup'
|
||||||
|
|
||||||
import { EventType } from '@/event/Event'
|
import { EventType } from '@/event/Events'
|
||||||
import { userFactory } from '@/seeds/factory/user'
|
import { userFactory } from '@/seeds/factory/user'
|
||||||
import {
|
import {
|
||||||
confirmContribution,
|
confirmContribution,
|
||||||
|
|||||||
@ -16,7 +16,6 @@ import { TransactionTypeId } from '@enum/TransactionTypeId'
|
|||||||
import { Transaction } from '@model/Transaction'
|
import { Transaction } from '@model/Transaction'
|
||||||
import { TransactionList } from '@model/TransactionList'
|
import { TransactionList } from '@model/TransactionList'
|
||||||
import { User } from '@model/User'
|
import { User } from '@model/User'
|
||||||
import { TransactionRepository } from '@repository/Transaction'
|
|
||||||
import { TransactionLinkRepository } from '@repository/TransactionLink'
|
import { TransactionLinkRepository } from '@repository/TransactionLink'
|
||||||
|
|
||||||
import { RIGHTS } from '@/auth/RIGHTS'
|
import { RIGHTS } from '@/auth/RIGHTS'
|
||||||
@ -24,7 +23,7 @@ import {
|
|||||||
sendTransactionLinkRedeemedEmail,
|
sendTransactionLinkRedeemedEmail,
|
||||||
sendTransactionReceivedEmail,
|
sendTransactionReceivedEmail,
|
||||||
} from '@/emails/sendEmailVariants'
|
} from '@/emails/sendEmailVariants'
|
||||||
import { EVENT_TRANSACTION_RECEIVE, EVENT_TRANSACTION_SEND } from '@/event/Event'
|
import { EVENT_TRANSACTION_RECEIVE, EVENT_TRANSACTION_SEND } from '@/event/Events'
|
||||||
import { Context, getUser } from '@/server/context'
|
import { Context, getUser } from '@/server/context'
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
@ -37,6 +36,7 @@ import { BalanceResolver } from './BalanceResolver'
|
|||||||
import { MEMO_MAX_CHARS, MEMO_MIN_CHARS } from './const/const'
|
import { MEMO_MAX_CHARS, MEMO_MIN_CHARS } from './const/const'
|
||||||
import { findUserByIdentifier } from './util/findUserByIdentifier'
|
import { findUserByIdentifier } from './util/findUserByIdentifier'
|
||||||
import { getLastTransaction } from './util/getLastTransaction'
|
import { getLastTransaction } from './util/getLastTransaction'
|
||||||
|
import { getTransactionList } from './util/getTransactionList'
|
||||||
|
|
||||||
export const executeTransaction = async (
|
export const executeTransaction = async (
|
||||||
amount: Decimal,
|
amount: Decimal,
|
||||||
@ -209,8 +209,7 @@ export class TransactionResolver {
|
|||||||
// find transactions
|
// find transactions
|
||||||
// first page can contain 26 due to virtual decay transaction
|
// first page can contain 26 due to virtual decay transaction
|
||||||
const offset = (currentPage - 1) * pageSize
|
const offset = (currentPage - 1) * pageSize
|
||||||
const transactionRepository = getCustomRepository(TransactionRepository)
|
const [userTransactions, userTransactionsCount] = await getTransactionList(
|
||||||
const [userTransactions, userTransactionsCount] = await transactionRepository.findByUserPaged(
|
|
||||||
user.id,
|
user.id,
|
||||||
pageSize,
|
pageSize,
|
||||||
offset,
|
offset,
|
||||||
@ -275,6 +274,7 @@ export class TransactionResolver {
|
|||||||
firstDate || now,
|
firstDate || now,
|
||||||
lastDate || now,
|
lastDate || now,
|
||||||
self,
|
self,
|
||||||
|
(userTransactions.length && userTransactions[0].balance) || new Decimal(0),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
logger.debug(`transactions=${transactions}`)
|
logger.debug(`transactions=${transactions}`)
|
||||||
@ -282,7 +282,7 @@ export class TransactionResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// transactions
|
// transactions
|
||||||
userTransactions.forEach((userTransaction) => {
|
userTransactions.forEach((userTransaction: dbTransaction) => {
|
||||||
const linkedUser =
|
const linkedUser =
|
||||||
userTransaction.typeId === TransactionTypeId.CREATION
|
userTransaction.typeId === TransactionTypeId.CREATION
|
||||||
? communityUser
|
? communityUser
|
||||||
@ -291,6 +291,15 @@ export class TransactionResolver {
|
|||||||
})
|
})
|
||||||
logger.debug(`TransactionTypeId.CREATION: transactions=${transactions}`)
|
logger.debug(`TransactionTypeId.CREATION: transactions=${transactions}`)
|
||||||
|
|
||||||
|
transactions.forEach((transaction: Transaction) => {
|
||||||
|
if (transaction.typeId !== TransactionTypeId.DECAY) {
|
||||||
|
const { balance, previousBalance, amount } = transaction
|
||||||
|
transaction.decay.decay = new Decimal(
|
||||||
|
Number(balance) - Number(amount) - Number(previousBalance),
|
||||||
|
).toDecimalPlaces(2, Decimal.ROUND_HALF_UP)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// Construct Result
|
// Construct Result
|
||||||
return new TransactionList(await balanceResolver.balance(context), transactions)
|
return new TransactionList(await balanceResolver.balance(context), transactions)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import {
|
|||||||
sendAccountMultiRegistrationEmail,
|
sendAccountMultiRegistrationEmail,
|
||||||
sendResetPasswordEmail,
|
sendResetPasswordEmail,
|
||||||
} from '@/emails/sendEmailVariants'
|
} from '@/emails/sendEmailVariants'
|
||||||
import { EventType } from '@/event/Event'
|
import { EventType } from '@/event/Events'
|
||||||
import { SecretKeyCryptographyCreateKey } from '@/password/EncryptorUtils'
|
import { SecretKeyCryptographyCreateKey } from '@/password/EncryptorUtils'
|
||||||
import { encryptPassword } from '@/password/PasswordEncryptor'
|
import { encryptPassword } from '@/password/PasswordEncryptor'
|
||||||
import { contributionLinkFactory } from '@/seeds/factory/contributionLink'
|
import { contributionLinkFactory } from '@/seeds/factory/contributionLink'
|
||||||
|
|||||||
@ -59,7 +59,7 @@ import {
|
|||||||
EVENT_ADMIN_USER_ROLE_SET,
|
EVENT_ADMIN_USER_ROLE_SET,
|
||||||
EVENT_ADMIN_USER_DELETE,
|
EVENT_ADMIN_USER_DELETE,
|
||||||
EVENT_ADMIN_USER_UNDELETE,
|
EVENT_ADMIN_USER_UNDELETE,
|
||||||
} from '@/event/Event'
|
} from '@/event/Events'
|
||||||
import { klicktippNewsletterStateMiddleware } from '@/middleware/klicktippMiddleware'
|
import { klicktippNewsletterStateMiddleware } from '@/middleware/klicktippMiddleware'
|
||||||
import { isValidPassword } from '@/password/EncryptorUtils'
|
import { isValidPassword } from '@/password/EncryptorUtils'
|
||||||
import { encryptPassword, verifyPassword } from '@/password/PasswordEncryptor'
|
import { encryptPassword, verifyPassword } from '@/password/PasswordEncryptor'
|
||||||
|
|||||||
20
backend/src/graphql/resolver/util/getTransactionList.ts
Normal file
20
backend/src/graphql/resolver/util/getTransactionList.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { Transaction as DbTransaction } from '@entity/Transaction'
|
||||||
|
|
||||||
|
import { Order } from '@enum/Order'
|
||||||
|
|
||||||
|
export const getTransactionList = async (
|
||||||
|
userId: number,
|
||||||
|
limit: number,
|
||||||
|
offset: number,
|
||||||
|
order: Order,
|
||||||
|
): Promise<[DbTransaction[], number]> => {
|
||||||
|
return DbTransaction.findAndCount({
|
||||||
|
where: {
|
||||||
|
userId,
|
||||||
|
},
|
||||||
|
order: { balanceDate: order, id: order },
|
||||||
|
relations: ['previousTransaction'],
|
||||||
|
skip: offset,
|
||||||
|
take: limit,
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -1,36 +0,0 @@
|
|||||||
import { EntityRepository, Repository } from '@dbTools/typeorm'
|
|
||||||
import { Transaction } from '@entity/Transaction'
|
|
||||||
|
|
||||||
import { Order } from '@enum/Order'
|
|
||||||
import { TransactionTypeId } from '@enum/TransactionTypeId'
|
|
||||||
|
|
||||||
@EntityRepository(Transaction)
|
|
||||||
export class TransactionRepository extends Repository<Transaction> {
|
|
||||||
findByUserPaged(
|
|
||||||
userId: number,
|
|
||||||
limit: number,
|
|
||||||
offset: number,
|
|
||||||
order: Order,
|
|
||||||
onlyCreation?: boolean,
|
|
||||||
): Promise<[Transaction[], number]> {
|
|
||||||
const query = this.createQueryBuilder('userTransaction')
|
|
||||||
.leftJoinAndSelect(
|
|
||||||
'userTransaction.contribution',
|
|
||||||
'contribution',
|
|
||||||
'userTransaction.id = contribution.transactionId',
|
|
||||||
)
|
|
||||||
.where('userTransaction.userId = :userId', { userId })
|
|
||||||
|
|
||||||
if (onlyCreation) {
|
|
||||||
query.andWhere('userTransaction.typeId = :typeId', {
|
|
||||||
typeId: TransactionTypeId.CREATION,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return query
|
|
||||||
.orderBy('userTransaction.balanceDate', order)
|
|
||||||
.limit(limit)
|
|
||||||
.offset(offset)
|
|
||||||
.getManyAndCount()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -38,6 +38,7 @@ const virtualLinkTransaction = (
|
|||||||
createdAt: Date,
|
createdAt: Date,
|
||||||
validUntil: Date,
|
validUntil: Date,
|
||||||
user: User,
|
user: User,
|
||||||
|
previousBalance: Decimal,
|
||||||
): Transaction => {
|
): Transaction => {
|
||||||
const linkDbTransaction: dbTransaction = {
|
const linkDbTransaction: dbTransaction = {
|
||||||
id: -2,
|
id: -2,
|
||||||
|
|||||||
@ -96,4 +96,8 @@ export class Transaction extends BaseEntity {
|
|||||||
@OneToOne(() => Contribution, (contribution) => contribution.transaction)
|
@OneToOne(() => Contribution, (contribution) => contribution.transaction)
|
||||||
@JoinColumn({ name: 'id', referencedColumnName: 'transactionId' })
|
@JoinColumn({ name: 'id', referencedColumnName: 'transactionId' })
|
||||||
contribution?: Contribution | null
|
contribution?: Contribution | null
|
||||||
|
|
||||||
|
@OneToOne(() => Transaction)
|
||||||
|
@JoinColumn({ name: 'previous' })
|
||||||
|
previousTransaction?: Transaction | null
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,18 +26,51 @@ Dies ist ein rein technischer Key und wird nur **innerhalb** der Anwendung zur I
|
|||||||
|
|
||||||
Die GradidoID ist zwar auch ein rein technischer Key, doch wird dieser als eine UUID der Version 4 erstellt. Dies basiert auf einer (pseudo)zufällig generierten Zahl aus 16 Bytes mit einer theoretischen Konfliktfreiheit von  in hexadezimaler Notation nach einem Pattern von fünf Gruppen durch Bindestrich getrennt - z.B. `550e8400-e29b-41d4-a716-446655440000`
|
Die GradidoID ist zwar auch ein rein technischer Key, doch wird dieser als eine UUID der Version 4 erstellt. Dies basiert auf einer (pseudo)zufällig generierten Zahl aus 16 Bytes mit einer theoretischen Konfliktfreiheit von  in hexadezimaler Notation nach einem Pattern von fünf Gruppen durch Bindestrich getrennt - z.B. `550e8400-e29b-41d4-a716-446655440000`
|
||||||
|
|
||||||
Somit kann die GradidoID auch System übergreifend zwischen Communities ausgetauscht werden und bietet dennoch eine weitestgehende eindeutige theoretisch konfliktfreie Identifikation des Users. System intern ist die Eindeutigkeit bei der Erstellung eines neuen Users auf jedenfall sichergestellt. Sollte ein User den Wechsel von einer Community in eine andere gradido-Community wünschen, so soll falls möglich die GradidoID für den User erhalten bleiben und übernommen werden können. Dies muss beim Umzug in der Ziel-Community geprüft werden. Falls diese GradidoID aus der Quell-Community wider erwarten existieren sollte, dann muss doch einen neue GradidoID für den User erzeugt werden.
|
Somit kann die GradidoID auch System übergreifend zwischen Communities ausgetauscht werden und bietet dennoch eine weitestgehende eindeutige theoretisch konfliktfreie Identifikation des Users. System intern ist die Eindeutigkeit bei der Erstellung eines neuen Users auf jedenfall sichergestellt. Sollte ein User den Wechsel von einer Community in eine andere gradido-Community wünschen, so soll falls möglich die GradidoID für den User erhalten bleiben und übernommen werden können. Dies muss beim Umzug in der Ziel-Community geprüft werden. Falls diese GradidoID aus der Quell-Community wider erwarten existieren sollte, dann muss doch einen neue GradidoID für den User in der Ziel-Community erzeugt werden.
|
||||||
|
|
||||||
#### Alias
|
#### Alias
|
||||||
|
|
||||||
Der Alias eines Users ist als rein fachlicher Key ausgelegt, der frei vom User definiert werden kann. Bei der Definition dieses frei definierbaren und menschenlesbaren Schlüsselwertes stellt die Gradido-Anwendung sicher, dass der vom User eingegebene Wert nicht schon von einem anderen User dieser Community verwendet wird. Für die Anlage eines Alias gelten folgende Konventionen:
|
Der Alias eines Users ist als rein fachlicher Key ausgelegt, der frei vom User definiert werden kann. Bei der Definition dieses frei definierbaren und menschenlesbaren Schlüsselwertes stellt die Gradido-Anwendung sicher, dass der vom User eingegebene Wert nicht schon von einem anderen User dieser Community verwendet wird. Für die Anlage eines Alias gelten folgende Konventionen:
|
||||||
|
|
||||||
- mindestens 5 Zeichen
|
* alpha-nummerisch
|
||||||
* alphanumerisch
|
* 2 <= Länge des alias <=20
|
||||||
* keine Umlaute
|
* beginnt mit einem Buchstaben
|
||||||
* nach folgender Regel erlaubt (RegEx: [a-zA-Z0-9]-|_[a-zA-Z0-9])
|
* keine Umlaute
|
||||||
- Blacklist für Schlüsselworte, die frei definiert werden können
|
* keine Sonderzeichen ausser dem Bindestrich "-" und dem Unterstrich "_"
|
||||||
- vordefinierte/reservierte System relevante Namen dürfen maximal aus 4 Zeichen bestehen
|
* nicht mehr als 2 Wiederholungen des gleichen Zeichens direkt hintereinander
|
||||||
|
* kein Unterscheidung von Groß-Kleinschreibung, es findet eine Konvertierung auf Kleinschreibung statt
|
||||||
|
|
||||||
|
Blackliste für nicht vom User verwendbare alias-Definitionen:
|
||||||
|
|
||||||
|
Notation: das %-Zeichen dient als Platzhalter für 0 oder beliebig viele der erlaubten Zeichen
|
||||||
|
|
||||||
|
* %gradido% (= die Sequenz gradido darf nicht enthalten sein)
|
||||||
|
* %community% (= die Sequenz community darf nicht enthalten sein)
|
||||||
|
* %communities% (= die Sequenz communities darf nicht enthalten sein)
|
||||||
|
* %admin% (= die Sequenz admin darf nicht enthalten sein)
|
||||||
|
* %gast% (= die Sequenz gast darf nicht enthalten sein)
|
||||||
|
* %guest% (= die Sequenz guest darf nicht enthalten sein)
|
||||||
|
* support% (= darf nicht mit der Sequenz support beginnen)
|
||||||
|
* user% (= darf nicht mit der Sequenz user beginnen)
|
||||||
|
* usr% (= darf nicht mit der Sequenz usr beginnen)
|
||||||
|
* home% (= darf nicht mit der Sequenz home beginnen)
|
||||||
|
* chief% (= darf nicht mit der Sequenz chief beginnen)
|
||||||
|
* chef% (= darf nicht mit der Sequenz chef beginnen)
|
||||||
|
* master% (= darf nicht mit der Sequenz master beginnen)
|
||||||
|
* email% (= darf nicht mit der Sequenz email beginnen)
|
||||||
|
* mail% (= darf nicht mit der Sequenz mail beginnen)
|
||||||
|
* root% (= darf nicht mit der Sequenz root beginnen)
|
||||||
|
* tmp% (= darf nicht mit der Sequenz tmp beginnen)
|
||||||
|
* temp% (= darf nicht mit der Sequenz temp beginnen)
|
||||||
|
* gdd% (= darf nicht mit der Sequenz gdd beginnen)
|
||||||
|
* gdt% (= darf nicht mit der Sequenz gdt beginnen)
|
||||||
|
* gdb% (= darf nicht mit der Sequenz gdb beginnen)
|
||||||
|
* age (= darf nicht age lauten)
|
||||||
|
* gmw (= darf nicht gmw lauten)
|
||||||
|
* auf (= darf nicht auf lauten)
|
||||||
|
* ...
|
||||||
|
|
||||||
|
Um für die Zukunft für eine Community im Rahmen der Dreifachen-Geldschöpfung und deren Verwaltung bestimmte Alias-Werte nicht an allgemeine User zu verlieren, werden in der Blackliste jetzt schon solche Belegungen reserviert. Damit können diese ggf. später wieder für system relevante User der Community wieder freigegeben werden.
|
||||||
|
|
||||||
#### Email
|
#### Email
|
||||||
|
|
||||||
@ -49,7 +82,7 @@ Die Email wird weiterhin als Kommunikationskanal ausserhalb der Gradido-Anwendun
|
|||||||
|
|
||||||
Die Erfassung des Alias erfolgt als zusätzliche Eingabe direkt bei der Registrierung eines neuen Users oder als weiterer Schritt direkt nach dem Login.
|
Die Erfassung des Alias erfolgt als zusätzliche Eingabe direkt bei der Registrierung eines neuen Users oder als weiterer Schritt direkt nach dem Login.
|
||||||
|
|
||||||
Dieser UseCase ist in die **Ausbaustufe-1** und **Ausbaustufe-x** unterteilt.
|
Dieser UseCase ist in die **Ausbaustufe-1** und **Ausbaustufe-x** unterteilt.
|
||||||
|
|
||||||
Alle beschriebenen Anforderungen der **Ausbaustufe-1** können mit Produktivsetzung des Issues #1798 - [GradidoID 1: adapt and migrate database schema](https://github.com/gradido/gradido/issues/1798) und dem [PR #2058 - GradidoID 1: adapt and migrate database schema](https://github.com/gradido/gradido/pull/2058) umgesetzt werden.
|
Alle beschriebenen Anforderungen der **Ausbaustufe-1** können mit Produktivsetzung des Issues #1798 - [GradidoID 1: adapt and migrate database schema](https://github.com/gradido/gradido/issues/1798) und dem [PR #2058 - GradidoID 1: adapt and migrate database schema](https://github.com/gradido/gradido/pull/2058) umgesetzt werden.
|
||||||
|
|
||||||
@ -63,7 +96,7 @@ In der Eingabemaske der Registrierung wird nun zusätzlich das Feld *Alias* ange
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
Mit dem (optionalen ?) Button "Eindeutigkeit prüfen" wird dem User die Möglichkeit gegeben vorab die Eindeutigkeit seiner *Alias*-Eingabe zu verifizieren ohne den Dialog über den "Registrieren"-Button zu verlassen. Denn es muss sichergestellt sein, dass noch kein existierender User der Community genau diesen *Alias* evtl. schon verwendet.
|
Mit dem (optionalen ?) Button "Eindeutigkeit prüfen" wird dem User die Möglichkeit gegeben vorab die Eindeutigkeit seiner *Alias*-Eingabe zu verifizieren ohne den Dialog über den "Registrieren"-Button zu verlassen. Denn es muss sichergestellt sein, dass noch kein existierender User der Community genau diesen *Alias* evtl. schon verwendet.
|
||||||
|
|
||||||
Wird diese Prüfung vom User nicht ausgeführt bevor er den Dialog mit dem "Registrieren"-Button abschließt, so erfolgt die *Alias*-Eindeutigkeitsprüfung als erster Schritt bevor die anderen Eingaben als neuer User geprüft und angelegt werden.
|
Wird diese Prüfung vom User nicht ausgeführt bevor er den Dialog mit dem "Registrieren"-Button abschließt, so erfolgt die *Alias*-Eindeutigkeitsprüfung als erster Schritt bevor die anderen Eingaben als neuer User geprüft und angelegt werden.
|
||||||
|
|
||||||
@ -93,20 +126,8 @@ Der Sprung nach der Login-Seite nach erfolgreichem Login auf die Profil-Seite ö
|
|||||||
Im Eingabe-Modus der Alias-Gruppe hat das Eingabefeld den Fokus und darin wird:
|
Im Eingabe-Modus der Alias-Gruppe hat das Eingabefeld den Fokus und darin wird:
|
||||||
|
|
||||||
* wenn noch kein Alias für den User in der Datenbank vorhanden ist, vom System ein Vorschlag unterbreitet. Der Vorschlag basiert auf dem Vornamen des Users und wird durch folgende Logik ermittelt:
|
* wenn noch kein Alias für den User in der Datenbank vorhanden ist, vom System ein Vorschlag unterbreitet. Der Vorschlag basiert auf dem Vornamen des Users und wird durch folgende Logik ermittelt:
|
||||||
* es wird mit dem Vorname des Users eine Datenbankabfrage durchgeführt, die zählt, wieviele User-Aliase es schon mit diesem Vornamen gibt und falls notwendig direkt mit einer nachfolgenden Nummer als Postfix versehen sind.
|
* es wird mit dem Vorname des Users eine Datenbankabfrage durchgeführt, die zählt, wieviele User-Aliase es schon mit diesem Vornamen gibt und falls notwendig direkt mit einer nachfolgenden Nummer als Postfix versehen.
|
||||||
* Aufgrund der Konvention, dass ein Alias mindestens 5 Zeichen lang sein muss, sind ggf. führende Nullen mitzuberücksichten.
|
* Aufgrund der Konvention für eine Alias-Definition könnte ein Vorname ggf. gegen die Alias-Regeln verstossen oder aber auch evtl. zu kurz oder lang sein. Auch ein mögliches Blockieren durch die Blacklist könnte den Vornamen des Users als alias verhindern. Dann muss der User selbst manuell seinen alias vollständig erfassen ohne, dass das System einen Vorschlag unterbreiten könnte.
|
||||||
* **Beispiel-1**: *Max* als Vorname
|
|
||||||
* in der Datenbank gibt es schon mehrer User mit den Aliasen: *Maximilian*, *Max01*, *Max_M*, *Max-M*, *MaxMu* und *Max02*.
|
|
||||||
* Dann schlägt das System den Alias *Max03* vor, da *Max* nur 3 Zeichen lang ist und es schon zwei Aliase *Max* gefolgt mit einer Nummer gibt (*Max01* und *Max02*)
|
|
||||||
* Die Aliase *Maximilian*, *Max_M*, *Max-M* und *MaxMu* werden nicht mitgezählt, das diese nach *Max* keine direkt folgende Ziffern haben
|
|
||||||
* **Beispiel-2**: *August* als Vorname
|
|
||||||
* in der Datenbank gibt es schon mehrer User mit den Aliasen: *Augusta*, *Augustus*, *Augustinus*
|
|
||||||
* Dann schlägt das System den Alias *August* vor, da *August* schon 6 Zeichen lang ist und es noch keinen anderen User mit Alias *August* gibt
|
|
||||||
* die Aliase *Augusta*, *Augustus* und *Augustinus* werden nicht mit gezählt, da diese länger als 5 Zeichen sind und sich von *August* unterscheiden
|
|
||||||
* **Beispiel-3**: *Nick* als Vorname
|
|
||||||
* in der Datenbank gibt es schon mehrer User mit den Aliasen: *Nicko*, *Nickodemus*
|
|
||||||
* Dann schlägt das System den Alias *Nick1* vor, da *Nick* kürzer als 5 Zeichen ist und es noch keinen anderen User mit dem Alias *Nick1* gibt
|
|
||||||
* die Aliase *Nicko* und *Nickodemus* werden nicht mit gezählt, da diese länger als 5 Zeichen sind und sich von *Nick* unterscheiden
|
|
||||||
* wenn schon ein Alias für den User in der Datenbank vorhanden ist, dann wird dieser unverändert aus der Datenbank und ohne Systemvorschlag einfach angezeigt.
|
* wenn schon ein Alias für den User in der Datenbank vorhanden ist, dann wird dieser unverändert aus der Datenbank und ohne Systemvorschlag einfach angezeigt.
|
||||||
|
|
||||||
Der User kann nun den im Eingabefeld angezeigten Alias verändern, wobei die Alias-Konventionen, wie oben im ersten Kapitel beschrieben einzuhalten und zu validieren sind.
|
Der User kann nun den im Eingabefeld angezeigten Alias verändern, wobei die Alias-Konventionen, wie oben im ersten Kapitel beschrieben einzuhalten und zu validieren sind.
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
</b-col>
|
</b-col>
|
||||||
<b-col offset="1" offset-md="0" offset-lg="0">
|
<b-col offset="1" offset-md="0" offset-lg="0">
|
||||||
<div>
|
<div>
|
||||||
{{ previousBookedBalance | GDD }}
|
{{ previousBalance | GDD }}
|
||||||
{{ decay === '0' ? $t('math.minus') : '' }}
|
{{ decay === '0' ? $t('math.minus') : '' }}
|
||||||
{{ decay | GDD }} {{ $t('math.equal') }}
|
{{ decay | GDD }} {{ $t('math.equal') }}
|
||||||
<b>{{ balance | GDD }}</b>
|
<b>{{ balance | GDD }}</b>
|
||||||
@ -35,7 +35,7 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
previousBookedBalance: {
|
previousBalance: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
<b-col cols="12" lg="4" md="4">
|
<b-col cols="12" lg="4" md="4">
|
||||||
<div>{{ $t('decay.last_transaction') }}</div>
|
<div>{{ $t('decay.last_transaction') }}</div>
|
||||||
</b-col>
|
</b-col>
|
||||||
<b-col offset="1" offset-md="0" offset-lg="0">
|
<b-col offset="1" offset-md="0" offset-lg="0" class="text-right mr-5">
|
||||||
<div>
|
<div>
|
||||||
<span>
|
<span>
|
||||||
{{ $d(new Date(decay.start), 'long') }}
|
{{ $d(new Date(decay.start), 'long') }}
|
||||||
@ -24,30 +24,44 @@
|
|||||||
</b-row>
|
</b-row>
|
||||||
<duration-row :decayStart="decay.start" :decayEnd="decay.end" />
|
<duration-row :decayStart="decay.start" :decayEnd="decay.end" />
|
||||||
|
|
||||||
|
<!-- Previous Balance -->
|
||||||
|
<b-row class="mt-2">
|
||||||
|
<b-col cols="12" lg="6" md="3">
|
||||||
|
<div>{{ $t('decay.old_balance') }}</div>
|
||||||
|
</b-col>
|
||||||
|
<b-col offset="1" offset-md="0" offset-lg="0" class="text-right mr-5">
|
||||||
|
{{ previousBalance | GDD }}
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
|
|
||||||
<!-- Decay-->
|
<!-- Decay-->
|
||||||
<b-row>
|
<b-row class="mt-0">
|
||||||
<b-col cols="12" lg="4" md="4">
|
<b-col cols="12" lg="3" md="3">
|
||||||
<div>{{ $t('decay.decay') }}</div>
|
<div>{{ $t('decay.decay') }}</div>
|
||||||
</b-col>
|
</b-col>
|
||||||
<b-col offset="1" offset-md="0" offset-lg="0">{{ decay.decay | GDD }}</b-col>
|
<b-col offset="1" offset-md="0" offset-lg="0" class="text-right mr-5">
|
||||||
|
{{ decay.decay | GDD }}
|
||||||
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
<!-- Type-->
|
<!-- Type-->
|
||||||
<b-row>
|
<b-row>
|
||||||
<b-col>
|
<b-col>
|
||||||
<b-row>
|
<b-row class="mb-2">
|
||||||
<!-- eslint-disable-next-line @intlify/vue-i18n/no-dynamic-keys-->
|
<!-- eslint-disable-next-line @intlify/vue-i18n/no-dynamic-keys-->
|
||||||
<b-col cols="12" lg="4" md="4">{{ $t(`decay.types.${typeId.toLowerCase()}`) }}</b-col>
|
<b-col cols="12" lg="3" md="3">{{ $t(`decay.types.${typeId.toLowerCase()}`) }}</b-col>
|
||||||
<b-col offset="1" offset-md="0" offset-lg="0">{{ amount | GDD }}</b-col>
|
<b-col offset="1" offset-md="0" offset-lg="0" class="text-right mr-5">
|
||||||
|
{{ amount | GDD }}
|
||||||
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
<!-- Total-->
|
<!-- Total-->
|
||||||
<b-row>
|
<b-row class="border-top pt-2">
|
||||||
<b-col cols="12" lg="4" md="4">
|
<b-col cols="12" lg="3" md="3">
|
||||||
<div>{{ $t('decay.total') }}</div>
|
<div>{{ $t('decay.new_balance') }}</div>
|
||||||
</b-col>
|
</b-col>
|
||||||
<b-col offset="1" offset-md="0" offset-lg="0">
|
<b-col offset="1" offset-md="0" offset-lg="0" class="text-right mr-5">
|
||||||
<b>{{ (Number(amount) + Number(decay.decay)) | GDD }}</b>
|
<b>{{ balance | GDD }}</b>
|
||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
</b-col>
|
</b-col>
|
||||||
@ -63,6 +77,8 @@ export default {
|
|||||||
DurationRow,
|
DurationRow,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
balance: { type: String, default: '0' },
|
||||||
|
previousBalance: { type: String, default: '0' },
|
||||||
amount: { type: String, default: '0' },
|
amount: { type: String, default: '0' },
|
||||||
typeId: { type: String, default: '' },
|
typeId: { type: String, default: '' },
|
||||||
memo: { type: String, default: '' },
|
memo: { type: String, default: '' },
|
||||||
|
|||||||
@ -7,7 +7,15 @@
|
|||||||
:decay="decay"
|
:decay="decay"
|
||||||
:typeId="typeId"
|
:typeId="typeId"
|
||||||
/>
|
/>
|
||||||
<decay-information-long v-else :amount="amount" :decay="decay" :typeId="typeId" :memo="memo" />
|
<decay-information-long
|
||||||
|
v-else
|
||||||
|
:amount="amount"
|
||||||
|
:decay="decay"
|
||||||
|
:typeId="typeId"
|
||||||
|
:memo="memo"
|
||||||
|
:balance="balance"
|
||||||
|
:previousBalance="previousBalance"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -39,6 +47,14 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
balance: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
previousBalance: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isStartBlock() {
|
isStartBlock() {
|
||||||
|
|||||||
@ -93,8 +93,9 @@ describe('GddTransactionList', () => {
|
|||||||
{
|
{
|
||||||
id: -1,
|
id: -1,
|
||||||
typeId: 'DECAY',
|
typeId: 'DECAY',
|
||||||
amount: '-0.16778637075575395772595',
|
amount: '-0.16',
|
||||||
balance: '31.59320453982945549519405',
|
balance: '31.59',
|
||||||
|
previousBalance: '31.75',
|
||||||
balanceDate: '2022-03-03T08:54:54',
|
balanceDate: '2022-03-03T08:54:54',
|
||||||
memo: '',
|
memo: '',
|
||||||
linkedUser: null,
|
linkedUser: null,
|
||||||
@ -110,6 +111,7 @@ describe('GddTransactionList', () => {
|
|||||||
typeId: 'SEND',
|
typeId: 'SEND',
|
||||||
amount: '1',
|
amount: '1',
|
||||||
balance: '31.76099091058520945292',
|
balance: '31.76099091058520945292',
|
||||||
|
previousBalance: '30.76',
|
||||||
balanceDate: '2022-02-28T13:55:47',
|
balanceDate: '2022-02-28T13:55:47',
|
||||||
memo:
|
memo:
|
||||||
'Um den Kessel schlingt den Reihn, Werft die Eingeweid‘ hinein. Kröte du, die Nacht und Tag Unterm kalten Steine lag,',
|
'Um den Kessel schlingt den Reihn, Werft die Eingeweid‘ hinein. Kröte du, die Nacht und Tag Unterm kalten Steine lag,',
|
||||||
@ -129,6 +131,7 @@ describe('GddTransactionList', () => {
|
|||||||
typeId: 'RECEIVE',
|
typeId: 'RECEIVE',
|
||||||
amount: '10',
|
amount: '10',
|
||||||
balance: '10',
|
balance: '10',
|
||||||
|
previousBalance: '31.75',
|
||||||
balanceDate: '2022-02-23T10:55:30',
|
balanceDate: '2022-02-23T10:55:30',
|
||||||
memo:
|
memo:
|
||||||
'Monatlanges Gift sog ein, In den Topf zuerst hinein… (William Shakespeare, Die Hexen aus Macbeth)',
|
'Monatlanges Gift sog ein, In den Topf zuerst hinein… (William Shakespeare, Die Hexen aus Macbeth)',
|
||||||
@ -148,6 +151,7 @@ describe('GddTransactionList', () => {
|
|||||||
typeId: 'CREATION',
|
typeId: 'CREATION',
|
||||||
amount: '1000',
|
amount: '1000',
|
||||||
balance: '32.96482231613347376132',
|
balance: '32.96482231613347376132',
|
||||||
|
previousBalance: '31.75',
|
||||||
balanceDate: '2022-02-25T07:29:26',
|
balanceDate: '2022-02-25T07:29:26',
|
||||||
memo: 'Jammern hilft nichts, sondern ich kann selber meinen Teil dazu beitragen.',
|
memo: 'Jammern hilft nichts, sondern ich kann selber meinen Teil dazu beitragen.',
|
||||||
linkedUser: {
|
linkedUser: {
|
||||||
@ -414,6 +418,7 @@ describe('GddTransactionList', () => {
|
|||||||
return {
|
return {
|
||||||
amount: '3.14',
|
amount: '3.14',
|
||||||
balanceDate: '2021-04-29T17:26:40+00:00',
|
balanceDate: '2021-04-29T17:26:40+00:00',
|
||||||
|
previousBalance: '31.75',
|
||||||
decay: {
|
decay: {
|
||||||
decay: '-477.01',
|
decay: '-477.01',
|
||||||
start: '2021-05-13T17:46:31.000Z',
|
start: '2021-05-13T17:46:31.000Z',
|
||||||
|
|||||||
@ -19,10 +19,7 @@
|
|||||||
class="pointer bg-white appBoxShadow gradido-border-radius px-4 pt-2 test-list-group-item"
|
class="pointer bg-white appBoxShadow gradido-border-radius px-4 pt-2 test-list-group-item"
|
||||||
>
|
>
|
||||||
<template #DECAY>
|
<template #DECAY>
|
||||||
<transaction-decay
|
<transaction-decay v-bind="transactions[index]" />
|
||||||
v-bind="transactions[index]"
|
|
||||||
:previousBookedBalance="previousBookedBalance(index)"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</transaction-list-item>
|
</transaction-list-item>
|
||||||
</div>
|
</div>
|
||||||
@ -34,24 +31,15 @@
|
|||||||
class="pointer mb-3 bg-white appBoxShadow gradido-border-radius p-3 test-list-group-item"
|
class="pointer mb-3 bg-white appBoxShadow gradido-border-radius p-3 test-list-group-item"
|
||||||
>
|
>
|
||||||
<template #SEND>
|
<template #SEND>
|
||||||
<transaction-send
|
<transaction-send v-bind="transactions[index]" />
|
||||||
v-bind="transactions[index]"
|
|
||||||
:previousBookedBalance="previousBookedBalance(index)"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #RECEIVE>
|
<template #RECEIVE>
|
||||||
<transaction-receive
|
<transaction-receive v-bind="transactions[index]" />
|
||||||
v-bind="transactions[index]"
|
|
||||||
:previousBookedBalance="previousBookedBalance(index)"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #CREATION>
|
<template #CREATION>
|
||||||
<transaction-creation
|
<transaction-creation v-bind="transactions[index]" />
|
||||||
v-bind="transactions[index]"
|
|
||||||
:previousBookedBalance="previousBookedBalance(index)"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #LINK_SUMMARY>
|
<template #LINK_SUMMARY>
|
||||||
@ -124,10 +112,6 @@ export default {
|
|||||||
})
|
})
|
||||||
window.scrollTo(0, 0)
|
window.scrollTo(0, 0)
|
||||||
},
|
},
|
||||||
previousBookedBalance(idx) {
|
|
||||||
if (this.transactions[idx + 1]) return this.transactions[idx + 1].balance
|
|
||||||
return '0'
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isPaginationVisible() {
|
isPaginationVisible() {
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<b-col cols="12" lg="4" md="4">
|
<b-col cols="12" lg="4" md="4">
|
||||||
<div>{{ $t('decay.past_time') }}</div>
|
<div>{{ $t('decay.past_time') }}</div>
|
||||||
</b-col>
|
</b-col>
|
||||||
<b-col offset="1" offset-md="0" offset-lg="0">
|
<b-col offset="1" offset-md="0" offset-lg="0" class="text-right mr-5">
|
||||||
<span v-if="duration">{{ durationText }}</span>
|
<span v-if="duration">{{ durationText }}</span>
|
||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
|
|||||||
@ -13,7 +13,8 @@ const mocks = {
|
|||||||
|
|
||||||
const propsData = {
|
const propsData = {
|
||||||
amount: '12.45',
|
amount: '12.45',
|
||||||
balance: '31.76099091058521',
|
balance: '31.76',
|
||||||
|
previousBalance: '19.31',
|
||||||
balanceDate: '2022-02-28T13:55:47.000Z',
|
balanceDate: '2022-02-28T13:55:47.000Z',
|
||||||
decay: {
|
decay: {
|
||||||
decay: '-0.2038314055482643084',
|
decay: '-0.2038314055482643084',
|
||||||
|
|||||||
@ -18,7 +18,14 @@
|
|||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
<b-collapse class="pb-4 pt-lg-3" v-model="visible">
|
<b-collapse class="pb-4 pt-lg-3" v-model="visible">
|
||||||
<decay-information :typeId="typeId" :decay="decay" :amount="amount" :memo="memo" />
|
<decay-information
|
||||||
|
:typeId="typeId"
|
||||||
|
:decay="decay"
|
||||||
|
:amount="amount"
|
||||||
|
:memo="memo"
|
||||||
|
:balance="balance"
|
||||||
|
:previousBalance="previousBalance"
|
||||||
|
/>
|
||||||
</b-collapse>
|
</b-collapse>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -61,7 +68,11 @@ export default {
|
|||||||
type: Number,
|
type: Number,
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
previousBookedBalance: {
|
balance: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
previousBalance: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
<decay-information-decay
|
<decay-information-decay
|
||||||
:balance="balance"
|
:balance="balance"
|
||||||
:decay="decay.decay"
|
:decay="decay.decay"
|
||||||
:previousBookedBalance="previousBookedBalance"
|
:previousBalance="previousBalance"
|
||||||
/>
|
/>
|
||||||
</b-collapse>
|
</b-collapse>
|
||||||
</div>
|
</div>
|
||||||
@ -44,9 +44,10 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
previousBookedBalance: {
|
},
|
||||||
type: String,
|
computed: {
|
||||||
required: true,
|
previousBalance() {
|
||||||
|
return String(Number(this.balance) - Number(this.decay.decay))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@ -13,7 +13,8 @@ const mocks = {
|
|||||||
|
|
||||||
const propsData = {
|
const propsData = {
|
||||||
amount: '12.45',
|
amount: '12.45',
|
||||||
balance: '31.76099091058521',
|
balance: '31.76',
|
||||||
|
previousBalance: '19.31',
|
||||||
balanceDate: '2022-02-28T13:55:47.000Z',
|
balanceDate: '2022-02-28T13:55:47.000Z',
|
||||||
decay: {
|
decay: {
|
||||||
decay: '-0.2038314055482643084',
|
decay: '-0.2038314055482643084',
|
||||||
|
|||||||
@ -42,7 +42,14 @@
|
|||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
<b-collapse class="pb-4 pt-lg-3" v-model="visible">
|
<b-collapse class="pb-4 pt-lg-3" v-model="visible">
|
||||||
<decay-information :typeId="typeId" :decay="decay" :amount="amount" :memo="memo" />
|
<decay-information
|
||||||
|
:typeId="typeId"
|
||||||
|
:decay="decay"
|
||||||
|
:amount="amount"
|
||||||
|
:memo="memo"
|
||||||
|
:balance="balance"
|
||||||
|
:previousBalance="previousBalance"
|
||||||
|
/>
|
||||||
</b-collapse>
|
</b-collapse>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -84,7 +91,11 @@ export default {
|
|||||||
typeId: {
|
typeId: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
previousBookedBalance: {
|
balance: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
previousBalance: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -13,7 +13,8 @@ const mocks = {
|
|||||||
|
|
||||||
const propsData = {
|
const propsData = {
|
||||||
amount: '12.45',
|
amount: '12.45',
|
||||||
balance: '31.76099091058521',
|
balance: '31.76',
|
||||||
|
previousBalance: '19.31',
|
||||||
balanceDate: '2022-02-28T13:55:47.000Z',
|
balanceDate: '2022-02-28T13:55:47.000Z',
|
||||||
decay: {
|
decay: {
|
||||||
decay: '-0.2038314055482643084',
|
decay: '-0.2038314055482643084',
|
||||||
|
|||||||
@ -41,7 +41,14 @@
|
|||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
<b-collapse class="pb-4 pt-lg-3" v-model="visible">
|
<b-collapse class="pb-4 pt-lg-3" v-model="visible">
|
||||||
<decay-information :typeId="typeId" :decay="decay" :amount="amount" :memo="memo" />
|
<decay-information
|
||||||
|
:typeId="typeId"
|
||||||
|
:decay="decay"
|
||||||
|
:amount="amount"
|
||||||
|
:memo="memo"
|
||||||
|
:balance="balance"
|
||||||
|
:previousBalance="previousBalance"
|
||||||
|
/>
|
||||||
</b-collapse>
|
</b-collapse>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -84,7 +91,11 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
previousBookedBalance: {
|
balance: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
previousBalance: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -33,6 +33,7 @@ export const transactionsQuery = gql`
|
|||||||
typeId
|
typeId
|
||||||
amount
|
amount
|
||||||
balance
|
balance
|
||||||
|
previousBalance
|
||||||
balanceDate
|
balanceDate
|
||||||
memo
|
memo
|
||||||
linkedUser {
|
linkedUser {
|
||||||
|
|||||||
@ -89,6 +89,8 @@
|
|||||||
"decay_introduced": "Die Vergänglichkeit wurde eingeführt am:",
|
"decay_introduced": "Die Vergänglichkeit wurde eingeführt am:",
|
||||||
"decay_since_last_transaction": "Vergänglichkeit seit der letzten Transaktion",
|
"decay_since_last_transaction": "Vergänglichkeit seit der letzten Transaktion",
|
||||||
"last_transaction": "Letzte Transaktion",
|
"last_transaction": "Letzte Transaktion",
|
||||||
|
"new_balance": "Neuer Kontostand",
|
||||||
|
"old_balance": "Vorheriger Kontostand",
|
||||||
"past_time": "Vergangene Zeit",
|
"past_time": "Vergangene Zeit",
|
||||||
"Starting_block_decay": "Startblock Vergänglichkeit",
|
"Starting_block_decay": "Startblock Vergänglichkeit",
|
||||||
"total": "Gesamt",
|
"total": "Gesamt",
|
||||||
|
|||||||
@ -89,6 +89,8 @@
|
|||||||
"decay_introduced": "Decay was introduced on:",
|
"decay_introduced": "Decay was introduced on:",
|
||||||
"decay_since_last_transaction": "Decay since the last transaction",
|
"decay_since_last_transaction": "Decay since the last transaction",
|
||||||
"last_transaction": "Last transaction:",
|
"last_transaction": "Last transaction:",
|
||||||
|
"new_balance": "New balance",
|
||||||
|
"old_balance": "Previous balance",
|
||||||
"past_time": "Time passed",
|
"past_time": "Time passed",
|
||||||
"Starting_block_decay": "Starting Block Decay",
|
"Starting_block_decay": "Starting Block Decay",
|
||||||
"total": "Total",
|
"total": "Total",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user