(ctx context.Context, email string)
| 46 | } |
| 47 | |
| 48 | func (r *userRepo) FindByEmail(ctx context.Context, email string) (*biz.User, error) { |
| 49 | ctx, span := otelx.Start(ctx, userRepoTracer, "UserRepo.FindByEmail") |
| 50 | defer span.End() |
| 51 | |
| 52 | u, err := r.data.DB.User.Query(). |
| 53 | Where(user.Email(email)). |
| 54 | Only(ctx) |
| 55 | if err != nil && !ent.IsNotFound(err) { |
| 56 | return nil, err |
| 57 | } else if u == nil { |
| 58 | return nil, nil |
| 59 | } |
| 60 | |
| 61 | return entUserToBizUser(u), nil |
| 62 | } |
| 63 | |
| 64 | func (r *userRepo) CreateByEmail(ctx context.Context, email string, firstName, lastName *string) (*biz.User, error) { |
| 65 | ctx, span := otelx.Start(ctx, userRepoTracer, "UserRepo.CreateByEmail") |
nothing calls this directly
no test coverage detected