export interface IApiResponse {
  records: any;
  id: string;
  code: number;
  status: boolean;
  message: string;
  data: object | string;
  title: string;
}

export interface IApiResponseInvoice {
  records: any;
  id: string;
  code: number;
  status: boolean;
  message: string;
  data: object | string;
  title: string;


}

export interface IActivityHistoryApiResponse {
  records: any;
  id: string;
  code: number;
  status: boolean;
  message: string;
  data: {
    customer: any[];  // Array of customer objects (or you can create a more detailed type for customer if needed)
    emailLogs: any[]; // Array of email logs (or you can create a more detailed type for email logs if needed)
    smsLogs: any[];
    noteLogs: any[]; 
    notes: any[];// Optional field for note logs, if you decide to include them in the response
    projects: any[];
    projectLogs: any[];
  };
  title: string;
}

export interface IActivityHistoryProjectApiResponse {
  records: any;
  id: string;
  code: number;
  status: boolean;
  message: string;
  data: {
    customerProjects: any[];  // Array of customer objects (or you can create a more detailed type for customer if needed)
    emailLogs: any[]; // Array of email logs (or you can create a more detailed type for email logs if needed)
    smsLogs: any[];
    noteLogs: any[]; 
    notes: any[];// Optional field for note logs, if you decide to include them in the response
  };
  title: string;
}


export interface IApiResponseWorkOrder {
  records: any;
  id: string;
  code: number;
  status: boolean;
  message: string;
  data: {
    id: string;
  };
  title: string;
}

export interface IApiLoopingResponse {
  records: any;
  // id: string;
  code: number;
  status: boolean;
  message: string;
  data: {
    id: string;
    productDetailsIsLooping: boolean;
    productsDetailsLoopingConstant: string;
  };
  title: string;
}

export interface IApiCustomerResponse {
  records: any;
  // id: string;
  code: number;
  status: boolean;
  message: string;
  data: {
    id: string;
  };
  title: string;
}

export interface IUser {
  username: string;
  password: string;
}

export interface IAuth {
  token: string;
}

export interface ICategory {
  id: number;
  categoryName: string;
  departmentId: number;
  roleId: number;
  coursingId: number;
  servingSize: number;
  hidePos: boolean;
  hideOnlineOrder: boolean;
  hideKiosk: boolean;
  Conversational: boolean;
  itemServiceCharge: string;
  ageRestriction: boolean;
  excludeCheckTax: boolean;
  taxeId: number;
  kitchenPrintersTypes: string;
  categoryButtonColor: string;
  categoryIsLooping: string;
  categoryLoopingConstant: string;
  categoryPrinterIds: number[];
  itemServiceChargeId: string;
  itemServiceChargePrice: string;
  categoryImg: string;
  isActive: boolean;
  mainCatId: number;
  parent_ids: number[];
}

export interface ICategoryNew {
  categoryName: string;
  departmentId: string;
  roleId: number[];
  coursingId: string;
  servingSize: number[];
  hidePos: boolean;
  hideOnlineOrder: boolean;
  hideKiosk: boolean;
  Conversational: boolean;
  ageRestriction: boolean;
  excludeCheckTax: boolean;
  taxeId: string;
  categoryButtonColor: string;
  categoryIsLooping: boolean;
  categoryLoopingConstant: string;
  categoryPrinterIds: number[];
  itemServiceChargeId: string;
  itemServiceChargePrice: string;
  categoryImg: string | null;
  isActive: boolean;
  parent_ids: number[] | null;
  mainCatId: string;
}
export interface ICategoryNeww {
  categoryName: string;
  categoryImg: string;
}

export interface ICompanyDetails {
  id: number;
  companyName: string;
  companyProvince: string;
  companyCity: string;
  companyPostalCode: string;
  companyEmail: string;
  companyMobileNumber: string;
  companyAltMobileNumber: string;
  companyWebSiteLink: string;
  companyDescription: string;
  companyStreetNumber: string;
  companyStreetName: string;
  companyPaymentMethod: string;
  CompanyLogo: string;
  isDefault: number;
}

export interface IDepartment {
  id: number;
  departmentName: string;
  description: string;
  DepartmentPrinterIds: number[];
}

