const { Integer, Checkbox, Text, Decimal, DateTime, Uuid, Relationship } = require('@keystonejs/fields'); module.exports = { fields: { id: { type: Uuid, isRequired: true, label: 'Egzemplarz' }, article_id: { type: Uuid, many: false, label: 'article' }, productsguid_id: { type: Relationship, ref: 'products', many: false, label: 'productsguid', filters: { products: ':productsguid_id' } }, itype: { type: Integer, isRequired: true, label: 'itype' }, sold: { type: Checkbox, isRequired: true, label: 'sold' }, deficiency: { type: Checkbox, isRequired: true, label: 'deficiency' }, catnum: { type: Text, label: 'catnum' }, description: { type: Text, label: 'description' }, price_delivery: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'price_delivery' }, price_purchase: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'price_purchase' }, price_detal: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'price_detal' }, price_detal_brutto: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Cena detaliczna brutto' }, price_eshop: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Cena esklep' }, profit_margin: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Marza' }, isize: { type: Text, isRequired: true, label: 'isize' }, mass: { type: Decimal, knexOptions: { precision: 10, scale: 2 }, label: 'Masa' }, quantity: { type: Decimal, knexOptions: { precision: 14, scale: 3 }, label: 'Ilosc' }, barcode: { type: Text, label: 'Kod kreskowy' }, tagged: { type: Checkbox, isRequired: true, label: 'tagged' }, currency_id: { type: Relationship, ref: 'currency', many: false, label: 'Waluta' }, producer: { type: Text, label: 'Producent' }, symbol_prod: { type: Text, label: 'Symbol producenta' }, silver_price: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Koszt srebra' }, gold_price: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Koszt zlota' }, platin_price: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Koszt platyny' }, purchase_date: { type: DateTime, label: 'Data zakupu' }, promo: { type: Checkbox, isRequired: true, label: 'promo' }, news: { type: Checkbox, isRequired: true, label: 'news' }, best: { type: Checkbox, isRequired: true, label: 'best' }, name: { type: Text, label: 'Nazwa' }, desctxt: { type: Text, label: 'desctxt' }, seotxt: { type: Text, label: 'seotxt' }, eshop: { type: Checkbox, isRequired: true, label: 'E-sklep' }, created_at: { type: DateTime, format: 'DD.MM.YYYY h:mm', isRequired: true, label: 'Utworzono' }, modified_at: { type: DateTime, format: 'DD.MM.YYYY h:mm', isRequired: true, label: 'Zmieniono' }, sup_id: { type: Relationship, ref: 'suppliers', many: false, label: 'suppliers_id' }, //pzdoc_id: { type: Relationship, ref: 'pzdoc.pzdoc_id', many: false, label: 'pzdoc' }, todo: spr. czy istotne kinds_id: { type: Relationship, ref: 'kinds', many: false, label: 'kinds' }, uom_id: { type: Relationship, ref: 'uom', many: false, label: 'uom' }, materials_id: { type: Relationship, ref: 'materials', many: false, label: 'materials' }, vat_id: { type: Relationship, ref: 'vat', many: false, isRequired: true, label: 'VAT' }, locations_id: { type: Relationship, ref: 'locations', many: false, label: 'locations' }, deliveryitems_id: { type: Relationship, ref: 'deliveryitems', many: false, label: 'deliveryitems' }, shops_id: { type: Relationship, ref: 'shops', many: false, isRequired: true, label: 'Magazyn' }, tagsoper_id: { type: Relationship, ref: 'operators', many: false, label: 'tagsoper' }, // todo: spr czy o to chodzilo w foregin keys orgyinalnej bazy price_delivery_before_discount: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Koszt dostawy przed rabatem' }, fifo_value: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'fifo_value' }, fifo: { type: Checkbox, label: 'fifo' }, fifo_last_price: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'fifo_last_price' }, transit: { type: Checkbox, isRequired: true, label: 'Transport' }, transit_symbol: { type: Text, label: 'Symbol transportu' }, transit_proofsymbol: { type: Text, label: 'transit_proofsymbol' }, transit_currency_id: { type: Relationship, ref: 'currency', many: false, label: 'Waluta transportu' }, transit_currency_rate: { type: Decimal, knexOptions: { precision: 12, scale: 4 }, label: 'transit_currency_rate' }, transit_purchase_costs: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'transit_purchase_costs' }, transit_currency_material_rate: { type: Decimal, knexOptions: { precision: 12, scale: 4 }, label: 'transit_currency_material_rate' }, quantity_precision: { type: Integer, isRequired: true, label: 'quantity_precision' }, }, label: 'Item'//, plural: 'Itemss' };