Skip to content

Commit

Permalink
Remove unused Template resolver from IncomingRequestsController (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
Magnus-Kuhn authored Oct 24, 2024
1 parent 0ff6901 commit 22cbba8
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ export class ConsumptionController {
this,
this.transport.eventBus,
this.accountController.identity,
this.accountController.relationships,
this.accountController.relationshipTemplates
this.accountController.relationships
).init();

const notificationItemProcessorRegistry = new NotificationItemProcessorRegistry(this, this.getDefaultNotificationItemProcessors());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ export class IncomingRequestsController extends ConsumptionBaseController {
private readonly relationshipResolver: {
getRelationshipToIdentity(id: CoreAddress): Promise<Relationship | undefined>;
getExistingRelationshipToIdentity(id: CoreAddress): Promise<Relationship | undefined>;
},
private readonly relationshipTemplateResolver: {
getRelationshipTemplate(id: CoreId): Promise<RelationshipTemplate | undefined>;
}
) {
super(ConsumptionControllerName.RequestsController, parent);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IDatabaseConnection } from "@js-soft/docdb-access-abstractions";
import { IRequest, IRequestItemGroup, RejectResponseItem, Request, RequestItemGroup, ResponseItem, ResponseItemGroup, ResponseItemResult } from "@nmshd/content";
import { CoreDate, CoreId } from "@nmshd/core-types";
import { CoreIdHelper, RelationshipTemplate, TransportLoggerFactory } from "@nmshd/transport";
import { CoreIdHelper, TransportLoggerFactory } from "@nmshd/transport";
import {
ConsumptionIds,
DecideRequestItemGroupParametersJSON,
Expand Down Expand Up @@ -1027,7 +1027,6 @@ describe("IncomingRequestsController", function () {
items: [TestRequestItem.from({ mustBeAccepted: false })]
});
const template = TestObjectFactory.createIncomingIRelationshipTemplate();
context.templateToReturnFromGetTemplate = RelationshipTemplate.from(template);

let cnsRequest = await context.incomingRequestsController.received({
receivedRequest: request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class RequestsTestsContext {
public mockEventBus = new MockEventBus();
public relationshipToReturnFromGetRelationshipToIdentity: Relationship | undefined;
public relationshipToReturnFromGetExistingRelationshipToIdentity: Relationship | undefined;
public templateToReturnFromGetTemplate: RelationshipTemplate | undefined;

public consumptionController: ConsumptionController;

private constructor() {
Expand Down Expand Up @@ -114,9 +114,6 @@ export class RequestsTestsContext {
{
getRelationshipToIdentity: () => Promise.resolve(context.relationshipToReturnFromGetRelationshipToIdentity),
getExistingRelationshipToIdentity: () => Promise.resolve(context.relationshipToReturnFromGetExistingRelationshipToIdentity)
},
{
getRelationshipTemplate: () => Promise.resolve(context.templateToReturnFromGetTemplate)
}
);

Expand All @@ -139,7 +136,6 @@ export class RequestsTestsContext {
this.actionToTry = undefined;
this.relationshipToReturnFromGetRelationshipToIdentity = undefined;
this.relationshipToReturnFromGetExistingRelationshipToIdentity = undefined;
this.templateToReturnFromGetTemplate = undefined;

TestRequestItemProcessor.numberOfApplyIncomingResponseItemCalls = 0;

Expand Down Expand Up @@ -230,12 +226,6 @@ export class RequestsGiven {
requestSourceObject: params.requestSource
});

try {
this.context.templateToReturnFromGetTemplate = RelationshipTemplate.from(params.requestSource as any);
} catch (_) {
// the source is not a template
}

await this.moveIncomingRequestToStatus(localRequest, params.status);

this.context.givenLocalRequest = localRequest;
Expand Down

0 comments on commit 22cbba8

Please sign in to comment.