@dugongjs/core
Version:
20 lines (19 loc) • 1.16 kB
TypeScript
import { type SerializedDomainEvent } from "../../domain/index.js";
import type { IAggregateQueryService } from "../../ports/common/ipc/i-aggregate-query-service.js";
import type { IDomainEventRepository } from "../../ports/index.js";
import type { ILogger } from "../logger/i-logger.js";
export type AggregateQueryServiceOptions = {
currentOrigin: string;
domainEventRepository: IDomainEventRepository;
logger?: ILogger;
};
export declare class AggregateQueryService implements IAggregateQueryService {
private readonly currentOrigin;
private readonly domainEventRepository;
private readonly logger?;
constructor(options: AggregateQueryServiceOptions);
getAggregateTypes(): Promise<string[]>;
getAggregateIds(origin: string | null, aggregateType: string, tenantId?: string | null): Promise<string[]>;
getAggregate(origin: string | null, aggregateType: string, aggregateId: string, tenantId?: string | null, toSequenceNumber?: number): Promise<object | null>;
getDomainEventsForAggregate(origin: string | null, aggregateType: string, aggregateId: string, tenantId?: string | null): Promise<SerializedDomainEvent[]>;
}