From 270845aa2acf46de3642f2cde96d4abbdea2e1d8 Mon Sep 17 00:00:00 2001 From: "Stone C. Lasley" Date: Thu, 2 Dec 2021 19:53:02 -0700 Subject: [PATCH] feat(gs1): HarvestDate Application Identifier --- src/__tests__/readers/gs-1.reader.spec.ts | 16 ++++++++++++++++ src/enums/ai-code.ts | 1 + src/models/application-identifiers.ts | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/src/__tests__/readers/gs-1.reader.spec.ts b/src/__tests__/readers/gs-1.reader.spec.ts index 535a8dc..1f71841 100644 --- a/src/__tests__/readers/gs-1.reader.spec.ts +++ b/src/__tests__/readers/gs-1.reader.spec.ts @@ -242,6 +242,12 @@ describe('Gs1Reader', () => { String.fromCharCode(29), ), ); + const actual4 = classUnderTest.decode( + ']C102084135560009503703 700720211024'.replace( + ' ', + String.fromCharCode(29), + ), + ); expect(actual.values).toContainEqual({ code: '21', @@ -284,5 +290,15 @@ describe('Gs1Reader', () => { code: '10', value: 'ES003472002', }); + + expect(actual4.values).toContainEqual({ + code: '02', + value: '08413556000950', + }); + expect(actual4.values).toContainEqual({ code: '37', value: '03' }); + expect(actual4.values).toContainEqual({ + code: '7007', + value: '20211024', + }); }); }); diff --git a/src/enums/ai-code.ts b/src/enums/ai-code.ts index 1fff83d..0c06a63 100644 --- a/src/enums/ai-code.ts +++ b/src/enums/ai-code.ts @@ -98,6 +98,7 @@ export enum AICode { UNECEMeatCarcassesAndCutsClassification = '7002', ExpirationDateAndTime = '7003', ActivePotency = '7004', + HarvestDate = '7007', Processorapproval = '703n', RollProductsWidthLengthCoreDiameterDirectionSplices = '8001', MobilePhoneIdentifier = '8002', diff --git a/src/models/application-identifiers.ts b/src/models/application-identifiers.ts index 6aec143..aa00ba5 100644 --- a/src/models/application-identifiers.ts +++ b/src/models/application-identifiers.ts @@ -651,6 +651,12 @@ const data = [ length: 4, variableLength: true, }, + { + code: AICode.HarvestDate, + description: 'Harvest Date', + length: 12, + variableLength: true, + }, { code: AICode.Processorapproval, description: 'Processor approval',