extendAbstract
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Julien Valverdé
2024-02-14 21:57:48 +01:00
parent 1758649507
commit a065daec1e
2 changed files with 25 additions and 4 deletions

View File

@@ -28,14 +28,22 @@ const Identifiable = <ID>() => trait
.build()
const StatefulSubscription = trait
.abstract<{
readonly isStatefulSubscription: true
readonly status: (
// .abstract<{
// readonly isStatefulSubscription: true
// readonly status: (
// { _tag: "awaitingPayment" } |
// { _tag: "active", activeSince: Date, expiresAt?: Date } |
// { _tag: "expired", expiredSince: Date }
// )
// }>()
.extendAbstract(Super => class extends Super {
readonly isStatefulSubscription!: true
readonly status!: (
{ _tag: "awaitingPayment" } |
{ _tag: "active", activeSince: Date, expiresAt?: Date } |
{ _tag: "expired", expiredSince: Date }
)
}>()
})
.build()
type StatefulSubscriptionClass = Trait.Class<typeof StatefulSubscription>