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

Remove unused Template resolver from IncomingRequestsController #312

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading