metis-desk/modules/assets/src/api/application/infrastructure.repository.ts
2026-10-17 17:01:16 +02:00

29 lines
786 B
TypeScript

import type { UniqueID } from "@repo/rdx-ddd";
import type { Result } from "@repo/rdx-utils";
import type { AssetCatalogError } from "../domain/asset-definition";
import type { AssetInfrastructure } from "../domain/asset-infrastructure.aggregate";
export interface IInfrastructureRepository {
get(
company: UniqueID
): Promise<
Result<
{ items: readonly AssetInfrastructure[]; actorNames: ReadonlyMap<string, string> },
AssetCatalogError
>
>;
save(
company: UniqueID,
asset: UniqueID,
change: (
previous: AssetInfrastructure | undefined
) => Result<AssetInfrastructure, AssetCatalogError>
): Promise<
Result<
{ item: AssetInfrastructure; actorNames: ReadonlyMap<string, string> },
AssetCatalogError
>
>;
}