Skip to content

Commit

Permalink
Initial implementation of Address (CFM-12), AdHocAttribute (CFM-13), …
Browse files Browse the repository at this point in the history
…TelephoneNumber (CFM-16), URL (CFM-17) and associated refactoring
  • Loading branch information
Benn Oshrin committed Feb 28, 2022
1 parent 9d68e80 commit 598e952
Show file tree
Hide file tree
Showing 73 changed files with 3,159 additions and 745 deletions.
130 changes: 119 additions & 11 deletions app/config/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@

"columns": {
"co_id": { "type": "integer", "foreignkey": { "table": "cos", "column": "id" }, "notnull": true },
"cou_id": { "type": "integer", "foreignkey": { "table": "cous", "column": "id" } },
"description": { "type": "string", "size": 128 },
"external_identity_id": { "type": "integer", "foreignkey": { "table": "external_identities", "column": "id" } },
"id": { "type": "integer", "autoincrement": true, "primarykey": true },
"language": { "type": "string", "size": 16 },
"name": { "type": "string", "size": 128, "notnull": true },
"person_id": { "type": "integer", "foreignkey": { "table": "people", "column": "id" } },
"person_role_id": { "type": "integer", "foreignkey": { "table": "person_roles", "column": "id" } },
"status": { "type": "string", "size": 2 },
"type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" }, "notnull": true },
"valid_from": { "type": "datetime" },
Expand Down Expand Up @@ -62,11 +65,15 @@
"id": {},
"co_id": {},
"address_required_fields": { "type": "string", "size": 160 },
"address_default_type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" } },
"email_address_default_type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" } },
"identifier_default_type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" } },
"name_default_type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" } },
"name_permitted_fields": { "type": "string", "size": 160 },
"name_required_fields": { "type": "string", "size": 160 }
"name_required_fields": { "type": "string", "size": 160 },
"telephone_number_default_type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" } },
"telephone_number_permitted_fields": { "type": "string", "size": 160 },
"url_default_type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" } }
},
"indexes": {
"co_settings_i1": { "columns": [ "co_id" ]},
Expand All @@ -78,7 +85,10 @@
"columns": [ "name_default_type_id" ]
},
"co_settings_i3": { "columns": [ "email_address_default_type_id" ] },
"co_settings_i4": { "columns": [ "identifier_default_type_id" ] }
"co_settings_i4": { "columns": [ "identifier_default_type_id" ] },
"co_settings_i5": { "columns": [ "address_default_type_id" ] },
"co_settings_i6": { "columns": [ "telephone_number_default_type_id" ] },
"co_settings_i7": { "columns": [ "url_default_type_id" ] }
}
},

Expand Down Expand Up @@ -146,8 +156,37 @@
}
},

"person_roles": {
"columns": {
"id": {},
"person_id": { "notnull": true },
"status": {},
"ordr": { "type": "integer" },
"cou_id": {},
"affiliation_type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" } },
"title": { "type": "string", "size": 128 },
"organization": { "type": "string", "size": 128 },
"department": { "type": "string", "size": 128 },
"manager_person_id": { "type": "integer", "foreignkey": { "table": "people", "column": "id" } },
"sponsor_person_id": { "type": "integer", "foreignkey": { "table": "people", "column": "id" } },
"valid_from": {},
"valid_through": {}
},
"indexes": {
"person_roles_i1": { "columns": [ "person_id" ] },
"person_roles_i2": { "columns": [ "sponsor_person_id" ] },
"person_roles_i3": { "columns": [ "cou_id" ] },
"person_roles_i4": { "columns": [ "affiliation_type_id" ] },
"person_roles_i5": { "columns": [ "manager_person_id" ] }
}
},

