Skip to content

Commit 19fe750

Browse files
committed
financial app work
1 parent 6ca5fac commit 19fe750

File tree

4 files changed

+522
-273
lines changed

4 files changed

+522
-273
lines changed

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,26 @@ const ToggleButton = styled.button`
6060
}
6161
`;
6262

63+
const CodePanel = styled.div`
64+
background: ${bankerPanel};
65+
border: 1px solid ${bankerAccent};
66+
border-radius: 8px;
67+
padding: 20px;
68+
color: ${bankerText};
69+
font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
70+
font-size: 0.98rem;
71+
white-space: pre-wrap;
72+
margin-top: 32px;
73+
margin-bottom: 32px;
74+
overflow-x: auto;
75+
`;
76+
77+
const CodeTitle = styled.div`
78+
font-weight: bold;
79+
color: ${bankerAccent};
80+
margin-bottom: 12px;
81+
`;
82+
6383
const APIs = () => {
6484
const [isCollapsed, setIsCollapsed] = useState(true);
6585
const [accountData, setAccountData] = useState([]);
@@ -168,6 +188,32 @@ const APIs = () => {
168188
)}
169189
</SidePanel>
170190

191+
{/* Code Panel for API Examples */}
192+
<CodePanel>
193+
<CodeTitle>ORDS REST API Example</CodeTitle>
194+
<code>
195+
{`// Get all accounts (GET)
196+
GET https://ij1tyzir3wpwlpe-financialdb.adb.eu-frankfurt-1.oraclecloudapps.com/ords/financial/accounts/
197+
198+
// Get a single account (GET)
199+
GET https://ij1tyzir3wpwlpe-financialdb.adb.eu-frankfurt-1.oraclecloudapps.com/ords/financial/accounts/{account_id}
200+
201+
// Create an account (POST)
202+
POST https://ij1tyzir3wpwlpe-financialdb.adb.eu-frankfurt-1.oraclecloudapps.com/ords/financial/accounts/
203+
Content-Type: application/json
204+
{
205+
"account_id": "A123",
206+
"account_name": "My Account",
207+
"account_type": "checking",
208+
"customer_id": "C456",
209+
"account_opened_date": "2024-06-11",
210+
"account_other_details": "details",
211+
"account_balance": 1000
212+
}
213+
`}
214+
</code>
215+
</CodePanel>
216+
171217
{/* Account Data Table */}
172218
<h3>Account Data</h3>
173219
{loading ? (

0 commit comments

Comments
 (0)