export interface IPostCategory {
  id: number;
  code: string;
  name: string;
}

export interface IPostTag {
  id: number;
  code: string;
  name: string;
}

export interface IAuthorSocialLink {
  url: string;
  platform: string;
}

export interface IProfileImage {
  filePath: string;
  id: number;
}

export interface IPostAuthor {
  id: number;
  onlineStatus: number;
  name: string;
  profileImage: IProfileImage | null;
  aboutMe: string | null;
  socialMediaLinks: IAuthorSocialLink[] | null;
}

export interface IFeaturedImage {
  id: number;
  cdnUrl: string;
  fileName: string;
  filePath: string;
  uniqueName: string;
}

export interface IBlogPost {
  id: number;
  code: string;
  postType: string;
  status: string;
  visibility: string;
  isExclusive: boolean;
  publishedAt: string;
  isFeatured: boolean;
  createdAt: string;
  updatedAt: string;
  title: string;
  featuredImage: IFeaturedImage | null;
  commentsCount: number;
  postCategories: IPostCategory[];
  postTags: IPostTag[];
  author: IPostAuthor;
  limitedContent: string | null;
  description: string | null;
  descriptionText: string | null;
  exerpt: string | null;
}

export interface IBlogPostsResponseData {
  data: IBlogPost[];
  page: number;
  perPage: number;
  totalRecords: number;
  totalPages: number;
}

// Static "page" posts (postType: "page") — e.g. the Privacy/Terms/Refund/
// Disclaimer documents rendered on the Legal page. Body lives in limitedContent
// as HTML.
export interface IPagePost {
  id: number;
  code: string;
  postType: string;
  status: string | null;
  visibility: string;
  publishedAt: string | null;
  createdAt: string;
  updatedAt: string;
  title: string;
  limitedContent: string | null;
  description: string | null;
  metaTitle: string | null;
  metaDescription: string | null;
}

export interface IPagesResponseData {
  data: IPagePost[];
  page: number;
  perPage: number;
  totalRecords: number;
  totalPages: number;
}

export interface IBlogCommentAuthor {
  id: number;
  onlineStatus: number;
  name: string;
  profileImage: IProfileImage | null;
  rank?: string;
}

export interface IBlogComment {
  id: number;
  userId: number;
  postId: number;
  parentId: number | null;
  content: string;
  status: string;
  createdAt: string;
  updatedAt: string;
  author: IBlogCommentAuthor;
  replies: IBlogCommentsBlock;
}

export interface IBlogCommentsBlock {
  page: number;
  perPage: number;
  totalRecords: number;
  totalPages: number;
  data: IBlogComment[];
}

export interface IBlogPostDetail extends IBlogPost {
  metaTitle: string | null;
  metaDescription: string | null;
  metaKeywords: string | null;
  canonicalUrl: string | null;
  exerpt: string | null;
  postAttachments: IFeaturedImage[];
  comments: IBlogCommentsBlock;
}

export interface IBlogCategory {
  id: number;
  code: string;
  status: number;
  level: number;
  refLink: string | null;
  createdAt: string;
  updatedAt: string;
  name: string;
  description: string;
  descriptionText: string | null;
  childCount: number;
  treeCount: number;
  categoryImage: string | null;
}
