ApiLogicServer 15.0.27__py3-none-any.whl → 15.0.32__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. api_logic_server_cli/add_cust/add_cust.py +4 -4
  2. api_logic_server_cli/api_logic_server.py +20 -5
  3. api_logic_server_cli/api_logic_server_info.yaml +3 -3
  4. api_logic_server_cli/cli.py +62 -11
  5. api_logic_server_cli/cli_args_base.py +1 -1
  6. api_logic_server_cli/create_from_model/__pycache__/dbml.cpython-312.pyc +0 -0
  7. api_logic_server_cli/create_from_model/dbml.py +1 -1
  8. api_logic_server_cli/create_from_model/ont_create.py +6 -1
  9. api_logic_server_cli/database/mcp.sqlite +0 -0
  10. api_logic_server_cli/fragments/mcp_admin.yml +11 -0
  11. api_logic_server_cli/genai/genai_admin_app.py +76 -23
  12. api_logic_server_cli/genai/genai_mcp.py +43 -0
  13. api_logic_server_cli/genai/genai_svcs.py +16 -15
  14. api_logic_server_cli/logging.yml +16 -1
  15. api_logic_server_cli/manager.py +26 -2
  16. api_logic_server_cli/prototypes/base/config/default.env +3 -0
  17. api_logic_server_cli/prototypes/base/devops/docker-compose-dev-azure/azure-deploy.sh +3 -3
  18. api_logic_server_cli/prototypes/base/devops/docker-compose-dev-local/docker-compose.sh +1 -1
  19. api_logic_server_cli/prototypes/base/ui/admin/admin_loader.py +2 -0
  20. api_logic_server_cli/prototypes/basic_demo/README.md +1 -1
  21. api_logic_server_cli/prototypes/basic_demo/customizations/database/db.sqlite +0 -0
  22. api_logic_server_cli/prototypes/basic_demo/customizations/database/models.py +0 -16
  23. api_logic_server_cli/prototypes/basic_demo/customizations/ui/admin/admin.yaml +0 -11
  24. api_logic_server_cli/prototypes/basic_demo/iteration/database/db.sqlite +0 -0
  25. api_logic_server_cli/prototypes/basic_demo/iteration/ui/admin/admin.yaml +4 -4
  26. api_logic_server_cli/prototypes/manager/README.md +1 -1
  27. api_logic_server_cli/prototypes/manager/samples/dbs/readme_samples.md +3 -0
  28. api_logic_server_cli/prototypes/manager/samples/readme_samples.md +3 -0
  29. api_logic_server_cli/prototypes/manager/system/app_model_editor/devops/docker-compose-dev-azure/azure-deploy.sh +1 -1
  30. api_logic_server_cli/prototypes/manager/system/app_model_editor/devops/docker-compose-dev-local-nginx/docker-compose.sh +1 -1
  31. api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/genai_demo_docs_logic/devops/docker-compose-dev-azure/azure-deploy.sh +1 -1
  32. api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/genai_demo_docs_logic/devops/docker-compose-dev-local/docker-compose.sh +1 -1
  33. api_logic_server_cli/prototypes/nw/ui/.DS_Store +0 -0
  34. api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/.DS_Store +0 -0
  35. api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/README.md +0 -2
  36. api_logic_server_cli/prototypes/nw/ui/reference_react_app/compile-errors.txt +324 -0
  37. api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/package-lock.json +24 -0
  38. api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/package.json +3 -0
  39. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/App.js +147 -0
  40. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Category.js +141 -0
  41. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Config.js +527 -0
  42. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Customer.js +193 -0
  43. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/CustomerDemographic.js +119 -0
  44. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Department.js +144 -0
  45. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Employee.js +213 -0
  46. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/EmployeeAudit.js +223 -0
  47. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/EmployeeTerritory.js +94 -0
  48. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Location.js +170 -0
  49. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Order.js +179 -0
  50. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/OrderDetail.js +201 -0
  51. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Product.js +226 -0
  52. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Region.js +104 -0
  53. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Shipper.js +120 -0
  54. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Supplier.js +143 -0
  55. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Territory.js +145 -0
  56. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Union.js +119 -0
  57. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/app_loader.js +24 -0
  58. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/.eslintrc +5 -0
  59. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/.yarnrc.yml +4 -0
  60. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/default-settings.js +25 -0
  61. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/default-settings.ts +25 -0
  62. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/errors.js +116 -0
  63. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/errors.ts +116 -0
  64. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/index.test.tsx +7 -0
  65. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/index.tsx +11 -0
  66. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/ra-jsonapi-client.js +577 -0
  67. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/ra-jsonapi-client.ts +577 -0
  68. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/resourceLookup.js +124 -0
  69. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/resourceLookup.ts +124 -0
  70. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/styles.module.css +9 -0
  71. api_logic_server_cli/prototypes/nw_no_cust/Tutorial.md +2 -2
  72. api_logic_server_cli/prototypes/sqlite/devops/docker-compose-dev-azure/azure-deploy.sh +1 -1
  73. api_logic_server_cli/{prototypes/basic_demo/customizations/logic/logic_discovery → templates}/mcp_client_executor_request.py +4 -2
  74. {apilogicserver-15.0.27.dist-info → apilogicserver-15.0.32.dist-info}/METADATA +1 -1
  75. {apilogicserver-15.0.27.dist-info → apilogicserver-15.0.32.dist-info}/RECORD +137 -120
  76. apilogicserver-15.0.32.dist-info/entry_points.txt +7 -0
  77. api_logic_server_cli/genai/genai_admin_app copy.py +0 -150
  78. api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-App-Resource-Learning-Prompt copy.md +0 -203
  79. api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/notes.md +0 -7
  80. api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/z-unused-Admin-App-Learning-Prompt.md +0 -179
  81. api_logic_server_cli/prototypes/nw/ui/react_admin/src/App.js +0 -58
  82. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Category.js +0 -82
  83. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Customer.js +0 -211
  84. api_logic_server_cli/prototypes/nw/ui/react_admin/src/CustomerDemographic.js +0 -57
  85. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Department.js +0 -98
  86. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Employee.js +0 -100
  87. api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeAudit.js +0 -106
  88. api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeTerritory.js +0 -98
  89. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Location.js +0 -87
  90. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Order.js +0 -98
  91. api_logic_server_cli/prototypes/nw/ui/react_admin/src/OrderDetail.js +0 -112
  92. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Product.js +0 -103
  93. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Region.js +0 -65
  94. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Shipper.js +0 -67
  95. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Supplier.js +0 -87
  96. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Territory.js +0 -90
  97. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Union.js +0 -61
  98. apilogicserver-15.0.27.dist-info/entry_points.txt +0 -3
  99. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/.DS_Store +0 -0
  100. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/README.md +0 -0
  101. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/README_create_react_app.md +0 -0
  102. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/package-lock.json +0 -0
  103. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/package.json +0 -0
  104. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/public/favicon.ico +0 -0
  105. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/public/index.html +0 -0
  106. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/public/logo192.png +0 -0
  107. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/public/logo512.png +0 -0
  108. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/public/manifest.json +0 -0
  109. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/public/robots.txt +0 -0
  110. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/App.css +0 -0
  111. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/App.js +0 -0
  112. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/App.test.js +0 -0
  113. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/Config-reference.js +0 -0
  114. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/Config.js +0 -0
  115. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/Customer-reference.js +0 -0
  116. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/Customer.js +0 -0
  117. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/Item.js +0 -0
  118. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/Order.js +0 -0
  119. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/Product.js +0 -0
  120. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/SysEmail.js +0 -0
  121. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/SysMcp.js +0 -0
  122. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/app_loader.js +0 -0
  123. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/index.css +0 -0
  124. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/index.js +0 -0
  125. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/logo.svg +0 -0
  126. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/.eslintrc +0 -0
  127. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/.yarnrc.yml +0 -0
  128. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/default-settings.js +0 -0
  129. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/default-settings.ts +0 -0
  130. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/errors.js +0 -0
  131. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/errors.ts +0 -0
  132. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/index.test.tsx +0 -0
  133. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/index.tsx +0 -0
  134. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/ra-jsonapi-client.js +0 -0
  135. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/ra-jsonapi-client.ts +0 -0
  136. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/resourceLookup.js +0 -0
  137. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/resourceLookup.ts +0 -0
  138. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/styles.module.css +0 -0
  139. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/reportWebVitals.js +0 -0
  140. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/setupTests.js +0 -0
  141. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/README_create_react_app.md +0 -0
  142. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/public/favicon.ico +0 -0
  143. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/public/index.html +0 -0
  144. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/public/logo192.png +0 -0
  145. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/public/logo512.png +0 -0
  146. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/public/manifest.json +0 -0
  147. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/public/robots.txt +0 -0
  148. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/App.css +0 -0
  149. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/App.test.js +0 -0
  150. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/SampleDBVersion.js +0 -0
  151. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/dataProvider.js +0 -0
  152. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/index.css +0 -0
  153. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/index.js +0 -0
  154. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/logo.svg +0 -0
  155. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/reportWebVitals.js +0 -0
  156. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/setupTests.js +0 -0
  157. {apilogicserver-15.0.27.dist-info → apilogicserver-15.0.32.dist-info}/WHEEL +0 -0
  158. {apilogicserver-15.0.27.dist-info → apilogicserver-15.0.32.dist-info}/licenses/LICENSE +0 -0
  159. {apilogicserver-15.0.27.dist-info → apilogicserver-15.0.32.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,193 @@
1
+ // begin MANDATORY imports (always generated EXACTLY)
2
+ import React from 'react';
3
+ import { List, FunctionField, Datagrid, TextField, EmailField, DateField, NumberField } from 'react-admin';
4
+ import { ReferenceField, ReferenceManyField } from 'react-admin';
5
+ import { TabbedShowLayout, Tab, SimpleShowLayout, TextInput, NumberInput, DateTimeInput } from 'react-admin';
6
+ import { ReferenceInput, SelectInput, SimpleForm, Show, Edit, Create } from 'react-admin';
7
+ import { Filter, Pagination, BooleanField, BooleanInput, Labeled } from 'react-admin';
8
+ import { EditButton, DeleteButton, CreateButton, ShowButton } from 'react-admin';
9
+ import { Grid, Typography, Box, Divider, Button } from '@mui/material';
10
+ import { useRecordContext, useRedirect, Link, required } from 'react-admin';
11
+ import AddIcon from '@mui/icons-material/Add';
12
+ // end mandatory imports
13
+
14
+ const CustomerFilter = (props) => (
15
+ <Filter {...props}>
16
+ <TextInput label="Search by Company Name" source="CompanyName" alwaysOn />
17
+ <BooleanInput label="Email Opt Out" source="email_opt_out" />
18
+ </Filter>
19
+ );
20
+
21
+ // Customer List
22
+ export const CustomerList = (props) => (
23
+ <List filters={<CustomerFilter />} {...props} sort={{ field: 'CompanyName', order: 'ASC' }} pagination={<Pagination rowsPerPageOptions={[5, 10, 25]} showFirstLastButtons />}>
24
+ <Datagrid rowClick="show">
25
+ <TextField source="CompanyName" label="Company Name" />
26
+ <TextField source="ContactName" label="Contact Name" />
27
+ <TextField source="City" label="City" />
28
+ <TextField source="Country" label="Country" />
29
+ <NumberField source="Balance" label="Balance" options={{ style: 'currency', currency: 'USD' }} />
30
+ <EditButton />
31
+ <DeleteButton />
32
+ </Datagrid>
33
+ </List>
34
+ );
35
+
36
+ // Customer Show
37
+ export const CustomerShow = (props) => (
38
+ <Show {...props}>
39
+ <SimpleShowLayout>
40
+ <Box sx={{ mb: 3 }}>
41
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
42
+ Customer Information
43
+ </Typography>
44
+ <Grid container spacing={3} sx={{ mb: 2 }}>
45
+ <Grid item xs={12} sm={6} md={3}>
46
+ <Box sx={{ p: 1 }}>
47
+ <Labeled label="Company Name">
48
+ <TextField source="CompanyName" />
49
+ </Labeled>
50
+ </Box>
51
+ </Grid>
52
+ <Grid item xs={12} sm={6} md={3}>
53
+ <Box sx={{ p: 1 }}>
54
+ <Labeled label="Balance">
55
+ <NumberField source="Balance" options={{ style: 'currency', currency: 'USD' }} />
56
+ </Labeled>
57
+ </Box>
58
+ </Grid>
59
+ <Grid item xs={12} sm={6} md={3}>
60
+ <Box sx={{ p: 1 }}>
61
+ <Labeled label="Contact Name">
62
+ <TextField source="ContactName" />
63
+ </Labeled>
64
+ </Box>
65
+ </Grid>
66
+ <Grid item xs={12} sm={6} md={3}>
67
+ <Box sx={{ p: 1 }}>
68
+ <Labeled label="Contact Title">
69
+ <TextField source="ContactTitle" />
70
+ </Labeled>
71
+ </Box>
72
+ </Grid>
73
+ </Grid>
74
+ <Divider sx={{ my: 2 }} />
75
+ </Box>
76
+ </SimpleShowLayout>
77
+ <TabbedShowLayout>
78
+ <Tab label="Orders">
79
+ <ReferenceManyField reference="Order" target="CustomerId" addLabel={false} pagination={<Pagination />}>
80
+ <Datagrid rowClick="show">
81
+ <TextField source="Id" label="Order ID" />
82
+ <TextField source="ShipName" label="Ship Name" />
83
+ <DateField source="OrderDate" label="Order Date" />
84
+ <NumberField source="AmountTotal" label="Amount Total" options={{ style: 'currency', currency: 'USD' }} />
85
+ <DateField source="ShippedDate" label="Shipped Date" />
86
+ <EditButton />
87
+ <DeleteButton />
88
+ </Datagrid>
89
+ </ReferenceManyField>
90
+ <AddOrderButton />
91
+ </Tab>
92
+ </TabbedShowLayout>
93
+ </Show>
94
+ );
95
+
96
+ // Custom Add Order Button
97
+ const AddOrderButton = () => {
98
+ const record = useRecordContext();
99
+ const redirect = useRedirect();
100
+
101
+ const handleClick = () => {
102
+ redirect(`/Order/create?source=${encodeURIComponent(JSON.stringify({ CustomerId: record?.id }))}`);
103
+ };
104
+
105
+ return (
106
+ <Button
107
+ variant="contained"
108
+ color="primary"
109
+ startIcon={<AddIcon />}
110
+ onClick={handleClick}
111
+ sx={{ mt: 2 }}
112
+ >
113
+ Add New Order
114
+ </Button>
115
+ );
116
+ };
117
+
118
+ // Customer Create
119
+ export const CustomerCreate = (props) => (
120
+ <Create {...props}>
121
+ <SimpleForm>
122
+ <Box sx={{ mb: 3 }}>
123
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
124
+ Create New Customer
125
+ </Typography>
126
+ <Grid container spacing={3} sx={{ mb: 2 }}>
127
+ <Grid item xs={12} sm={6} md={4}>
128
+ <Box sx={{ p: 1 }}>
129
+ <TextInput source="CompanyName" label="Company Name" fullWidth validate={required()} />
130
+ </Box>
131
+ </Grid>
132
+ <Grid item xs={12} sm={6} md={4}>
133
+ <Box sx={{ p: 1 }}>
134
+ <TextInput source="ContactName" label="Contact Name" fullWidth />
135
+ </Box>
136
+ </Grid>
137
+ <Grid item xs={12} sm={6} md={4}>
138
+ <Box sx={{ p: 1 }}>
139
+ <NumberInput source="Balance" label="Balance" fullWidth />
140
+ </Box>
141
+ </Grid>
142
+ <Grid item xs={12} sm={6} md={4}>
143
+ <Box sx={{ p: 1 }}>
144
+ <TextInput source="ContactTitle" label="Contact Title" fullWidth />
145
+ </Box>
146
+ </Grid>
147
+ </Grid>
148
+ </Box>
149
+ </SimpleForm>
150
+ </Create>
151
+ );
152
+
153
+ // Customer Edit
154
+ export const CustomerEdit = (props) => (
155
+ <Edit {...props} redirect={false}>
156
+ <SimpleForm>
157
+ <Box sx={{ mb: 3 }}>
158
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
159
+ Edit Customer
160
+ </Typography>
161
+ <Grid container spacing={3} sx={{ mb: 2 }}>
162
+ <Grid item xs={12} sm={6} md={4}>
163
+ <Box sx={{ p: 1 }}>
164
+ <TextInput source="CompanyName" label="Company Name" fullWidth validate={required()} />
165
+ </Box>
166
+ </Grid>
167
+ <Grid item xs={12} sm={6} md={4}>
168
+ <Box sx={{ p: 1 }}>
169
+ <TextInput source="ContactName" label="Contact Name" fullWidth />
170
+ </Box>
171
+ </Grid>
172
+ <Grid item xs={12} sm={6} md={4}>
173
+ <Box sx={{ p: 1 }}>
174
+ <NumberInput source="Balance" label="Balance" fullWidth />
175
+ </Box>
176
+ </Grid>
177
+ <Grid item xs={12} sm={6} md={4}>
178
+ <Box sx={{ p: 1 }}>
179
+ <TextInput source="ContactTitle" label="Contact Title" fullWidth />
180
+ </Box>
181
+ </Grid>
182
+ </Grid>
183
+ </Box>
184
+ </SimpleForm>
185
+ </Edit>
186
+ );
187
+
188
+ export default {
189
+ list: CustomerList,
190
+ show: CustomerShow,
191
+ create: CustomerCreate,
192
+ edit: CustomerEdit,
193
+ };
@@ -0,0 +1,119 @@
1
+ // begin MANDATORY imports (always generated EXACTLY)
2
+ import React from 'react';
3
+ import { List, FunctionField, Datagrid, TextField, EmailField, DateField, NumberField } from 'react-admin';
4
+ import { ReferenceField, ReferenceManyField } from 'react-admin';
5
+ import { TabbedShowLayout, Tab, SimpleShowLayout, TextInput, NumberInput, DateTimeInput } from 'react-admin';
6
+ import { ReferenceInput, SelectInput, SimpleForm, Show, Edit, Create } from 'react-admin';
7
+ import { Filter, Pagination, BooleanField, BooleanInput, Labeled } from 'react-admin';
8
+ import { EditButton, DeleteButton, CreateButton, ShowButton } from 'react-admin';
9
+ import { Grid, Typography, Box, Divider, Button } from '@mui/material';
10
+ import { useRecordContext, useRedirect, Link, required } from 'react-admin';
11
+ import AddIcon from '@mui/icons-material/Add';
12
+ // end mandatory imports
13
+
14
+ const CustomerDemographicFilter = (props) => (
15
+ <div {...props}>
16
+ <TextInput label="Search by ID" source="Id" alwaysOn />
17
+ </div>
18
+ );
19
+
20
+ // CustomerDemographic List
21
+ export const CustomerDemographicList = (props) => {
22
+ return (
23
+ <List filters={<CustomerDemographicFilter />} {...props} sort={{ field: 'Id', order: 'ASC' }} pagination={<Pagination rowsPerPageOptions={[5, 10, 25]} />}>
24
+ <Datagrid rowClick="show">
25
+ <TextField source="Id" label="ID" />
26
+ <TextField source="CustomerDesc" label="Customer Description" />
27
+ </Datagrid>
28
+ </List>
29
+ );
30
+ };
31
+
32
+ // CustomerDemographic Show
33
+ export const CustomerDemographicShow = (props) => {
34
+ return (
35
+ <Show {...props}>
36
+ <SimpleShowLayout>
37
+ <Box sx={{ mb: 3 }}>
38
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
39
+ Customer Demographic Information
40
+ </Typography>
41
+ <Grid container spacing={2}>
42
+ <Grid item xs={12}>
43
+ <Labeled label="ID">
44
+ <TextField source="Id" />
45
+ </Labeled>
46
+ </Grid>
47
+ <Grid item xs={12}>
48
+ <Labeled label="Customer Description">
49
+ <TextField source="CustomerDesc" />
50
+ </Labeled>
51
+ </Grid>
52
+ </Grid>
53
+ <Divider sx={{ my: 2 }} />
54
+ </Box>
55
+ </SimpleShowLayout>
56
+ </Show>
57
+ );
58
+ };
59
+
60
+ // CustomerDemographic Create
61
+ export const CustomerDemographicCreate = (props) => {
62
+ return (
63
+ <Create {...props}>
64
+ <SimpleForm>
65
+ <Box sx={{ mb: 3 }}>
66
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
67
+ Create New Customer Demographic
68
+ </Typography>
69
+ <Grid container spacing={3} sx={{ mb: 2 }}>
70
+ <Grid item xs={12} sm={6} md={4}>
71
+ <Box sx={{ p: 1 }}>
72
+ <TextInput source="Id" label="ID" fullWidth validate={required()} />
73
+ </Box>
74
+ </Grid>
75
+ <Grid item xs={12} sm={6} md={8}>
76
+ <Box sx={{ p: 1 }}>
77
+ <TextInput source="CustomerDesc" label="Customer Description" fullWidth />
78
+ </Box>
79
+ </Grid>
80
+ </Grid>
81
+ </Box>
82
+ </SimpleForm>
83
+ </Create>
84
+ );
85
+ };
86
+
87
+ // CustomerDemographic Edit
88
+ export const CustomerDemographicEdit = (props) => {
89
+ return (
90
+ <Edit {...props}>
91
+ <SimpleForm>
92
+ <Box sx={{ mb: 3 }}>
93
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
94
+ Edit Customer Demographic
95
+ </Typography>
96
+ <Grid container spacing={3} sx={{ mb: 2 }}>
97
+ <Grid item xs={12} sm={6} md={4}>
98
+ <Box sx={{ p: 1 }}>
99
+ <TextInput source="Id" label="ID" fullWidth disabled />
100
+ </Box>
101
+ </Grid>
102
+ <Grid item xs={12} sm={6} md={8}>
103
+ <Box sx={{ p: 1 }}>
104
+ <TextInput source="CustomerDesc" label="Customer Description" fullWidth />
105
+ </Box>
106
+ </Grid>
107
+ </Grid>
108
+ </Box>
109
+ </SimpleForm>
110
+ </Edit>
111
+ );
112
+ };
113
+
114
+ export default {
115
+ list: CustomerDemographicList,
116
+ show: CustomerDemographicShow,
117
+ create: CustomerDemographicCreate,
118
+ edit: CustomerDemographicEdit,
119
+ };
@@ -0,0 +1,144 @@
1
+ // begin MANDATORY imports (always generated EXACTLY)
2
+ import React from 'react';
3
+ import { List, FunctionField, Datagrid, TextField, EmailField, DateField, NumberField } from 'react-admin';
4
+ import { ReferenceField, ReferenceManyField } from 'react-admin';
5
+ import { TabbedShowLayout, Tab, SimpleShowLayout, TextInput, NumberInput, DateTimeInput } from 'react-admin';
6
+ import { ReferenceInput, SelectInput, SimpleForm, Show, Edit, Create } from 'react-admin';
7
+ import { Filter, Pagination, BooleanField, BooleanInput, Labeled } from 'react-admin';
8
+ import { EditButton, DeleteButton, CreateButton, ShowButton } from 'react-admin';
9
+ import { Grid, Typography, Box, Divider, Button } from '@mui/material';
10
+ import { useRecordContext, useRedirect, Link, required } from 'react-admin';
11
+ import AddIcon from '@mui/icons-material/Add';
12
+ // end mandatory imports
13
+
14
+ export const DepartmentList = (props) => (
15
+ <List {...props} sort={{ field: 'DepartmentName', order: 'ASC' }} pagination={<Pagination rowsPerPageOptions={[5, 10, 25]} showFirstLastButtons />}>
16
+ <Datagrid rowClick="show">
17
+ <TextField source="DepartmentName" label="Department Name" />
18
+ <NumberField source="SecurityLevel" label="Security Level" />
19
+ </Datagrid>
20
+ </List>
21
+ );
22
+
23
+ // Department Show
24
+ export const DepartmentShow = (props) => (
25
+ <Show {...props}>
26
+ <SimpleShowLayout>
27
+ <Box sx={{ mb: 3 }}>
28
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
29
+ Department Information
30
+ </Typography>
31
+ <Grid container spacing={3} sx={{ mb: 2 }}>
32
+ <Grid item xs={12} sm={6} md={3}>
33
+ <Box sx={{ p: 1 }}>
34
+ <Labeled label="Department Name">
35
+ <TextField source="DepartmentName" />
36
+ </Labeled>
37
+ </Box>
38
+ </Grid>
39
+ <Grid item xs={12} sm={6} md={3}>
40
+ <Box sx={{ p: 1 }}>
41
+ <Labeled label="Security Level">
42
+ <NumberField source="SecurityLevel" />
43
+ </Labeled>
44
+ </Box>
45
+ </Grid>
46
+ </Grid>
47
+ <Divider sx={{ my: 2 }} />
48
+ </Box>
49
+ </SimpleShowLayout>
50
+ <TabbedShowLayout>
51
+ <Tab label="Employee List">
52
+ <ReferenceManyField reference="Employee" target="OnLoanDepartmentId" addLabel={false} pagination={<Pagination />}>
53
+ <Datagrid rowClick="show">
54
+ <TextField source="LastName" label="Last Name" />
55
+ <TextField source="FirstName" label="First Name" />
56
+ <DateField source="HireDate" label="Hire Date" />
57
+ <EditButton />
58
+ <DeleteButton />
59
+ </Datagrid>
60
+ </ReferenceManyField>
61
+ <AddEmployeeButton />
62
+ </Tab>
63
+ </TabbedShowLayout>
64
+ </Show>
65
+ );
66
+
67
+ // Custom Add Employee Button
68
+ const AddEmployeeButton = () => {
69
+ const record = useRecordContext();
70
+ const redirect = useRedirect();
71
+
72
+ const handleClick = () => {
73
+ redirect(`/Employee/create?source=${encodeURIComponent(JSON.stringify({ OnLoanDepartmentId: record?.id }))}`);
74
+ };
75
+
76
+ return (
77
+ <Button
78
+ variant="contained"
79
+ color="primary"
80
+ startIcon={<AddIcon />}
81
+ onClick={handleClick}
82
+ sx={{ mt: 2 }}
83
+ >
84
+ Add New Employee
85
+ </Button>
86
+ );
87
+ };
88
+
89
+ // Department Create
90
+ export const DepartmentCreate = (props) => (
91
+ <Create {...props}>
92
+ <SimpleForm>
93
+ <Box sx={{ mb: 3 }}>
94
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
95
+ Create New Department
96
+ </Typography>
97
+ <Grid container spacing={3} sx={{ mb: 2 }}>
98
+ <Grid item xs={12} sm={6} md={4}>
99
+ <Box sx={{ p: 1 }}>
100
+ <TextInput source="DepartmentName" label="Department Name" fullWidth />
101
+ </Box>
102
+ </Grid>
103
+ <Grid item xs={12} sm={6} md={4}>
104
+ <Box sx={{ p: 1 }}>
105
+ <NumberInput source="SecurityLevel" label="Security Level" fullWidth />
106
+ </Box>
107
+ </Grid>
108
+ </Grid>
109
+ </Box>
110
+ </SimpleForm>
111
+ </Create>
112
+ );
113
+
114
+ // Department Edit
115
+ export const DepartmentEdit = (props) => (
116
+ <Edit {...props} redirect={false}>
117
+ <SimpleForm>
118
+ <Box sx={{ mb: 3 }}>
119
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
120
+ Edit Department
121
+ </Typography>
122
+ <Grid container spacing={3} sx={{ mb: 2 }}>
123
+ <Grid item xs={12} sm={6} md={4}>
124
+ <Box sx={{ p: 1 }}>
125
+ <TextInput source="DepartmentName" label="Department Name" fullWidth />
126
+ </Box>
127
+ </Grid>
128
+ <Grid item xs={12} sm={6} md={4}>
129
+ <Box sx={{ p: 1 }}>
130
+ <NumberInput source="SecurityLevel" label="Security Level" fullWidth />
131
+ </Box>
132
+ </Grid>
133
+ </Grid>
134
+ </Box>
135
+ </SimpleForm>
136
+ </Edit>
137
+ );
138
+
139
+ export default {
140
+ list: DepartmentList,
141
+ show: DepartmentShow,
142
+ create: DepartmentCreate,
143
+ edit: DepartmentEdit,
144
+ };
@@ -0,0 +1,213 @@
1
+ // begin MANDATORY imports (always generated EXACTLY)
2
+ import React from 'react';
3
+ import { List, FunctionField, Datagrid, TextField, EmailField, DateField, NumberField } from 'react-admin';
4
+ import { ReferenceField, ReferenceManyField } from 'react-admin';
5
+ import { TabbedShowLayout, Tab, SimpleShowLayout, TextInput, NumberInput, DateTimeInput } from 'react-admin';
6
+ import { ReferenceInput, SelectInput, SimpleForm, Show, Edit, Create } from 'react-admin';
7
+ import { Filter, Pagination, BooleanField, BooleanInput, Labeled } from 'react-admin';
8
+ import { EditButton, DeleteButton, CreateButton, ShowButton } from 'react-admin';
9
+ import { Grid, Typography, Box, Divider, Button } from '@mui/material';
10
+ import { useRecordContext, useRedirect, Link, required } from 'react-admin';
11
+ import AddIcon from '@mui/icons-material/Add';
12
+ // end mandatory imports
13
+
14
+ const EmployeeFilter = (props) => (
15
+ <Filter {...props}>
16
+ <TextInput label="Search" source="LastName" alwaysOn />
17
+ </Filter>
18
+ );
19
+
20
+ // Employee List
21
+ export const EmployeeList = (props) => {
22
+ return (
23
+ <List filters={<EmployeeFilter />} {...props} sort={{ field: 'LastName', order: 'ASC' }} pagination={<Pagination rowsPerPageOptions={[5, 10, 25]} showFirstLastButtons />}>
24
+ <Datagrid rowClick="show">
25
+ <TextField source="LastName" label="Last Name" />
26
+ <TextField source="FirstName" label="First Name" />
27
+ <EmailField source="Email" label="Email" />
28
+ <NumberField source="Salary" label="Salary" options={{ style: 'currency', currency: 'USD'}} />
29
+ <ReferenceField source="WorksForDepartmentId" reference="Department" label="Department">
30
+ <TextField source="DepartmentName" />
31
+ </ReferenceField>
32
+ <EditButton />
33
+ <DeleteButton />
34
+ <ShowButton />
35
+ </Datagrid>
36
+ </List>
37
+ );
38
+ };
39
+
40
+ // Employee Show
41
+ export const EmployeeShow = (props) => {
42
+ return (
43
+ <Show {...props}>
44
+ <SimpleShowLayout>
45
+ <Box sx={{ mb: 3 }}>
46
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
47
+ Employee Information
48
+ </Typography>
49
+ <Grid container spacing={3} sx={{ mb: 2 }}>
50
+ <Grid item xs={12} sm={6} md={3}>
51
+ <Box sx={{ p: 1 }}>
52
+ <Labeled label="Last Name">
53
+ <TextField source="LastName" />
54
+ </Labeled>
55
+ </Box>
56
+ </Grid>
57
+ <Grid item xs={12} sm={6} md={3}>
58
+ <Box sx={{ p: 1 }}>
59
+ <Labeled label="First Name">
60
+ <TextField source="FirstName" />
61
+ </Labeled>
62
+ </Box>
63
+ </Grid>
64
+ <Grid item xs={12} sm={6} md={3}>
65
+ <Box sx={{ p: 1 }}>
66
+ <Labeled label="Salary">
67
+ <NumberField source="Salary" options={{ style: 'currency', currency: 'USD'}} />
68
+ </Labeled>
69
+ </Box>
70
+ </Grid>
71
+ <Grid item xs={12} sm={6} md={3}>
72
+ <Box sx={{ p: 1 }}>
73
+ <Labeled label="Email">
74
+ <EmailField source="Email" />
75
+ </Labeled>
76
+ </Box>
77
+ </Grid>
78
+ </Grid>
79
+ <Divider sx={{ my: 2 }} />
80
+ </Box>
81
+ </SimpleShowLayout>
82
+ <TabbedShowLayout>
83
+ <Tab label="Audit Logs">
84
+ <ReferenceManyField reference="EmployeeAudit" target="EmployeeId" addLabel={false} pagination={<Pagination />}>
85
+ <Datagrid rowClick="show">
86
+ <TextField source="Id" label="Audit ID" />
87
+ <TextField source="LastName" label="Last Name" />
88
+ <TextField source="FirstName" label="First Name" />
89
+ <DateField source="CreatedOn" label="Created On" />
90
+ <EditButton />
91
+ <DeleteButton />
92
+ </Datagrid>
93
+ </ReferenceManyField>
94
+ </Tab>
95
+ <Tab label="Territories">
96
+ <ReferenceManyField reference="EmployeeTerritory" target="EmployeeId" addLabel={false} pagination={<Pagination />}>
97
+ <Datagrid rowClick="show">
98
+ <NumberField source="TerritoryId" label="Territory ID" />
99
+ <EditButton />
100
+ <DeleteButton />
101
+ </Datagrid>
102
+ </ReferenceManyField>
103
+ </Tab>
104
+ <Tab label="Order History">
105
+ <ReferenceManyField reference="Order" target="EmployeeId" addLabel={false} pagination={<Pagination />}>
106
+ <Datagrid rowClick="show">
107
+ <TextField source="Id" label="Order ID" />
108
+ <DateField source="OrderDate" label="Order Date" />
109
+ <NumberField source="AmountTotal" label="Total Amount" options={{ style: 'currency', currency: 'USD'}} />
110
+ <EditButton />
111
+ <DeleteButton />
112
+ </Datagrid>
113
+ </ReferenceManyField>
114
+ </Tab>
115
+ </TabbedShowLayout>
116
+ </Show>
117
+ );
118
+ };
119
+
120
+ // Employee Create
121
+ export const EmployeeCreate = (props) => {
122
+ return (
123
+ <Create {...props}>
124
+ <SimpleForm>
125
+ <Box sx={{ mb: 3 }}>
126
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
127
+ Create New Employee
128
+ </Typography>
129
+ <Grid container spacing={3} sx={{ mb: 2 }}>
130
+ <Grid item xs={12} sm={6} md={4}>
131
+ <Box sx={{ p: 1 }}>
132
+ <TextInput source="LastName" label="Last Name" fullWidth validate={required()} />
133
+ </Box>
134
+ </Grid>
135
+ <Grid item xs={12} sm={6} md={4}>
136
+ <Box sx={{ p: 1 }}>
137
+ <TextInput source="FirstName" label="First Name" fullWidth />
138
+ </Box>
139
+ </Grid>
140
+ <Grid item xs={12} sm={6} md={4}>
141
+ <Box sx={{ p: 1 }}>
142
+ <TextInput source="Email" label="Email" fullWidth />
143
+ </Box>
144
+ </Grid>
145
+ <Grid item xs={12} sm={6} md={4}>
146
+ <Box sx={{ p: 1 }}>
147
+ <NumberInput source="Salary" label="Salary" fullWidth />
148
+ </Box>
149
+ </Grid>
150
+ <Grid item xs={12} sm={6} md={4}>
151
+ <Box sx={{ p: 1 }}>
152
+ <ReferenceInput source="WorksForDepartmentId" reference="Department" fullWidth>
153
+ <SelectInput optionText="DepartmentName" validate={required()} />
154
+ </ReferenceInput>
155
+ </Box>
156
+ </Grid>
157
+ </Grid>
158
+ </Box>
159
+ </SimpleForm>
160
+ </Create>
161
+ );
162
+ };
163
+
164
+ // Employee Edit
165
+ export const EmployeeEdit = (props) => {
166
+ return (
167
+ <Edit {...props} redirect={false}>
168
+ <SimpleForm>
169
+ <Box sx={{ mb: 3 }}>
170
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
171
+ Edit Employee
172
+ </Typography>
173
+ <Grid container spacing={3} sx={{ mb: 2 }}>
174
+ <Grid item xs={12} sm={6} md={4}>
175
+ <Box sx={{ p: 1 }}>
176
+ <TextInput source="LastName" label="Last Name" fullWidth validate={required()} />
177
+ </Box>
178
+ </Grid>
179
+ <Grid item xs={12} sm={6} md={4}>
180
+ <Box sx={{ p: 1 }}>
181
+ <TextInput source="FirstName" label="First Name" fullWidth />
182
+ </Box>
183
+ </Grid>
184
+ <Grid item xs={12} sm={6} md={4}>
185
+ <Box sx={{ p: 1 }}>
186
+ <TextInput source="Email" label="Email" fullWidth />
187
+ </Box>
188
+ </Grid>
189
+ <Grid item xs={12} sm={6} md={4}>
190
+ <Box sx={{ p: 1 }}>
191
+ <NumberInput source="Salary" label="Salary" fullWidth />
192
+ </Box>
193
+ </Grid>
194
+ <Grid item xs={12} sm={6} md={4}>
195
+ <Box sx={{ p: 1 }}>
196
+ <ReferenceInput source="WorksForDepartmentId" reference="Department" fullWidth>
197
+ <SelectInput optionText="DepartmentName" validate={required()} />
198
+ </ReferenceInput>
199
+ </Box>
200
+ </Grid>
201
+ </Grid>
202
+ </Box>
203
+ </SimpleForm>
204
+ </Edit>
205
+ );
206
+ };
207
+
208
+ export default {
209
+ list: EmployeeList,
210
+ show: EmployeeShow,
211
+ create: EmployeeCreate,
212
+ edit: EmployeeEdit,
213
+ };