initial customer.jdl
This commit is contained in:
parent
12a18b9d5f
commit
79f59fb323
66
src/main/jdl/customer.jdl
Normal file
66
src/main/jdl/customer.jdl
Normal file
@ -0,0 +1,66 @@
|
||||
|
||||
entity Customer {
|
||||
number Integer required unique min(10000) max(99999),
|
||||
prefix String required unique pattern(/[a-z][a-z0-9]+/),
|
||||
}
|
||||
|
||||
entity Contact {
|
||||
firstName String required maxlength(80),
|
||||
lastName String required maxlength(80),
|
||||
email String required maxlength(80)
|
||||
}
|
||||
|
||||
enum CustomerContactRole {
|
||||
CONTRACTUAL,
|
||||
TECHNICAL,
|
||||
FINANCIAL
|
||||
}
|
||||
|
||||
entity CustomerContact {
|
||||
role CustomerContactRole required
|
||||
}
|
||||
|
||||
entity Membership {
|
||||
sinceDate LocalDate required,
|
||||
untilDate LocalDate
|
||||
}
|
||||
|
||||
enum ShareAction {
|
||||
SUBSCRIPTION,
|
||||
CANCELLATION
|
||||
}
|
||||
|
||||
entity Share {
|
||||
date LocalDate required,
|
||||
action ShareAction required,
|
||||
quantity Integer required,
|
||||
comment String maxlength(160)
|
||||
}
|
||||
|
||||
enum AssetAction {
|
||||
PAYMENT,
|
||||
HANDOVER,
|
||||
ADOPTION,
|
||||
LOSS,
|
||||
CLEARING,
|
||||
PAYBACK
|
||||
}
|
||||
|
||||
entity Asset {
|
||||
date LocalDate required,
|
||||
action AssetAction required,
|
||||
amount BigDecimal required,
|
||||
comment String maxlength(160)
|
||||
}
|
||||
|
||||
relationship OneToMany {
|
||||
Customer to Membership{customer(prefix)},
|
||||
Membership to Share{member},
|
||||
Membership to Asset{member}
|
||||
}
|
||||
|
||||
relationship ManyToOne {
|
||||
CustomerContact{contact(email) required} to Contact{role},
|
||||
CustomerContact{customer(prefix) required} to Customer{role}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user