Implementation of a generic backend of eshop in Crystal
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
383 B

6 years ago
6 years ago
6 years ago
6 years ago
  1. require "json"
  2. require "uuid"
  3. require "uuid/json"
  4. class Product
  5. JSON.mapping(
  6. price: {type: Float64, nilable: true},
  7. tax_rate: {type: Float64, nilable: true},
  8. name: {type: String, default: "Undefined"},
  9. description: {type: String, default: "No description available"},
  10. pic_url: {type: String, nilable: true},
  11. id: UUID,
  12. )
  13. end