"external_identities": {
"comment": "XXX most of these fields are going to move to person_roles instead",
"comment": [
"XXX most of these fields are going to move to person_roles instead",
"XXX how is manager_identifier and sponsor_identifier going to work? we can fk from people but not external_identities",
"XXX affiliation should become affiliation_type_id"
],

"columns": {
"id": {},
Expand All @@ -158,6 +197,8 @@
"title": { "type": "string", "size": 128 },
"organization": { "type": "string", "size": 128 },
"department": { "type": "string", "size": 128 },
"manager_identifier": { "type": "string", "size": 512 },
"sponsor_identifier": { "type": "string", "size": 512 },
"valid_from": {},
"valid_through": {}
},
Expand All @@ -175,7 +216,7 @@
"family": { "type": "string", "size": 128 },
"suffix": { "type": "string", "size": 32 },
"type_id": {},
"language": { "type": "string", "size": 16 },
"language": {},
"primary_name": { "type": "boolean" },
"display_name": { "type": "string", "size": 256 }
},
Expand All @@ -186,6 +227,58 @@
"sourced": true
},

"ad_hoc_attributes": {
"comment": "we use 'tag' instead of 'key' since the latter is reserved by mysql",

"columns": {
"id": {},
"tag": { "type": "string", "size": 128 },
"value": { "type": "string", "size": 256 }
},
"indexes": {
"ad_hoc_attributes_i1": { "columns": [ "tag" ] }
},
"mvea": [ "person", "person_role", "external_identity" ],
"sourced": true
},

"addresses": {
"columns": {
"id": {},
"street": { "type": "text" },
"room": { "type": "string", "size": 64 },
"locality": { "type": "string", "size": 128 },
"state": { "type": "string", "size": 128 },
"postal_code": { "type": "string", "size": 16 },
"country": { "type": "string", "size": 128 },
"description": {},
"type_id": {},
"language": {}
},
"indexes": {
"addresses_i1": { "columns": [ "type_id" ] }
},
"mvea": [ "person", "person_role", "external_identity" ],
"sourced": true
},

"email_addresses": {
"columns": {
"id": {},
"mail": { "type": "string", "size": 256 },
"description": {},
"type_id": {},
"verified": { "type": "boolean" }
},
"indexes": {
"email_addresses_i1": { "columns": [ "mail", "type_id", "person_id" ] },
"email_addresses_i2": { "columns": [ "mail", "type_id", "external_identity_id" ] },
"email_addresses_i3": { "columns": [ "type_id" ] }
},
"mvea": [ "person", "external_identity" ],
"sourced": true
},

