Skip to content

Commit 5bf0238

Browse files
committedFeb 14, 2025·
feat:TRV14 added
1 parent 057ce6f commit 5bf0238

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3377
-4
lines changed
 

‎constants/index.ts

+21-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,27 @@ export const FIS14ApiSequence = {
197197
ON_UPDATE: 'on_update',
198198
ON_UPDATE_1: 'on_update_1',
199199
}
200-
200+
export const TRV14ApiSequence = {
201+
SEARCH: 'search',
202+
ON_SEARCH1: 'on_search_1',
203+
ON_SEARCH2: 'on_search_2',
204+
SELECT1: 'select_1',
205+
ON_SELECT1: 'on_select_1',
206+
SELECT2: 'select_2',
207+
ON_SELECT2: 'on_select_2',
208+
INIT: 'init',
209+
ON_INIT: 'on_init',
210+
CONFIRM: 'confirm',
211+
ON_CONFIRM: 'on_confirm',
212+
STATUS: 'status',
213+
ON_STATUS: 'on_status',
214+
SOFT_CANCEL: 'soft_cancel',
215+
SOFT_ON_CANCEL: 'soft_on_cancel',
216+
CANCEL: 'cancel',
217+
ON_CANCEL: 'on_cancel',
218+
UPDATE: 'update',
219+
ON_UPDATE: 'on_update',
220+
}
201221
export const mobilitySequence = {
202222
SEARCH: 'search',
203223
SEARCH_INC: 'search_inc',

‎controller/validate/helper.ts

+10
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { validateLogsForFIS10 } from '../../shared/Actions/FIS10Actions'
1010
import { validateLogsForFIS13 } from '../../shared/Actions/FIS13Actions'
1111
import { validateLogsForTRV13 } from '../../shared/Actions/TRV13Actions'
1212
import { getFis14Format, validateLogsForFIS14 } from '../../shared/Actions/FIS14Actions'
13+
import { validateLogsForTRV14 } from '../../shared/Actions/TRV14Actions'
1314

1415
const createSignature = async ({ message }: { message: string }) => {
1516
const privateKey = process.env.SIGN_PRIVATE_KEY as string
@@ -126,6 +127,7 @@ const validateMobility = async (domain: string, payload: string, version: string
126127
let success = false
127128
let message = ERROR_MESSAGE.LOG_VERIFICATION_UNSUCCESSFUL
128129

130+
129131
if (!flow) throw new Error('Flow not defined')
130132

131133
switch (domain) {
@@ -156,8 +158,16 @@ const validateMobility = async (domain: string, payload: string, version: string
156158
success = true
157159
message = ERROR_MESSAGE.LOG_VERIFICATION_SUCCESSFUL
158160
}
161+
break
162+
case 'ONDC:TRV14':
163+
response = validateLogsForTRV14(payload, flow, version)
159164

165+
if (_.isEmpty(response)) {
166+
success = true
167+
message = ERROR_MESSAGE.LOG_VERIFICATION_SUCCESSFUL
168+
}
160169
break
170+
161171
default:
162172
message = ERROR_MESSAGE.LOG_VERIFICATION_INVALID_DOMAIN
163173
logger.warn('Invalid Domain!!')

0 commit comments

Comments
 (0)