Skip to content

Conversation

NikolaVetnic
Copy link
Collaborator

In this PR I have added Pages and ISBN attributes to Book entity. In addition I have resolved the issue with the Path does not exist.CDS (annotations) error in VS Code that sprung up once the Reviews were added.

@NikolaVetnic NikolaVetnic requested a review from fatschi August 13, 2025 10:56
@NikolaVetnic NikolaVetnic self-assigned this Aug 13, 2025
@NikolaVetnic NikolaVetnic added the enhancement New feature or request label Aug 13, 2025
@@ -123,3 +148,11 @@ annotate AdminService.Books with {
annotate AdminService.Books with {
genre @Common.ValueListWithFixedValues;
}

// hint: this was needed to make the path not found at 'reviews/@UI.LineItem' go away
annotate AdminService.Reviews with @(UI: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

great thx

on reviews.book = $self;

pages : Integer @assert.range: [(0),_]; // hint: adds validation, must be > 0
isbn : String(20) @assert.format: '^(?=(?:\D*\d){10}(?:(?:\D*\d){3})?$)[\d-]+$'; // hint: https://stackoverflow.com/questions/41271613/use-regex-to-verify-an-isbn-number
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice, does this work when you try to edit an isbn in the books-admin? does it lead to errors?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If you input an invalid ISBN value it prevents you from saving changes to the entity. I have not tested it more extensively as in what happens when wrong data is seeded and such.

@HunorTotBagi HunorTotBagi linked an issue Sep 4, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ISBN and page number attributes to Book entity
2 participants