Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
chore: rename Entity to EntityType
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwwinter committed Feb 29, 2024
1 parent df65143 commit e245bab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
15 changes: 11 additions & 4 deletions src/query/core/entity-config-resolver.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { IEntityConfigResolver } from './entity-config-resolver.interface';
import { map, Observable } from 'rxjs';
import { Entity, EntityAttribute, EntityConfig } from '../domain/EntityConfig';
import {
EntityAttribute,
EntityConfig,
EntityType,
} from '../domain/EntityConfig';
import { CouchDbClient } from '../../couchdb/couch-db-client.service';

export interface AppConfigFile {
Expand Down Expand Up @@ -39,7 +43,7 @@ export class EntityConfigResolver implements IEntityConfigResolver {
const keys = Object.keys(config.data).filter((key) =>
key.startsWith('entity:'),
);
const entities: Entity[] = [];
const entities: EntityType[] = [];
for (let i = 0; i < keys.length; i++) {
entities.push(this.parseEntityConfig(keys[i], config));
}
Expand All @@ -48,7 +52,10 @@ export class EntityConfigResolver implements IEntityConfigResolver {
);
}

private parseEntityConfig(entityKey: string, config: AppConfigFile): Entity {
private parseEntityConfig(
entityKey: string,
config: AppConfigFile,
): EntityType {
const data = config.data[entityKey];

let label: string;
Expand All @@ -67,6 +74,6 @@ export class EntityConfigResolver implements IEntityConfigResolver {
),
);

return new Entity(label, attributes);
return new EntityType(label, attributes);
}
}
4 changes: 2 additions & 2 deletions src/query/domain/EntityConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class EntityAttribute {
) {}
}

export class Entity {
export class EntityType {
constructor(
public label: string,
public attributes: EntityAttribute[],
Expand All @@ -15,6 +15,6 @@ export class Entity {
export class EntityConfig {
constructor(
public version: string,
public entities: Entity[],
public entities: EntityType[],
) {}
}

0 comments on commit e245bab

Please sign in to comment.