/** Types generated for queries found in "src/modules/auth/providers/invitations.provider.ts" */
export type DateOrString = Date | string;

export type stringArray = (string)[];

/** 'GetActiveInvitationsByEmails' parameters type */
export interface IGetActiveInvitationsByEmailsParams {
  emails?: stringArray | null | void;
  ownerId?: string | null | void;
}

/** 'GetActiveInvitationsByEmails' return type */
export interface IGetActiveInvitationsByEmailsResult {
  /** Email address of the invited user */
  email: string;
  /** Unique invitation identifier */
  id: string;
}

/** 'GetActiveInvitationsByEmails' query type */
export interface IGetActiveInvitationsByEmailsQuery {
  params: IGetActiveInvitationsByEmailsParams;
  result: IGetActiveInvitationsByEmailsResult;
}

/** 'GetInvitationsByTokens' parameters type */
export interface IGetInvitationsByTokensParams {
  tokenHashes: readonly (string | null | void)[];
}

/** 'GetInvitationsByTokens' return type */
export interface IGetInvitationsByTokensResult {
  /** Timestamp when invitation was accepted (NULL until accepted, single-use token tracking) */
  accepted_at: Date | null;
  /** Auth0 user ID from pre-registration (e.g., 'auth0|507f1f77bcf86cd799439011'), used for cleanup */
  auth0_user_id: string | null;
  /** Business the user is being invited to */
  business_id: string;
  /** Invitation expiration timestamp (typically 7 days from creation) */
  expires_at: Date;
  /** Unique invitation identifier */
  id: string;
  /** Role to assign to the user upon acceptance */
  role_id: string;
  /** SHA-256 hash of invitation token (never store plaintext token) */
  token_hash: string;
}

/** 'GetInvitationsByTokens' query type */
export interface IGetInvitationsByTokensQuery {
  params: IGetInvitationsByTokensParams;
  result: IGetInvitationsByTokensResult;
}

/** 'ListInvitations' parameters type */
export interface IListInvitationsParams {
  ownerId?: string | null | void;
}

/** 'ListInvitations' return type */
export interface IListInvitationsResult {
  /** Email address of the invited user */
  email: string;
  /** Invitation expiration timestamp (typically 7 days from creation) */
  expires_at: Date;
  /** Unique invitation identifier */
  id: string;
  /** Role to assign to the user upon acceptance */
  role_id: string;
}

/** 'ListInvitations' query type */
export interface IListInvitationsQuery {
  params: IListInvitationsParams;
  result: IListInvitationsResult;
}

/** 'DeleteInvitation' parameters type */
export interface IDeleteInvitationParams {
  invitationId?: string | null | void;
  ownerId?: string | null | void;
}

/** 'DeleteInvitation' return type */
export interface IDeleteInvitationResult {
  /** Unique invitation identifier */
  id: string;
  /** Deterministic local user identifier linked to this invitation */
  user_id: string;
}

/** 'DeleteInvitation' query type */
export interface IDeleteInvitationQuery {
  params: IDeleteInvitationParams;
  result: IDeleteInvitationResult;
}

/** 'DeletePendingInvitationPlaceholder' parameters type */
export interface IDeletePendingInvitationPlaceholderParams {
  ownerId?: string | null | void;
  userId?: string | null | void;
}

/** 'DeletePendingInvitationPlaceholder' return type */
export type IDeletePendingInvitationPlaceholderResult = void;

/** 'DeletePendingInvitationPlaceholder' query type */
export interface IDeletePendingInvitationPlaceholderQuery {
  params: IDeletePendingInvitationPlaceholderParams;
  result: IDeletePendingInvitationPlaceholderResult;
}

/** 'InsertInvitation' parameters type */
export interface IInsertInvitationParams {
  auth0UserCreated?: boolean | null | void;
  auth0UserId?: string | null | void;
  email?: string | null | void;
  expiresAt?: DateOrString | null | void;
  invitedByBusinessId?: string | null | void;
  invitedByUserId?: string | null | void;
  ownerId?: string | null | void;
  roleId?: string | null | void;
  tokenHash?: string | null | void;
  userId?: string | null | void;
}

/** 'InsertInvitation' return type */
export interface IInsertInvitationResult {
  /** Business the user is being invited to */
  business_id: string;
  /** Email address of the invited user */
  email: string;
  /** Invitation expiration timestamp (typically 7 days from creation) */
  expires_at: Date;
  /** Unique invitation identifier */
  id: string;
  /** Role to assign to the user upon acceptance */
  role_id: string;
}

/** 'InsertInvitation' query type */
export interface IInsertInvitationQuery {
  params: IInsertInvitationParams;
  result: IInsertInvitationResult;
}