export interface ICoursing {
  id: number;
  coursingName: string;
  priocity: string;
}

export interface ITaxes {
  id: number;
  taxName: string;
  taxType: string;
  applyTo: string;
  percentage: string;
  taxCode: string;
  isDefault: boolean;
}

export interface IProductCategory {
  id: number;
  productCatName: string;
  productCatDescription: string;
  productCatImg: string;
  isMain: boolean;
  isActive: boolean;
  mainCatId: number;
  productCategoryIsLooping: boolean;
  productCategoryIsLoopingConstant: number;
}

export interface IProductTag {
  id: number;
  tagName: string;
  isActive: boolean;
}

export interface IProductBrand {
  id: number;
  productBrandName: string;
  isActive: boolean;
}

export interface IPrinter {
  id: number;
  printerName: string;
  printerDescription: string;
}

export interface IProduct {
  productName: string;
  productShortDescription: string;
  productLongDescription: string;
  productConversionUnit: number[];
  productBrandId: string;
  productCategoryId: string;
  productTagIds: number[];
  productViewOnline: boolean; 
  productPrinterIds: number[];
  productIcon: string;
  productImg: string;
  productButtonColor: string;
  productBarcode: string;
  isActive: boolean;
  productDetailsIsLooping: boolean;
  productsDetailsLoopingConstant: string;
  productCanSell: boolean;
  productPrice: string;
  mainCatId: string,
  loopingDetails?:{
    tableName: string;
    shortTableName: string;
    tableColumns: {
      name: string;
      type: string;
      columnField: string;
      options: string[];
      value: any;
    }[];
  };
}

export interface IProductEx {
  productName: string;
  productCategoryId: string;
  mainCatId: string,
  productDetailsIsLooping: boolean;
  productsDetailsLoopingConstant: string;

}

export interface IProductPopUP {
  id: string;
  productName: string;
  phoneType: string;
  productShortDescription: string;
  productLongDescription: string;
  productConversionUnit: number[];
  productBrandId: number | null;
  productCategoryId: number;
  ProductCategoryLevel: number;
  productTagIds: number[];
  productViewOnline: boolean; // Assuming this should be a boolean
  productPrinterIds: number[];
  productIcon: string;
  productImg: string;
  productButtonColor: string;
  productBarcode: string;
  isActive: boolean;
  productPrice: string;
  productDetailsIsLooping: boolean;
  productsDetailsLoopingConstant: string;
  productsDetailsLoopingProductId: string;
  phoneLoopingDetails?: {
    productId: string;
    phoneType: string;
    phoneColor: string;
    phoneLoopingId: number;
  };
  computerLoopingDetails?: {
    productId: string;
    computerModel: string;
    computerRam: string;
    computerLoopingId: number;
  };
  productCanSell: boolean;
  productMainCategoryId: string;
  loopingDetails?:{
    tableName: string;
    shortTableName: string;
    tableColumns: {
      name: string;
      type: string;
      columnField: string;
      options: string[];
      value: any;
    }[];
  };
}

export interface ILastProductId {
  lastInsertedId: number;
}

export interface IProductPayload {
  productBrandId: string | null;
  productCategoryId: string | null;
  productTagIds: string[] | null;
  productViewOnline: string | null;
  createdDateEnd: Date | null;
  createdDateStart: Date | null;
  searchText: string | null;
  createdDate: string | null;
  id: string | null;
}

export interface ICategoryPayload {
  departmentId: string;
  coursingId: string;
  roleId: string[] | null;
  taxeId: string;
  createdDateEnd: Date | null;
  createdDateStart: Date | null;
  searchText: string;
  numberOfLength: number| null;
  isActive: boolean | null;
  categoryIsLooping: string | null;
  createdDate: string | null;
}

export interface IUpdateStatuInvoicePayload {
  id: string;
  mainStatus: string;
}

export interface ISearchPayload {
  searchText: string;
}

export interface IModifier {
  id: number;
  modifierName: string;
  modifierTaxeIds: number[];
  modifierPrinterIds: number[];
  maxNoOfTimes: number;
  setModifierPrice: boolean;
  modifierPrice: number;
}