"identifiers": {
"columns": {
"id": {},
Expand All @@ -203,18 +296,32 @@
"sourced": true
},

"email_addresses": {
"telephone_numbers": {
"columns": {
"id": {},
"mail": { "type": "string", "size": 256 },
"country_code": { "type": "string", "size": 3 },
"area_code": { "type": "string", "size": 8 },
"number": { "type": "string", "size": 64 },
"extension": { "type": "string", "size": 16 },
"description": {},
"type_id": {},
"verified": { "type": "boolean" }
"type_id": {}
},
"indexes": {
"email_addresses_i1": { "columns": [ "mail", "type_id", "person_id" ] },
"email_addresses_i2": { "columns": [ "mail", "type_id", "external_identity_id" ] },
"email_addresses_i3": { "columns": [ "type_id" ] }
"telephone_numbers_i1": { "columns": [ "type_id" ] }
},
"mvea": [ "person", "person_role", "external_identity" ],
"sourced": true
},

"urls": {
"columns": {
"id": {},
"url": { "type": "string", "size": 256 },
"description": {},
"type_id": {}
},
"indexes": {
"urls_i1": { "columns": [ "type_id" ] }
},
"mvea": [ "person", "external_identity" ],
"sourced": true
Expand All @@ -228,6 +335,7 @@
"action": { "type": "string", "size": 4 },
"comment": { "type": "string", "size": 256 },
"person_id": {},
"person_role_id": {},
"external_identity_id": {},
"actor_person_id": { "type": "integer", "foreignkey": { "table": "people", "column": "id" } }
},
Expand Down
15 changes: 15 additions & 0 deletions app/resources/locales/en_US/controller.po
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@

# Controllers (Models)

msgid "Addresses"
msgstr "{0,plural,=1{Address} other{Addresses}}"

msgid "AdHocAttributes"
msgstr "{0,plural,=1{Ad Hoc Attribute} other{Ad Hoc Attributes}}"

msgid "ApiUsers"
msgstr "{0,plural,=1{API User} other{API Users}}"

Expand Down Expand Up @@ -57,5 +63,14 @@ msgstr "{0,plural,=1{Name} other{Names}}"
msgid "People"
msgstr "{0,plural,=1{Person} other{People}}"

msgid "PersonRoles"
msgstr "{0,plural,=1{Person Role} other{Person Roles}}"

msgid "TelephoneNumbers"
msgstr "{0,plural,=1{Telephone Number} other{Telephone Numbers}}"

msgid "Types"
msgstr "{0,plural,=1{Type} other{Types}}"

msgid "Urls"
msgstr "{0,plural,=1{URL} other{URLs}}"
18 changes: 18 additions & 0 deletions app/resources/locales/en_US/defaultType.po
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@

# Labels for default types when a new CO is created

msgid "Addresses.campus"
msgstr "Campus"

msgid "Addresses.home"
msgstr "Home"

msgid "Addresses.office"
msgstr "Office"

msgid "Addresses.postal"
msgstr "Postal"

msgid "EmailAddresses.delivery"
msgstr "Delivery"

Expand Down Expand Up @@ -113,3 +125,9 @@ msgstr "Official"

msgid "Names.preferred"
msgstr "Preferred"

msgid "Urls.official"
msgstr "Official"

msgid "Urls.personal"
msgstr "Personal"
24 changes: 24 additions & 0 deletions app/resources/locales/en_US/enumeration.po
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,30 @@ msgstr "Honorific, Given, Family, Suffix"
msgid "PermittedNameFieldsEnum.honorific,given,middle,family,suffix"
msgstr "Honorific, Given, Middle, Family, Suffix"

msgid "PermittedTelephoneNumberFieldsEnum.number"
msgstr "Number"

msgid "PermittedTelephoneNumberFieldsEnum.number,extension"
msgstr "Number, Extension"

msgid "PermittedTelephoneNumberFieldsEnum.area_code,number"
msgstr "Area Code, Number"

msgid "PermittedTelephoneNumberFieldsEnum.area_code,number,extension"
msgstr "Area Code, Number, Extension"

msgid "PermittedTelephoneNumberFieldsEnum.country_code,number"
msgstr "Country Code, Number"

msgid "PermittedTelephoneNumberFieldsEnum.country_code,number,extension"
msgstr "Country Code, Number, Extension"

msgid "PermittedTelephoneNumberFieldsEnum.country_code,area_code,number"
msgstr "Country Code, Area Code, Number"

msgid "PermittedTelephoneNumberFieldsEnum.country_code,area_code,number,extension"
msgstr "Country Code, Area Code, Number, Extension"

msgid "RequiredAddressFieldsEnum.country"
msgstr "Country"

Expand Down
14 changes: 13 additions & 1 deletion app/resources/locales/en_US/error.po
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ msgstr "When this value is selected, {0} cannot be empty"
msgid "input.invalid"
msgstr "Invalid character found"

msgid "input.invalid.email"
msgstr "The provided value is not a valid email address"

msgid "input.invalid.url"
msgstr "The provided value is not a valid URL"

msgid "input.length"
msgstr "The provided value cannot be longer than {0} characters"

msgid "invalid"
msgstr "Invalid value \"{0}\""

Expand Down Expand Up @@ -130,7 +139,10 @@ msgid "perm"
msgstr "Permission Denied"

msgid "primary_link"
msgstr "Could not find value for Primary Link {0}"
msgstr "Could not find value for Primary Link"

msgid "primary_link.mismatch"
msgstr "All records must have the same Primary Link"

msgid "rule.ValidateCo.errorField"
msgstr "errorField not set in ruleValidateCO"
Expand Down
Loading

0 comments on commit 598e952

Please sign in to comment.