ApiLogicServer 15.0.27__py3-none-any.whl → 15.0.28__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 (124) hide show
  1. api_logic_server_cli/api_logic_server.py +2 -2
  2. api_logic_server_cli/cli.py +1 -1
  3. api_logic_server_cli/genai/genai_admin_app.py +11 -6
  4. api_logic_server_cli/genai/genai_svcs.py +3 -3
  5. api_logic_server_cli/logging.yml +16 -1
  6. api_logic_server_cli/prototypes/nw/ui/.DS_Store +0 -0
  7. api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/.DS_Store +0 -0
  8. api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/README.md +0 -2
  9. api_logic_server_cli/prototypes/nw/ui/reference_react_app/compile-errors.txt +324 -0
  10. api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/package-lock.json +24 -0
  11. api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/package.json +3 -0
  12. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/App.js +147 -0
  13. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Category.js +141 -0
  14. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Config.js +527 -0
  15. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Customer.js +193 -0
  16. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/CustomerDemographic.js +119 -0
  17. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Department.js +144 -0
  18. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Employee.js +213 -0
  19. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/EmployeeAudit.js +223 -0
  20. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/EmployeeTerritory.js +94 -0
  21. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Location.js +170 -0
  22. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Order.js +179 -0
  23. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/OrderDetail.js +201 -0
  24. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Product.js +226 -0
  25. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Region.js +104 -0
  26. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Shipper.js +120 -0
  27. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Supplier.js +143 -0
  28. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Territory.js +145 -0
  29. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Union.js +119 -0
  30. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/app_loader.js +24 -0
  31. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/.eslintrc +5 -0
  32. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/.yarnrc.yml +4 -0
  33. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/default-settings.js +25 -0
  34. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/default-settings.ts +25 -0
  35. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/errors.js +116 -0
  36. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/errors.ts +116 -0
  37. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/index.test.tsx +7 -0
  38. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/index.tsx +11 -0
  39. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/ra-jsonapi-client.js +577 -0
  40. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/ra-jsonapi-client.ts +577 -0
  41. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/resourceLookup.js +124 -0
  42. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/resourceLookup.ts +124 -0
  43. api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/styles.module.css +9 -0
  44. {apilogicserver-15.0.27.dist-info → apilogicserver-15.0.28.dist-info}/METADATA +1 -1
  45. {apilogicserver-15.0.27.dist-info → apilogicserver-15.0.28.dist-info}/RECORD +107 -91
  46. api_logic_server_cli/prototypes/nw/ui/react_admin/src/App.js +0 -58
  47. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Category.js +0 -82
  48. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Customer.js +0 -211
  49. api_logic_server_cli/prototypes/nw/ui/react_admin/src/CustomerDemographic.js +0 -57
  50. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Department.js +0 -98
  51. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Employee.js +0 -100
  52. api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeAudit.js +0 -106
  53. api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeTerritory.js +0 -98
  54. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Location.js +0 -87
  55. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Order.js +0 -98
  56. api_logic_server_cli/prototypes/nw/ui/react_admin/src/OrderDetail.js +0 -112
  57. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Product.js +0 -103
  58. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Region.js +0 -65
  59. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Shipper.js +0 -67
  60. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Supplier.js +0 -87
  61. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Territory.js +0 -90
  62. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Union.js +0 -61
  63. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/.DS_Store +0 -0
  64. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/README.md +0 -0
  65. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/README_create_react_app.md +0 -0
  66. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/package-lock.json +0 -0
  67. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/package.json +0 -0
  68. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/public/favicon.ico +0 -0
  69. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/public/index.html +0 -0
  70. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/public/logo192.png +0 -0
  71. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/public/logo512.png +0 -0
  72. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/public/manifest.json +0 -0
  73. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/public/robots.txt +0 -0
  74. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/App.css +0 -0
  75. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/App.js +0 -0
  76. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/App.test.js +0 -0
  77. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/Config-reference.js +0 -0
  78. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/Config.js +0 -0
  79. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/Customer-reference.js +0 -0
  80. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/Customer.js +0 -0
  81. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/Item.js +0 -0
  82. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/Order.js +0 -0
  83. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/Product.js +0 -0
  84. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/SysEmail.js +0 -0
  85. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/SysMcp.js +0 -0
  86. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/app_loader.js +0 -0
  87. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/index.css +0 -0
  88. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/index.js +0 -0
  89. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/logo.svg +0 -0
  90. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/.eslintrc +0 -0
  91. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/.yarnrc.yml +0 -0
  92. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/default-settings.js +0 -0
  93. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/default-settings.ts +0 -0
  94. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/errors.js +0 -0
  95. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/errors.ts +0 -0
  96. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/index.test.tsx +0 -0
  97. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/index.tsx +0 -0
  98. /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
  99. /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
  100. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/resourceLookup.js +0 -0
  101. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/resourceLookup.ts +0 -0
  102. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/rav4-jsonapi-client/styles.module.css +0 -0
  103. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/reportWebVitals.js +0 -0
  104. /api_logic_server_cli/prototypes/basic_demo/customizations/ui/{basic_demo_app → reference_react_app}/src/setupTests.js +0 -0
  105. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/README_create_react_app.md +0 -0
  106. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/public/favicon.ico +0 -0
  107. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/public/index.html +0 -0
  108. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/public/logo192.png +0 -0
  109. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/public/logo512.png +0 -0
  110. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/public/manifest.json +0 -0
  111. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/public/robots.txt +0 -0
  112. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/App.css +0 -0
  113. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/App.test.js +0 -0
  114. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/SampleDBVersion.js +0 -0
  115. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/dataProvider.js +0 -0
  116. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/index.css +0 -0
  117. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/index.js +0 -0
  118. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/logo.svg +0 -0
  119. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/reportWebVitals.js +0 -0
  120. /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/setupTests.js +0 -0
  121. {apilogicserver-15.0.27.dist-info → apilogicserver-15.0.28.dist-info}/WHEEL +0 -0
  122. {apilogicserver-15.0.27.dist-info → apilogicserver-15.0.28.dist-info}/entry_points.txt +0 -0
  123. {apilogicserver-15.0.27.dist-info → apilogicserver-15.0.28.dist-info}/licenses/LICENSE +0 -0
  124. {apilogicserver-15.0.27.dist-info → apilogicserver-15.0.28.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,201 @@
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 OrderDetailList = (props) => {
15
+ return (
16
+ <List {...props} sort={{ field: 'Id', order: 'ASC' }}>
17
+ <Datagrid rowClick="show">
18
+ <TextField source="Id" label="ID" />
19
+ <ReferenceField source="ProductId" reference="Product" label="Product">
20
+ <TextField source="ProductName" />
21
+ </ReferenceField>
22
+ <ReferenceField source="OrderId" reference="Order" label="Order">
23
+ <TextField source="Id" />
24
+ </ReferenceField>
25
+ <NumberField source="UnitPrice" label="Unit Price" options={{ style: 'currency', currency: 'USD' }} />
26
+ <NumberField source="Quantity" label="Quantity" />
27
+ <NumberField source="Discount" label="Discount" />
28
+ <NumberField source="Amount" label="Amount" options={{ style: 'currency', currency: 'USD' }} />
29
+ <DateField source="ShippedDate" label="Shipped Date" />
30
+ <EditButton />
31
+ <DeleteButton />
32
+ </Datagrid>
33
+ </List>
34
+ );
35
+ };
36
+
37
+ // Order Detail Show
38
+ export const OrderDetailShow = (props) => {
39
+ return (
40
+ <Show {...props}>
41
+ <SimpleShowLayout>
42
+ <Box sx={{ mb: 3 }}>
43
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
44
+ Order Detail
45
+ </Typography>
46
+ <Grid container spacing={2} sx={{ mb: 2 }}>
47
+ <Grid item xs={12} sm={6} md={3}>
48
+ <Box sx={{ p: 1 }}>
49
+ <Labeled label="ID">
50
+ <TextField source="Id" />
51
+ </Labeled>
52
+ </Box>
53
+ </Grid>
54
+ <Grid item xs={12} sm={6} md={3}>
55
+ <Box sx={{ p: 1 }}>
56
+ <Labeled label="Product">
57
+ <ReferenceField source="ProductId" reference="Product">
58
+ <TextField source="ProductName" />
59
+ </ReferenceField>
60
+ </Labeled>
61
+ </Box>
62
+ </Grid>
63
+ <Grid item xs={12} sm={6} md={3}>
64
+ <Box sx={{ p: 1 }}>
65
+ <Labeled label="Order">
66
+ <ReferenceField source="OrderId" reference="Order">
67
+ <TextField source="Id" />
68
+ </ReferenceField>
69
+ </Labeled>
70
+ </Box>
71
+ </Grid>
72
+ <Grid item xs={12} sm={6} md={3}>
73
+ <Box sx={{ p: 1 }}>
74
+ <Labeled label="Unit Price">
75
+ <NumberField source="UnitPrice" options={{ style: 'currency', currency: 'USD' }} />
76
+ </Labeled>
77
+ </Box>
78
+ </Grid>
79
+ <Grid item xs={12} sm={6} md={3}>
80
+ <Box sx={{ p: 1 }}>
81
+ <Labeled label="Quantity">
82
+ <NumberField source="Quantity" />
83
+ </Labeled>
84
+ </Box>
85
+ </Grid>
86
+ <Grid item xs={12} sm={6} md={3}>
87
+ <Box sx={{ p: 1 }}>
88
+ <Labeled label="Discount">
89
+ <NumberField source="Discount" />
90
+ </Labeled>
91
+ </Box>
92
+ </Grid>
93
+ <Grid item xs={12} sm={6} md={3}>
94
+ <Box sx={{ p: 1 }}>
95
+ <Labeled label="Amount">
96
+ <NumberField source="Amount" options={{ style: 'currency', currency: 'USD' }} />
97
+ </Labeled>
98
+ </Box>
99
+ </Grid>
100
+ <Grid item xs={12} sm={6} md={3}>
101
+ <Box sx={{ p: 1 }}>
102
+ <Labeled label="Shipped Date">
103
+ <DateField source="ShippedDate" />
104
+ </Labeled>
105
+ </Box>
106
+ </Grid>
107
+ </Grid>
108
+ </Box>
109
+ </SimpleShowLayout>
110
+ </Show>
111
+ );
112
+ };
113
+
114
+ // Order Detail Create
115
+ export const OrderDetailCreate = (props) => {
116
+ return (
117
+ <Create {...props}>
118
+ <SimpleForm>
119
+ <Box sx={{ mb: 3 }}>
120
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
121
+ Create New Order Detail
122
+ </Typography>
123
+ <Grid container spacing={2} sx={{ mb: 2 }}>
124
+ <Grid item xs={12} sm={6} md={3}>
125
+ <Box sx={{ p: 1 }}>
126
+ <ReferenceInput source="ProductId" reference="Product" fullWidth>
127
+ <SelectInput optionText="ProductName" validate={required()} />
128
+ </ReferenceInput>
129
+ </Box>
130
+ </Grid>
131
+ <Grid item xs={12} sm={6} md={3}>
132
+ <Box sx={{ p: 1 }}>
133
+ <ReferenceInput source="OrderId" reference="Order" fullWidth>
134
+ <SelectInput optionText="Id" validate={required()} />
135
+ </ReferenceInput>
136
+ </Box>
137
+ </Grid>
138
+ <Grid item xs={12} sm={6} md={3}>
139
+ <Box sx={{ p: 1 }}>
140
+ <NumberInput source="Quantity" validate={required()} fullWidth />
141
+ </Box>
142
+ </Grid>
143
+ <Grid item xs={12} sm={6} md={3}>
144
+ <Box sx={{ p: 1 }}>
145
+ <NumberInput source="Discount" fullWidth />
146
+ </Box>
147
+ </Grid>
148
+ </Grid>
149
+ </Box>
150
+ </SimpleForm>
151
+ </Create>
152
+ );
153
+ };
154
+
155
+ // Order Detail Edit
156
+ export const OrderDetailEdit = (props) => {
157
+ return (
158
+ <Edit {...props}>
159
+ <SimpleForm>
160
+ <Box sx={{ mb: 3 }}>
161
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
162
+ Edit Order Detail
163
+ </Typography>
164
+ <Grid container spacing={2} sx={{ mb: 2 }}>
165
+ <Grid item xs={12} sm={6} md={3}>
166
+ <Box sx={{ p: 1 }}>
167
+ <ReferenceInput source="ProductId" reference="Product" fullWidth>
168
+ <SelectInput optionText="ProductName" validate={required()} />
169
+ </ReferenceInput>
170
+ </Box>
171
+ </Grid>
172
+ <Grid item xs={12} sm={6} md={3}>
173
+ <Box sx={{ p: 1 }}>
174
+ <ReferenceInput source="OrderId" reference="Order" fullWidth>
175
+ <SelectInput optionText="Id" validate={required()} />
176
+ </ReferenceInput>
177
+ </Box>
178
+ </Grid>
179
+ <Grid item xs={12} sm={6} md={3}>
180
+ <Box sx={{ p: 1 }}>
181
+ <NumberInput source="Quantity" validate={required()} fullWidth />
182
+ </Box>
183
+ </Grid>
184
+ <Grid item xs={12} sm={6} md={3}>
185
+ <Box sx={{ p: 1 }}>
186
+ <NumberInput source="Discount" fullWidth />
187
+ </Box>
188
+ </Grid>
189
+ </Grid>
190
+ </Box>
191
+ </SimpleForm>
192
+ </Edit>
193
+ );
194
+ };
195
+
196
+ export default {
197
+ list: OrderDetailList,
198
+ show: OrderDetailShow,
199
+ create: OrderDetailCreate,
200
+ edit: OrderDetailEdit,
201
+ };
@@ -0,0 +1,226 @@
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 ProductFilter = (props) => (
15
+ <Filter {...props}>
16
+ <TextInput label="Search Product Name" source="ProductName" alwaysOn />
17
+ <BooleanInput label="Discontinued" source="Discontinued" />
18
+ </Filter>
19
+ );
20
+
21
+ // Product List
22
+ export const ProductList = (props) => {
23
+ return (
24
+ <List filters={<ProductFilter />} {...props} sort={{ field: 'ProductName', order: 'ASC' }} pagination={<Pagination rowsPerPageOptions={[5, 10, 25]} showFirstLastButtons />}>
25
+ <Datagrid rowClick="show">
26
+ <TextField source="ProductName" label="Product Name" />
27
+ <NumberField source="UnitPrice" label="Price" options={{ style: 'currency', currency: 'USD' }} />
28
+ <NumberField source="UnitsInStock" label="Units In Stock" />
29
+ <BooleanField source="Discontinued" label="Discontinued" />
30
+ <EditButton />
31
+ <DeleteButton />
32
+ </Datagrid>
33
+ </List>
34
+ );
35
+ };
36
+
37
+ // Product Show
38
+ export const ProductShow = (props) => {
39
+ return (
40
+ <Show {...props}>
41
+ <SimpleShowLayout>
42
+ <Box sx={{ mb: 3 }}>
43
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
44
+ Product Details
45
+ </Typography>
46
+ <Grid container spacing={3} sx={{ mb: 2 }}>
47
+ <Grid item xs={12} sm={6} md={4}>
48
+ <Box sx={{ p: 1 }}>
49
+ <Labeled label="Product Name">
50
+ <TextField source="ProductName" />
51
+ </Labeled>
52
+ </Box>
53
+ </Grid>
54
+ <Grid item xs={12} sm={6} md={4}>
55
+ <Box sx={{ p: 1 }}>
56
+ <Labeled label="Price">
57
+ <NumberField source="UnitPrice" options={{ style: 'currency', currency: 'USD' }} />
58
+ </Labeled>
59
+ </Box>
60
+ </Grid>
61
+ <Grid item xs={12} sm={6} md={4}>
62
+ <Box sx={{ p: 1 }}>
63
+ <Labeled label="Units In Stock">
64
+ <NumberField source="UnitsInStock" />
65
+ </Labeled>
66
+ </Box>
67
+ </Grid>
68
+ <Grid item xs={12} sm={6} md={4}>
69
+ <Box sx={{ p: 1 }}>
70
+ <Labeled label="Discontinued">
71
+ <BooleanField source="Discontinued" />
72
+ </Labeled>
73
+ </Box>
74
+ </Grid>
75
+ </Grid>
76
+ <Divider sx={{ my: 2 }} />
77
+ </Box>
78
+ </SimpleShowLayout>
79
+ <TabbedShowLayout>
80
+ <Tab label="Order Details">
81
+ <ReferenceManyField reference="OrderDetail" target="ProductId" addLabel={false} pagination={<Pagination />}>
82
+ <Datagrid rowClick="show">
83
+ <TextField source="Id" label="Detail ID" />
84
+ <NumberField source="Quantity" label="Quantity" />
85
+ <NumberField source="Amount" label="Amount" options={{ style: 'currency', currency: 'USD' }} />
86
+ <EditButton />
87
+ <DeleteButton />
88
+ </Datagrid>
89
+ </ReferenceManyField>
90
+ <AddOrderDetailButton />
91
+ </Tab>
92
+ </TabbedShowLayout>
93
+ </Show>
94
+ );
95
+ };
96
+
97
+ // Custom Add Order Detail Button
98
+ const AddOrderDetailButton = () => {
99
+ const record = useRecordContext();
100
+ const redirect = useRedirect();
101
+
102
+ const handleClick = () => {
103
+ redirect(`/OrderDetail/create?source=${encodeURIComponent(JSON.stringify({ ProductId: record?.id }))}`);
104
+ };
105
+
106
+ return (
107
+ <Button
108
+ variant="contained"
109
+ color="primary"
110
+ startIcon={<AddIcon />}
111
+ onClick={handleClick}
112
+ sx={{ mt: 2 }}
113
+ >
114
+ Add New Order Detail
115
+ </Button>
116
+ );
117
+ };
118
+
119
+ // Product Create
120
+ export const ProductCreate = (props) => {
121
+ return (
122
+ <Create {...props}>
123
+ <SimpleForm>
124
+ <Box sx={{ mb: 3 }}>
125
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
126
+ Create New Product
127
+ </Typography>
128
+ <Grid container spacing={3} sx={{ mb: 2 }}>
129
+ <Grid item xs={12} sm={6} md={4}>
130
+ <Box sx={{ p: 1 }}>
131
+ <TextInput source="ProductName" label="Product Name" fullWidth validate={required()} />
132
+ </Box>
133
+ </Grid>
134
+ <Grid item xs={12} sm={6} md={4}>
135
+ <Box sx={{ p: 1 }}>
136
+ <NumberInput source="UnitPrice" label="Unit Price (USD)" fullWidth validate={required()} />
137
+ </Box>
138
+ </Grid>
139
+ <Grid item xs={12} sm={6} md={4}>
140
+ <Box sx={{ p: 1 }}>
141
+ <NumberInput source="UnitsInStock" label="Units In Stock" fullWidth validate={required()} />
142
+ </Box>
143
+ </Grid>
144
+ <Grid item xs={12} sm={6} md={4}>
145
+ <Box sx={{ p: 1 }}>
146
+ <BooleanInput source="Discontinued" label="Discontinued" />
147
+ </Box>
148
+ </Grid>
149
+ <Grid item xs={12} sm={6} md={4}>
150
+ <Box sx={{ p: 1 }}>
151
+ <ReferenceInput source="SupplierId" reference="Supplier" fullWidth>
152
+ <SelectInput optionText="CompanyName" validate={required()} />
153
+ </ReferenceInput>
154
+ </Box>
155
+ </Grid>
156
+ <Grid item xs={12} sm={6} md={4}>
157
+ <Box sx={{ p: 1 }}>
158
+ <ReferenceInput source="CategoryId" reference="Category" fullWidth>
159
+ <SelectInput optionText="CategoryName" validate={required()} />
160
+ </ReferenceInput>
161
+ </Box>
162
+ </Grid>
163
+ </Grid>
164
+ </Box>
165
+ </SimpleForm>
166
+ </Create>
167
+ );
168
+ };
169
+
170
+ // Product Edit
171
+ export const ProductEdit = (props) => {
172
+ return (
173
+ <Edit {...props} redirect={false}>
174
+ <SimpleForm>
175
+ <Box sx={{ mb: 3 }}>
176
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
177
+ Edit Product
178
+ </Typography>
179
+ <Grid container spacing={3} sx={{ mb: 2 }}>
180
+ <Grid item xs={12} sm={6} md={4}>
181
+ <Box sx={{ p: 1 }}>
182
+ <TextInput source="ProductName" label="Product Name" fullWidth validate={required()} />
183
+ </Box>
184
+ </Grid>
185
+ <Grid item xs={12} sm={6} md={4}>
186
+ <Box sx={{ p: 1 }}>
187
+ <NumberInput source="UnitPrice" label="Unit Price (USD)" fullWidth validate={required()} />
188
+ </Box>
189
+ </Grid>
190
+ <Grid item xs={12} sm={6} md={4}>
191
+ <Box sx={{ p: 1 }}>
192
+ <NumberInput source="UnitsInStock" label="Units In Stock" fullWidth validate={required()} />
193
+ </Box>
194
+ </Grid>
195
+ <Grid item xs={12} sm={6} md={4}>
196
+ <Box sx={{ p: 1 }}>
197
+ <BooleanInput source="Discontinued" label="Discontinued" />
198
+ </Box>
199
+ </Grid>
200
+ <Grid item xs={12} sm={6} md={4}>
201
+ <Box sx={{ p: 1 }}>
202
+ <ReferenceInput source="SupplierId" reference="Supplier" fullWidth>
203
+ <SelectInput optionText="CompanyName" validate={required()} />
204
+ </ReferenceInput>
205
+ </Box>
206
+ </Grid>
207
+ <Grid item xs={12} sm={6} md={4}>
208
+ <Box sx={{ p: 1 }}>
209
+ <ReferenceInput source="CategoryId" reference="Category" fullWidth>
210
+ <SelectInput optionText="CategoryName" validate={required()} />
211
+ </ReferenceInput>
212
+ </Box>
213
+ </Grid>
214
+ </Grid>
215
+ </Box>
216
+ </SimpleForm>
217
+ </Edit>
218
+ );
219
+ };
220
+
221
+ export default {
222
+ list: ProductList,
223
+ show: ProductShow,
224
+ create: ProductCreate,
225
+ edit: ProductEdit,
226
+ };
@@ -0,0 +1,104 @@
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 RegionFilter = (props) => (
15
+ <Filter {...props}>
16
+ <TextInput label="Search" source="RegionDescription" alwaysOn />
17
+ </Filter>
18
+ );
19
+
20
+ // Region List
21
+ export const RegionList = (props) => {
22
+ return (
23
+ <List filters={<RegionFilter />} {...props} sort={{ field: 'RegionDescription', order: 'ASC' }} pagination={<Pagination rowsPerPageOptions={[5, 10, 25]} showFirstLastButtons />}>
24
+ <Datagrid rowClick="show">
25
+ <TextField source="RegionDescription" label="Region Description" />
26
+ </Datagrid>
27
+ </List>
28
+ );
29
+ };
30
+
31
+ // Region Show
32
+ export const RegionShow = (props) => {
33
+ return (
34
+ <Show {...props}>
35
+ <SimpleShowLayout>
36
+ <Box sx={{ mb: 3 }}>
37
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
38
+ Region Information
39
+ </Typography>
40
+ <Grid container spacing={3} sx={{ mb: 2 }}>
41
+ <Grid item xs={12} sm={6} md={4}>
42
+ <Box sx={{ p: 1 }}>
43
+ <TextField source="RegionDescription" label="Region Description" />
44
+ </Box>
45
+ </Grid>
46
+ </Grid>
47
+ <Divider sx={{ my: 2 }} />
48
+ </Box>
49
+ </SimpleShowLayout>
50
+ </Show>
51
+ );
52
+ };
53
+
54
+ // Region Create
55
+ export const RegionCreate = (props) => {
56
+ return (
57
+ <Create {...props}>
58
+ <SimpleForm>
59
+ <Box sx={{ mb: 3 }}>
60
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
61
+ Create New Region
62
+ </Typography>
63
+ <Grid container spacing={3} sx={{ mb: 2 }}>
64
+ <Grid item xs={12} sm={6} md={4}>
65
+ <Box sx={{ p: 1 }}>
66
+ <TextInput source="RegionDescription" label="Region Description" fullWidth validate={required()} />
67
+ </Box>
68
+ </Grid>
69
+ </Grid>
70
+ </Box>
71
+ </SimpleForm>
72
+ </Create>
73
+ );
74
+ };
75
+
76
+ // Region Edit
77
+ export const RegionEdit = (props) => {
78
+ return (
79
+ <Edit {...props} redirect={false}>
80
+ <SimpleForm>
81
+ <Box sx={{ mb: 3 }}>
82
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
83
+ Edit Region
84
+ </Typography>
85
+ <Grid container spacing={3} sx={{ mb: 2 }}>
86
+ <Grid item xs={12} sm={6} md={4}>
87
+ <Box sx={{ p: 1 }}>
88
+ <TextInput source="RegionDescription" label="Region Description" fullWidth validate={required()} />
89
+ </Box>
90
+ </Grid>
91
+ </Grid>
92
+ </Box>
93
+ </SimpleForm>
94
+ </Edit>
95
+ );
96
+ };
97
+
98
+ // Export the entry points for the React Admin interface
99
+ export default {
100
+ list: RegionList,
101
+ show: RegionShow,
102
+ create: RegionCreate,
103
+ edit: RegionEdit,
104
+ };
@@ -0,0 +1,120 @@
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 ShipperFilter = (props) => (
15
+ <Filter {...props}>
16
+ <TextInput label="Search" source="CompanyName" alwaysOn />
17
+ </Filter>
18
+ );
19
+
20
+ // Shipper List
21
+ export const ShipperList = (props) => {
22
+ return (
23
+ <List filters={<ShipperFilter />} {...props} sort={{ field: 'CompanyName', order: 'ASC' }}>
24
+ <Datagrid rowClick="show">
25
+ <TextField source="CompanyName" label="Company Name" />
26
+ <TextField source="Phone" label="Phone" />
27
+ <EditButton />
28
+ <DeleteButton />
29
+ </Datagrid>
30
+ </List>
31
+ );
32
+ };
33
+
34
+ // Shipper Show
35
+ export const ShipperShow = (props) => {
36
+ return (
37
+ <Show {...props}>
38
+ <SimpleForm>
39
+ <Box sx={{ mb: 3 }}>
40
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
41
+ Shipper Information
42
+ </Typography>
43
+ <Grid container spacing={3} sx={{ mb: 2 }}>
44
+ <Grid item xs={12} sm={6} md={4}>
45
+ <Box sx={{ p: 1 }}>
46
+ <TextField source="CompanyName" label="Company Name" fullWidth />
47
+ </Box>
48
+ </Grid>
49
+ <Grid item xs={12} sm={6} md={4}>
50
+ <Box sx={{ p: 1 }}>
51
+ <TextField source="Phone" label="Phone" fullWidth />
52
+ </Box>
53
+ </Grid>
54
+ </Grid>
55
+ </Box>
56
+ </SimpleForm>
57
+ </Show>
58
+ );
59
+ };
60
+
61
+ // Shipper Create
62
+ export const ShipperCreate = (props) => {
63
+ return (
64
+ <Create {...props}>
65
+ <SimpleForm>
66
+ <Box sx={{ mb: 3 }}>
67
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
68
+ Create New Shipper
69
+ </Typography>
70
+ <Grid container spacing={3} sx={{ mb: 2 }}>
71
+ <Grid item xs={12} sm={6} md={4}>
72
+ <Box sx={{ p: 1 }}>
73
+ <TextInput source="CompanyName" label="Company Name" validate={required()} fullWidth />
74
+ </Box>
75
+ </Grid>
76
+ <Grid item xs={12} sm={6} md={4}>
77
+ <Box sx={{ p: 1 }}>
78
+ <TextInput source="Phone" label="Phone" fullWidth />
79
+ </Box>
80
+ </Grid>
81
+ </Grid>
82
+ </Box>
83
+ </SimpleForm>
84
+ </Create>
85
+ );
86
+ };
87
+
88
+ // Shipper Edit
89
+ export const ShipperEdit = (props) => {
90
+ return (
91
+ <Edit {...props}>
92
+ <SimpleForm>
93
+ <Box sx={{ mb: 3 }}>
94
+ <Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
95
+ Edit Shipper
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="CompanyName" label="Company Name" validate={required()} fullWidth />
101
+ </Box>
102
+ </Grid>
103
+ <Grid item xs={12} sm={6} md={4}>
104
+ <Box sx={{ p: 1 }}>
105
+ <TextInput source="Phone" label="Phone" fullWidth />
106
+ </Box>
107
+ </Grid>
108
+ </Grid>
109
+ </Box>
110
+ </SimpleForm>
111
+ </Edit>
112
+ );
113
+ };
114
+
115
+ export default {
116
+ list: ShipperList,
117
+ show: ShipperShow,
118
+ create: ShipperCreate,
119
+ edit: ShipperEdit,
120
+ };