Skip to content

Commit

Permalink
feat(CB2-12695): docblocks refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mullen committed Jul 11, 2024
1 parent 19f4d27 commit a9d3edf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/utils/ExtractTestResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import { ValidationUtil } from './ValidationUtil';
/**
* This is used to extract the relevant fields from the test record that is
* required to be sent to MC in order to clear prohibitions
* @param {DynamoDBRecord} record
* @param record - a dynamoDB record
* @returns MCRequest[] - an array of MCRequest interface, contains formatted test data
*/
export const extractMCTestResults = (record: DynamoDBRecord): MCRequest[] => {
const testResultUnmarshall: TestResultSchema = unmarshall(record.dynamodb.NewImage as any) as TestResultSchema;
Expand Down Expand Up @@ -69,15 +70,17 @@ export const extractMCTestResults = (record: DynamoDBRecord): MCRequest[] => {
};

/**
* This method is used to change the test result to be a single, uppercase character
* @param {TestResults} testResult
* This method is used to change the test result to be a single, uppercase character.
* @param testResult - enum of string test results PASS/PRS (smc-prohibition doesn't interact with fail).
* @returns string - changes testResult to string of S or R
*/
export const calculateTestResult = (testResult: TestResults): string =>
testResult === TestResults.PASS ? 'S' : 'R';

/**
* This method is used to change the format of an iso string to be formatted as yyyy/MM/dd
* @param {string} date
* @param date - string of the test date
* @returns string - date in dd/MM/yyyy format
*/
export const isoDateFormatter = (date: string): string =>
DateTime.fromISO(date).toFormat('dd/MM/yyyy');

0 comments on commit a9d3edf

Please sign in to comment.