Repository navigation
Expand file tree
/
Copy pathpopulate_test_data.sh
More file actions
executable file
·60 lines (50 loc) · 1.77 KB
/
Copy pathpopulate_test_data.sh
File metadata and controls
executable file
·60 lines (50 loc) · 1.77 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
echo "📦 Populating Test Data"
echo "======================="
cd icp_backend
# Register test users
echo "👥 Registering test users..."
dfx canister call supply_chain_backend register_user '(record {
email="manufacturer@example.com";
first_name="John";
last_name="Manufacturer";
company="EcoTextiles Ltd.";
role=variant { Manufacturer }
})'
dfx canister call supply_chain_backend register_user '(record {
email="logistics@example.com";
first_name="Sarah";
last_name="Logistics";
company="GlobalShip Logistics";
role=variant { LogisticsProvider }
})'
# Register test products
echo "📦 Registering test products..."
dfx canister call supply_chain_backend register_product '(record {
name="Organic Cotton T-Shirt";
category="Apparel";
description=opt "100% organic cotton t-shirt with natural dyes";
batch_number=opt "BATCH-TEX-001";
production_date=1704067200000000000;
manufacturing_location="Mumbai, India";
raw_materials=vec { "Organic Cotton"; "Natural Dyes" };
certifications=vec { "GOTS Certified"; "Fair Trade" };
sustainability_score=opt 95.0;
estimated_value=opt 25.99
})'
dfx canister call supply_chain_backend register_product '(record {
name="Solar Power Bank";
category="Electronics";
description=opt "Portable solar-powered charging device";
batch_number=opt "BATCH-ELEC-001";
production_date=1704067200000000000;
manufacturing_location="Shenzhen, China";
raw_materials=vec { "Solar Cells"; "Lithium Battery"; "Recycled Aluminum" };
certifications=vec { "RoHS Compliant"; "Energy Star" };
sustainability_score=opt 85.0;
estimated_value=opt 89.99
})'
echo "✅ Test data populated!"
# Show analytics
echo "📊 Current analytics:"
dfx canister call supply_chain_backend get_analytics