Skip to content

Commit c04ee02

Browse files
committed
financial app work
1 parent fde254c commit c04ee02

File tree

18 files changed

+459
-152
lines changed

18 files changed

+459
-152
lines changed

financial/backend-springboot/src/main/java/oracleai/financial/FinancialController.java renamed to financial/backend-springboot/src/main/java/oracleai/financial/BackendController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//@CrossOrigin(origins = "https://oracledatabase-financial.org")
1919
@CrossOrigin(origins = "*")
2020
//@CrossOrigin(origins = "http://158.180.20.119")
21-
public class FinancialController {
21+
public class BackendController {
2222

2323
@Autowired
2424
private DataSource dataSource;

financial/frontend-react/src/pages/ATM.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ const ATM = () => {
257257
<iframe
258258
width="100%"
259259
height="315"
260-
src="https://www.youtube.com/embed/E1pOaCkd_PM"
260+
src="https://www.youtube.com/embed/rSn9cI2oRrA"
261261
title="YouTube video player"
262262
frameBorder="0"
263263
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"

financial/frontend-react/src/pages/Accounts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ const Accounts = () => {
291291
<iframe
292292
width="100%"
293293
height="315"
294-
src="https://www.youtube.com/embed/3p8X-i1y43U"
294+
src="https://www.youtube.com/embed/UljBwo_wGnE"
295295
title="YouTube video player"
296296
frameBorder="0"
297297
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"

financial/frontend-react/src/pages/Dashboard.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const DashBoard = () => {
8383
{/* Collapsible Section */}
8484
<CollapsibleSection>
8585
<CollapsibleHeader onClick={() => setShowCollapsible(!showCollapsible)}>
86-
{showCollapsible ? '▼' : '►'} Observability & Dashboards
86+
{showCollapsible ? '▼' : '►'} Show/Hide Developer Details
8787
</CollapsibleHeader>
8888
{showCollapsible && (
8989
<CollapsibleContent>
@@ -95,6 +95,18 @@ const DashBoard = () => {
9595
>
9696
Open Grafana Dashboard (admin/Welcome12345*)
9797
</a>
98+
<div style={{ marginTop: 24 }}>
99+
<iframe
100+
width="900"
101+
height="506"
102+
src="https://www.youtube.com/embed/Uuj9MCiYTPo"
103+
title="Developer Details"
104+
frameBorder="0"
105+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
106+
allowFullScreen
107+
style={{ borderRadius: '8px', border: `1px solid ${bankerAccent}`, background: '#fff' }}
108+
></iframe>
109+
</div>
98110
</CollapsibleContent>
99111
)}
100112
</CollapsibleSection>
@@ -135,18 +147,6 @@ const DashBoard = () => {
135147
alt="Technical Architecture"
136148
/>
137149
</ImageContainer>
138-
139-
{/* Grafana iframe */}
140-
<VideoContainer>
141-
<h4>Grafana Dashboard (admin/Welcome12345*):</h4>
142-
<iframe
143-
src="https://oracleai-financial.org/grafana"
144-
title="Grafana Dashboard"
145-
width="100%"
146-
height="1000"
147-
style={{ border: `1px solid ${bankerAccent}`, borderRadius: '8px', background: '#fff' }}
148-
></iframe>
149-
</VideoContainer>
150150
</PageContainer>
151151
);
152152
};

financial/frontend-react/src/pages/Graph.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ const Graph = () => {
247247
<iframe
248248
width="100%"
249249
height="315"
250-
src="https://www.youtube.com/embed/E1pOaCkd_PM"
250+
src="https://www.youtube.com/embed/DVzpuhxiNvw"
251251
title="YouTube video player"
252252
frameBorder="0"
253253
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"

financial/frontend-react/src/pages/Investments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ const Investments = () => {
215215
<iframe
216216
width="100%"
217217
height="315"
218-
src="https://www.youtube.com/embed/E1pOaCkd_PM"
218+
src="https://www.youtube.com/embed/fijnYAQ8zlk"
219219
title="YouTube video player"
220220
frameBorder="0"
221221
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"

financial/frontend-react/src/pages/Messaging.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const Messaging = () => {
131131
const [fromAccounts, setFromAccounts] = useState([]);
132132
const [result, setResult] = useState('');
133133
const [loading, setLoading] = useState(false);
134-
const [txnCrashOption, setTxnCrashOption] = useState('');
134+
const [txnCrashOption, setTxnCrashOption] = useState('noCrash');
135135
const [txnCrashResult, setTxnCrashResult] = useState('');
136136
const [orderResult, setOrderResult] = useState('');
137137
const [inventoryResult, setInventoryResult] = useState('');
@@ -147,13 +147,15 @@ const Messaging = () => {
147147
throw new Error(`HTTP error! status: ${response.status}`);
148148
}
149149
const data = await response.json();
150-
setFromAccounts(data.items || []);
150+
// Transactions.js expects data.items, fallback to data if not present
151+
const accounts = data.items || data;
152+
setFromAccounts(accounts);
151153
} catch (error) {
152154
console.error('Error fetching from accounts:', error);
153155
}
154156
};
155157
fetchFromAccounts();
156-
}, [BASE_URL]);
158+
}, [ACCOUNT_FETCH_URL]);
157159

158160
const handleChange = (e) => {
159161
const { name, value } = e.target;
@@ -204,8 +206,14 @@ const Messaging = () => {
204206
body: JSON.stringify(formData),
205207
});
206208
const text = await response.text();
207-
const data = text ? JSON.parse(text) : {};
208-
setOrderResult(JSON.stringify(data));
209+
// Try to parse JSON, otherwise show raw response
210+
let data;
211+
try {
212+
data = text ? JSON.parse(text) : {};
213+
setOrderResult(JSON.stringify(data));
214+
} catch (err) {
215+
setOrderResult(text); // Show raw response if not JSON
216+
}
209217
} catch (err) {
210218
setOrderResult('❌ Error: ' + err.message);
211219
} finally {
@@ -356,10 +364,12 @@ const Messaging = () => {
356364
<option value="" disabled>
357365
Select an account
358366
</option>
359-
{fromAccounts.map((account) => (
360-
<option key={account.ACCOUNT_ID} value={account.ACCOUNT_ID}>
361-
{account.ACCOUNT_ID}
362-
</option>
367+
{fromAccounts && fromAccounts.length > 0 && fromAccounts.map((account) => (
368+
account && account.ACCOUNT_ID ? (
369+
<option key={account.ACCOUNT_ID} value={account.ACCOUNT_ID}>
370+
{account.ACCOUNT_ID}
371+
</option>
372+
) : null
363373
))}
364374
</Select>
365375

financial/frontend-react/src/pages/StockTicker.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ const StockTicker = () => {
151151
const [customerIds, setCustomerIds] = useState([]);
152152

153153
useEffect(() => {
154-
fetch('https://oracleai-financial.org/financial/stockticker')
154+
fetch('https://oracleai-financial.org/financial/truecache/stockticker')
155155
.then(res => res.json())
156156
.then(data => setStockList(data))
157157
.catch(() => setStockList([]));
@@ -181,7 +181,7 @@ const StockTicker = () => {
181181
action,
182182
};
183183

184-
fetch('https://oracleai-financial.org/financial/stockbuyorsell', {
184+
fetch('https://oracleai-financial.org/financial/truecache/stockbuyorsell', {
185185
method: 'POST',
186186
headers: {
187187
'Content-Type': 'application/json',
@@ -192,7 +192,7 @@ const StockTicker = () => {
192192
.then((data) => {
193193
if (data.success) {
194194
setLastAction({ ticker: formData.stock, action });
195-
fetch('https://oracleai-financial.org/financial/stockticker')
195+
fetch('https://oracleai-financial.org/financial/truecache/stockticker')
196196
.then(res => res.json())
197197
.then(data => setStockList(data))
198198
.catch(() => setStockList([]));
@@ -261,7 +261,7 @@ const StockTicker = () => {
261261
<iframe
262262
width="100%"
263263
height="315"
264-
src="https://www.youtube.com/embed/E1pOaCkd_PM"
264+
src="https://www.youtube.com/embed/OHOlL9no2Sc"
265265
title="YouTube video player"
266266
frameBorder="0"
267267
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"

financial/kafka-tx-outbox-nft-purchase/kafka-txeventq-txoutbox/src/main/java/com/example/OKafkaProperties.java

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,26 @@
66
public class OKafkaProperties {
77
public static Properties getLocalConnectionProps(String ojdbcPropertiesFile,
88
Integer port) {
9-
Properties props = new Properties();
9+
Properties producerProps = new Properties();
1010
// We use the default PDB for Oracle Database 23ai.
11-
props.put("oracle.service.name", "freepdb1");
12-
// The localhost connection uses PLAINTEXT.
13-
props.put("security.protocol", "PLAINTEXT");
14-
props.put("bootstrap.servers", String.format("localhost:%d",
15-
Objects.requireNonNullElse(port, 1521)));
16-
props.put("oracle.net.tns_admin", ojdbcPropertiesFile);
17-
return props;
11+
// props.put("oracle.service.name", "freepdb1");
12+
// // The localhost connection uses PLAINTEXT.
13+
// props.put("security.protocol", "PLAINTEXT");
14+
// props.put("bootstrap.servers", String.format("localhost:%d",
15+
// Objects.requireNonNullElse(port, 1521)));
16+
// props.put("oracle.net.tns_admin", ojdbcPropertiesFile);
17+
18+
19+
20+
producerProps.put("security.protocol", "SSL");
21+
//location containing Oracle Wallet, tnsname.ora and ojdbc.properties file...
22+
// producerProps.put("oracle.net.tns_admin", "/oraclefinancial/creds"); //location of ojdbc.properties file
23+
producerProps.put("oracle.net.tns_admin", "/Users/pparkins/Downloads/Wallet_financialdb"); //location of ojdbc.properties file
24+
producerProps.put("tns.alias", "financialdb_high");
25+
producerProps.put("enable.idempotence", "true");
26+
producerProps.put("oracle.transactional.producer", "true");
27+
producerProps.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
28+
producerProps.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
29+
return producerProps;
1830
}
1931
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
user = testuser
2-
password = Welcome123#
1+
user = financial
2+
password = Welcome12345

0 commit comments

Comments
 (0)