Skip to content

chore: sample project#58

Draft
Kronprinz03 wants to merge 8 commits intomainfrom
create-sample-project
Draft

chore: sample project#58
Kronprinz03 wants to merge 8 commits intomainfrom
create-sample-project

Conversation

@Kronprinz03
Copy link
Contributor

Have you...

  • Added relevant entry to the change log?

@hyperspace-insights
Copy link
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


Add Status Management Sample Project for Testing

Chore

🔧 Added a complete sample CAP (Cloud Application Programming) project under tests/sample/status-management to serve as a test fixture. The project is based on the classic SAP CAP Bookshop sample and includes two SAP Fiori List Report applications for managing Books and Authors.

Changes

  • tests/sample/status-management/LICENSE: Apache 2.0 license file for the sample project.
  • tests/sample/status-management/package.json: Root package configuration for the @capire/bookshop CAP project with workspace setup for the two Fiori apps.
  • tests/sample/status-management/readme.md: Documentation for running and getting started with the sample project.
  • tests/sample/status-management/index.cds: Top-level CDS entry point importing the schema and services.
  • tests/sample/status-management/db/schema.cds: CDS data model defining Books, Authors, and Genres entities.
  • tests/sample/status-management/db/init.js: DB initializer for seeding currency data after CSV import.
  • tests/sample/status-management/db/data/*.csv: Sample data files for Authors, Books, Books translations, and Genres.
  • tests/sample/status-management/srv/admin-service.cds: Admin OData service with BPM process annotations (@bpm.process.start, @bpm.process.cancel, @bpm.process.businessKey) on the Books entity.
  • tests/sample/status-management/srv/admin-service.js: Admin service implementation with auto-ID generation for Authors and Books.
  • tests/sample/status-management/srv/cat-service.cds: Catalog service exposing read-only book lists and an order submission action.
  • tests/sample/status-management/srv/cat-service.js: Catalog service logic including discount logic and stock management.
  • tests/sample/status-management/srv/admin-constraints.cds: Input validation constraints for Books, Authors, and Genres entities.
  • tests/sample/status-management/app/books/ & tests/sample/status-management/app/authors/: Complete SAP Fiori List Report V4 applications for Books and Authors, each including UI5 configuration, manifest, OPA integration tests, and CDS annotations.
  • tests/sample/status-management/test/requests.http & requests-hcql.http: HTTP request samples for testing OData and HCQL endpoints.

  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.19.3 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • Summary Prompt: Default Prompt
  • Correlation ID: 8b8c9720-281f-11f1-890c-1795decb4e1e
  • Event Trigger: pull_request.opened
  • LLM: anthropic--claude-4.6-sonnet
  • Output Template: Default Template

💌 Have ideas or want to contribute? Create an issue and share your thoughts with us!
📑 Check out the documentation for more information.
📬 Subscribe to the Hyperspace PR Bot DL to get the latest announcements and pilot features!

Made with ❤️ by Hyperspace.

Copy link
Contributor

@hyperspace-insights hyperspace-insights bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR adds a status-management sample project based on the CAP bookshop template, but several issues need attention before it is ready:

  1. Invalid namespace (index.cds): sap.capire.status-management uses a hyphen which is illegal in CDS identifiers and will cause compilation failures.
  2. Empty BPM process IDs (admin-service.cds): Both @bpm.process.start and @bpm.process.cancel have id: '', meaning the plugin cannot bind to any real process at runtime — the core purpose of this sample is non-functional as-is.
  3. Null coercion bug (admin-service.js): When the table is empty, max(ID) returns null and null + 4 silently coerces to 4 — the null case should be handled explicitly.
  4. Mismatched package metadata (package.json): The name, description, and repository still point to the generic bookshop template rather than the status-management sample.
  5. Typo (requests.http): "AdmingService" should be "AdminService".

The most critical blockers are the invalid namespace and the empty process IDs, as they would prevent the sample from running or demonstrating its intended BPM integration.

PR Bot Information

Version: 1.19.3 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • LLM: anthropic--claude-4.6-sonnet
  • Correlation ID: 8b8c9720-281f-11f1-890c-1795decb4e1e
  • Event Trigger: pull_request.opened

// This file allows other projects to import the bookshop model by
// using {...} from '@capire/bookshop';

namespace sap.capire.status-management; //> important for reflection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Invalid CDS namespace identifier — hyphens are not allowed

sap.capire.status-management uses a hyphen, which is not a valid identifier character in CDS namespaces. CDS namespace parts must be valid identifiers (letters, digits, underscores). This will cause a CDS compilation error.

Consider renaming to use an underscore: sap.capire.status_management.

Suggested change
namespace sap.capire.status-management; //> important for reflection
namespace sap.capire.status_management; //> important for reflection

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

async function genid (req) {
if (req.data.ID) return
const {id} = await SELECT.one.from(req.target).columns('max(ID) as id')
req.data.ID = id + 4 // Note: that is not safe! ok for this sample only.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: id from SELECT.one can be null when the table is empty, causing null + 4 to produce 4 in JavaScript — but more critically the intent is clearly to assign a valid integer. If the table has no rows, max(ID) returns null and req.data.ID will be set to 4 (which works by accident). However, this is a silent bug — null + 4 === 4 in JS but only because of implicit coercion. Should explicitly handle the null case:

req.data.ID = (id ?? 0) + 4
Suggested change
req.data.ID = id + 4 // Note: that is not safe! ok for this sample only.
req.data.ID = (id ?? 0) + 4 // Note: that is not safe! ok for this sample only.

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

entity Authors as projection on my.Authors;

@bpm.process.start : {
id: '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Empty string id: '' for @bpm.process.start and @bpm.process.cancel — the process IDs are left blank. Without a valid process definition ID, the plugin will be unable to locate or start/cancel the correct BPM process at runtime. These should be filled in with the actual process definition IDs before this sample can function as intended.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

&$filter=contains(author,'Bro')


### AdmingService.read Authors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: Comment reads "AdmingService" instead of "AdminService"

AdmingService has an extra 'g'. Should be AdminService.

Suggested change
### AdmingService.read Authors
### AdminService.read Authors

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

"name": "@capire/bookshop",
"version": "2.1.9",
"description": "Our primer sample for getting started in a nutshell.",
"repository": "https://github.com/capire/bookshop",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming: Package metadata describes a generic bookshop, not the status-management sample

The name is @capire/bookshop, description references "getting started in a nutshell", and the repository points to https://github.com/capire/bookshop. This sample is named status-management and is meant to demonstrate BPM process integration. This mismatch will cause confusion for anyone using this as a reference sample.

Consider updating name, description, and repository to reflect the status-management purpose.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

@tilwbr tilwbr force-pushed the create-sample-project branch from 7364af9 to 5c394a3 Compare March 25, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants