# RepositoryCopy

A Repository Copy represents a copy of a [Publication](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/publication) that exists in a target [Repository](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/repository). The Repository Copy either (1) was the result of an accepted [Deposit](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/deposit) from PASS, in which case there would be a link to the Copy from the related Deposit record, or (2) was created outside of PASS by some other process. In the second case, PASS stores information to help determine whether a Publication is already compliant with the repository's requirements.

| Field        | Type      | Description                                                                                         |
| ------------ | --------- | --------------------------------------------------------------------------------------------------- |
| id\*         | String    | Autogenerated identifier of object                                                                  |
| externalIds  | String\[] | IDs assigned to this entity by the target repository                                                |
| copyStatus\* | String    | Status of the copy in the external repository's workflow ([*see list below*](#copy-status-options)) |
| accessUrl    | String    | URL to access the item in the repository, could allow Users to see the final result                 |

| Relationship  | Type   | Target                                                                                           | Description                        |
| ------------- | ------ | ------------------------------------------------------------------------------------------------ | ---------------------------------- |
| publication\* | To One | [Publication](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/publication) | Publication that this is a copy of |
| repository\*  | To One | [Repository](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/repository)   | Repository being deposited to      |

\*required

## Copy 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.

| Value       | Description                                                                                                                                                                                                                                                                                                                                                                                                     |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| accepted    | The target [Repository](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/repository) has indicated that the Deposit has been accepted                                                                                                                                                                                                                                                      |
| in-progress | The target [Repository](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/repository) is processing the Deposit                                                                                                                                                                                                                                                                             |
| stalled     | The target [Repository](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/repository) has detected a problem that has caused the progress to stall. This will likely require some direct interaction with the repository to re-initiate the process. Examples include when there are incorrect files or when a user did not respond to a validation request in a reasonable amount of time. |
| complete    | The target [Repository](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/repository) has accepted the Deposit, and publication is pending if not already complete                                                                                                                                                                                                                          |
| rejected    | The target [Repository](https://docs.eclipse-pass.org/developer-documentation/pass-core/model/repository) has rejected the Deposit.                                                                                                                                                                                                                                                                             |
