Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Missing draft in generated type for entity #302

Open
1 task done
FilipTLW opened this issue Aug 27, 2024 · 1 comment
Open
1 task done

[BUG] Missing draft in generated type for entity #302

FilipTLW opened this issue Aug 27, 2024 · 1 comment
Labels
bug Something isn't working keepalive Will not be closed by Stale bot

Comments

@FilipTLW
Copy link

FilipTLW commented Aug 27, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Nature of Your Project

TypeScript

Current Behavior

I need to access the drafts object of an entity which is used as

Composition of many LimsPlanStepManValueSelectOptions on manValueSelect.parent = $self;

When using

await INSERT.into(LimsPlanStepManValueSelectOption.drafts, manValueSelectObjects)

I get the typescript error
Property 'drafts' does not exist on type 'typeof LimsPlanStepManValueSelectOptions '.
When trying to enable drafts on that entity I get the CAP error
Composition in draft-enabled entity can't lead to another entity with “@odata.draft.enabled” (in entity:“LimsPlanService.LimsPlanStep”/element:“manValueSelect”)

The Typescript error can be avoided using // @ts-ignore which then results in expected behavior.

Expected Behavior

The Typescript definitions of models which are used as Compositions should include a drafts entity in order to be able to properly register event handlers or perform database operations on them, without using // @ts-ignore.

Steps To Reproduce

No response

Environment

- **OS**: Debian GNU/Linux 12 (bookworm) (SAP Business Aplication Studio)
- **Node**: v20.12.0
- **npm**: 10.5.0
- **cds-typer**: 0.25.0
- **cds**: 7.9.4

Repository Containing a Minimal Reproducible Example

No response

Anything else?

No response

@FilipTLW FilipTLW added bug Something isn't working new labels Aug 27, 2024
@daogrady daogrady removed the new label Sep 3, 2024
Copy link

github-actions bot commented Oct 3, 2024

This issue has not been updated in a while. If it is still relevant, please comment on it to keep it open. The issue will be closed soon if it remains inactive.

@github-actions github-actions bot added the stale label Oct 3, 2024
@daogrady daogrady added keepalive Will not be closed by Stale bot and removed stale labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working keepalive Will not be closed by Stale bot
Projects
None yet
Development

No branches or pull requests

2 participants