mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
28 lines
819 B
TypeScript
28 lines
819 B
TypeScript
/* eslint-disable no-unused-vars */
|
|
import { PendingTransaction } from '../entity/PendingTransaction'
|
|
import { Transaction } from '../entity/Transaction'
|
|
import { AbstractLoggingView } from './AbstractLogging.view'
|
|
import { TransactionLoggingView } from './TransactionLogging.view'
|
|
|
|
// TODO: move enum into database, maybe rename database
|
|
enum PendingTransactionState {
|
|
NEW = 1,
|
|
PENDING = 2,
|
|
SETTLED = 3,
|
|
REVERTED = 4,
|
|
}
|
|
|
|
export class PendingTransactionLoggingView extends AbstractLoggingView {
|
|
public constructor(private self: PendingTransaction) {
|
|
super()
|
|
}
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
public toJSON(): any {
|
|
return {
|
|
...new TransactionLoggingView(this.self as Transaction).toJSON(),
|
|
state: PendingTransactionState[this.self.state],
|
|
}
|
|
}
|
|
}
|