interface CustomerInterface {
  id?: number;
  userId: number;
  customerId?: string;
  status: number;
}

interface CodeIdentifierObject {
  code: string;
}

interface SubscriptionWebhookObject {
  subscriptionId?: number;
  metaData?: Object;
  externalStatus?: string; 
  currentPeriodStart?: Date;
  currentPeriodEnd?: Date;
  planData?: Object;
  userId?: number;
  amount?: number; 
  currency?: string;
  externalSubscriptionId?: string;
  subscriptionStatus?: number;
  transactionStatus?: number;
  oldSubscriptionId?: number | null;
}

interface SubscriptionPaymentObject {
  subscriptionId?: number;
  status?: number;
  currentPeriodStart?: Date;
  currentPeriodEnd?: Date;
}
interface TransactionPaymentObject {
  transactionId?: number;
  metaData?: Object;
  externalStatus?: string; 
  amount?: number; 
  status?: number;
}

interface SubscriptionInterface {
  id?: number;
  userId?: number;
  accountId?: number | null;
  planId?: number | null;
  priceId?: number | null;
  externalSubscriptionId?: string;
  currentPeriodStart?: Date;
  currentPeriodEnd?: Date;
  gateway?: string;
  status?: number;
  createdAt?: Date;
  updatedAt?: Date;
  planData?: Object | null;
  transaction?: TransactionInterface;
  transactions?: TransactionInterface[];
}
interface SubscriptionRequestObject {
  email?: string;
  planId: number;
  priceId: number;
  paymentMethodId?: string;
  receipt?: string;
}

interface SubscriptionPaginatedData {
  count: number;
  rows: SubscriptionInterface[];
}

interface SubscriptionListRequestObject {
  page: number;
  perPage: number;
  userId?: number | null;
  status?: number | null;
  // searchText: string | null;
  // sortBy: string;
  // sortDirection: string;
}

interface SubscriptionPaginatedList {
  page: number;
  perPage: number;
  totalRecords: number;
  totalPages?: number;
  data: SubscriptionInterface[] | [];
}

interface TransactionInterface {
  id?: number;
  externalOrderId?: string | null;
  subscriptionId?: number | null;
  planData?: Object | null;
  userId: number;
  externalPaymentId?: string | null;
  amount: number;
  currency: string;
  status: number;
  paidAt?: Date | null;
  gateway?: string;
  metaData?: object;
}

interface TranasctionListRequestObject {
  page: number;
  perPage: number;
  subscriptionId?: number | null;
  userId?: number | null;
  transactionType?: string | null;
}

interface TranasctionPaginatedList {
  page: number;
  perPage: number;
  totalRecords: number;
  totalPages?: number;
  data: TransactionInterface[] | [];
}

interface TransactionPaginatedData {
  count: number;
  rows: TransactionInterface[];
}



interface PaymentInterface {
  id?: number;
  userId?: number;
  accountId?: number | null;
  receiverId?: number | null;
  planId?: number;
  planData?: Object;
  priceId?: number;
  code?: string;
  amount: number;
  currency: string;
  gateway?: string;
  status?: number;
  createdAt?: Date;
  updatedAt?: Date;
  transaction?: TransactionInterface;
}

interface RequiredPlanDataInterface {
  name: string;
  amount: number;
  planId: number;
  priceId: number;
  currency: string;
  duration: number;
  frequency: 'days' | 'weeks' | 'months' | 'years';
  autoRenew?: 0 | 1;
  description: string;
  descriptionText: string;
}

interface ClientSecret{
  clientSecret:string
}

interface ClientSecretRequest{
  amount:number;
  currency:string;
}

interface AppPurchaseVerifyRequestObject {
  platform: string;
  planId: number;
  priceId: number;
  receipt: string;
  purchaseData: {
    productId: string;
    transactionId: string;
  };
}

interface PaymentAttachPaymentMethodServiceInput {
  paymentMethodId: string;
  email: string;
}

interface PaymentMethodIdentifierServiceInput {
  paymentMethodId: string;
}

interface PaymentBuySubscriptionServiceInput {
  planId: number;
  priceId: number;
}



interface PaymentUpdateSubscriptionServiceInput {
  planId: number;
  priceId: number;
  userId?: number | null;
}

interface PaymentCancelSubscriptionServiceInput {
  id: number;
}

interface PaymentGetSubscriptionByIdServiceInput {
  id: number;
}

interface PaymentGetSubscriptionsServiceInput {
  listRequest: SubscriptionListRequestObject;
  forUser: boolean;
}

interface PaymentGetTransactionsServiceInput {
  listRequest: TranasctionListRequestObject;
  forUser: boolean;
}

interface PaymentInitiatePaymentServiceInput {
  email: string;
  planId: number;
  priceId: number;
}

interface PaymentUpdatePaymentServiceInput {
  planId: number;
  priceId: number;
}

interface PaymentInitiateRefundServiceInput {
  transactionId: number;
  amount: number;
}

interface PaymentFetchStatusServiceInput {
  merchantOrderId: string;
}



interface PaymentWebhookServiceInput {
  data: any;
}

interface PaymentCreateWalletIntentServiceInput {
  amount: number;
  currency: string;
}

interface PaymentRevenueStatsServiceInput {
  startDate?: Date | null;
  endDate?: Date | null;
}

interface PaymentSubscriptionStatsServiceInput {
  startDate?: Date | null;
  endDate?: Date | null;
}

interface PaymentSubscriptionUserStatsServiceInput {
  startDate?: Date | null;
  endDate?: Date | null;
}

interface PaymentAddTrialSubscriptionServiceInput {
  userId: number;
}

interface PaymentExpireSubscriptionServiceInput {
  subscriptionId: number;
}

interface PaymentUpdateEndedSubscriptionsServiceInput {
  startDate?: Date | null;
  endDate?: Date | null;
}

interface PaymentAppPurchaseServiceInput {
  planId: number;
  priceId: number;
  purchaseData: any;
}

interface PaymentVerifyAppPurchaseServiceInput {
  platform: string;
  planId: number;
  priceId: number;
  receipt: string;
  purchaseData: {
    productId: string;
    transactionId: string;
  };
}
