Skip to content

Commit

Permalink
[olivercodes] doc(gh-2): add design notes to service layer
Browse files Browse the repository at this point in the history
  • Loading branch information
olivercodes committed Jun 29, 2023
1 parent 62e9484 commit e47c372
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion notes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Notes

Openapi spec 2.0/3.0
Gin, Fastapi
Gin, fast api
Harvest, structurally what has happened at VA, RB
Lambda, pign it interval, interaction. Or just build in your own interval
Github Webhooks - might be noisy
Expand Down
10 changes: 10 additions & 0 deletions pkg/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ func (s *teamServiceImpl) RequestRemoveTeam(teamID string) error {
return nil
}

/*
It's important to note here, we utilize the underlying repo functions
to create this business logic. All repos do is implement CRUD, the logic
is left to the service layer. This allows us to swap in/out datastores (repos)
with node code changes to anything except the datastore impl.
Using this function as an example, we combine the implementations of both
GetTeam and UpdateTeam to craft our custom RequestRemoveTeam, which also has
business logic to check if the team has been yet marked for deletion.
*/
func (s *teamServiceImpl) ConfirmRemoveTeam(teamID string) error {
team, err := s.repo.GetTeam(teamID)
if err != nil {
Expand Down

0 comments on commit e47c372

Please sign in to comment.