56 lines
1.1 KiB
Plaintext
56 lines
1.1 KiB
Plaintext
entity Event {
|
|
name String required,
|
|
date LocalDate required,
|
|
playersLimit Integer,
|
|
cost BigDecimal,
|
|
comment TextBlob
|
|
}
|
|
|
|
entity Registration {
|
|
dateTime ZonedDateTime required,
|
|
active Boolean required,
|
|
playerName String,
|
|
comment TextBlob
|
|
}
|
|
|
|
entity Charge {
|
|
chargeDate LocalDate required,
|
|
type ChargeType required,
|
|
amount BigDecimal required,
|
|
// User will be linked through a relationship, no need for an attribute here
|
|
}
|
|
|
|
enum ChargeType {
|
|
CHARGE,
|
|
PAYMENT
|
|
}
|
|
|
|
// Change the relationship to reflect composition
|
|
relationship OneToMany {
|
|
Event{registrations} to Registration{event(name)}
|
|
}
|
|
|
|
// Declare User as a built-in entity
|
|
relationship ManyToOne {
|
|
Registration{user(login)} to User with builtInEntity
|
|
}
|
|
|
|
relationship ManyToOne {
|
|
Charge{event(id)} to Event
|
|
}
|
|
|
|
relationship ManyToOne {
|
|
Charge{registration(id)} to Registration
|
|
}
|
|
|
|
relationship ManyToOne {
|
|
Charge{user(login)} to User with builtInEntity
|
|
}
|
|
|
|
service Event with serviceClass
|
|
|
|
// No pagination as per your request
|
|
|
|
// Excluding DTOs as per your request
|
|
// noDto *
|