Skip to main content

editors_changed

event type: com.mbta.ctd.glides.editors_changed.v1

Inspectors sign in and out of editing specific trainsheets. This event publishes changes to who is editing.

Since one action by an inspector might result in multiple changes, for example if they sign out of one location and in to another, the changes are published in a list.

In practice, we limit each location to have only one editor, and limit each editor to only one location, but that rule may or may not change and this event schema doesn't guarantee that.

Note that the author may or may not match the editors in changes, since inspectors can change whether other people are editing. For example, when an inspector takes over editing at a location, they may sign out the previous editor. Then they would issue a stop change for the previous editor and a start change for themself.

Data

Fields in the event's data:

  • metadata (Metadata): how the changes were entered in Glides, including the author.
  • changes (array of EditorChange): a list of start and stop editing events.

EditorChange

Fields:

  • type (string "start"|"stop"): Whether the editor started or stopped editing.
  • location (Location): the location the editor started or stopped managing.
  • editor (GlidesUser): the affected editor.

GlidesUser

See GlidesUser

Location

See Location

Metadata

See Metadata

Examples

Inspector Alice (badge number: 123) starts her shift at Boston College. The previous inspector (badge number: 456) did not stop editing, so Alice clicks the "Take Over" button in Glides.
{
"type": "com.mbta.ctd.glides.editors_changed.v1",
"specversion": "1.0",
"source": "glides.mbta.com",
"id": "19fdb184-7dd6-4664-8472-04bd6177ec44",
"time": "2023-01-20T09:30:00-05:00",
"data": {
"metadata": {
"author": {
"emailAddress": "ainspector@example.com",
"badgeNumber": "123"
},
"inputTimestamp": "2023-01-20T09:29:59-05:00",
"inputType": "take-over-editing",
"location": {
"todsId": "lakst"
}
},
"changes": [
{
"type": "stop",
"location": {
"todsId": "lakst"
},
"editor": {
"emailAddress": "binspector@example.com",
"badgeNumber": "456"
}
},
{
"type": "start",
"location": {
"todsId": "lakst"
},
"editor": {
"emailAddress": "ainspector@example.com",
"badgeNumber": "123"
}
}
]
}
}

Schema

Loading com.mbta.ctd.glides.editors_changed.v1...