Skip to content

Commit 21432a0

Browse files
committed
financial app work
1 parent 4cd9f8c commit 21432a0

File tree

7 files changed

+610
-359
lines changed

7 files changed

+610
-359
lines changed

financial/react-frontend/src/components/Sidebar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ const Sidebar = () => {
238238
<img src="/images/Side Menu Icons/Transfer to External Bank.svg" alt="Transfer to brokerage accounts" />
239239
</IconWrapper>
240240
<TextContainer>
241-
<HighlightedText>Transfer to brokerage accounts</HighlightedText>
241+
<HighlightedText>Assets/Inventory Management</HighlightedText>
242242
{showDetails && <div>
243243
Kafka and TxEventQ <br />
244244
FSGBU

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

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ const Accounts = () => {
183183
const [formData, setFormData] = useState({
184184
_id: '',
185185
accountName: '',
186-
accountType: '',
186+
accountType: 'checking', // Default to "checking"
187187
customerId: '',
188188
accountOpenedDate: new Date().toISOString().split('T')[0],
189189
accountOtherDetails: '',
@@ -215,7 +215,11 @@ const Accounts = () => {
215215
const payload = {
216216
...formData,
217217
accountId: formData._id,
218+
accountName: '1000', // Always send "1000" as the value
218219
accountCustomerId: formData.customerId,
220+
accountOpenedDate: new Date().toISOString().split('T')[0], // Always use current date
221+
accountOtherDetails: '', // Always send empty string
222+
accountBalance: 1000, // Always send 1000
219223
};
220224

221225
try {
@@ -232,9 +236,8 @@ const Accounts = () => {
232236
setFormData({
233237
_id: '',
234238
accountName: '',
235-
accountType: '',
239+
accountType: 'checking', // Default to "checking"
236240
customerId: '',
237-
accountOpenedDate: new Date().toISOString().split('T')[0],
238241
accountOtherDetails: '',
239242
accountBalance: '',
240243
writeOption: 'MongoDB API accessing Oracle Database',
@@ -373,17 +376,6 @@ const Accounts = () => {
373376
required
374377
/>
375378

376-
<Label htmlFor="accountName">Account Name</Label>
377-
<Input
378-
type="text"
379-
id="accountName"
380-
name="accountName"
381-
value={formData.accountName}
382-
onChange={handleChange}
383-
placeholder="Enter account name"
384-
required
385-
/>
386-
387379
<Label htmlFor="accountType">Account Type</Label>
388380
<Select
389381
id="accountType"
@@ -398,24 +390,27 @@ const Accounts = () => {
398390
<option value="brokerage">brokerage</option>
399391
</Select>
400392

401-
<Label htmlFor="customerId">Customer ID</Label>
393+
<Label htmlFor="customerId">Customer Name / ID</Label>
402394
<Input
403395
type="text"
404396
id="customerId"
405397
name="customerId"
406398
value={formData.customerId}
407399
onChange={handleChange}
408-
placeholder="Enter customer ID"
400+
placeholder="Enter customer Name / ID"
409401
required
410402
/>
411403

412-
<Label htmlFor="accountOpenedDate">Opened Date</Label>
404+
{/* Remove these lines from the form */}
405+
{/*
406+
<Label htmlFor="accountName">Account Name</Label>
413407
<Input
414-
type="date"
415-
id="accountOpenedDate"
416-
name="accountOpenedDate"
417-
value={formData.accountOpenedDate}
408+
type="text"
409+
id="accountName"
410+
name="accountName"
411+
value={formData.accountName}
418412
onChange={handleChange}
413+
placeholder="Enter account name"
419414
required
420415
/>
421416
@@ -428,17 +423,7 @@ const Accounts = () => {
428423
onChange={handleChange}
429424
placeholder="Enter other details"
430425
/>
431-
432-
<Label htmlFor="accountBalance">Balance</Label>
433-
<Input
434-
type="number"
435-
id="accountBalance"
436-
name="accountBalance"
437-
value={formData.accountBalance}
438-
onChange={handleChange}
439-
placeholder="Enter balance"
440-
required
441-
/>
426+
*/}
442427

443428
{/* Write Data Using */}
444429
<h4>Write data using...</h4>
@@ -495,10 +480,6 @@ const Accounts = () => {
495480
</div>
496481
</Form>
497482

498-
<Form onSubmit={handleSubmit}>
499-
{/* ...form fields and radio buttons as before... */}
500-
</Form>
501-
502483
{/* Table to display all accounts */}
503484
{loading ? (
504485
<p>Loading accounts...</p>

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

Lines changed: 81 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,41 @@ const ResultBox = styled.div`
102102
white-space: pre-wrap;
103103
`;
104104

105+
const TwoColumnContainer = styled.div`
106+
display: flex;
107+
gap: 32px;
108+
width: 100%;
109+
@media (max-width: 900px) {
110+
flex-direction: column;
111+
gap: 0;
112+
}
113+
`;
114+
115+
const LeftColumn = styled.div`
116+
flex: 2;
117+
min-width: 320px;
118+
`;
119+
120+
const RightColumn = styled.div`
121+
flex: 1;
122+
min-width: 320px;
123+
background: ${bankerPanel};
124+
border: 1px solid ${bankerAccent};
125+
border-radius: 8px;
126+
padding: 20px;
127+
color: ${bankerText};
128+
font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
129+
font-size: 0.98rem;
130+
white-space: pre-wrap;
131+
overflow-x: auto;
132+
`;
133+
134+
const CodeTitle = styled.div`
135+
font-weight: bold;
136+
color: ${bankerAccent};
137+
margin-bottom: 12px;
138+
`;
139+
105140
const Investments = () => {
106141
const [isCollapsed, setIsCollapsed] = useState(true);
107142
const [searchText, setSearchText] = useState("advise as to my financial situation");
@@ -150,6 +185,22 @@ const Investments = () => {
150185
}
151186
};
152187

188+
const codeSnippet = `// Oracle Database Vector Search (PL/SQL)
189+
SELECT *
190+
FROM financial_docs
191+
WHERE VECTOR_SEARCH('compliance', :query)
192+
ORDER BY score DESC
193+
FETCH FIRST 5 ROWS ONLY;
194+
195+
// Call MCP from PL/SQL
196+
DECLARE
197+
result VARCHAR2(4000);
198+
BEGIN
199+
result := MCP.GET_MARKET_DATA('AAPL');
200+
DBMS_OUTPUT.PUT_LINE(result);
201+
END;
202+
`;
203+
153204
return (
154205
<PageContainer>
155206
<h2>Process: Get personal financial insights</h2>
@@ -227,26 +278,36 @@ const Investments = () => {
227278
)}
228279
</SidePanel>
229280

230-
{/* Search Form */}
231-
<SearchForm onSubmit={handleSearch}>
232-
<SearchLabel htmlFor="searchText">Search:</SearchLabel>
233-
<SearchInput
234-
type="text"
235-
id="searchText"
236-
name="searchText"
237-
value={searchText}
238-
onChange={e => setSearchText(e.target.value)}
239-
/>
240-
<SearchButton type="submit" disabled={loading}>
241-
{loading ? "Searching..." : "Search"}
242-
</SearchButton>
243-
</SearchForm>
244-
{searchResult && (
245-
<ResultBox>
246-
<strong>Result:</strong>
247-
<div>{searchResult}</div>
248-
</ResultBox>
249-
)}
281+
{/* Search and Code Snippet Section */}
282+
<TwoColumnContainer>
283+
<LeftColumn>
284+
<SearchForm onSubmit={handleSearch}>
285+
<SearchLabel htmlFor="searchText">Search:</SearchLabel>
286+
<SearchInput
287+
type="text"
288+
id="searchText"
289+
name="searchText"
290+
value={searchText}
291+
onChange={e => setSearchText(e.target.value)}
292+
/>
293+
<SearchButton type="submit" disabled={loading}>
294+
{loading ? "Searching..." : "Search"}
295+
</SearchButton>
296+
</SearchForm>
297+
{searchResult && (
298+
<ResultBox>
299+
<strong>Result:</strong>
300+
<div>{searchResult}</div>
301+
</ResultBox>
302+
)}
303+
</LeftColumn>
304+
<RightColumn>
305+
<CodeTitle>Sample Vector Search & MCP Source Code</CodeTitle>
306+
<code>
307+
{codeSnippet}
308+
</code>
309+
</RightColumn>
310+
</TwoColumnContainer>
250311
</PageContainer>
251312
);
252313
};

0 commit comments

Comments
 (0)