export interface ISearchIsActivePayload {
  searchText: string;
  isActive: boolean | null;
}

export interface ILoopingTableListPayload {
  searchText: string;
  id: string;
}

export interface IInvoiceListPayload {
  searchText: string;
  id: string;
  quoteWorkOrderCustomerId: string;
  quoteWorkOrderCustomerProjectId: string;
}

export interface IPriceHistoryPayload {
  productName: string;
  transferTypeFrom: string;
  transferTypeTo: string;
}

export interface IWorkOrderHistoryPayload {
  id: string;
}

export interface ICustomerTransactionPayload {
  searchText: string;
  customerId: string;
  projectId: string;
}

export interface ICustomerProjectPayload {
  searchText: string;
  customerId: string;
  id: string;
}

export interface IWorkOrderByCustomerProjectPayload {
  searchText: string;
  quoteWorkOrderCustomerId: string;
  quoteWorkOrderCustomerProjectId: string | null;
}

export interface ISelectCustomerPayload {
  quoteWorkOrderCustomerId: string;
}

export interface IUpdateWorkOrderByCustomerProjectPayload {
  id: number;
  quoteWorkOrderCustomerId: string;
  quoteWorkOrderCustomerProjectId: string;
}

export interface IRemovedorkOrderByCustomerProjectPayload {
  id: string;
  quoteWorkOrderCustomerId: string;
}

export interface ILoopingTablePayload {
  tableName: string;
}

export interface IGetByCategoryPayload {
  categoryId: string;
}

export interface IGetByCategoryArrayPayload {
  parent_ids: number[];
}

export interface ISubCategory {
  id: number;
  categoryName: string;
  subCatDescription: string;
  subCatImg: string;
  subIsMain: boolean;
  isActive: boolean;
  mainCatId: number;
  parentIds: number[];
  parent_ids: number[];
  categoryIsLooping: string;
  categoryLoopingConstant: string;
}

export interface ICategoryFilterPayload {
  searchText: string;
  numberOfLength: number;
  isActive: boolean | null;
}

export interface ILoopingTable {
  id: string;
  tableName: string;
  shortTableName: string;
  tableColumns: { name: string, type: string, columnField: string, options?: string[]}[];
}

export interface ILoopingWithDataTable {
  id: string;
  tableName: string;
  shortTableName: string;
  tableColumns: { 
    name: string; 
    type: string; 
    columnField: string; 
    options?: string[]; 
    value?: string | []; 
  }[];
  [key: string]: any; 
}

export interface ICustomer {
  id: number; 
  customerFirstName: string;
  customerLastName: string;
  customerMobileNum: string;
  customerEmail: string;
  customerAddress: string; 
  customerDescription: string;
  customerCompanyName: string;
  customerCompanyPhoneNumebr: string;
  customerCompanyEmail: string; 
  customerPreferTimeToCall: string;
  customerImg: string;
}

export interface TimeSlot {
  startTime: string;
  endTime: string;
  hourlySalary: string;
}

export interface Availability {
  day: string;
  timeSlots: TimeSlot[];
}

export interface IDriver {
  id: number;
  driverMobileNum: string;
  driverFirstName: string;
  driverLastName: string;
  driverImg: string;
  driverCity: string;
  driverAddress: string;
  driverAltMobileNum: string;
  driverEmail: string;
  driverDescription: string;
  driverUserRole: string;
  driverUserName: string;
  driverPassWord: string;
  availability: Availability[];
  projectId: number[];
}
export interface ICustomerTransaction {
  id: number; 
  transactionName: string;
  customerId: string;
  transactionAmount: string;
  transactionDescription: string;
  transactionCollection: string; 
  transactionCollectionDate: string;
  istransactionReminder: boolean;
  transactionReminderDate: string;
  transactionReminderMedia: string[]; 
  created_at: string;
  projectId: string;
}

export interface ICustomerProject {
  id: number; 
  projectName: string;
  created_at: string;
  customerId: string;
  projectType: string;
  projectDomainName: string;
  projectPhoneNumber: string;
  projectAddress: string;
  projectStartDate: string;
  projectEstimatedEndDate: string;
  projectProposalDate: string;
  projectUploadProposal: string;
  workOrderIds: string;
  projectDescription: string;
  projectEmail: string;
}

