diff --git a/src/compareWithLabeled.ts b/src/compareWithLabeled.ts index 807679f..d76116a 100644 --- a/src/compareWithLabeled.ts +++ b/src/compareWithLabeled.ts @@ -17,7 +17,7 @@ import { FieldResult, LineItem, LineItemFieldResults, - ComparisonInputWithMultipleValues, + ComparisonInputWithMultiPossibleValues, } from './types' type ComparisonResultWithoutAPS = Omit @@ -47,7 +47,7 @@ export const createMismatchComment = ( export const evaluateField = ( field: keyof ComparisonInput, parsed: ComparisonInput, - labeled: ComparisonInputWithMultipleValues, + labeled: ComparisonInputWithMultiPossibleValues, // eslint-disable-next-line @typescript-eslint/no-explicit-any comparator: ComparisonFn, comparatorOptions?: ComparisonOptions @@ -122,7 +122,7 @@ export const evaluateArray = ( export const evaluateCostsAddUp = ( parsed: ComparisonInput, - labeled: ComparisonInputWithMultipleValues + labeled: ComparisonInputWithMultiPossibleValues ): FieldResult => { const expectedTotal = labeled?.totalAmount if (!expectedTotal) return { match: null, comments: ['missing labeled total amount'] } @@ -164,7 +164,7 @@ export const evaluateCostsAddUp = ( export const evaluateLineItemCount = ( parsed: ComparisonInput['lineItems'], - labeled: ComparisonInputWithMultipleValues['lineItems'] + labeled: ComparisonInputWithMultiPossibleValues['lineItems'] ): FieldResult => { if (!parsed && !labeled) { return { @@ -188,7 +188,7 @@ export const evaluateLineItemCount = ( export const evaluateLineItemFields = ( parsed: ComparisonInput['lineItems'], - labeled: ComparisonInputWithMultipleValues['lineItems'] + labeled: ComparisonInputWithMultiPossibleValues['lineItems'] ): LineItemFieldResults => { const result: LineItemFieldResults = { lineItemName: { match: null }, @@ -320,7 +320,7 @@ export const compareWithLabeled = ({ labeled, }: { parsed: ComparisonInput - labeled: ComparisonInputWithMultipleValues + labeled: ComparisonInputWithMultiPossibleValues }): ComparisonResult => { const fieldResults: ComparisonResultWithoutAPS = { status: evaluateField('status', parsed, labeled, compareOrderStatus), diff --git a/src/index.ts b/src/index.ts index 35a5fb5..3ca9152 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,8 @@ export { compareWithLabeled } from './compareWithLabeled' export { MatchKey, APS_FIELDS } from './constants' -export type { ComparisonInput, ComparisonResult, LineItemWithMultiPossibleValues } from './types' +export type { + ComparisonInput, + ComparisonInputWithMultiPossibleValues, + ComparisonResult, + LineItemWithMultiPossibleValues, +} from './types' diff --git a/src/types.ts b/src/types.ts index 808f0a5..0f34e64 100644 --- a/src/types.ts +++ b/src/types.ts @@ -42,7 +42,7 @@ export type ComparisonInput = { trackingNumbers: string[] | null } -export type ComparisonInputWithMultipleValues = Omit< +export type ComparisonInputWithMultiPossibleValues = Omit< ComparisonInput, 'lineItems' | 'merchantName' > & {