(ctx context.Context, workflowID uuid.UUID, includeRevoked bool)
| 55 | } |
| 56 | |
| 57 | func (r *RobotAccountRepo) List(ctx context.Context, workflowID uuid.UUID, includeRevoked bool) ([]*biz.RobotAccount, error) { |
| 58 | ctx, span := otelx.Start(ctx, robotAccountRepoTracer, "RobotAccountRepo.List") |
| 59 | defer span.End() |
| 60 | |
| 61 | raQuery := r.data.DB.Workflow.Query().Where(workflow.ID(workflowID)).QueryRobotaccounts() |
| 62 | if !includeRevoked { |
| 63 | raQuery = raQuery.Where(robotaccount.RevokedAtIsNil()) |
| 64 | } |
| 65 | |
| 66 | robotAccounts, err := raQuery.All(ctx) |
| 67 | if err != nil { |
| 68 | return nil, err |
| 69 | } |
| 70 | |
| 71 | result := make([]*biz.RobotAccount, 0, len(robotAccounts)) |
| 72 | for _, a := range robotAccounts { |
| 73 | result = append(result, entRaToBizRa(a, workflowID)) |
| 74 | } |
| 75 | |
| 76 | return result, nil |
| 77 | } |
| 78 | |
| 79 | func (r *RobotAccountRepo) FindByID(ctx context.Context, id uuid.UUID) (*biz.RobotAccount, error) { |
| 80 | ctx, span := otelx.Start(ctx, robotAccountRepoTracer, "RobotAccountRepo.FindByID") |
nothing calls this directly
no test coverage detected