29 lines
786 B
TypeScript
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
|
|
>
|
|
>;
|
|
}
|