# SubmissionEvent

The SubmissionEvent model captures significant events that are performed by an agent and occur against a [Submission](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/submission). Currently, the agent is a PASS [User](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/user). The definition of "significant" will evolve depending on which events are useful to capture in order to trigger notifications, or form an audit trail. The events that are currently deemed significant for capture are documented under [`eventType`](#event-type-options).

| Field           | Type   | Description                                                                                                                                                                       |
| --------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id\*            | String | Autogenerated identifier of object                                                                                                                                                |
| eventType\*     | String | The type of event ([*see list below*](#event-type-options))                                                                                                                       |
| performedDate\* | String | DateTime the event was performed by the [User](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/user)                                                        |
| performerRole   | String | Role of the person performing the event ([*see list below*](#performer-role-options))                                                                                             |
| comment         | String | A comment relevant to the SubmissionEvent. For example, when a `changes-requested` event occurs, the User might add a comment through the UI to specify what changes are needed.  |
| link            | String | A URI for a resource relevant to the SubmissionEvent. For example, when a `changes-requested` event occurs, this may contain an Ember application URL to the affected Submission. |

| Relationship  | Type   | Target                                                                                         | Description                               |
| ------------- | ------ | ---------------------------------------------------------------------------------------------- | ----------------------------------------- |
| performedBy\* | To One | [User](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/user)             | User responsible for performing the event |
| submission\*  | To One | [Submission](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/submission) | Submission that the event relates to      |

\*required

## Event type options

The following describes the types of events that might be recorded as SubmissionEvents.

| Value                      | Description                                                                                                                                                                                                                                                                                                |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| approval-requested-newuser | A Submission was prepared by a `preparer` on behalf of a person who does not yet have a [User](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/user) record in PASS. The `preparer` is requesting that the `submitter` join PASS and then approve and submit it or provide feedback. |
| approval-requested         | A Submission was prepared by a `preparer` who is now requesting that the `submitter` approve and submit it or provide feedback.                                                                                                                                                                            |
| changes-requested          | A Submission was prepared by a `preparer`, but on review by the `submitter`, a change was requested. The Submission has been handed back to the `preparer` for editing.                                                                                                                                    |
| cancelled                  | A Submission was prepared and then cancelled by the `submitter` or `preparer` without being submitted. No further edits can be made to the Submission.                                                                                                                                                     |
| submitted                  | The submit button has been pressed through the UI.                                                                                                                                                                                                                                                         |

## Performer role options

The following describe the roles of people who might perform a SubmissionEvent.

| Value     | Description                                                                                                                                                                                                     |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| preparer  | An individual who can prepare a Submission on behalf of another User - select the Publication, Repositories, Files, and Grants - but cannot approve the Repository agreements or submit the record for Deposit. |
| submitter | An individual responsible for a Submission. A person with this role can do all of the tasks that a `preparer` can do, but also approve any Repository agreements and submit the record for Deposit.             |
