-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dummy team and team component relationship and fixed test
- Loading branch information
1 parent
f7254b9
commit edf33f2
Showing
16 changed files
with
127 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,7 @@ var ( | |
|
||
DummyYearOldDate = time.Now().AddDate(-1, 0, 0) | ||
) | ||
|
||
func ptr[T any](t T) *T { | ||
return &t | ||
} |
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,17 @@ | ||
package dummy | ||
|
||
import "github.com/flanksource/duty/models" | ||
|
||
var LogisticBackendTeamComponent = models.TeamComponent{ | ||
TeamID: BackendTeam.ID, | ||
ComponentID: Logistics.ID, | ||
SelectorID: ptr("366d4ecb71d8ce12cf253e55d541f987"), | ||
} | ||
|
||
var PaymentsTeamComponent = models.TeamComponent{ | ||
TeamID: PaymentTeam.ID, | ||
ComponentID: PaymentsAPI.ID, | ||
SelectorID: ptr("7fbaeebb537818e8b334fd336613f8d4 "), | ||
} | ||
|
||
var AllTeamComponents = []models.TeamComponent{LogisticBackendTeamComponent, PaymentsTeamComponent} |
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,33 @@ | ||
package dummy | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/flanksource/duty/models" | ||
"github.com/google/uuid" | ||
) | ||
|
||
var FrontendTeam = models.Team{ | ||
ID: uuid.New(), | ||
Name: "Frontend", | ||
Icon: "frontend", | ||
CreatedBy: JohnDoe.ID, | ||
CreatedAt: time.Now(), | ||
UpdatedAt: time.Now(), | ||
} | ||
|
||
var BackendTeam = models.Team{ | ||
ID: uuid.MustParse("3d3f49ba-93d6-4058-8acc-96233f7c5c80"), | ||
Name: "Backend", | ||
Spec: []byte(`{"components": [{ "name": "logistics" }]}`), | ||
CreatedBy: JohnDoe.ID, | ||
} | ||
|
||
var PaymentTeam = models.Team{ | ||
ID: uuid.MustParse("72d965e2-b58b-4a23-ba73-2cae0daf5981"), | ||
Name: "Payment", | ||
Spec: []byte(`{"components": [{ "name": "logistics-ui" }]}`), | ||
CreatedBy: JohnDoe.ID, | ||
} | ||
|
||
var AllDummyTeams = []models.Team{BackendTeam, FrontendTeam, PaymentTeam} |
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 |
---|---|---|
|
@@ -117,7 +117,7 @@ | |
"healthy", | ||
"unhealthy" | ||
], | ||
"teams": [], | ||
"teams": ["Backend"], | ||
"tags": { | ||
"telemetry": [ | ||
"enabled" | ||
|
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,26 @@ | ||
{ | ||
"components": [ | ||
{ | ||
"id": "4643e4de-6215-4c71-9600-9cf69b2cbbee", | ||
"agent_id": "ebd4cbf7-267e-48f9-a050-eca12e535ce1", | ||
"external_id": "dummy/payments-api", | ||
"name": "payments-api", | ||
"status": "healthy", | ||
"type": "Application", | ||
"summary": { | ||
"healthy": 1 | ||
}, | ||
"is_leaf": false, | ||
"created_at": "2023-01-01T05:29:00+05:30", | ||
"updated_at": "2023-01-01T05:29:00+05:30" | ||
} | ||
], | ||
"healthStatuses": [ | ||
"healthy" | ||
], | ||
"teams": ["Payment"], | ||
"tags": null, | ||
"types": [ | ||
"Application" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
"healthy", | ||
"unhealthy" | ||
], | ||
"teams": [], | ||
"teams": ["Backend"], | ||
"tags": { | ||
"telemetry": [ | ||
"enabled" | ||
|
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