users
dynamic: .‘Users’
user-initializer: (
‘Type’ = create ‘Unknown’ ( )
)
passwords: .'Passwords'
password-value: .'Data'.'Password'
password-status: .'Data'.'Active' (
| active => 'Yes' ( )
| reset => 'No' ( )
)
password-initializer: (
'Data' = ( )
)
authorities: .'Authorities'
identities: .'Identities'>'User'
identity-initializer: ( )
interfaces
root {
can-update: user .‘Type’?‘Admin’
'Users': collection ['Name'] {
'Name': text
'Type': stategroup (
'Admin' { }
'Unknown' { }
)
}
'Passwords': collection ['User'] {
'User': text -> ^ .'Users'[]
'Data': group {
can-update: user is ( ^ >'User' )
'Password': text
'Active': stategroup (
'No' { }
'Yes' { }
)
}
}
'Authorities': collection ['Authority'] {
'Authority': text
'Identities': collection ['Identity'] {
'Identity': text
'User': text -> ^ ^ .'Users'[]
}
}
'Provinces': collection ['Name'] {
'Name': text
// ex 1
'Person': reference-set -> downstream ^ .'Person'* .'provinces'* = inverse >'Name'
'Count': number 'count' = count <'Person'* .'employment status'?'employed'
// ex 2
'Person address': reference-set -> downstream ^ .'Person'* .'address'* = inverse >'province'
'Persons': collection ['uid'] = union (
'address refs' = <'Person address'[ ^ .'Person'* ]
) {
'uid': text -> downstream ^ ^ .'Person'[] = key
}
//'Count2': number 'count' = count .'Persons'* ...
}
'Person': collection ['uid'] {
'uid': text
'BSN': number positive 'bsn-number'
'first name': text
'last name': text
'age': number positive 'age'
'address': collection ['postcode'] {
'postcode': text
'street name number': text
'city': text
'province': text -> ^ ^ .'Provinces'[]
// stategroup (
// 'North-Holland' { }
// 'South-Hollan' { }
// 'Flevoland' { }
// 'Utrecht' { }
// 'Drenthe' { }
// 'Zeeland' { }
// 'Brabant' { }
// 'Groningen' { }
// 'Overijssel' { }
// 'Friesland' { }
// 'Limburg' { }
// )
}
'provinces': collection ['Name'] = union (
'address' = .'address'* >'province'
) {
'Name': text -> ^ ^ .'Provinces'[] = key
'employment status': stategroup = switch ^ .'employment status' (
|'unemployed' => 'unemployed' ( )
|'employed' => 'employed' ( )
) (
'employed' { }
'unemployed' { }
)
}
'email': text
'telephone number': text
'employment status': stategroup (
'employed' { }
'unemployed' { }
)
'benefits': stategroup (
'jobless' { } // WW uitkering
'sickness' { } // IVA / arbeidsongeschikt
'elderly' { } // IOW / AOW ?
)
}
//'provicial-employment': collection ['province'] {
// 'provinces': text -> <path to collection>[]^ ^
//}
}
numerical-types
‘bsn-number’
‘age’
@numerical-type: (
label: “years old”
)
‘count’
// ‘template-type’
// general data
// specific case by case data
// PII