2
0

product_option.go 615 B

12345678910111213141516171819202122232425
  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. ProductId string `db:"product_id"`
  12. CreatedAt time.Time `db:"created_at"`
  13. UpdatedAt time.Time `db:"updated_at"`
  14. DeletedAt *time.Time `db:"deleted_at"`
  15. }
  16. func (opt *ProductOption) As() *generated.ProductOption {
  17. return &generated.ProductOption{
  18. ID: model.NewId(model.GidOption, opt.Id),
  19. Name: opt.Name,
  20. Values: opt.Values,
  21. }
  22. }