@omnia/fx-models
Version:
Provide Omnia Fx Models Stuffs.
42 lines (41 loc) • 1.31 kB
TypeScript
import { GuidValue } from "@omnia/fx-models/internal-do-not-import-from-here/shared/models";
import { Identity, ResolvedUserIdentity } from "./identities";
import { ISocialReaction } from "./SocialReaction";
export interface IPostOwner {
omniaServiceId: GuidValue;
}
export interface IPostTypeIdentifier {
postTypeId: GuidValue;
}
export interface IPostIdentifier {
postId: GuidValue;
}
export interface IPostReference extends IPostIdentifier, IPostOwner, IPostTypeIdentifier {
}
export interface IPostBaseWithContext<TPostContext extends IPostBaseContext> extends IPostBase {
context: TPostContext;
}
export interface IPostBase extends IPostTypeIdentifier {
parentId?: GuidValue;
mentionedUsers?: Array<ResolvedUserIdentity>;
content: string;
}
export interface IPostBaseContext extends IPostOwner {
getTopicId: () => GuidValue;
}
export interface IPostLike extends ISocialReaction {
id: GuidValue;
postId: GuidValue;
topicId: GuidValue;
}
export interface IPersistedPost<TPostType extends IPostBase> extends IPostReference {
post: TPostType;
createdBy?: Identity;
createdAt?: string;
modifiedBy?: Identity;
modifiedAt?: string;
deletedBy?: Identity;
deletedAt?: string;
likedBy: Array<Identity>;
likes?: Array<IPostLike>;
}