mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
25 lines
920 B
TypeScript
25 lines
920 B
TypeScript
import { InputTransactionType } from '@/graphql/enum/InputTransactionType'
|
|
import { TransactionDraft } from '@/graphql/input/TransactionDraft'
|
|
import { getEnumValue } from '@/utils/typeConverter'
|
|
|
|
import { AbstractLoggingView } from './AbstractLogging.view'
|
|
import { UserIdentifierLoggingView } from './UserIdentifierLogging.view'
|
|
|
|
export class TransactionDraftLoggingView extends AbstractLoggingView {
|
|
public constructor(private self: TransactionDraft) {
|
|
super()
|
|
}
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
public toJSON(): any {
|
|
return {
|
|
user: new UserIdentifierLoggingView(this.self.user).toJSON(),
|
|
linkedUser: new UserIdentifierLoggingView(this.self.linkedUser).toJSON(),
|
|
amount: Number(this.self.amount),
|
|
type: getEnumValue(InputTransactionType, this.self.type),
|
|
createdAt: this.self.createdAt,
|
|
targetDate: this.self.targetDate,
|
|
}
|
|
}
|
|
}
|