forked from mosip/mosip-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
life-insurance-credential.json
37 lines (37 loc) · 1.37 KB
/
life-insurance-credential.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
##Here we are injecting DateTool instance from java velocity library to set the expiry date
#set( $defaultLocale = $date.getLocale() )
#set( $calenderNow = $date.getCalendar() )
#set( $ISO8601DateTimeWithMillisUTC = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" )
## Adding no. of Days we want to set as expiry, here '5' represent Day and '30' represent no. of days
#set( $expiry =$calenderNow.add(5, 30))
#set( $formattedPolicyIssuedOn = $date.toDate($ISO8601DateTimeWithMillisUTC, ${policyIssuedOn}))
#set( $formattedPolicyExpiresOn = $date.toDate($ISO8601DateTimeWithMillisUTC, ${policyExpiresOn}))
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://holashchand.github.io/test_project/insurance-context.json",
{
"LifeInsuranceCredential": {
"@id":"InsuranceCredential"
}
}
],
"type": [
"VerifiableCredential",
"LifeInsuranceCredential"
],
"issuer": "${issuerId}",
"expirationDate": "${date.format($ISO8601DateTimeWithMillisUTC, $calenderNow, $defaultLocale)}",
"credentialSubject": {
"dob": "${dob}",
"gender": "${gender}",
"mobile": "${mobile}",
"benefits": #if($benefits)$benefits#else#set($benefits = '"[]"') $benefits#end,
"fullName": "${fullName}",
"email": "${email}",
"policyIssuedOn": "${date.format('yyyy-MM-dd', $formattedPolicyIssuedOn)}",
"policyExpiresOn": "${date.format('yyyy-MM-dd', $formattedPolicyExpiresOn)}",
"policyName": "${policyName}",
"policyNumber": "${policyNumber}"
}
}