Skip to content

Commit

Permalink
chore: update idr seeding script (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
namhoang1604 authored Nov 25, 2024
1 parent 826a86a commit 201ffa2
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 36 deletions.
7 changes: 6 additions & 1 deletion app-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6901,7 +6901,12 @@
},
{
"type": "nlis",
"format": "^3ABCD123[a-zA-Z0-9]{8}$",
"format": "^[A-Z0-9]{8}[A-Z][A-Z][A-Z][A-Z0-9]{5}$",
"carriers": ["manual_entry"]
},
{
"type": "abn",
"format": "^(\\d *?){11}$",
"carriers": ["manual_entry"]
}
],
Expand Down
39 changes: 22 additions & 17 deletions packages/components/src/constants/app-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -1376,7 +1376,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -1585,7 +1585,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -2524,7 +2524,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -2701,7 +2701,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -2882,7 +2882,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -3063,7 +3063,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -3265,7 +3265,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -3766,7 +3766,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -4183,7 +4183,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -4846,7 +4846,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Packhouse Facility"
},
"headers": {
Expand Down Expand Up @@ -5059,7 +5059,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Packhouse Facility"
},
"headers": {
Expand Down Expand Up @@ -5732,7 +5732,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Fumigation and Freight Forwarding Facility"
},
"headers": {
Expand Down Expand Up @@ -5945,7 +5945,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Fumigation and Freight Forwarding Facility"
},
"headers": {
Expand Down Expand Up @@ -6618,7 +6618,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Airport Terminal Facility"
},
"headers": {
Expand Down Expand Up @@ -6831,7 +6831,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Airport Terminal Facility"
},
"headers": {
Expand Down Expand Up @@ -6901,7 +6901,12 @@
},
{
"type": "nlis",
"format": "^3ABCD123[a-zA-Z0-9]{8}$",
"format": "^[A-Z0-9]{8}[A-Z][A-Z][A-Z][A-Z0-9]{5}$",
"carriers": ["manual_entry"]
},
{
"type": "abn",
"format": "^(\\d *?){11}$",
"carriers": ["manual_entry"]
}
],
Expand Down
39 changes: 22 additions & 17 deletions packages/mock-app/src/constants/app-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -1376,7 +1376,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -1585,7 +1585,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -2524,7 +2524,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -2701,7 +2701,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -2882,7 +2882,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -3063,7 +3063,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -3265,7 +3265,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -3766,7 +3766,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -4183,7 +4183,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Orchard Facility"
},
"headers": {
Expand Down Expand Up @@ -4846,7 +4846,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Packhouse Facility"
},
"headers": {
Expand Down Expand Up @@ -5059,7 +5059,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Packhouse Facility"
},
"headers": {
Expand Down Expand Up @@ -5732,7 +5732,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Fumigation and Freight Forwarding Facility"
},
"headers": {
Expand Down Expand Up @@ -5945,7 +5945,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Fumigation and Freight Forwarding Facility"
},
"headers": {
Expand Down Expand Up @@ -6618,7 +6618,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Airport Terminal Facility"
},
"headers": {
Expand Down Expand Up @@ -6831,7 +6831,7 @@
"vckit": {
"vckitAPIUrl": "http://localhost:3332/v2",
"issuer": {
"id": "did:web:6028-115-79-212-164.ngrok-free.app",
"id": "did:web:uncefact.github.io:project-vckit:test-and-development",
"name": "Airport Terminal Facility"
},
"headers": {
Expand Down Expand Up @@ -6901,7 +6901,12 @@
},
{
"type": "nlis",
"format": "^3ABCD123[a-zA-Z0-9]{8}$",
"format": "^[A-Z0-9]{8}[A-Z][A-Z][A-Z][A-Z0-9]{5}$",
"carriers": ["manual_entry"]
},
{
"type": "abn",
"format": "^(\\d *?){11}$",
"carriers": ["manual_entry"]
}
],
Expand Down
10 changes: 10 additions & 0 deletions seeding/idr-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ GS1_IDENTIFIER_FILE="./seeding/idr-identifier.gs1.json"
# Path to the IDR identifier JSON file for nlis namespace
NLIS_IDENTIFIER_FILE="./seeding/idr-identifier.nlis.json"

# Path to the IDR identifier JSON file for nlis namespace
ATO_IDENTIFIER_FILE="./seeding/idr-identifier.ato.json"

# Wait for the service to be available
echo "Waiting for ${SERVICE_NAME} service to be ready..."

Expand Down Expand Up @@ -53,4 +56,11 @@ curl -X POST \
-H 'Content-Type: application/json' \
-d @"$NLIS_IDENTIFIER_FILE"

curl -X POST \
http://${IDR_SERVICE_HOST}:${IDR_SERVICE_PORT}/api/identifiers \
-H 'accept: application/json' \
-H "Authorization: Bearer ${IDR_SERVICE_API_KEY}" \
-H 'Content-Type: application/json' \
-d @"$ATO_IDENTIFIER_FILE"

printf "\nSeeding ${SERVICE_NAME} service data complete!\n\n"
14 changes: 14 additions & 0 deletions seeding/idr-identifier.ato.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"namespace": "ato",
"applicationIdentifiers": [
{
"title": "Australian Business Number",
"label": "Australian Business Number",
"shortcode": "abn",
"ai": "01",
"type": "I",
"regex": "^(\\d *?){11}$",
"qualifiers": []
}
]
}
2 changes: 1 addition & 1 deletion seeding/idr-identifier.nlis.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"shortcode": "nlis",
"ai": "01",
"type": "I",
"regex": "(3ABCD123[a-zA-Z0-9]{8})",
"regex": "^[A-Z0-9]{8}[A-Z][A-Z][A-Z][A-Z0-9]{5}$",
"qualifiers": []
}
]
Expand Down

0 comments on commit 201ffa2

Please sign in to comment.