const { Text, Checkbox, Integer, Decimal, Relationship } = require('@keystonejs/fields'); const { AutoIncrement } = require('@keystonejs/fields-auto-increment'); module.exports = { fields: { suppliers_id: { type: AutoIncrement, isRequired: true, label: 'suppliers' }, name: { type: Text, isRequired: true, label: 'Nazwa' }, shortname: { type: Text, label: 'Nazwa Skrocona' }, shortid: { type: Text, label: 'shortid' }, street: { type: Text, label: 'Ulica' }, city: { type: Text, label: 'Miasto' }, zipcode: { type: Text, label: 'Kod pocztowy' }, country: { type: Text, label: 'Kraj' }, phone: { type: Text, label: 'Numer telefonu' }, phone_mb: { type: Text, label: 'phone_mb' }, fax: { type: Text, label: 'FAX' }, email: { type: Text, label: 'Adres e-mail' }, prefixnip: { type: Text, label: 'prefixnip' }, nip: { type: Text, label: 'NIP' }, supcomment: { type: Text, label: 'supcomment' }, supplier: { type: Checkbox, isRequired: true, label: 'Dostawca?' }, payervat: { type: Checkbox, isRequired: true, label: 'Platnik VAT?' }, pesel: { type: Text, label: 'PESEL' }, www: { type: Text, label: 'Adres WWW' }, docidentity_type: { type: Integer, label: 'docidentity_type' }, docidentity_number: { type: Text, label: 'docidentity_number' }, discount: { type: Decimal, knexOptions: { precision: 5, scale: 1 }, label: 'Rabat' }, wsuser: { type: Text, label: 'wsuser' }, wspass: { type: Text, label: 'wspass' }, paytype: { type: Text, label: 'paytype' }, paydays: { type: Integer, label: 'paydays' }, // document_groups_id: { type: Relationship, ref: 'document_groups.document_groups_id', many: true, label: 'document_groups' }, todo: spr. czy to wazne bylo i jaki foregin key i w ogole }, label: 'Supplier'//, plural: 'Suppliers' };