Skip to content

Commit

Permalink
Moving some diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesiarmes committed Sep 6, 2024
1 parent 751128e commit f0b2b18
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 51 deletions.
51 changes: 0 additions & 51 deletions doc/api.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,5 @@
# Document Transfer Service API

```mermaid
sequenceDiagram
critical Request a document transfer
activate Consumer
activate API
activate Database
Consumer->>API: Request transfer
API->>Database: Record transfer
API->>Database: Enqueue background job
API->>Consumer: Return transfer id
deactivate Consumer
end
critical Background job processing
activate Worker
loop until success or max attempts
Worker->>Database: Reserve job
activate Source
Worker->>Source: Fetch document
deactivate Source
activate Destination
Worker->>Destination: Transfer document
deactivate Destination
alt Transfer succeeded
Worker->>Database: Update request status
Worker->>Database: Mark job complete
else Transfer failed
alt Max attempts reached
rect rgb(191, 223, 255)
Worker->>Database: Update request status
Worker->>Database: Mark job failed
end
else Retry transfer
Worker->>Database: Mark job failed
end
end
end
deactivate Worker
end
opt Check transfer status
activate Consumer
Consumer->>API: Check transfer status
API->>Database: Retrieve transfer status
API->>Consumer: Return transfer status
deactivate Database
deactivate API
deactivate Consumer
end
```

Interacting with the Document Transfer Service is done through a RESTful API.
All requests and responses should be in JSON format, unless otherwise indicated.

Expand Down
51 changes: 51 additions & 0 deletions doc/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,57 @@ length of time as jobs are deleted once they have been completed.
See the [database] documentation for more details on how the database is
configured.

```mermaid
sequenceDiagram
critical Request a document transfer
activate Consumer
activate API
activate Database
Consumer->>API: Request transfer
API->>Database: Record transfer
API->>Database: Enqueue background job
API->>Consumer: Return transfer id
deactivate Consumer
end
critical Background job processing
activate Worker
loop until success or max attempts
Worker->>Database: Reserve job
activate Source
Worker->>Source: Fetch document
deactivate Source
activate Destination
Worker->>Destination: Transfer document
deactivate Destination
alt Transfer succeeded
Worker->>Database: Update request status
Worker->>Database: Mark job complete
else Transfer failed
alt Max attempts reached
rect rgb(191, 223, 255)
Worker->>Database: Update request status
Worker->>Database: Mark job failed
end
else Retry transfer
Worker->>Database: Mark job failed
end
end
end
deactivate Worker
end
opt Check transfer status
activate Consumer
Consumer->>API: Check transfer status
API->>Database: Retrieve transfer status
API->>Consumer: Return transfer status
deactivate Database
deactivate API
deactivate Consumer
end
```

[api]: architecture/api.md
[c4-containers]: https://c4model.com/#ContainerDiagram
[database]: database.md
Expand Down

0 comments on commit f0b2b18

Please sign in to comment.