2026-10-07 08:16:39 +00:00
|
|
|
import type { UniqueID } from "@repo/rdx-ddd";
|
|
|
|
|
import type { Result } from "@repo/rdx-utils";
|
|
|
|
|
|
|
|
|
|
import type { SupportConnection } from "../domain/support-connection.aggregate";
|
2026-10-10 16:21:06 +00:00
|
|
|
|
|
|
|
|
export type SupportResource = Readonly<{ id: UniqueID; name: string; active: boolean }>;
|
|
|
|
|
|
2026-10-07 08:16:39 +00:00
|
|
|
import type { SupportError } from "../domain/support-values";
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-07 08:16:39 +00:00
|
|
|
export type SupportContext = Readonly<{
|
|
|
|
|
connections: readonly SupportConnection[];
|
2026-10-10 16:21:06 +00:00
|
|
|
tools: readonly SupportResource[];
|
2026-10-07 08:16:39 +00:00
|
|
|
assetRetired: boolean;
|
|
|
|
|
actorNames: ReadonlyMap<string, string>;
|
|
|
|
|
}>;
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-07 08:16:39 +00:00
|
|
|
export interface ISupportRepository {
|
2026-10-09 22:19:35 +00:00
|
|
|
remove(company: UniqueID, asset: UniqueID, id: UniqueID): Promise<Result<void, SupportError>>;
|
2026-10-07 08:16:39 +00:00
|
|
|
get(company: UniqueID, asset: UniqueID): Promise<Result<SupportContext, SupportError>>;
|
|
|
|
|
save(
|
|
|
|
|
company: UniqueID,
|
|
|
|
|
asset: UniqueID,
|
|
|
|
|
action: (context: SupportContext) => Result<SupportConnection, SupportError>
|
|
|
|
|
): Promise<
|
|
|
|
|
Result<{ connection: SupportConnection; actorNames: ReadonlyMap<string, string> }, SupportError>
|
|
|
|
|
>;
|
|
|
|
|
}
|