filecoin-project / filplus-backend

Other
2 stars 1 forks source link

Endpoint: Trigger SSA #189

Closed kacperzuk-neti closed 3 months ago

kacperzuk-neti commented 3 months ago

Endpoint: application/trigger_ssa

Description: The application/trigger_ssa endpoint checks, based on the data received (TriggerSSAInfo), the current state of the application. If the conditions are met, it calls the refill function.

It will be used by filplus-registry to provide a manual way to trigger SSA flow in case the SSA bot fails. It's basically the /application/refill endpoint, but with some additional checks (see Usage Conditions) to make sure we don't trigger it when we shouldn't.

Usage Conditions: To execute this endpoint, the following conditions must be met:

  1. The application must be in the Granted state.
  2. The Last active allocation ID must not be active.
  3. The total allocated amount can't be greater than or equal to the total requested amount.

Impact on Application Lifecycle: It will add a comment on the relevant GitHub issue and change the label to refill.

Deployment Considerations: No special actions are required.

Example TriggerSSAInfo:


{
  "id": "client_address",
  "owner": "owner_name",
  "repo": "repo_name",
  "amount": "1",
  "amount_type": "PiB"
}