-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(connector): fix reset connector api
- Loading branch information
1 parent
6e6f68d
commit 36ea334
Showing
12 changed files
with
283 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
internal/connectors/engine/activities/storage_connectors_get.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package activities | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/formancehq/payments/internal/models" | ||
"go.temporal.io/sdk/workflow" | ||
) | ||
|
||
func (a Activities) StorageConnectorsGet(ctx context.Context, connectorID models.ConnectorID) (*models.Connector, error) { | ||
connector, err := a.storage.ConnectorsGet(ctx, connectorID) | ||
if err != nil { | ||
return nil, temporalStorageError(err) | ||
} | ||
return connector, nil | ||
} | ||
|
||
var StorageConnectorsGetActivity = Activities{}.StorageConnectorsGet | ||
|
||
func StorageConnectorsGet(ctx workflow.Context, connectorID models.ConnectorID) (*models.Connector, error) { | ||
var connector models.Connector | ||
err := executeActivity(ctx, StorageConnectorsGetActivity, &connector, connectorID) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &connector, err | ||
} |
18 changes: 18 additions & 0 deletions
18
internal/connectors/engine/activities/storage_connectors_schedule_for_deletion.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package activities | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/formancehq/payments/internal/models" | ||
"go.temporal.io/sdk/workflow" | ||
) | ||
|
||
func (a Activities) StorageConnectorsScheduleForDeletion(ctx context.Context, connectorID models.ConnectorID) error { | ||
return temporalStorageError(a.storage.ConnectorsScheduleForDeletion(ctx, connectorID)) | ||
} | ||
|
||
var StorageConnectorsScheduleForDeletionActivity = Activities{}.StorageConnectorsScheduleForDeletion | ||
|
||
func StorageConnectorsScheduleForDeletion(ctx workflow.Context, connectorID models.ConnectorID) error { | ||
return executeActivity(ctx, StorageConnectorsScheduleForDeletionActivity, nil, connectorID) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.