• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

GrottoCenter / grottocenter-api / 19277458745

11 Nov 2025 08:15PM UTC coverage: 45.598% (+0.8%) from 44.806%
19277458745

push

github

Clément Ronzon
feat(region): adds endpoints for Region page support

963 of 2824 branches covered (34.1%)

Branch coverage included in aggregate %.

165 of 235 new or added lines in 15 files covered. (70.21%)

2 existing lines in 2 files now uncovered.

2958 of 5775 relevant lines covered (51.22%)

6.84 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

29.41
/api/services/DataQualityComputeService.js
1
const CommonService = require('./CommonService');
1✔
2

3
/**
4
 * this service is used to retrieves the elements included
5
 * in the computation of the quality of the data of an entrance.
6
 */
7
const GET_ENTRANCES_WITH_QUALITY_BY_MASSIF = `
1✔
8
  SELECT *
9
  FROM v_data_quality_compute_entrance
10
  WHERE id_massif = $1
11
`;
12

13
const GET_ENTRANCES_WITH_QUALITY_BY_COUNTRY = `
1✔
14
  SELECT DISTINCT id_entrance, general_latest_date_of_update, general_nb_contributions, location_latest_date_of_update, location_nb_contributions, description_latest_date_of_update, description_nb_contributions, document_latest_date_of_update, document_nb_contributions, rigging_latest_date_of_update, rigging_nb_contributions, history_latest_date_of_update, history_nb_contributions, comment_latest_date_of_update, comment_nb_contributions, entrance_name, id_country, country_name, date_of_update
15
  FROM v_data_quality_compute_entrance
16
  WHERE id_country = $1
17
`;
18

19
const GET_ENTRANCES_WITH_QUALITY_BY_REGION = `
1✔
20
  SELECT DISTINCT v.id_entrance, v.general_latest_date_of_update, v.general_nb_contributions, v.location_latest_date_of_update, v.location_nb_contributions, v.description_latest_date_of_update, v.description_nb_contributions, v.document_latest_date_of_update, v.document_nb_contributions, v.rigging_latest_date_of_update, v.rigging_nb_contributions, v.history_latest_date_of_update, v.history_nb_contributions, v.comment_latest_date_of_update, v.comment_nb_contributions, v.entrance_name, v.id_country, v.country_name, v.date_of_update
21
  FROM v_data_quality_compute_entrance v
22
  JOIN t_entrance e ON v.id_entrance = e.id
23
  WHERE e.iso_3166_2 = $1
24
`;
25

26
module.exports = {
1✔
27
  /**
28
   *
29
   * @param {int} massifId
30
   * @returns {Object} the date of the latest update and the number of contributions on all entrances in a massif
31
   *          or null if no result or something went wrong
32
   */
33
  getEntrancesWithQualityByMassif: async (massifId) => {
34
    try {
×
35
      const queryResult = await CommonService.query(
×
36
        GET_ENTRANCES_WITH_QUALITY_BY_MASSIF,
37
        [massifId]
38
      );
39
      return queryResult.rows;
×
40
    } catch (e) {
41
      return null;
×
42
    }
43
  },
44

45
  /**
46
   *
47
   * @param {string} countryId alpha-2 code
48
   * @returns {Object} the date of the latest update and the number of contributions on all entrances in a country
49
   *          or null if no result or something went wrong
50
   */
51
  getEntrancesWithQualityByCountry: async (countryId) => {
52
    try {
×
53
      const queryResult = await CommonService.query(
×
54
        GET_ENTRANCES_WITH_QUALITY_BY_COUNTRY,
55
        [countryId]
56
      );
57
      return queryResult.rows;
×
58
    } catch (e) {
59
      return null;
×
60
    }
61
  },
62

63
  /**
64
   *
65
   * @param {string} regionId ISO 3166-2 code (e.g., 'US-TN')
66
   * @returns {Object} the date of the latest update and the number of contributions on all entrances in a region
67
   *          or null if no result or something went wrong
68
   */
69
  getEntrancesWithQualityByRegion: async (regionId) => {
NEW
70
    try {
×
NEW
71
      const queryResult = await CommonService.query(
×
72
        GET_ENTRANCES_WITH_QUALITY_BY_REGION,
73
        [regionId]
74
      );
NEW
75
      return queryResult.rows;
×
76
    } catch (e) {
NEW
77
      return null;
×
78
    }
79
  },
80
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc