module.exports = {
  USER_ADMIN_CIRCUITS: ['surya1977', 'ElenaEspx'],
  ADMIN_IDTELEGRAM_TEST_USERNAME: ['surya1977', 'SuryaArena', 'surya4', 'test1234'],
  ADMIN_USER_SERVER: 'surya1977',
  Accepted: {
    CHECK_READ_GUIDELINES: 1,
    CHECK_SEE_VIDEO_PRINCIPI: 2,
  },
  LIMIT_NOTIF_FOR_USER: 50,
  LIMIT_NOTIFCOINS_FOR_USER: 50,
  LIMIT_NOTIFCOINS_IN_ATTESA_FOR_USER: 200,

  QUERYTYPE_MYGROUP: 1,
  QUERYTYPE_REFUSED_USER_GRP: 2,
  ALL_SAW_AND_ACCEPTED: 3,
  QUERYTYPE_CIRCUIT: 10,
  QUERYTYPE_REFUSED_USER_CIRCUIT: 12,
  QUERYTYPE_LIST_MOVEMENTS: 15,
  QUERYTYPE_LIST_ALLMOVEMENTS: 16,
  QUERYTYPE_LIST_MOVEMENTS_GROUPNAME: 17,
  QUERYTYPE_LIST_MOVEMENTS_CONTOCOM: 18,
  QUERYTYPE_GROUP_CIRCUIT: 20,
  QUERYTYPE_REFUSED_GROUP_CIRCUIT: 22,
  // ---------------------

  FILTER_EXTRALIST_NOT_REGISTERED: 1,
  FILTER_EXTRALIST_NOT_CONTACTED: 2,
  FILTER_EXTRALIST_WITH_NOTE: 4,
  FILTER_USER_NO_ZOOM: 8,
  FILTER_USER_NO_INVITANTE: 16,
  FILTER_USER_NO_TELEGRAM_ID: 32,
  FILTER_USER_CODICE_AUTH_TELEGRAM: 64,
  FILTER_USER_NO_EMAIL_VERIFICATA: 128,
  FILTER_USER_NO_DREAM: 256,
  FILTER_EXTRALIST_DELETED: 512,
  FILTER_USER_TELEGRAM_BLOCKED: 1024,
  FILTER_ATTIVI: 2048,
  FILTER_NASCOSTI: 4096,
  FILTER_NAVI_NON_PRESENTI: 8192,
  FILTER_QUALIFIED: 16384,
  FILTER_ASK_ZOOM_VISTO: 32768,
  FILTER_HOURS_MYLIST: 65536,
  FILTER_HOURS_ALL: 131072,
  FILTER_REPORTED: 262144,
  FILTER_TO_MAKE_MEMBERSHIP_CARD: 524288,
  FILTER_MEMBERSHIP_CARD_OK: 1048576,
  FILTER_USER_NO_VERIFIED_APORTADOR: 2097152,
  FILTER_USER_SI_TELEGRAM_ID: 4194304,
  FILTER_USER_WITHOUT_USERNAME_TELEGRAM: 8388608,
  FILTER_USER_PROVINCE: 16777216,
  FILTER_USER_SENZA_PROVINCE: 33554432,
  FILTER_USER_SENZA_CIRCUITO: 67108864,
  FILTER_USER_CON_CIRCUITO: 134217728,
  FILTER_USER_ONLINE_6_MESI: 268435456,
  FILTER_NOTE: 536870912,
  FILTER_SENZA_NOTE: 1073741824,
  FILTER_DA_CONTATTARE: 2147483648,
  FILTER_FACILITATORE: 4294967296,
  FILTER_USER_COMUNE: 8589934592,

  OPTIONS_SEARCH_ONLY_FULL_WORDS: 1,
  OPTIONS_SEARCH_USER_ONLY_FULL_WORDS: 2,
  OPTIONS_SEARCH_USER_ALL_WORDS: 4,
  OPTIONS_ADD_COUNT_FAVORITE: 8,

  PROD: {
    GAS: 1,
    BOTTEGA: 2,
  },

  FRIENDSCMD: {
    SETTRUST: 121,
    REQFRIEND: 125,
    SETFRIEND: 132,
    SETHANDSHAKE: 133,
    REMOVE_FROM_MYFRIENDS: 144,
    REFUSE_REQ_FRIEND: 145,
    CANCEL_REQ_FRIEND: 146,
    REMOVE_FROM_MYHANDSHAKE: 147,
    BLOCK_USER: 155,
    UNBLOCK_USER: 156,
    REPORT_USER: 158,
    FIND_PEOPLE: 166,
    DELETE_USER: 170,
  },

  GROUPSCMD: {
    SETTRUST: 1121,
    REQGROUP: 1125,
    SETGROUP: 1132,
    REMOVE_FROM_MYGROUP: 1144,
    REFUSE_REQ_GROUP: 1145,
    CANCEL_REQ_GROUP: 1146,
    BLOCK_GROUP: 1155,
    FIND_GROUP: 1166,
    DELETE_GROUP: 1170,
    ADDADMIN_OFMYGROUP: 1180,
    REMOVEADMIN_OFMYGROUP: 1185,
  },

  CIRCUITCMD: {
    CREATE: 1001,
    REQ: 2000,
    SET: 2001,
    SETFIDO: 2005,
    REMOVE_FROM_MYLIST: 2144,
    REFUSE_REQ: 2145,
    CANCEL_REQ: 2146,
    DELETE: 2170,
    ADDADMIN: 2180,
    REMOVEADMIN: 2185,
    SENDCOINS_REQ: 2200,
    SENDCOINS_REQ_SENT: 2205,
    SENDCOINS_ACCEPT: 2210,
    SENDCOINS_ACCEPT_SENT: 2212,
    SENDCOINS_REFUSE: 2220,
    SENDCOINS_REFUSE_SENT: 2222,
  },

  USERCMD: {
    FAVORITE: 3001,
  },

  REPORT_FILT_RESP: 1,
  REPORT_FILT_ATTIVITA: 2,

  PUBTOSHARE: {
    ALL: 0,
    ONLY_TABLE_FOLLOW: 1,
  },

  TAB_COUNTRY: 'countries',
  TAB_PHONES: 'phones',
  TAB_SETTINGS: 'settings',
  TAB_SITES: 'sites',
  TAB_MYGROUPS: 'mygroups',
  TAB_MYCIRCUITS: 'circuits',
  TAB_BOTS: 'bots',
  TAB_USERS: 'users',
  TAB_MYPAGES: 'mypages',

  KEY_TO_CRYPTED: ['PWD_FROM'],
  SITES_KEY_TO_CRYPTED: ['email_pwd'],
  MYGROUPS_KEY_TO_CRYPTED: 'pwd',

  SUFFIX_CRYPTED: ['_cryp'],

  TablePickup: ['countries', 'phones'],

  PaymentTypes: ['Nessuno', 'Bonifico Bancario', 'Paypal', 'In Contanti alla CNM'],

  PARAM_SHOW_PROVINCE: 1,

  TABLES_MYSKILLS: 'myskills',
  TABLES_MYBACHECAS: 'mybachecas',
  TABLES_MYHOSPS: 'myhosps',
  TABLES_MYGOODS: 'mygoods',
  TABLES_MYEVENTS: 'myevents',
  TABLES_CIRCUITS: 'circuits',
  TABLES_MYGROUPS: 'mygroups',
  TABLES_ATTIVITAS: 'attivitas',
  TABLES_CATALOG: 'catalogs',
  TABLES_LISTA_EDITORI: 'lista_editori',
  TABLES_RACCOLTACATALOGHIS: 'raccoltacataloghis',

  MYTABS: [
    { id: 0, table: 'none' },
    { id: 1, table: 'myskills' },
    { id: 2, table: 'mybachecas' },
    { id: 3, table: 'myhosps' },
    { id: 4, table: 'mygoods' },
    { id: 5, table: 'myevents' },
    { id: 6, table: 'attivitas' },
  ],

  CMD_REACTION: {
    SET_FAVORITE: 1,
    SET_BOOKMARK: 2,
    SET_SEEN: 3,
    SET_ATTEND: 4,
  },

  REACTIONS_FIELD: {
    numseen: 1,
    numbook: 1,
    numfav: 1,
    numattend: 1,
  },

  ANNUNCI_FIELDS: {
    idMyGroup: 1,
    expiryDateAdvert: 1,

    // **ADDFIELD_ANNUNCI
  },

  // Condivise
  TABLES_FAVORITE_BOOKMARK: ['myskills', 'mygoods', 'mybachecas', 'myhosps', 'attivitas'],
  TABLEFORUSERS: ['myskills', 'mygoods', 'mybachecas', 'myhosps'],

  // Solo per NODEJS

  TABLES_ENABLE_GETREC_BYID: ['mybachecas', 'myhosps', 'myskills', 'mygoods', 'attivitas'],
  TABLES_USER_INCLUDE_MY: ['mygroups', 'circuits'],
  TABLES_GETCOMPLETEREC: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'attivitas'],

  //++Todo: per abilitare gli utenti ad inserire un Circuito aggiungere 'circuits' alla lista TABLES_PERM_NEWREC
  TABLES_PERM_NEWREC: ['skills', 'goods', 'bachecas', 'subskills', 'mygroups', 'myhosps', 'catalogs', 'raccoltacataloghis'],

  TABLES_REACTIONS: ['mybachecas', 'myhosps', 'myskills', 'mygoods', 'attivitas'],

  TABLES_VISU_STAT_IN_HOME: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'mygroups', 'circuits'],

  TABLES_ADV_NOTIFICATION: ['myskills', 'myhosps', 'mygoods'],
  TABLES_ORDER_DATE_UPDATED: ['myskills', 'myhosps', 'mygoods'],
  TABLES_ORDER_DESCR: ['mygroups'],
  TABLES_EVENTS_NOTIFICATION: ['mybachecas'],
  TABLES_GROUPS_NOTIFICATION: ['mygroups'],
  TABLES_CIRCUITS_NOTIFICATION: ['circuits'],

  TABLES_ENABLE_GETTABLE_FOR_NOT_LOGGED: ['attivitas', 'catalogs', 'raccoltacataloghis'],

  TABLES_NUM_AS_ID_NUMBER: [],

  TABLES_ID_STRING: ['circuits', 'accounts', 'movements', 'mygroups'],

  TABLES_ID_NUMBER: [
    'permissions',
    'levels',
    'adtypes',
    'adtypegoods',
    'statusSkills',
    'sectors',
    'goods',
    'sectorgoods',
    'bachecas',
    'sectorbachecas',
    'catgrps',
    'skills',
    'subskills',
    'cities',
    'provinces',
    // 'myskills',
    // 'mybachecas',
    // 'myhosps',
    // 'mygoods',
    // 'mygroups'
  ],
  TABLES_USER_ID: ['mygroups', 'myskills', 'mybachecas', 'myhosps', 'mygoods'],
  TABLES_CREATEDBY: ['mygroups', 'circuits', 'attivitas'],
  TABLES_UPDATE_LASTMODIFIED: [
    'myskills',
    'mybachecas',
    'myhosps',
    'mygoods',
    'bots',
    'mygroups',
    'circuits',
    'attivitas',
    'myelems',
    'mypages',
    'products',
    'catalogs',
    'crons',
  ],

  TABLES_FIELDS_DESCR_AND_CITY_AND_USER: ['myskills', 'mybachecas', 'myhosps', 'mygoods'],

  TABLES_PERM_CHANGE_FOR_USERS: ['myskills', 'mybachecas', 'myhosps', 'mygoods'],

  TABLES_POPULATE_DATA: [
    {
      table: 'adtypegoods',
      keyOFF: 'descr',
    },
    {
      table: 'catalogs',
      key: 'title',
    },
    {
      table: 'adtypes',
      keyOFF: 'descr',
    },
    { table: 'catgrps' },
    {
      table: 'contribtypes',
      keyOLD: 'descr',
    },
    { table: 'goods', key: 'descr', key2: 'idSectorGood' },
    { table: 'levels', key: 'descr' },
    { table: 'cities', key: 'comune' },
    { table: 'provinces', key: 'descr' },
    { table: 'sectorgoods', keyOLD: 'descr' },
    { table: 'sectors', keyOLD: 'descr' },
    // { table: 'skills', key: 'descr', key2: 'idSector' },
    { table: 'skills' },
    { table: 'statusSkills', keyOLD: 'descr' },
    // { table: 'catais', key: 'descr' },
    // { table: 'queryais', key: 'descr' },
  ],

  VISIB_ALL: 0,
  VISIB_ONLYIF_VERIFIED: 1,
  VISIB_ONLY_MANAGER: 2,
  VISIB_ONLY_ADMIN: 4,

  CIRCUIT_CFG: {
    MULT_FIDO_USER: 2.0,
    MULT_FIDO_GROUP: 2.0,
  },

  Visibility_Group: {
    PRIVATE: 1,
    HIDDEN: 2,
    // PASSWORD: 4,
  },

  BOTTYPE_NONE: 0,
  BOTTYPE_PAGE: 1,
  BOTTYPE_LINK: 2,
  BOTTYPE_TEXT: 3,
  BOTTYPE_MENU: 4,
  BOTTYPE_MARKDOWN: 5,
  BOTTYPE_BOTTONI_INLINE: 6,

  RIS_OK: '👍🏻 OK',

  CashType: {
    None: 0,
    Incoming: 1,
    Outcoming: 2,
  },

  Cmd: {
    PROVINCE: 1,
    COMUNI: 2,
    CITIES_SERVER: 3,
    CAT_SKILL_TXT: 4,
    CAT_NO_SPAZI: 5,
    CAT_GOODS_TXT: 10,
    PRODUCTS: 20,
    PRODUCTS_V2: 22,
    INVENTARIO: 30,
    MACRO_CATALOGO_JSON: 40,
    MACRO_RANKING: 50,
    MACRO_DESCRELINKSITOWEB: 60,
  },

  WalletFinalStatusType: {
    None: 0,
    InCommonCash: 1,
    InMyWallet: 2,
  },

  Permissions: {
    Admin: 1,
    Manager: 2,
    Teacher: 4,
    Facilitatore: 8,
    Editor: 16,
    Zoomeri: 32,
    Department: 64,
    Grafico: 128,
    Commerciale: 256,
  },

  MessageOptions: {
    Notify_OnlyToNotifinApp: 1,
    Notify_ByEmail: 2,
    Notify_ByPushNotification: 4,
    Notify_ByBotTelegram: 8,
  },

  TypeMsg: {
    SEND_TO_ALL: 1,
    SEND_TO_SOCI: 2,
    SEND_TO_SOCIO_RESIDENTE: 3,
    SEND_TO_CONSIGLIO: 5,
    SEND_TO_NON_SOCI: 10,
    SEND_TO_PAOLO: 20,
    SEND_TO_USER: 25,
    SEND_TO_GROUP: 30,
    SEND_TO_CIRCUIT: 35,
    SEND_TO_MYSELF: 40,
    SEND_TO_TELEG_NO_USERNAME_TELEG: 50,
    SEND_TO_TELEG_NO_VERIF_BY_APORTADOR: 60,
  },

  TypeMsg_Actions: {
    NORMAL: 0,
    YESNO: 1,
    OPZ1_2: 2,
  },

  TYPECASH: {
    NESSUNO: 0,
    IN: 1,
    OUT: 2,
  },

  AdType: {
    OFFRO: 1,
    CERCO: 2,
  },

  TypeCashStr: [
    {
      label: '[Nessuno]',
      value: 0,
    },
    {
      label: 'Ingresso',
      value: 1,
    },
    {
      label: 'Uscita',
      value: 2,
    },
  ],

  UNITS_OF_MEASURE: {
    NESSUNO: 0,
    GRAMMI: 1,
    CHILI: 2,
    LITRI: 3,
    MILLILITRI: 4,
    PEZZI: 10,
  },

  Units_Of_Measure_ListBox: [
    {
      label: '[Nessuno]',
      short: '',
      value: 0,
    },
    {
      label: 'Grammi (g)',
      short: 'g',
      value: 1,
    },
    {
      label: 'Chili (kg)',
      short: 'kg',
      value: 2,
    },
    {
      label: 'Litri (Lt)',
      short: 'Lt',
      value: 3,
    },
    {
      label: 'MilliLitri (ml)',
      short: 'ml',
      value: 4,
    },
    {
      label: 'Pezzi (p)',
      short: 'p',
      value: 10,
    },
    {
      label: 'Uova',
      short: 'uova',
      value: 15,
    },
  ],

  CallFunz: {
    SOSTITUISCI: 345,
    AGGIUNGI_NUOVO_IMBARCO: 380,
    CANCELLA_IMBARCO: 385,
    DAMMI_PRIMO_UTENTE_LIBERO: 390,
    GET_VALBYTABLE: 400,
    SET_VALBYTABLE: 410,
    ZOOM_GIA_PARTECIPATO: 510,
    REGISTRATION: 6,
    RICHIESTA_GRUPPO: 10,
    RICHIESTA_AMICIZIA: 15,
    RICHIESTA_HANDSHAKE: 16,
    RICHIESTA_CIRCUIT: 20,
    RICHIESTA_FIDO: 25,
    ENTRA_RIS_ITALIA: 30,
  },

  OrderStatus: {
    NONE: 0,
    IN_CART: 1,
    CHECKOUT_SENT: 2,
    ORDER_CONFIRMED: 3,
    PAYED: 4,
    DELIVERED: 5, // Consegnato
    SHIPPED: 6, //Spedito
    RECEIVED: 7,
    CANCELED: 10,
    PREPARED: 15,
    DELETE_REALLY: 20,
  },

  OrderStat: {
    // IN_CART: { label: 'In Carrello', value: 1 }, //IN_CART
    IN_CORSO: { label: 'In Corso', value: 2, icon: 'fas fa-tasks', color: 'text-black' }, //CHECKOUT_SENT
    CONFERMATI: {
      label: 'Confermati',
      value: 3,
      icon: 'fas fa-calendar',
      color: 'text-blue',
    }, //ORDER_CONFIRMED
    PAGATI: { label: 'Pagati', value: 4, icon: 'money', color: 'text-green' }, //PAYED
    DELIVERED: {
      label: 'Consegnato',
      value: 5,
      icon: 'fas fa-calendar',
      color: 'text-blue',
    }, //DELIVERED
    SHIPPED: {
      label: 'Spediti',
      value: 6,
      icon: 'fas fa-shipping-fast',
      color: 'text-green',
    }, //SHIPPED
    RECEIVED: { label: 'Ricevuti', value: 7, icon: '', color: 'text-blue' }, //RECEIVED
    COMPLETATI: {
      label: 'Completati',
      value: 8,
      icon: 'fas fa-check',
      color: 'text-blue',
    }, //COMPLETED
    CANCELLATI: { label: 'Cancellati', value: 10, icon: 'delete', color: 'text-red' }, //CANCELED
    PREPARED: {
      label: 'Preparati',
      value: 15,
      icon: 'fas fa-archive',
      color: 'text-blue',
    },
  },

  OrderStatusStr: [
    {
      label: 'Nessuno',
      value: 0,
    },
    {
      label: 'In Carrello',
      value: 1,
    },
    {
      label: 'Ordine in Lavorazione',
      value: 2,
    },
    {
      label: 'Preparato',
      value: 15,
    },
    {
      label: 'Ordine Confermato',
      value: 3,
    },
    {
      label: 'Pagato',
      value: 4,
    },
    {
      label: 'Consegnato',
      value: 5,
    },
    {
      label: 'Spedito',
      value: 6,
    },
    {
      label: 'Ricevuto',
      value: 7,
    },
    {
      label: 'Cancellato',
      value: 10,
    },
  ],

  ConfSite: {
    Notif_Reg_Bot_ToManagers: 1,
    Notif_Reg_Push_Admin: 2,
    Need_Aportador_On_DataReg_To_Verify_Reg: 4,
    AskInvitantesulBot: 8,
    AskUsernameSulBot: 16,
    registerUserWithBot: 32,
    regNameSurnameMandatory: 64,
    askUSernameTelegramToTheReg: 128,
  },

  MsgTeleg: {
    SHARE_MSGREG: 1,
    SHARE_TEXT: 2,
    SHARE_ANNUNCIO: 3,
  },

  TypeMsgTemplate: {
    MSG_BENVENUTO: 2010,
    MS_SHARE_LINK: 2000,
    MSG_BENV_REGISTRATO: 2020,
    MSG_INVITE_WHATSAPP: 2040,
    MSG_VERIFICA_TELEGRAM_COMPLETATA: 2050,
    MSG_VERIFICA_TELEGRAM_COMPLETATA_NOTIF_INVITANTE: 2060,
  },

  TypeSend: {
    PUSH_NOTIFICATION: 1,
    TELEGRAM: 2,
    EMAIL: 4,
  },
  UsersNotif: {
    NEW_ADV_CITY: 1,
    NEW_ADV_PROVINCE: 2,
    NEW_ADV_REGION: 4,
    NEW_ADV_MY_GROUPS: 8,
    NEW_ADV_MY_RIS_CIRCUIT: 16,
    NEW_ADV_SECTOR: 32,
    NEW_ADV_YOUR_PROVINCE: 64,
  },

  StatusNotifs: {
    STATUS_FRIENDS_ACCEPTED: 1,
    STATUS_FRIENDS_REFUSED: 2,
    STATUS_FRIENDS_REPORTED: 3,
    STATUS_HANDSHAKE_ACCEPTED: 10,
    STATUS_HANDSHAKE_REFUSED: 11,
  },

  GroupsNotifs: {
    STATUS_GROUPS_NEW: 1,
    STATUS_GROUPS_ACCEPTED: 3,
    STATUS_GROUPS_REFUSED: 4,
    STATUS_GROUPS_BLOCKED: 5,
    STATUS_GROUPS_DELETED: 6,
    STATUS_GROUPS_REMOVED: 7,
  },

  CircuitsNotif: {
    STATUS_NONE: 0,
    STATUS_NEW: 51,
    STATUS_ACCEPTED: 53,
    STATUS_REFUSED: 54,
    STATUS_BLOCKED: 55,
    STATUS_DELETED: 56,
    STATUS_REMOVED: 57,
    STATUS_COINS_ACCEPTED: 60,
    STATUS_COINS_REFUSED: 61,
    STATUS_COINS_ACCEPTED_SENT: 62,
    STATUS_COINS_REFUSED_SENT: 63,
  },

  QualiNotifs: {
    CIRCUITS: 1,
    OTHERS: 2,
  },

  TypeNotifs: {
    TYPEDIR_BACHECA: 1,
    ID_BACHECA_NEW_GOOD: 1,
    ID_BACHECA_NEW_SERVICE: 2,
    ID_BACHECA_NEW_HOSP: 4,

    TYPEDIR_EVENTS: 2,
    ID_EVENTS_NEW_REC: 1,
    ID_EVENTS_REMOVE_REC: 2,
    ID_EVENTS_ATTEND: 4,
    ID_EVENTS_SEND_MSG: 8,

    TYPEDIR_FRIENDS: 3,
    ID_FRIENDS_NEW_REC: 1,
    ID_FRIENDS_ACCEPTED: 2,
    ID_FRIENDS_REFUSED: 4,
    ID_FRIENDS_ACCEPTED_MY_REQUEST: 8,
    ID_FRIENDS_REPORTED: 16,
    ID_FRIENDS_UNBLOCKED: 32,

    TYPEDIR_GROUPS: 4,
    ID_GROUP_NEW_REC: 1,
    ID_GROUP_ACCEPTED: 2,
    ID_GROUP_REFUSED: 4,
    ID_GROUP_REQUEST_TO_ENTER: 8,
    ID_GROUP_BLOCK_USER: 16,
    ID_GROUP_DELETE_USER: 32,
    ID_GROUP_REMOVED: 64,
    ID_GROUP_ADDED_ADMIN_OFMYGROUP: 128,
    ID_GROUP_REMOVED_ADMIN_OFMYGROUP: 256,

    TYPEDIR_CIRCUITS: 5,
    ID_CIRCUIT_NEW_REC: 1,
    ID_CIRCUIT_ACCEPTED: 2,
    ID_CIRCUIT_REFUSED: 4,
    ID_CIRCUIT_REQUEST_TO_ENTER: 8,
    ID_CIRCUIT_BLOCK_USER: 16,
    ID_CIRCUIT_DELETE_USER: 32,
    ID_CIRCUIT_REMOVED: 64,
    ID_CIRCUIT_ADDED_ADMIN: 128,
    ID_CIRCUIT_REMOVED_ADMIN: 256,
    ID_CIRCUIT_SENDCOINSREQ: 512,
    ID_CIRCUIT_COINS_ACCEPTED: 1024,
    ID_CIRCUIT_COINS_REFUSED: 2048,
    ID_CIRCUIT_SENDCOINSREQ_SENT: 4096,
    ID_CIRCUIT_COINS_ACCEPTED_SENT: 8192,
    ID_CIRCUIT_COINS_REFUSED_SENT: 16384,
    ID_CIRCUIT_SETFIDO: 32768,

    TYPEDIR_BOOKING: 6,

    TYPEDIR_MSGS: 7,
    ID_MSGS_NEW_REC: 1,

    TYPEDIR_HANDSHAKE: 10,
    ID_HANDSHAKE_ACCEPTED: 2,

    TYPEDIR_FAVORITE: 11,
    ID_FAVORITE_ADDED: 1,

    TYPEDIR_TEST: 444,
    ID_TEST_NEW_REC: 1,
  },

  // Tipi di Notifiche:
  /*
  Notif: {
    UPDATE_APP: 1,
    NEW_GOOD_MY_PROVINCE: 12,
    NEW_GOOD_MY_COMUNE: 13,
    NEW_SERVICE_MY_PROVINCE: 14,
    NEW_SERVICE_MY_COMUNE: 15,
    NEW_HOSP_MY_PROVINCE: 16,
    NEW_HOSP_MY_COMUNE: 17,

    REQ_NEW_FRIEND: 20,
    ACCEPTED_NEW_FRIEND_REQ: 21,

    RIS_RECEIVED: 50,
    RIS_SENT_CONFIRMED: 51,
    RIS_SENT_REFUSED: 52,
  },

   */

  fieldsUserToChange() {
    return [
      '_id',
      'index',
      'username',
      'group',
      'email',
      'name',
      'surname',
      'perm',
      'date_reg',
      'verified_email',
      'verified_by_aportador',
      'ipaddr',
      'lasttimeonline',
      'profile',
      'calcstat',
      'news_on',
      'diario_on',
      'test',
      'aportador_solidario',
      'made_gift',
      'ind_order',
      'old_order',
      'numinvitati',
      'numinvitatiattivi',
      'qualified',
    ];
  },

  DEFAULT_NOTIFS_USER: [
    {
      dir: 1,
      value: 88,
    },
    {
      dir: 2,
      value: 4,
    },
    {
      dir: 3,
      value: 1,
    },
    {
      dir: 4,
      value: 1,
    },
    {
      dir: 5,
      value: 1,
    },
    {
      dir: 11,
      value: 1,
    },
    {
      dir: 12,
      value: 1,
    },
  ],

  CIRCUIT_STATUS: {
    FASE0: 0,
    FASE1_CREAZIONE_GRUPPO: 1,
    FASE2_ORGANIZZAZIONE: 2,
    FASE3_MONETA_ABILITATA: 3,
  },

  CIRCUIT_PARAMS: {
    SCOPERTO_MIN_GRP: 200,
    SCOPERTO_MAX_GRP: 400,
    SCOPERTO_MIN_CONTO_COMUNITARIO: 500,
    SCOPERTO_MAX_CONTO_COMUNITARIO: 1000,
  },

  TABLETYPE: {
    DefaultCal: 0,
    MyBachecas: 1,
  },

  getProjectByTable(table, proj_add) {
    let proj = {};

    if (table === this.TABLES_MYGOODS) {
      proj = {
        recGood: 1,
        sectorGood: 1,
        idSectorGood: 1,
        idGood: 1,
        idShipping: 1,
        idStatusGood: 1,
        //**ADDFIELD_MYGOOD
      };
    } else if (table === this.TABLES_MYGROUPS) {
      proj = {
        groupname: 1,
        title: 1,
        descr: 1,
        img: 1,
        visibility: 1,
        admins: 1,
        idCatGrp: 1,
        date_created: 1,
        date_updated: 1,
        photos: 1,
        idCity: 1,
        note: 1,
        website: 1,
        link_telegram: 1,
        comune: 1,
        mycities: 1,
        sector: 1,
        recCatGrp: 1,
        mycircuits: 1,
        lastdate_reqRisGroup: 1,
      };
    } else if (table === this.TABLES_CIRCUITS) {
      proj = {
        _id: 1,
        groupnameId: 1,
        path: 1,
        name: 1,
        strProv: 1,
        subname: 1,
        longdescr: 1,
        regulation: 1,
        numMembers: 1,
        link_group: 1,
        totCircolante: 1,
        totTransato: 1,
        systemUserId: 1,
        createdBy: 1,
        date_created: 1,
        date_updated: 1,
        nome_valuta: 1,
        fido_scoperto_default: 1,
        deperimento: 1,
        circuitiExtraProv: 1,
        isCircItalia: 1,
        enableOnlyIf1CircuitExist: 1,
        ignoreLimits: 1,
        askManagerToEnter: 1,
        sendEmailAfterAskingToEnter: 1,
        circuitoIndipendente: 1,
        creditodiPartenza: 1,
        status: 1,
        transactionsEnabled: 1,
        qta_max_default: 1,
        fido_scoperto_default_grp: 1,
        qta_max_default_grp: 1,
        fido_scoperto_default_contocom: 1,
        qta_max_default_contocom: 1,
        valuta_per_euro: 1,
        symbol: 1,
        idCity: 1,
        pub_to_share: 1,
        visibility: 1,
        color: 1,
        abbrev: 1,
        data_costituz: 1,
        photos: 1,
        admins: 1,
        req_users: 1,
        refused_users: 1,
        mycities: 1,
        //**ADDFIELD_CIRCUITS
      };
    } else if (table === this.TABLES_MYSKILLS) {
      proj = {
        recSkill: 1,
        sector: 1,
        idSector: 1,
        idSkill: 1,
        myskill: 1,
        idStatusSkill: 1,
        idContribType: 1,
        numLevel: 1,
        adType: 1,
        photos: 1,
        note: 1,
        website: 1,
        //**ADDFIELD_MYSKILL
      };
    } else if (table === this.TABLES_MYHOSPS) {
      proj = {
        visibile: 1,
        adType: 1,
        typeHosp: 1,
        numMaxPeopleHosp: 1,
        accomodation: 1,
        preferences: 1,
        idContribType: 1,
        photos: 1,
        idCity: 1,
        note: 1,
        website: 1,
        link_maplocation: 1,
      };
    } else if (table === this.TABLES_ATTIVITAS) {
      proj = {
        recSkill: 1,
        sector: 1,
        idSector: 1,
        idSkill: 1,
        idCity: 1,
        logo: 1,
        photos: 1,
        note: 1,
        descr: 1,
        website: 1,
        date_created: 1,
        date_updated: 1,
        tipodiAttivita: 1,
        name: 1,
        coordinate_gps: 1,
        email: 1,
        telegram_username: 1,
        cell_phone: 1,
        whatsapp: 1,
        createdBy: 1,
        //**ADDFIELD_ATTIVITA
      };
    } else if (table === this.TABLES_MYBACHECAS) {
      proj = {
        recSkill: 1,
        idSectorBacheca: 1,
        idBacheca: 1,
        sectorBacheca: 1,
        idStatusSkill: 1,
        idContribType: 1,
        dateTimeStart: 1,
        dateTimeEnd: 1,
        website: 1,
        organisedBy: 1,
        contact_phone: 1,
        contact_email: 1,
        contact_telegram: 1,
        address: 1,
        min_partecip: 1,
        max_partecip: 1,
        contribstr: 1,
        link_maplocation: 1,
        link_conference: 1,
        //**ADDFIELD_MYBACHECAS
      };
    }

    const proj_common = {
      'mygrp.groupname': 1,
      'mygrp.title': 1,
      'mygrp.photos': 1,
    };

    proj = Object.assign({}, proj, proj_common);

    if (proj_add) proj = Object.assign({}, proj, proj_add);

    return proj;
  },

  getProjectForAll(proj_add, table) {
    let proj = {
      idapp: 1,
      idContribType: 1,
      idCity: 1,
      pub_to_share: 1,
      adType: 1,
      photos: 1,
      note: 1,
      da_contattare: 1,
      descr: 1,
      date_created: 1,
      date_updated: 1,
      userId: 1,
      username: 1,
      name: 1,
      surname: 1,
      email: 1,
      groupname: 1,
      lasttimeonline: 1,
      comune: 1,
      myreact: 1,
      mycities: 1,
      lang: 1,
      verified_by_aportador: 1,
      idMyGroup: 1,
      'profile.img': 1,
      'profile.mygroups': 1,
      'profile.mycircuits': 1,
      'profile.qualifica': 1,
      'profile.note': 1,
      'profile.da_contattare': 1,
      'profile.resid_str_comune': 1,
      'profile.resid_province': 1,
      'profile.resid_card': 1,
      'profile.username_telegram': 1,
      'profile.favorite': 1,
      'profile.bookmark': 1,
      'profile.attend': 1,
      'profile.seen': 1,
      reported: 1,
      date_report: 1,
      username_who_report: 1,
      namecomplete: 1,
      date_reg: 1,
      perm: 1,
    };

    if (proj_add) proj = Object.assign({}, proj, proj_add);

    proj = { ...proj, ...this.REACTIONS_FIELD };
    proj = { ...proj, ...this.ANNUNCI_FIELDS };

    if (table) {
      let proj_add3 = this.getProjectByTable(table);
      proj = Object.assign({}, proj, proj_add3);
    }

    return proj;
  },

  getDirectoryByTable(table, barre = false) {
    let add = '';
    if (barre) add = '/';

    if (table === 'myskills') {
      return add + 'myservice' + add;
    } else if (table === 'mybachecas') {
      return add + 'mypage' + add;
    } else if (table === 'myhosps') {
      return add + 'myhosps' + add;
    } else if (table === 'mygoods') {
      return add + 'mygood' + add;
    } else if (table === 'mygroups') {
      return add + 'grp' + add;
    } else if (table === 'circuits') {
      return add + 'circuit' + add;
    } else if (table === 'catalogs') {
      return add + 'catalogs' + add;
    }

    return '';
  },
  getStatusStr(status) {
    const trovatorec = this.OrderStatusStr.find((rec) => rec.value === status);
    return trovatorec ? trovatorec.label : '';
  },

  getDirectoryImgByTable(table, username) {
    if (this.TABLEFORUSERS.includes(table)) {
      ris = 'profile/' + username + '/' + table + '/';
    }

    return ris;
  },

  ButtonCodeAction: {
    NONE: 0,
    NEXT_10: 1,
  },

  CAMPI_PRODUCTINFO_CONVERT: ['weight_and_unit', 'weight_and_unit_lordo'],

  CAMPI_PRODUCTINFO_RICOPIA_DATI: ['old_code'],

  PRODUCTINFO: {
    CAMPI_FIRST_UPPERCASE: ['name'],
  },

  CAMPI_TYPE: {
    STRING: 1,
  },

  CAMPI_PRODUCTINFO: [
    { name: 'name', type: '' },
    { name: 'code', type: '' },
    { name: 'codice', type: '' },
    { name: 'description', type: 1 },
    { name: 'link_scheda', type: '' },
    { name: 'idCatProds', type: '' },
    { name: 'idSubCatProds', type: '' },
    { name: 'weight', type: '' },
    { name: 'weight_lordo', type: '' },
    { name: 'unit', type: '' },
    { name: 'unit_lordo', type: '' },
    { name: 'size', type: '' },
    { name: 'vegan', type: '' },
    { name: 'sfuso', type: '' },
    { name: 'img', type: '' },
    { name: 'image_link', type: '' },
    { name: 'link', type: '' },
    { name: 'ingredienti', type: '' },
    { name: 'valori_nutrizionali', type: '' },
    { name: 'author', type: '' },
    { name: 'collezione', type: '' },
    { name: 'publisher', type: '' },
    { name: 'pagine', type: '' },
    { name: 'misure', type: '' },
    { name: 'note', type: '' },
  ],

  CAMPI_PRODUCT: [
    'active',
    'price',
    'stockQty',
    'perc_iva',
    'price_acquistato',
    'minBuyQty',
    'minStepQty',
    'cat_name',
    'subcat_name',
    'producer_name',
    'provider_name',
    'magazzino_name',
    'qtyToReachForGas',
    'maxbookableGASQty',
    'gas_name',
    'sconto1',
    'sconto2',
  ],

  CONVERTI_CAMPO: [
    {
      originale: 'maxbookableGASQty',
      convertito: 'prenotato',
    },
    {
      originale: 'qtyToReachForGas',
      convertito: 'quantita_da_raggiungere',
    },
  ],

  CAMPI_EURO: ['price', 'price_acquistato'],

  MAX_QTA_PREORD: 5000,
  MAX_QTA_NON_IMPOSTATA: -1,

  STATUSSKILL_DI_PERSONA: 1,
  STATUSSKILL_ONLINE: 2,

  TYPEHOSP_SCAMBIOCASA: 1,
  TYPEHOSP_OSPITALITA: 2,

  PRODUCTTYPE: {
    BENE: 1,
    SERVIZIO: 2,
    OSPITALITA: 4,
    PRODOTTO: 10,
    LIBRO: 20,
    EBOOK: 21,
    AUDIOLIBRO: 22,
    VIDEO: 23,
    CARTE: 25,
    // -----------
    NUOVO: 101,
    USATO: 102,
    DOWNLOAD: 103,
    DVD: 104,
    EPUB: 105,
    MOBI: 106,
    PDF: 107,
    STREAMING: 108,

    PRODUCT: 1000,
  },

  AccountType: {
    USER: 0,
    CONTO_DI_GRUPPO: 1,
    COMMUNITY_ACCOUNT: 2,
  },

  CmdQueryMs: {
    GET: 0,
    SET: 1,
    UPDATE: 2,
  },

  SENDRIS_CODES: {
    EXCEED_FIDO: 10,
    EXCEED_QTAMAX: 20,
  },

  DESTNEWSLETTER: {
    LISTA_NEWSLETTER: 0,
    UTENTI: 1,
    DIARIO: 2,
    TEST: 10,
  },

  STATUS_JOB: {
    NONE: 0,
    START: 1,
    FINISH: 10,
    PAUSE: 2,
    ERR: -10,
  },

  TERMINATED_WHY: {
    END_NORMALLY: 1,
    END_WITHERROR: -50,
    TOOLONGTIME: -10,
  },

  // Download, DVD, Epub, Mobi, Nuovo, PDF, Streaming, Usato

  PUNTI_PER_POLLICE: 96,

  SCONTI_APPLICA: {
    NESSUNO: 0,
    A_TUTTI: 1,
  },

  ELEMTYPE: {
    TITLE: 5,
    MARGINI: 6,
    CARD: 7,
    IMGTITLE: 8,
    IMGPOSTER: 9,
    TEXT: 10,
    HTML: 20,
    IMAGE: 30,
    IMAGEUPLOAD: 35,
    SEPARATOR: 40,
    VIDEO: 50,
    VIDEO_YOUTUBE: 52,
    PAGE: 55,
    PAGEINTRO: 58,
    CALENDAR: 70,
    CAROUSEL_IDISCIPLINE: 80,
    CAROUSEL_HOME: 85,
    CHECK_EMAIL: 100,
    IMAGE_GALLERY: 101,
    HEADING: 102,
    LIST: 103,
    CODE: 104,
    DIVIDER: 105,
    CAROUSEL_IMGS: 110,
    OPENSTREETMAP: 120,
    MAINVIEW: 130,
    CHECKAPPRUNNING: 135,
    DASHBOARD: 140,
    DASHGROUP: 145,
    MOVEMENTS: 148,
    STATUSREG: 160,
    CHECKIFISLOGGED: 170,
    INFO_VERSION: 180,
    BOTT_CONDIVIDI: 190,
    BOTT_CHAT_TERRITORIALE: 192,
    BUTTON: 195,
    PRESENTAZIONE: 200,
    MYACTIVITIES: 205,
    NOTIFATTOP: 210,
    CHART: 220,
    CHECKNEWVERSION: 230,
    CHECKTESTENV: 240,
    BTN_REG: 250,
    BTN_REG_BYBOT: 255,
    REGISTRATION: 258,
    BTN_LOGIN: 260,
    MODIFICA_PROFILO: 265,
    FOOTER: 270,
    PROFILETUTORIAL: 280,
    VISUVIDEOPROMOANDPDF: 290,
    ECOMMERCE: 300,
    CATALOGO: 310,
    RACCOLTA: 315,
    TOOLSAI: 320,
    CHATBOT: 325,
    MAPPA: 350,
    MAPPAUTENTI: 360,
    MAPPACOMUNI: 370,
    MAPPAGETCOORDINATE: 380,
    EDITADDRESSBYCOORD: 390,
    GRID_ORIZ: 400,
    QRCODE: 410,
    CATALOGLIST: 420,
    SEARCHPRODUCT: 430,
    RACCOLTE_CATALOGHI: 450,
    STAT_PAGES: 460,
    SECTION: 1000,
    ROW: 1100,
    COLUMN: 1200,
    PAGE_SECTION: 1500,
    PROFILE_COMPLETITION: 1510,
  },

  TOK_INIZIALE_VERIF_TELEG: '',

  JOB_TO_EXECUTE: {
    MIGRATION_SECTORS_DIC25: 'Migration_Sectors_Dic_2025',
  },
};
