Skip to content

Populate {ModelName}Relations through the CLI #2988

@nabdelgadir

Description

@nabdelgadir

Description / Steps to reproduce / Feature proposal

Once #2960 is landed, lb4 model will add a generic empty {ModelName}Relations interface to the model class file.

Cross-posting from #2960 (comment):

@bajtos:

Entries for individual relations would be added to {ModelName}Relations either manually by the application developer or by lb4 relation command.

Current Behaviour

lb4 model generates empty interface, e.g.:

export interface TodoRelations {}

lb4 relation does not add any navigational properties to this empty interface.

Expected Behaviour

  • Enhance lb4 relation to populate {ModelName}Relations

Example:

export interface TodoRelations {
 todoList?: TodoListWithRelations;
}
export interface TodoListRelations {
  todos?: TodoWithRelations[];
  image?: TodoListImageWithRelations;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    RelationsModel relations (has many, etc.)developer-experienceIssues affecting ease of use and overall experience of LB usersfeaturestale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions