| name | angular-lister-component-creator |
| description | Create Angular lister/editor components and service wiring for an entity; use for prompts like "Create editor and lister components for entity ..." or compliance verification requests. |
Task preconditions
You MUST NOT generate code if even one of the preconditions is not met.
Identify target entity
Extract the entity name from the request.
Check if name is a valid identifier for the programming languages Java, Typescript and SQL.
Check that NO entity class with this name already exists.
Replace placeholder {Entity} with the given name.
Replace placeholder {entity} with kebab case of the the given name.
Identify target domain package
Extract the domain package name from the request.
Check if name is a valid identifier for the programming languages Java, Typescript and SQL.
Check that a package directory with this name exists.
Replace placeholder {package} with the given name.
Task steps
Create entity type
Create entity type script {entity}.type.ts for entity class {Entity}.java.
Create entity service
Use doc/concept/angular/entity-service.adoc as the implementation baseline.
Use doc/service/{entity}-restapi.adoc as the REST API specification.
Create entity service script {entity}.service.ts for REST API access.
Create entity editor component
Use doc/concept/angular/entity-editor.adoc as the implementation baseline.
Create directory src/main/angular/pages/{package}/{entity}-editor.
Create component script {entity}-editor.ts.
Create component layout {entity}-editor.html.
Add controls to edit all properties of the entity.
Do not show or edit the primary key or the version of the entity.
Create entity lister component
Use doc/concept/angular/entity-lister.adoc as the implementation baseline.
Create directory src/main/angular/pages/{package}/{entity}-lister.
Create component script {entity}-lister.ts.
Create component layout {entity}-lister.html.
Find the minimum set of properties needed to identify the entity, e.g. name.
Use those properties for column names in the table.
Add route for entity lister component
Use doc/concept/angular/entity-lister.adoc as the implementation baseline.
Create route script {entity}-routes.ts.
Add route script to app.routes.ts.
Add a navigation link to app.html.