-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
a7e8687
commit 632ffc3
Showing
11 changed files
with
468 additions
and
56 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package query | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/flowck/dobermann/backend/internal/domain" | ||
"github.com/flowck/dobermann/backend/internal/domain/monitor" | ||
) | ||
|
||
type AllIncidents struct { | ||
AccountID domain.ID | ||
Params PaginationParams | ||
} | ||
|
||
type incidentsFinder interface { | ||
FindAll(ctx context.Context, accID domain.ID, params PaginationParams) (PaginatedResult[*monitor.Incident], error) | ||
} | ||
|
||
type AllIncidentsHandler struct { | ||
incidentsFinder incidentsFinder | ||
} | ||
|
||
func NewAllIncidentsHandler(incidentsFinder incidentsFinder) AllIncidentsHandler { | ||
return AllIncidentsHandler{ | ||
incidentsFinder: incidentsFinder, | ||
} | ||
} | ||
|
||
func (h AllIncidentsHandler) Execute(ctx context.Context, q AllIncidents) (PaginatedResult[*monitor.Incident], error) { | ||
return h.incidentsFinder.FindAll(ctx, q.AccountID, q.Params) | ||
} |
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.
Oops, something went wrong.