2.1 KiB
Executable Business Blueprint Design
Goal
Generate runnable business workflow code from EasyCode business blueprints without allowing AI to emit arbitrary Java source.
Scope
This phase covers general workflow actions plus inventory and amount style numeric changes. Generated projects should get Controller endpoints, transactional Service methods, rule checks, row inserts, field updates, status updates, numeric increase/decrease helpers, and frontend buttons/API calls.
This phase does not cover arbitrary Java snippets, complex accounting ledgers, permissions beyond the existing generated shell, distributed locks, or idempotency keys.
Architecture
AI returns a structured DSL in businessActions. The backend normalizes and validates that DSL against the saved database schema, stores it in front_project.business_blueprint, and passes it into Velocity templates. Templates render deterministic Java and Vue code from the DSL.
Existing rules: List<String> remains as human-readable notes. New executable checks live in ruleChecks.
DSL
Each action may include:
code,name,ownerTable,method,path,transaction,requestFieldsrules: human-readable notesruleChecks: executable checkseffects: executable data mutations
Supported ruleChecks:
EXISTSNOT_EXISTSFIELD_EQUALSFIELD_NOT_EQUALSFIELD_INNUMBER_GTE
Supported effects:
INSERT_ROWUPDATE_FIELDSSET_STATUSINCREASE_NUMBERDECREASE_NUMBER- legacy
UPDATE_FIELD
Safety
All table and column identifiers must exist in the saved schema. Effect value placeholders are limited to safe forms: literals, ${param.field}, and ${now}. Numeric amounts may be literals or ${param.field}. SQL fragments from AI are not accepted except the existing legacy UPDATE_FIELD.value, which remains bounded by the template helper.
Testing
Backend tests cover parsing and persistence of structured checks/effects, validation of unknown tables or fields, and template rendering markers for the generated helper methods. Existing tests must remain green.