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

Feature: Add support for simplified @Entity decorator basic usage #141

Closed
jrista opened this issue Aug 9, 2020 · 0 comments
Closed

Feature: Add support for simplified @Entity decorator basic usage #141

jrista opened this issue Aug 9, 2020 · 0 comments
Assignees
Labels
approved Approved for Implementation enhancement New feature or request
Milestone

Comments

@jrista
Copy link
Contributor

jrista commented Aug 9, 2020

When creating entity model types for consumption by Auto-Entity, the @Entity decorator is required. Currently, that decorator in turn requires an IEntityOptions object to be passed with at least a modelName string property. For many simpler use cases, the model name may be the only property required.

This proposal recommends that the @Entity decorator be enhanced to support simpler usage, by requiring either a string for the model name, or the full IEntityOptions object, be passed in. This would allow simple usage as follows:

@Entity('MyEntity')
export class MyEntity {
	@Key id: number;
}
@jrista jrista added enhancement New feature or request approved Approved for Implementation labels Aug 9, 2020
@jrista jrista added this to the 0.5.0 Beta milestone Aug 9, 2020
@jrista jrista self-assigned this Aug 9, 2020
@jrista jrista modified the milestones: 0.5.0 Beta, 0.6.0 Alpha 1 Aug 14, 2020
@jrista jrista modified the milestones: 0.6.0 Alpha 1, 0.5.0 Beta 3 Aug 30, 2020
jrista pushed a commit that referenced this issue Aug 30, 2020
 * Introduce to `defaultMaxAge` to IEntityOptions
 + Add EntityAge with predefined common ages for use with `defaultMaxAge`
 * Update @entity decorator to support passing name in only or options or both
 > Move key decorator tokens into entity-tokens.ts
 > Extract entity decorator into its own file entity-decorator.ts
 > Extract key decorator into its own file key-decorator.ts
 * Update index/public api to reference all exports from new locations
 * Added EntityAge enum to public api
 * Removed all imports from '../..'

Issues #144 #141
jrista pushed a commit that referenced this issue Aug 30, 2020
 * Introduce to `defaultMaxAge` to IEntityOptions
 + Add EntityAge with predefined common ages for use with `defaultMaxAge`
 * Update @entity decorator to support passing name in only or options or both
 > Move key decorator tokens into entity-tokens.ts
 > Extract entity decorator into its own file entity-decorator.ts
 > Extract key decorator into its own file key-decorator.ts
 * Update index/public api to reference all exports from new locations
 * Added EntityAge enum to public api
 * Removed all imports from '../..'

Issues #144 #141
jrista pushed a commit that referenced this issue Aug 30, 2020
 * Introduce to `defaultMaxAge` to IEntityOptions
 + Add EntityAge with predefined common ages for use with `defaultMaxAge`
 * Update @entity decorator to support passing name in only or options or both
 > Move key decorator tokens into entity-tokens.ts
 > Extract entity decorator into its own file entity-decorator.ts
 > Extract key decorator into its own file key-decorator.ts
 * Update index/public api to reference all exports from new locations
 * Added EntityAge enum to public api
 * Removed all imports from '../..'

Issues #144 #141
jrista pushed a commit that referenced this issue Aug 30, 2020
 * Introduce to `defaultMaxAge` to IEntityOptions
 + Add EntityAge with predefined common ages for use with `defaultMaxAge`
 * Update @entity decorator to support passing name in only or options or both
 > Move key decorator tokens into entity-tokens.ts
 > Extract entity decorator into its own file entity-decorator.ts
 > Extract key decorator into its own file key-decorator.ts
 * Update index/public api to reference all exports from new locations
 * Added EntityAge enum to public api
 * Removed all imports from '../..'

Issues #144 #141
@jrista jrista closed this as completed Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved for Implementation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant