ApiLogicServer 14.2.2__py3-none-any.whl → 14.3.0__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.
- {ApiLogicServer-14.2.2.dist-info → ApiLogicServer-14.3.0.dist-info}/METADATA +2 -2
- {ApiLogicServer-14.2.2.dist-info → ApiLogicServer-14.3.0.dist-info}/RECORD +73 -54
- api_logic_server_cli/api_logic_server.py +47 -10
- api_logic_server_cli/api_logic_server_info.yaml +3 -3
- api_logic_server_cli/cli.py +9 -3
- api_logic_server_cli/create_from_model/__pycache__/api_logic_server_utils.cpython-312.pyc +0 -0
- api_logic_server_cli/create_from_model/__pycache__/ont_build.cpython-312.pyc +0 -0
- api_logic_server_cli/create_from_model/__pycache__/ont_create.cpython-312.pyc +0 -0
- api_logic_server_cli/create_from_model/api_logic_server_utils.py +4 -0
- api_logic_server_cli/create_from_model/ont_build.py +53 -19
- api_logic_server_cli/create_from_model/ont_create.py +14 -5
- api_logic_server_cli/fragments/declare_logic.py +72 -0
- api_logic_server_cli/{prototypes/manager/system/genai/create_db_models_inserts/logic_discovery_prefix.py → fragments/declare_logic_begin.py} +2 -1
- api_logic_server_cli/fragments/declare_logic_end.py +52 -0
- api_logic_server_cli/genai/client.py +24 -0
- api_logic_server_cli/genai/genai.py +37 -17
- api_logic_server_cli/genai/genai_logic_builder.py +21 -35
- api_logic_server_cli/genai/genai_svcs.py +109 -13
- api_logic_server_cli/genai/genai_utils.py +0 -1
- api_logic_server_cli/model_migrator/model_migrator_start.py +1 -1
- api_logic_server_cli/model_migrator/reposreader.py +9 -1
- api_logic_server_cli/model_migrator/rule_obj.py +24 -6
- api_logic_server_cli/prototypes/base/api/api_discovery/ontimize_api.py +4 -1
- api_logic_server_cli/prototypes/base/config/activate_logicbank.py +8 -4
- api_logic_server_cli/prototypes/base/config/config.py +10 -6
- api_logic_server_cli/prototypes/base/database/bind_dbs.py +2 -1
- api_logic_server_cli/prototypes/base/database/test_data/readme.md +5 -5
- api_logic_server_cli/prototypes/base/logic/declare_logic.py +8 -3
- api_logic_server_cli/prototypes/base/logic/load_verify_rules.py +216 -0
- api_logic_server_cli/prototypes/base/logic/logic_discovery/auto_discovery.py +23 -11
- api_logic_server_cli/prototypes/genai_demo/database/models.py +11 -55
- api_logic_server_cli/prototypes/genai_demo/logic/declare_logic.py +29 -21
- api_logic_server_cli/prototypes/manager/.vscode/launch.json +3 -3
- api_logic_server_cli/prototypes/manager/README.md +25 -10
- api_logic_server_cli/prototypes/manager/system/genai/create_db_models_inserts/create_db_models_imports.py +1 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/genai_demo.response_example +19 -18
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/genai_demo_iteration_discount/.DS_Store +0 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/genai_demo_iteration_discount/000_you_are.prompt +1 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/genai_demo_iteration_discount/001_logic_training.prompt +314 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/genai_demo_iteration_discount/002_create_db_models.prompt +150 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/genai_demo_iteration_discount/003_create_db_models.response +134 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/genai_demo_iteration_discount/004_iteratio_logic.prompt +131 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/genai_demo_iteration_discount/005_create_db_models.response-example +141 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/genai_demo_iteration_discount/create_db_models.py +105 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/genai_demo_iteration_discount/db.dbml +70 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/genai_demo_iteration_discount/readme.md +6 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/genai_demo_iteration_discount/response.json +178 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/wg_dev_merge/base_genai_demo_no_logic/logic/declare_logic.py +0 -1
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/wg_dev_merge/dev_demo_no_logic_fixed/logic/declare_logic.py +0 -1
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/wg_dev_merge/wg_demo_no_logic_fixed/genai/examples/genai_demo/wg_dev_merge/base_genai_demo_no_logic/logic/declare_logic.py +0 -1
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/wg_dev_merge/wg_demo_no_logic_fixed/genai/examples/genai_demo/wg_dev_merge/dev_demo_no_logic_fixed/logic/declare_logic.py +0 -1
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/wg_dev_merge/wg_demo_no_logic_fixed/genai/examples/genai_demo/wg_dev_merge/wg_genai_demo_no_logic_fixed_from_CLI/logic/declare_logic.py +0 -1
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/wg_dev_merge/wg_demo_no_logic_fixed/logic/declare_logic.py +0 -1
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/wg_dev_merge/wg_demo_no_logic_fixed/system/genai/examples/genai_demo/wg_dev_merge/base_genai_demo_no_logic/logic/declare_logic.py +0 -1
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/wg_dev_merge/wg_demo_no_logic_fixed/system/genai/examples/genai_demo/wg_dev_merge/dev_demo_no_logic_fixed/logic/declare_logic.py +0 -1
- api_logic_server_cli/prototypes/manager/system/genai/examples/genai_demo/wg_dev_merge/wg_demo_no_logic_fixed/system/genai/examples/genai_demo/wg_dev_merge/wg_genai_demo_no_logic_fixed_from_CLI/logic/declare_logic.py +0 -1
- api_logic_server_cli/prototypes/manager/system/genai/examples/time_tracking_billing/002_create_db_models.prompt +194 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/time_tracking_billing/003_create_db_models.response +298 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/time_tracking_billing/db.sqlite +0 -0
- api_logic_server_cli/prototypes/manager/system/genai/examples/time_tracking_billing/readme.md +8 -0
- api_logic_server_cli/prototypes/manager/system/genai/learning_requests/logic_bank_api.prompt +14 -10
- api_logic_server_cli/prototypes/manager/system/genai/prompt_inserts/iteration.prompt +2 -1
- api_logic_server_cli/prototypes/nw_no_cust/venv_setup/system_note.txt +1 -1
- api_logic_server_cli/prototypes/ont_app/templates/home_tree_template.html +9 -0
- api_logic_server_cli/prototypes/ont_app/templates/tree_routing.jinja +32 -0
- api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/sqlacodegen/__pycache__/codegen.cpython-312.pyc +0 -0
- api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/sqlacodegen/codegen.py +2 -1
- api_logic_server_cli/tools/mini_skel/logic/load_verify_rules.py +1 -1
- api_logic_server_cli/tools/mini_skel/run.py +1 -0
- api_logic_server_cli/model_migrator/system/custom_endpoint.py +0 -545
- api_logic_server_cli/prototypes/base/database/test_data/z_test_data_rows.py +0 -98
- {ApiLogicServer-14.2.2.dist-info → ApiLogicServer-14.3.0.dist-info}/LICENSE +0 -0
- {ApiLogicServer-14.2.2.dist-info → ApiLogicServer-14.3.0.dist-info}/WHEEL +0 -0
- {ApiLogicServer-14.2.2.dist-info → ApiLogicServer-14.3.0.dist-info}/entry_points.txt +0 -0
- {ApiLogicServer-14.2.2.dist-info → ApiLogicServer-14.3.0.dist-info}/top_level.txt +0 -0
api_logic_server_cli/prototypes/manager/system/genai/learning_requests/logic_bank_api.prompt
CHANGED
|
@@ -113,7 +113,7 @@ class Rule:
|
|
|
113
113
|
"""
|
|
114
114
|
Copy declares child column copied from parent column.
|
|
115
115
|
|
|
116
|
-
Example
|
|
116
|
+
Example:
|
|
117
117
|
Prompt
|
|
118
118
|
Store the Item.unit_price as a copy from Product.unit_price
|
|
119
119
|
Response
|
|
@@ -190,7 +190,6 @@ Response is to create 2 rules - a derivation and a constraint, as follows:
|
|
|
190
190
|
Intermediate sum/count values also work for counts. For example:
|
|
191
191
|
|
|
192
192
|
Prompt:
|
|
193
|
-
|
|
194
193
|
A airplane cannot have more passengers than its seating capacity.
|
|
195
194
|
|
|
196
195
|
Response is to create 2 rules - a count derivation and a constraint, as follows:
|
|
@@ -212,12 +211,11 @@ Response is to create 2 rules - a derivation and a constraint, as follows:
|
|
|
212
211
|
Rule.sum(derive=Employee.skill_rating_total, as_sum_of=EmployeeSkill.rating)
|
|
213
212
|
And, be sure to create the second Rule:
|
|
214
213
|
Rule.Formula(derive=Employee.skill_summary,
|
|
215
|
-
|
|
214
|
+
as_expression=lambda row: row.skill_rating_total + 2 * row.years_of_service)
|
|
216
215
|
|
|
217
216
|
|
|
218
217
|
Prompt:
|
|
219
|
-
|
|
220
|
-
A student cannot be an honor student unless they have mre than 2 service activities.
|
|
218
|
+
A student cannot be an honor student unless they have more than 2 service activities.
|
|
221
219
|
|
|
222
220
|
Response is to create 2 rules - a count derivation and a constraint, as follows:
|
|
223
221
|
First Rule to Create:
|
|
@@ -230,7 +228,6 @@ Response is to create 2 rules - a count derivation and a constraint, as follows:
|
|
|
230
228
|
Here is an equivalent request:
|
|
231
229
|
|
|
232
230
|
Prompt:
|
|
233
|
-
|
|
234
231
|
A airplane's passengers must be less than its seating capacity.
|
|
235
232
|
|
|
236
233
|
Response is to create 2 rules - a count derivation and a constraint, as follows:
|
|
@@ -244,20 +241,20 @@ Response is to create 2 rules - a count derivation and a constraint, as follows:
|
|
|
244
241
|
|
|
245
242
|
For "more than" constraints, create columns with count rules:
|
|
246
243
|
|
|
247
|
-
Prompt Reject Employees with more than 3 Felonies.
|
|
244
|
+
Prompt: Reject Employees with more than 3 Felonies.
|
|
248
245
|
|
|
249
246
|
Response:
|
|
250
247
|
First Rule is to create:
|
|
251
248
|
Rule.count(derive=Employee.felony_count, as_count_of=Felonies)
|
|
252
249
|
And, be sure to create the contraint rule:
|
|
253
250
|
Rule.constraint(validate=Employee,
|
|
254
|
-
as_condition=lambda row: row.felony_count
|
|
251
|
+
as_condition=lambda row: row.felony_count<=3,
|
|
255
252
|
error_msg="Employee has excessive Felonies")
|
|
256
253
|
|
|
257
254
|
|
|
258
255
|
For "any" constraints, create columns with count rules:
|
|
259
256
|
|
|
260
|
-
Prompt Reject Employees with any class 5 Felonies or more than 3 Felonies.
|
|
257
|
+
Prompt: Reject Employees with any class 5 Felonies or more than 3 Felonies.
|
|
261
258
|
|
|
262
259
|
Response:
|
|
263
260
|
First Rule is to create:
|
|
@@ -265,7 +262,7 @@ Response:
|
|
|
265
262
|
Rule.count(derive=Employee.felony_count, as_count_of=Felonies)
|
|
266
263
|
And, be sure to create the contraint rule:
|
|
267
264
|
Rule.constraint(validate=Employee,
|
|
268
|
-
as_condition=lambda row: row.class_5_felony_count
|
|
265
|
+
as_condition=lambda row: row.class_5_felony_count == 0 and row.felony_count<=3,
|
|
269
266
|
error_msg="Employee has excessive Felonies")
|
|
270
267
|
|
|
271
268
|
Formulas can reference parent values in 2 versions - choose formula vs copy as follows:
|
|
@@ -278,6 +275,13 @@ Formulas can reference parent values in 2 versions - choose formula vs copy as f
|
|
|
278
275
|
Response
|
|
279
276
|
Rule.copy(derive=Item.ready, from_parent=Order.ready)
|
|
280
277
|
|
|
278
|
+
Formulas can use Python conditions:
|
|
279
|
+
Prompt: Item amount is price * quantity, with a 10% discount for gold products
|
|
280
|
+
Response:
|
|
281
|
+
Rule.Formula(derive=Item.amount,
|
|
282
|
+
as_expression=lambda row: row.price * row.quantity if row.gold else .9 * row.price * row.quantity)
|
|
283
|
+
If the attributes are decimal, use the form Decimal('0.9')
|
|
284
|
+
|
|
281
285
|
Sum and Count where clauses:
|
|
282
286
|
1. must not restate the foreign key / primary key matchings
|
|
283
287
|
2. Can only reference child attributes
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
Update the prior response - be sure not to lose classes and test data already created.
|
|
1
|
+
Update the prior response - be sure not to lose classes, rules and test data already created.
|
|
2
|
+
If there is more than one derivation for the same column, use the last one provided.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Project created as nw
|
|
1
|
+
Project created as nw- (nw, no customizations)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<div fxLayout="row" fxLayoutAlign="center start" fxFlexFill class="container">
|
|
2
|
+
<o-tree #tree service="{{ service }}" entity="{{ entity }}"
|
|
3
|
+
keys="{{ keys }}" root-title="{{ entity }}" columns="{{ columns }}"
|
|
4
|
+
visible-columns="{{ favorite }}" route=":{{ keys }}" fxFlex="20">
|
|
5
|
+
</o-tree>
|
|
6
|
+
<div fxLayout="column" fxLayoutAlign="center stretch" fxFlex="80">
|
|
7
|
+
<router-outlet></router-outlet>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { RouterModule, Routes } from '@angular/router';
|
|
3
|
+
import { {{ entity_first_cap }}HomeComponent } from './home/{{ entity }}-home.component';
|
|
4
|
+
import { {{ entity_first_cap }}NewComponent } from './new/{{ entity }}-new.component';
|
|
5
|
+
import { {{ entity_first_cap }}DetailComponent } from './detail/{{ entity }}-detail.component';
|
|
6
|
+
|
|
7
|
+
const routes: Routes = [
|
|
8
|
+
{path: '', component: {{ entity_first_cap }}HomeComponent,
|
|
9
|
+
children: [
|
|
10
|
+
{ path: 'new', component: {{ entity_first_cap }}NewComponent },
|
|
11
|
+
{ path: ':{{ keyPath }}', component: {{ entity_first_cap }}DetailComponent,
|
|
12
|
+
data: {
|
|
13
|
+
oPermission: {
|
|
14
|
+
permissionId: '{{ entity }}-detail-permissions'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}{{ additional_routes }}
|
|
18
|
+
]}
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
export const {{ entity_upper}}_MODULE_DECLARATIONS = [
|
|
22
|
+
{{ entity_first_cap }}HomeComponent,
|
|
23
|
+
{{ entity_first_cap }}NewComponent,
|
|
24
|
+
{{ entity_first_cap }}DetailComponent
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@NgModule({
|
|
29
|
+
imports: [RouterModule.forChild(routes)],
|
|
30
|
+
exports: [RouterModule]
|
|
31
|
+
})
|
|
32
|
+
export class {{ entity_first_cap }}RoutingModule { }
|
api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/sqlacodegen/__pycache__/codegen.cpython-312.pyc
CHANGED
|
Binary file
|
|
@@ -1179,7 +1179,8 @@ else:
|
|
|
1179
1179
|
render_coltype = not dedicated_fks or any(fk.column is column for fk in dedicated_fks)
|
|
1180
1180
|
if 'DataTypes.char_type DEBUG ONLY' == str(column):
|
|
1181
1181
|
debug_stop = "Debug Stop: Column" # char_type = Column(CHAR(1, 'SQL_Latin1_General_CP1_CI_AS'))
|
|
1182
|
-
|
|
1182
|
+
if str(column) in ['Credit_limit', 'credit_limit']:
|
|
1183
|
+
debug_stop = "Debug Stop: Column"
|
|
1183
1184
|
if column.key != column.name:
|
|
1184
1185
|
kwarg.append('key')
|
|
1185
1186
|
if column.primary_key:
|
|
@@ -9,7 +9,7 @@ from importlib import import_module
|
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
from werkzeug.utils import secure_filename
|
|
11
11
|
from database.models import *
|
|
12
|
-
from logic_bank.logic_bank import
|
|
12
|
+
from logic_bank.logic_bank import Rule, LogicBank
|
|
13
13
|
from colorama import Fore, Style, init
|
|
14
14
|
from logic_bank.logic_bank import RuleBank
|
|
15
15
|
from logic_bank.rule_bank.rule_bank_setup import find_referenced_attributes
|