2
0

product_option.go 671 B

1234567891011121314151617181920212223242526
  1. package relation
  2. import (
  3. "github.com/gshopify/service-wrapper/model"
  4. "gshopper.com/gshopify/products/graphql/generated"
  5. "time"
  6. )
  7. type ProductOption struct {
  8. Id string `db:"id"`
  9. Name string `db:"name"`
  10. Values []string `db:"values"`
  11. Position int8 `db:"position"`
  12. CreatedAt time.Time `db:"created_at"`
  13. UpdatedAt time.Time `db:"updated_at"`
  14. PublishedAt *time.Time `db:"published_at"`
  15. DeletedAt *time.Time `db:"deleted_at"`
  16. }
  17. func (opt *ProductOption) As() *generated.ProductOption {
  18. return &generated.ProductOption{
  19. ID: model.NewId(model.GidOption, opt.Id),
  20. Name: opt.Name,
  21. Values: opt.Values,
  22. }
  23. }