export interface ProductSale {
  productName: string;
  quantity: number;
  price: number;
  tax: number;
  total: number;
}

export interface IQuoteWorkOrder {
  id: number;
  quoteWorkOrderCompanyId: number;
  quoteWorkOrderCustomerId: string;
  quoteWorkOrderNo: string;
  quoteWorkOrderIssueDate: string | null;
  quoteWorkOrderDueDate: string | null; 
  quoteWorkOrderAmount: number | null;
  quoteWorkOrderStatus: number;
  quoteWorkOrderSale: ProductSale[];
  quoteWorkOrderDiscount: string;
  quoteWorkOrderSubTotal: string;
  quoteWorkOrderSaleGrandTotal: string;
  quoteWorkOrderSaleDiscountDescription: string | null;
  customer: ICustomer;
  company: ICompanyDetails;
  created_at: string;
  quoteWorkOrderCustomerProjectId: string;
}

export interface IInvoice {
  id: number;
  work_order_id: number;
  InvoiceNo: string;
  quoteWorkOrderCompanyId: number;
  quoteWorkOrderCustomerId: string;
  quoteWorkOrderNo: string;
  quoteWorkOrderIssueDate: string | null;
  quoteWorkOrderDueDate: string | null; 
  quoteWorkOrderAmount: number | null;
  quoteWorkOrderStatus: number;
  quoteWorkOrderSale: ProductSale[];
  quoteWorkOrderDiscount: string;
  quoteWorkOrderSubTotal: string;
  quoteWorkOrderSaleGrandTotal: string;
  quoteWorkOrderSaleDiscountDescription: string | null;
  customer: ICustomer;
  company: ICompanyDetails;
  created_at: string;
}

export interface IProductPopUP {
  id: string;
  productName: string;
  phoneType: string;
  productShortDescription: string;
  productLongDescription: string;
  productConversionUnit: number[];
  productBrandId: number | null;
  productCategoryId: number;
  ProductCategoryLevel: number;
  productTagIds: number[];
  productViewOnline: boolean;
  productPrinterIds: number[];
  productIcon: string;
  productImg: string;
  productButtonColor: string;
  productBarcode: string;
  isActive: boolean;
  productDetailsIsLooping: boolean;
  productsDetailsLoopingConstant: string;
  productsDetailsLoopingProductId: string;
  productCanSell: boolean;
  productMainCategoryId: string;
  loopingDetails?:{
    tableName: string;
    shortTableName: string;
    tableColumns: {
      name: string;
      type: string;
      columnField: string;
      options: string[];
      value: any;
    }[];
  }

}


export interface IEmail {
  id: number; 
  to: string;
  subject: string;
  message: string;
  invoice: string;
}

export interface IText {
  id: number; 
  to: string;
  message: string;
  
}

export interface INote {
  id: number; 
  to: string;
  subject: string;
  message: string;
  
}

export interface INoteEmail {
  id: number; 
  note_subject: string;
  note_message: string;
  
}

export interface IEmailTemplate {
  id: number;
  template_name: string;
  subject: string;
  message: string;
  is_mandatory : number;
  is_show : number;

}

export interface INoteTemplate {
  id: number;
  note_title: string;
  subject: string;
  note_message: string;
}


export interface IPermissionAction {
  id: number;
  action: "view" | "create" | "edit" | "delete";
  key: string; // e.g. "project.view"
}

export interface IPermissionModuleGroup {
  module: string;        // e.g. "project"
  label: string;         // e.g. "Project"
  permissions: IPermissionAction[];
}

export interface IRoleModuleSummary {
  module: string;
  label: string;
  actions: string[]; // e.g. ["view", "create"]
}

export interface IRole {
  id: number;
  name: string;
  description: string | null;
  is_system: boolean;
  user_count: number;
  permission_count: number;
  modules: IRoleModuleSummary[];
}

export interface ICreateRolePayload {
  name: string;
  description?: string;
  permission_ids: number[];
}

export interface IUpdateRolePayload {
  id: number;
  name?: string;
  description?: string;
  permission_ids?: number[];
}


