Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
alishakawaguchi committed Sep 2, 2023
1 parent a3e2499 commit 8a33dd6
Showing 1 changed file with 0 additions and 85 deletions.
85 changes: 0 additions & 85 deletions backend/services/mgmt/v1alpha1/job-service/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,91 +115,6 @@ func (s *Service) GetJob(
}), nil
}

// func (s *Service) CreateJob(
// ctx context.Context,
// req *connect.Request[mgmtv1alpha1.CreateJobRequest],
// ) (*connect.Response[mgmtv1alpha1.CreateJobResponse], error) {
// accountUuid, err := s.verifyUserInAccount(ctx, req.Msg.AccountId)
// if err != nil {
// return nil, err
// }
// userUuid, err := s.getUserUuid(ctx)
// if err != nil {
// return nil, err
// }

// destUuids := []pgtype.UUID{}
// for _, destId := range req.Msg.ConnectionDestinationIds {
// destUuid, err := nucleusdb.ToUuid(destId)
// if err != nil {
// return nil, err
// }
// destUuids = append(destUuids, destUuid)
// }

// cron := pgtype.Text{}
// if req.Msg.CronSchedule != nil {
// err = cron.Scan(req.Msg.GetCronSchedule())
// if err != nil {
// return nil, err
// }
// }
// connectionSourceUuid, err := nucleusdb.ToUuid(req.Msg.ConnectionSourceId)
// if err != nil {
// return nil, err
// }

// mappings := []*jsonmodels.JobMapping{}
// for _, mapping := range req.Msg.Mappings {
// jm := &jsonmodels.JobMapping{}
// err = jm.FromDto(mapping)
// if err != nil {
// return nil, err
// }
// mappings = append(mappings, jm)
// }

// var createdJob *db_queries.NeosyncApiJob
// if err = s.db.WithTx(ctx, nil, func(q *db_queries.Queries) error {
// job, err := q.CreateJob(ctx, db_queries.CreateJobParams{
// Name: req.Msg.JobName,
// AccountID: *accountUuid,
// Status: int16(mgmtv1alpha1.JobStatus_JOB_STATUS_ENABLED),
// CronSchedule: cron,
// HaltOnNewColumnAddition: nucleusdb.BoolToInt16(req.Msg.HaltOnNewColumnAddition),
// CreatedByID: *userUuid,
// UpdatedByID: *userUuid,
// ConnectionSourceID: connectionSourceUuid,
// Mappings: mappings,
// })
// if err != nil {
// return err
// }

// connDestParams := []db_queries.CreateJobConnectionDestinationsParams{}
// for _, destUuid := range destUuids {
// connDestParams = append(connDestParams, db_queries.CreateJobConnectionDestinationsParams{
// JobID: job.ID,
// ConnectionID: destUuid,
// })
// }
// if len(connDestParams) > 0 {
// _, err = q.CreateJobConnectionDestinations(ctx, connDestParams)
// if err != nil {
// return err
// }
// }
// createdJob = &job
// return nil
// }); err != nil {
// return nil, err
// }

// return connect.NewResponse(&mgmtv1alpha1.CreateJobResponse{
// Job: dtomaps.ToJobDto(createdJob, destUuids),
// }), nil
// }

func (s *Service) CreateJob(
ctx context.Context,
req *connect.Request[mgmtv1alpha1.CreateJobRequest],
Expand Down

0 comments on commit 8a33dd6

Please sign in to comment.