Conversation
✅ Deploy Preview for tradetrust-gallery ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughUpdates 12 OpenAttestation certificate JSON fixture files with refreshed identifiers, UUIDs, metadata, addresses, product details, network references, timestamps, and cryptographic signatures without modifying document schemas or structural layouts. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Fix all issues with AI agents
In `@public/static/OA/certificate-of-origin-default.json`:
- Line 41: Update the ISO country code values to uppercase for the certificate
JSON: change the exporter and manufacturer "countryCode" fields (the entries
currently set to "In" and "in") to "IN" in certificate-of-origin-default.json,
then recompute the document's targetHash/merkleRoot and re-sign the document so
signatures remain valid; ensure other related keys (e.g., exportCountry.code and
originCountry.code) remain consistent with the updated "countryCode" fields.
In `@public/static/OA/certificate-of-origin-expired.json`:
- Line 84: Fix the leading space in the invoice id: locate the JSON entry with
key "iD" whose value is "18e20857-4ab6-4761-bcad-723b78b30cd1:string:
INV-XYZ-0001" in certificate-of-origin-expired.json and remove the space before
"INV-XYZ-0001" so the value matches the other IDs (no leading whitespace).
- Line 41: The certificate-of-origin fixtures contain inconsistent casing for
India in the countryCode field (e.g. the value
"1286192d-9dcb-443a-a7cf-b5b7ef5429f1:string:In" and similar "…:in"); update all
occurrences of that countryCode in certificate-of-origin-expired.json,
certificate-of-origin-revoked.json, and certificate-of-origin-default.json so
the ISO 3166-1 alpha-2 code is uppercase "IN" (preserve the rest of the
string/UUID prefix and only change the trailing country code portion).
In `@public/static/OA/certificate-of-origin-revoked.json`:
- Line 81: The invoice reference values for the "iD" field contain a leading
space before the invoice code (e.g., "iD":
"38626513-3a69-4969-9076-c6009eba8aad:string: INV-XYZ-0001"); remove the extra
space so the value reads "...string:INV-XYZ-0001" (no space) in the affected
fixtures and repeat the same fix for the other instances where "iD" holds a
value with ": INV-..." to ensure consistency across all OA certificate fixtures.
- Line 38: Update the JSON entries where the key "countryCode" uses incorrect
casing ("In" or "in") to the uppercase ISO alpha-2 value "IN"; specifically
search the certificate-of-origin JSON fixtures
(certificate-of-origin-revoked.json, certificate-of-origin-default.json,
certificate-of-origin-expired.json) for any "countryCode" values that are not
"IN" and replace them with "IN" to ensure consistent uppercase country codes.
In `@public/static/OA/warehouse-receipt-inoperative.json`:
- Line 7: The issuer name in this JSON uses "DEMO" instead of the consistent
"DEMO STORE"; update the "name" entry value (the string that contains
"5a6f729e-...:string:DEMO") to use "DEMO STORE" instead, and make the same
replacement in the sibling files bill-of-lading-inoperative.json,
bill-of-lading-operative.json, and warehouse-receipt-operative.json; after
changing the issuer string, recompute and update any dependent integrity fields
(e.g., targetHash and merkleRoot) in each affected file so their hashes match
the modified content.
🧹 Nitpick comments (1)
public/static/OA/electronic-promissory-note-operative.json (1)
32-56: Document payload fields look reasonable for a demo fixture.All drawer/drawee details, amounts, and signer metadata are plausible sample data. Minor observation: the dates (
dueDate,signerTimeStamp,commitmentDate) are all2025-06-19, which is in the past relative to the current date (February 2026). This is fine for gallery demo fixtures, but if the intent is to showcase a currently "operative" promissory note, consider using a future date to avoid any confusion when viewers check the document against the current date.
| "cityName": "1b78ad6e-00fc-4e30-ac80-001557030664:string:Mumbai", | ||
| "postcode": "2050ea9a-73c6-4357-9202-2eca9fa0a207:string:400001", | ||
| "countrySubDivisionName": "70cc8e28-86a6-442f-bacc-09c334392f91:string:Maharashtra", | ||
| "countryCode": "15ce7594-0206-4866-8330-32e57970e653:string:In" |
There was a problem hiding this comment.
Inconsistent country code casing: "In" and "in" instead of "IN".
ISO 3166-1 alpha-2 country codes are conventionally uppercase. The exporter's countryCode at Line 41 is "In" and the manufacturer's countryCode at Line 73 is "in", while other references in this file (e.g., exportCountry.code, originCountry.code) correctly use uppercase "IN". If a renderer or validator enforces strict casing, these mismatches could cause unexpected behavior in the gallery demo.
Note: Fixing these values would require re-computing the document's targetHash/merkleRoot and re-signing.
Also applies to: 73-73
🤖 Prompt for AI Agents
In `@public/static/OA/certificate-of-origin-default.json` at line 41, Update the
ISO country code values to uppercase for the certificate JSON: change the
exporter and manufacturer "countryCode" fields (the entries currently set to
"In" and "in") to "IN" in certificate-of-origin-default.json, then recompute the
document's targetHash/merkleRoot and re-sign the document so signatures remain
valid; ensure other related keys (e.g., exportCountry.code and
originCountry.code) remain consistent with the updated "countryCode" fields.
| "cityName": "f0004d72-8d37-48fd-8afc-85095106ba2a:string:Mumbai", | ||
| "postcode": "4bc465c4-2238-4fab-8b46-3ba4058a655b:string:400001", | ||
| "countrySubDivisionName": "d0ee0b55-8350-47e1-9146-dbaf25f3e0e2:string:Maharashtra", | ||
| "countryCode": "1286192d-9dcb-443a-a7cf-b5b7ef5429f1:string:In" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# First, check if the file exists and examine the relevant lines
echo "=== Checking certificate-of-origin-expired.json ==="
if [ -f "public/static/OA/certificate-of-origin-expired.json" ]; then
echo "File found. Checking lines around 41, 73, 32, and 93:"
sed -n '30,35p; 39,43p; 71,75p; 91,95p' "public/static/OA/certificate-of-origin-expired.json" | cat -n
else
echo "File not found at specified path"
fi
echo -e "\n=== Searching for all countryCode entries in OA fixtures ==="
rg -n 'countryCode.*:string:' --glob 'public/static/OA/*.json' | head -30Repository: TradeTrust/gallery
Length of output: 2637
🏁 Script executed:
#!/bin/bash
# More comprehensive search: check all country codes and their casing patterns
echo "=== All country codes in OA JSON fixtures (with casing) ==="
rg -o '"countryCode":\s*"[^:]+:string:([A-Za-z]{2})"' --glob 'public/static/OA/*.json' -r '$1' | sort | uniq -c | sort -rnRepository: TradeTrust/gallery
Length of output: 688
🏁 Script executed:
#!/bin/bash
# Count total OA JSON fixture files
echo "=== Total OA JSON fixture files ==="
find public/static/OA -name '*.json' -type f | wc -l
echo ""
echo "=== List of all OA JSON files ==="
find public/static/OA -name '*.json' -type f | sortRepository: TradeTrust/gallery
Length of output: 815
🏁 Script executed:
#!/bin/bash
# Check for India country codes across ALL OA files (both uppercase and non-uppercase)
echo "=== All India country code occurrences (case-insensitive search) ==="
rg -i '"countryCode".*:string:(in|IN)"' --glob 'public/static/OA/*.json' public/static/OA/Repository: TradeTrust/gallery
Length of output: 898
Fix inconsistent India country code casing across certificate-of-origin fixtures.
ISO 3166-1 alpha-2 country codes must be uppercase. The correct code is "IN", but three certificate-of-origin JSON files use inconsistent casing:
certificate-of-origin-expired.json: line 41 uses"In"(mixed case), line 73 uses"in"(lowercase)certificate-of-origin-revoked.json: line 38 uses"In", line 70 uses"in"certificate-of-origin-default.json: line 41 uses"In", line 73 uses"in"
Systems performing case-sensitive string comparisons against these codes may behave unexpectedly.
Proposed fixes
For certificate-of-origin-expired.json:
- "countryCode": "1286192d-9dcb-443a-a7cf-b5b7ef5429f1:string:In"
+ "countryCode": "1286192d-9dcb-443a-a7cf-b5b7ef5429f1:string:IN"- "countryCode": "79968cd7-3233-4487-ae42-529a9a2ed1c8:string:in"
+ "countryCode": "79968cd7-3233-4487-ae42-529a9a2ed1c8:string:IN"Apply the same fixes to certificate-of-origin-revoked.json and certificate-of-origin-default.json.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "countryCode": "1286192d-9dcb-443a-a7cf-b5b7ef5429f1:string:In" | |
| "countryCode": "1286192d-9dcb-443a-a7cf-b5b7ef5429f1:string:IN" |
🤖 Prompt for AI Agents
In `@public/static/OA/certificate-of-origin-expired.json` at line 41, The
certificate-of-origin fixtures contain inconsistent casing for India in the
countryCode field (e.g. the value
"1286192d-9dcb-443a-a7cf-b5b7ef5429f1:string:In" and similar "…:in"); update all
occurrences of that countryCode in certificate-of-origin-expired.json,
certificate-of-origin-revoked.json, and certificate-of-origin-default.json so
the ISO 3166-1 alpha-2 code is uppercase "IN" (preserve the rest of the
string/UUID prefix and only change the trailing country code portion).
| }, | ||
| "iD": "8bd77660-6084-459d-9723-163be4408ce6:string: INV-XYZ-0001", | ||
| "formattedIssueDateTime": "d92e4c92-2002-481b-ba9d-6f7e503c9c34:string:2025-06-10T10:09:00.000Z" | ||
| "iD": "18e20857-4ab6-4761-bcad-723b78b30cd1:string: INV-XYZ-0001", |
There was a problem hiding this comment.
Leading space in invoice ID.
The invoice iD value is " INV-XYZ-0001" (note the space before INV). This appears to be a typo — all other IDs in this document have no leading whitespace.
Proposed fix
- "iD": "18e20857-4ab6-4761-bcad-723b78b30cd1:string: INV-XYZ-0001",
+ "iD": "18e20857-4ab6-4761-bcad-723b78b30cd1:string:INV-XYZ-0001",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "iD": "18e20857-4ab6-4761-bcad-723b78b30cd1:string: INV-XYZ-0001", | |
| "iD": "18e20857-4ab6-4761-bcad-723b78b30cd1:string:INV-XYZ-0001", |
🤖 Prompt for AI Agents
In `@public/static/OA/certificate-of-origin-expired.json` at line 84, Fix the
leading space in the invoice id: locate the JSON entry with key "iD" whose value
is "18e20857-4ab6-4761-bcad-723b78b30cd1:string: INV-XYZ-0001" in
certificate-of-origin-expired.json and remove the space before "INV-XYZ-0001" so
the value matches the other IDs (no leading whitespace).
| "cityName": "5175dfcf-4420-4733-8d94-26448d4363c9:string:Mumbai", | ||
| "postcode": "bb156798-3fdf-4105-87f3-56c4c31a85e1:string:400001", | ||
| "countrySubDivisionName": "e2b98415-bac9-41bd-8d34-5602546750d2:string:Maharashtra", | ||
| "countryCode": "06e4833c-09c8-403d-aaa5-4ec2dea32aa7:string:In" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# First, verify the specific file exists and check the mentioned lines
echo "=== Checking if file exists ==="
if [ -f "public/static/OA/certificate-of-origin-revoked.json" ]; then
echo "File found"
echo ""
echo "=== Content around line 38 ==="
sed -n '35,40p' public/static/OA/certificate-of-origin-revoked.json
echo ""
echo "=== Content around line 70 ==="
sed -n '68,73p' public/static/OA/certificate-of-origin-revoked.json
else
echo "File not found"
fi
echo ""
echo "=== Searching for lowercase/mixed-case countryCode values ==="
rg -n 'countryCode.*:string:[a-z]' --glob '*.json' public/static/OA/
echo ""
echo "=== All countryCode values in OA files for comparison ==="
rg -n 'countryCode' --glob '*.json' public/static/OA/ | head -50Repository: TradeTrust/gallery
Length of output: 2705
Inconsistent country code casing: "In" should be "IN".
ISO 3166-1 alpha-2 country codes are uppercase by convention. The exporter's countryCode on Line 38 is "In" while other country codes in this document use uppercase ("GB"). The manufacturer's countryCode on Line 70 is "in" (lowercase).
The same casing inconsistency pattern appears in other OA certificate files in this PR:
certificate-of-origin-default.json: Line 41 has"In", Line 73 has"in"certificate-of-origin-expired.json: Line 41 has"In", Line 73 has"in"
Fix all occurrences to use uppercase "IN" for consistency.
Proposed fix for certificate-of-origin-revoked.json
Line 38:
- "countryCode": "06e4833c-09c8-403d-aaa5-4ec2dea32aa7:string:In"
+ "countryCode": "06e4833c-09c8-403d-aaa5-4ec2dea32aa7:string:IN"Line 70:
- "countryCode": "040fac9b-be45-48be-b57a-e035ac7c267f:string:in"
+ "countryCode": "040fac9b-be45-48be-b57a-e035ac7c267f:string:IN"🤖 Prompt for AI Agents
In `@public/static/OA/certificate-of-origin-revoked.json` at line 38, Update the
JSON entries where the key "countryCode" uses incorrect casing ("In" or "in") to
the uppercase ISO alpha-2 value "IN"; specifically search the
certificate-of-origin JSON fixtures (certificate-of-origin-revoked.json,
certificate-of-origin-default.json, certificate-of-origin-expired.json) for any
"countryCode" values that are not "IN" and replace them with "IN" to ensure
consistent uppercase country codes.
| }, | ||
| "iD": "7b53d5ff-1822-4c47-8bbe-2c734dfc90ec:string: INV-XYZ-0001", | ||
| "formattedIssueDateTime": "e519c226-4769-4069-9f5c-c0d6a61b5ff3:string:2025-06-10T10:09:00.000Z" | ||
| "iD": "38626513-3a69-4969-9076-c6009eba8aad:string: INV-XYZ-0001", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# First, check the specific file and line mentioned
echo "=== Checking certificate-of-origin-revoked.json at line 81 ==="
sed -n '75,87p' public/static/OA/certificate-of-origin-revoked.json | cat -A
echo ""
echo "=== Searching for leading spaces after :string: across all OA fixture files ==="
rg -n ':string: ' --glob '*.json' public/static/OA/
echo ""
echo "=== Count of matches ==="
rg ':string: ' --glob '*.json' public/static/OA/ | wc -lRepository: TradeTrust/gallery
Length of output: 1597
Fix leading spaces in invoice reference IDs across OA certificate fixtures.
The value "iD": "38626513-3a69-4969-9076-c6009eba8aad:string: INV-XYZ-0001" contains a leading space before INV. This pattern exists in 4 fixture files:
public/static/OA/certificate-of-origin-revoked.json:81public/static/OA/certificate-of-origin-expired.json:84public/static/OA/certificate-of-origin-default.json:84public/static/OA/certificate-of-origin-redacted.json:48
Proposed fix
- "iD": "38626513-3a69-4969-9076-c6009eba8aad:string: INV-XYZ-0001",
+ "iD": "38626513-3a69-4969-9076-c6009eba8aad:string:INV-XYZ-0001",🤖 Prompt for AI Agents
In `@public/static/OA/certificate-of-origin-revoked.json` at line 81, The invoice
reference values for the "iD" field contain a leading space before the invoice
code (e.g., "iD": "38626513-3a69-4969-9076-c6009eba8aad:string: INV-XYZ-0001");
remove the extra space so the value reads "...string:INV-XYZ-0001" (no space) in
the affected fixtures and repeat the same fix for the other instances where "iD"
holds a value with ": INV-..." to ensure consistency across all OA certificate
fixtures.
| "id": "66dc87b4-42ef-4b47-b74a-ebd5c3d42d75:string:did:ethr:0x433097a1C1b8a3e9188d8C54eCC057B1D69f1638", | ||
| "name": "ceebbab5-5358-41fb-9291-7d3c2bdbba0b:string:DEMO", | ||
| "id": "8bf86153-6ff5-4263-a49b-8a633c810e6d:string:did:ethr:0x433097a1C1b8a3e9188d8C54eCC057B1D69f1638", | ||
| "name": "5a6f729e-2834-43b7-9175-40bc67ba7213:string:DEMO", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check issuer names across all OA JSON files in the PR to confirm inconsistency
echo "=== Issuer names across OA gallery docs ==="
fd --type f --extension json . public/static/OA/ --exec grep -oP '"name":\s*"[^:]*:string:(\w+[^"]*)"' {} + | sed 's/.*string://' | sort | uniq -c | sort -rnRepository: TradeTrust/gallery
Length of output: 1110
🏁 Script executed:
#!/bin/bash
# More detailed check - show which files use which issuer names
echo "=== Breakdown by file ==="
fd --type f --extension json . public/static/OA/ | while read file; do
issuer=$(grep -oP '"name":\s*"[^:]*:string:([^"]*)"' "$file" | head -1 | sed 's/.*string://')
echo "$file: $issuer"
done | sortRepository: TradeTrust/gallery
Length of output: 925
Issuer name inconsistency: Multiple files use "DEMO" instead of "DEMO STORE".
Four documents use "DEMO" as the issuer name (bill-of-lading-inoperative.json, bill-of-lading-operative.json, warehouse-receipt-inoperative.json, warehouse-receipt-operative.json), while all other documents in this PR—invoices, certificates of origin, and promissory notes—use "DEMO STORE". This creates an inconsistent pattern across the OA gallery. If the different issuer names are intentional for logistics vs. commercial documents, please clarify; otherwise, align all files to use "DEMO STORE" and update the respective targetHash/merkleRoot values.
🤖 Prompt for AI Agents
In `@public/static/OA/warehouse-receipt-inoperative.json` at line 7, The issuer
name in this JSON uses "DEMO" instead of the consistent "DEMO STORE"; update the
"name" entry value (the string that contains "5a6f729e-...:string:DEMO") to use
"DEMO STORE" instead, and make the same replacement in the sibling files
bill-of-lading-inoperative.json, bill-of-lading-operative.json, and
warehouse-receipt-operative.json; after changing the issuer string, recompute
and update any dependent integrity fields (e.g., targetHash and merkleRoot) in
each affected file so their hashes match the modified content.
Summary
Updating gallery docs to use DNS-DID and DNS-TXT.
Changes
Updated all gallery docs under OpenAttestation (Legacy)
Issues
TT-1205
Summary by CodeRabbit