Skip to content

Commit

Permalink
Update a few docstrings (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterMuriuki authored Oct 22, 2024
1 parent ac36028 commit 17f3224
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/core/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ export const formEndpoint = 'api/v1/forms' as const;
export const editSubmissionEndpoint = 'api/v1/submissions' as const;

// field accessor names
/** on the facility registration form; accessor that is updated with symbol color */
export const markerColorAccessor = 'marker-color';
/** on the visit form; accessor of time when a visit occurred */
export const dateOfVisitAccessor = 'endtime';
/** on the facility registration form; accessor for field that informs on the priority level of a facility */
export const priorityLevelAccessor = 'priority_level';
/** on the facility registration form; informs on how many submissions(facilities) that have been created */
export const numOfSubmissionsAccessor = 'num_of_submissions';
/** uniquely identifies a submission; on the facility registration form, it represents a created facility */
export const submissionIdAccessor = "_id";

// magic strings
export const AbortErrorName = 'AbortError';
2 changes: 1 addition & 1 deletion packages/core/src/evaluator/configRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class ConfigRunner {
totalRegFormSubmissions = regFormSubmissionsNum;
reporter.updateTotalFacilities(totalRegFormSubmissions);

// fetches submissions for the first form.
// fetches submissions for the facility registration form.
const regFormSubmissionsIterator = service.fetchPaginatedFormSubmissionsGenerator(
regFormId,
regFormSubmissionsNum,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/evaluator/helpers/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { markerColorAccessor } from '../../constants';
import { markerColorAccessor, submissionIdAccessor } from '../../constants';
import { OnaApiService, upLoadMarkerColor } from '../../services/onaApi/services';
import { RegFormSubmission, LogFn, timestamp, uuid, Metric } from '../../helpers/types';
import {
Expand Down Expand Up @@ -29,7 +29,7 @@ export async function transformFacility(
// let modifificationStatus: { modified: boolean; error: string | null } =
// createModificationStatus(false);

const facilityId = regFormSubmission._id;
const facilityId = regFormSubmission[submissionIdAccessor];
const mostRecentVisitResult = await getMostRecentVisitDateForFacility(
service,
facilityId,
Expand Down

0 comments on commit 17f3224

Please sign in to comment.