-
-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: tag type service feature oriented architecture and tx suppo…
…rt (#5489)
- Loading branch information
Showing
21 changed files
with
124 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/lib/features/export-import-toggles/import-permissions-service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Db } from '../../db/db'; | ||
import EventStore from '../../db/event-store'; | ||
import { IUnleashConfig } from '../../types'; | ||
import { EventService } from '../../services'; | ||
import FeatureTagStore from '../../db/feature-tag-store'; | ||
import FakeEventStore from '../../../test/fixtures/fake-event-store'; | ||
import FakeFeatureTagStore from '../../../test/fixtures/fake-feature-tag-store'; | ||
import TagTypeService from './tag-type-service'; | ||
import TagTypeStore from './tag-type-store'; | ||
import FakeTagTypeStore from './fake-tag-type-store'; | ||
|
||
export const createTagTypeService = | ||
(config: IUnleashConfig) => | ||
(db: Db): TagTypeService => { | ||
const { getLogger, eventBus } = config; | ||
const eventStore = new EventStore(db, getLogger); | ||
const featureTagStore = new FeatureTagStore(db, eventBus, getLogger); | ||
const eventService = new EventService( | ||
{ | ||
eventStore, | ||
featureTagStore, | ||
}, | ||
config, | ||
); | ||
const tagTypeStore = new TagTypeStore(db, eventBus, getLogger); | ||
return new TagTypeService({ tagTypeStore }, config, eventService); | ||
}; | ||
|
||
export const createFakeTagTypeService = ( | ||
config: IUnleashConfig, | ||
): TagTypeService => { | ||
const eventStore = new FakeEventStore(); | ||
const featureTagStore = new FakeFeatureTagStore(); | ||
const eventService = new EventService( | ||
{ | ||
eventStore, | ||
featureTagStore, | ||
}, | ||
config, | ||
); | ||
const tagTypeStore = new FakeTagTypeStore(); | ||
|
||
return new TagTypeService({ tagTypeStore }, config, eventService); | ||
}; |
4 changes: 2 additions & 2 deletions
4
src/test/fixtures/fake-tag-type-store.ts → .../features/tag-type/fake-tag-type-store.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
src/lib/services/tag-type-service.ts → ...lib/features/tag-type/tag-type-service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/lib/types/stores/tag-type-store.ts → .../features/tag-type/tag-type-store-type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
src/lib/db/tag-type-store.ts → src/lib/features/tag-type/tag-type-store.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 17 additions & 4 deletions
21
src/test/e2e/api/admin/tag-types.e2e.test.ts → ...b/features/tag-type/tag-types.e2e.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters