products.js 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. const { Text, Uuid, Decimal, Integer, Checkbox, DateTime, Relationship } = require('@keystonejs/fields');
  2. const { AutoIncrement } = require('@keystonejs/fields-auto-increment');
  3. module.exports = {
  4. fields: {
  5. products_id: { type: AutoIncrement, isRequired: true, label: 'products' },
  6. productsguid_id: { type: Uuid, many: false, label: 'productsguid' },
  7. catnum: { type: Text, label: 'catnum' },
  8. symbol_supplier: { type: Text, label: 'symbol_supplier' },
  9. description: { type: Text, label: 'description' },
  10. price_delivery: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'price_delivery' },
  11. price_purchase: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'price_purchase' },
  12. price_detal: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'price_detal' },
  13. price_detal_brutto: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'price_detal_brutto' },
  14. price_eshop: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Cena esklep' },
  15. profit_margin: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Marza' },
  16. isize: { type: Text, isRequired: true, label: 'isize' },
  17. mass: { type: Decimal, knexOptions: { precision: 10, scale: 2 }, label: 'Masa' },
  18. productiondays: { type: Integer, label: 'Czas prukcji' },
  19. promo: { type: Checkbox, isRequired: true, label: 'Promocja' },
  20. news: { type: Checkbox, isRequired: true, label: 'news' },
  21. best: { type: Checkbox, isRequired: true, label: 'best' },
  22. name: { type: Text, label: 'Nazwa' },
  23. desctxt: { type: Text, label: 'Opis' },
  24. seotxt: { type: Text, label: 'SEO' },
  25. eshop: { type: Checkbox, isRequired: true, label: 'esklep' },
  26. created_at: { type: DateTime, format: 'DD.MM.YYYY h:mm', isRequired: true, label: 'Stworzono:' },
  27. modified_at: { type: DateTime, format: 'DD.MM.YYYY h:mm', isRequired: true, label: 'Zmodyfikowano:' },
  28. currency_id: { type: Relationship, ref: 'currency', many: false, label: 'Waluta' },
  29. kinds_id: { type: Relationship, ref: 'kinds', many: true, label: 'Rodzaje' },
  30. uom_id: { type: Relationship, ref: 'uom', many: false, label: 'uom' },
  31. materials_id: { type: Relationship, ref: 'materials', many: true, label: 'Surowiec' },
  32. vat_id: { type: Relationship, ref: 'vat', many: false, label: 'VAT' },
  33. productsgroup_id: { type: Relationship, ref: 'productsgroup', many: false, label: 'productsgroup' },
  34. suppliers_id: { type: Relationship, ref: 'suppliers', many: true, label: 'Dostawca' },
  35. custom1: { type: Text, label: 'Dane 1' },
  36. custom2: { type: Text, label: 'Dane 2' },
  37. custom3: { type: Text, label: 'Dane 3' },
  38. custom4: { type: Text, label: 'Dane 4' },
  39. custom5: { type: Text, label: 'Dane 5' },
  40. qdec: { type: Integer, label: 'qdec' },
  41. fifo: { type: Checkbox, label: 'fifo' },
  42. barcode: { type: Text, label: 'barcode' },
  43. price_detal_per_uom: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'price_detal_per_uom' },
  44. price_detal_per_uom_brutto: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'price_detal_per_uom_brutto' },
  45. minmax_active: { type: Checkbox, isRequired: true, label: 'Min/Max' },
  46. auto_order: { type: Checkbox, isRequired: true, label: 'auto_order' },
  47. }, label: 'Product'//, plural: 'Productss'
  48. };