Skip to content

Commit

Permalink
chore: remove unused enums
Browse files Browse the repository at this point in the history
Signed-off-by: Otieno Calvine <nyarangaotieno@gmail.com>
  • Loading branch information
NYARAS committed Sep 8, 2021
1 parent 6f11a82 commit 1530439
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 114 deletions.
47 changes: 0 additions & 47 deletions pkg/onboarding/domain/enum.go
Expand Up @@ -62,50 +62,3 @@ func (e FivePointRating) MarshalGQL(w io.Writer) {
log.Printf("%v\n", err)
}
}

// EmploymentType ...
type EmploymentType string

// EmploymentTypeEmployed ..
const (
EmploymentTypeEmployed EmploymentType = "EMPLOYED"
EmploymentTypeSelfEmployed EmploymentType = "SELF_EMPLOYED"
)

// AllEmploymentType ..
var AllEmploymentType = []EmploymentType{
EmploymentTypeEmployed,
EmploymentTypeSelfEmployed,
}

// IsValid ..
func (e EmploymentType) IsValid() bool {
switch e {
case EmploymentTypeEmployed, EmploymentTypeSelfEmployed:
return true
}
return false
}

func (e EmploymentType) String() string {
return string(e)
}

// UnmarshalGQL ..
func (e *EmploymentType) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}

*e = EmploymentType(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid EmploymentType", str)
}
return nil
}

// MarshalGQL ..
func (e EmploymentType) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
45 changes: 0 additions & 45 deletions pkg/onboarding/domain/model/models_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions pkg/onboarding/presentation/graph/enums.graphql
Expand Up @@ -49,17 +49,6 @@ enum AddressType {
WORK
}

enum EmploymentType {
EMPLOYED
SELF_EMPLOYED
}

enum Persona {
ALICE
JUMA
BOB
ANDREW
}

enum ChannelOfContact {
APP
Expand Down
11 changes: 0 additions & 11 deletions pkg/onboarding/presentation/graph/generated/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1530439

Please sign in to comment.