(ctx context.Context, email string, firstName, lastName *string)
| 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") |
| 66 | defer span.End() |
| 67 | |
| 68 | u, err := r.data.DB.User.Create().SetEmail(email).SetNillableFirstName(firstName).SetNillableLastName(lastName).Save(ctx) |
| 69 | if err != nil { |
| 70 | return nil, err |
| 71 | } |
| 72 | |
| 73 | // Query it to load the fully formed object, including proper casted dates that come from the DB |
| 74 | return r.FindByID(ctx, u.ID) |
| 75 | } |
| 76 | |
| 77 | // UpdateNameAndLastName updates the first and last name of a user |
| 78 | func (r *userRepo) UpdateNameAndLastName(ctx context.Context, userID uuid.UUID, firstName, lastName *string) (*biz.User, error) { |
nothing calls this directly
no test coverage detected