# Deposit

A [Submission](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/submission) can have multiple Deposits, each to a different [Repository](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/repository). This entity describes the interaction of PASS with a target [Repository](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/repository) for an individual [Submission](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/submission) with the purpose of satisfying one or more [Policies](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/policy).

| Attribute        | Type   | Description                                                                                                               |
| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| id\*             | String | Autogenerated identifier of object.                                                                                       |
| depositStatusRef | String | A URL or some kind of reference that can be dereferenced, entity body parsed, and used to determine the status of Deposit |
| depositStatus\*  | String | Status of deposit ([*see list below*](#deposit-status-options))                                                           |
| statusMessage    | String | A human readable messabe about the deposit                                                                                |
| version\*        | Long   | Version number that increments on updates. Used to check update requests and ensure consistency.                          |

| Relationship   | Type   | Target                                                                                                  | Description                          |
| -------------- | ------ | ------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| submission\*   | To One | [Submission](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/submission)          | Submission this Deposit is a part of |
| repository\*   | To One | [Repository](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/repository)          | Repository being deposited to        |
| repositoryCopy | To One | [Repository Copy](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/repositorycopy) | Repository Copy for this Deposit     |

\*required

## Deposit status options

These are the possible statuses for a Deposit in the order they could occur. Note that not all repositories will go through every status.

Intermediate statusA Deposit with an *intermediate* status indicates that the processing of the Deposit is not yet complete. At some indeterminate point in the future, the status *may* be updated to a *terminal* state.Terminal statusA Deposit with a *terminal* status indicates that the processing of the Deposit is complete.

| Value     | State        | Description                                                                                                                                                                                                                                                                                  |
| --------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| submitted | Intermediate | PASS has sent a package to the target [Repository](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/repository) and is waiting for an update on the status                                                                                                              |
| rejected  | Terminal     | The target [Repository](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/repository) has rejected the Deposit                                                                                                                                                           |
| failed    | Intermediate | A failure occurred while performing the deposit, it may be re-tried later.                                                                                                                                                                                                                   |
| accepted  | Terminal     | The target [Repository](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/repository) has accepted the [Files](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/file) into the repository and they are pending publication if not published already |
