mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
decontruct input
This commit is contained in:
parent
6f8da4202a
commit
6691be813f
@ -1,22 +1,24 @@
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import Decimal from 'decimal.js-light'
|
||||
|
||||
interface DecayInterface {
|
||||
balance: Decimal
|
||||
decay: Decimal
|
||||
roundedDecay: Decimal
|
||||
start: Date | null
|
||||
end: Date | null
|
||||
duration: number | null
|
||||
}
|
||||
|
||||
@ObjectType()
|
||||
export class Decay {
|
||||
constructor(data: {
|
||||
balance: Decimal
|
||||
decay: Decimal
|
||||
roundedDecay: Decimal
|
||||
start: Date | null
|
||||
end: Date | null
|
||||
duration: number | null
|
||||
}) {
|
||||
this.balance = data.balance
|
||||
this.decay = data.decay
|
||||
this.roundedDecay = data.roundedDecay
|
||||
this.start = data.start
|
||||
this.end = data.end
|
||||
this.duration = data.duration
|
||||
constructor({ balance, decay, roundedDecay, start, end, duration }: DecayInterface) {
|
||||
this.balance = balance
|
||||
this.decay = decay
|
||||
this.roundedDecay = roundedDecay
|
||||
this.start = start
|
||||
this.end = end
|
||||
this.duration = duration
|
||||
}
|
||||
|
||||
@Field(() => Decimal)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user