import type {
  ClubMember,
  ClubResolveInput,
  ClubSettings,
  ClubTransaction,
  RecordClubTransactionCommand,
  RecordClubTransactionResult,
  UpdateClubSettingsCommand,
} from './club.js';

export interface CreateClubMemberCommand {
  memberCode: string;
  deviceTokenHash: string;
  userId?: string | null;
}

export interface ClubRepository {
  getSettings(): Promise<ClubSettings>;
  updateSettings(input: UpdateClubSettingsCommand, updatedBy: string | null): Promise<ClubSettings>;
  createMemberWithDevice(input: CreateClubMemberCommand): Promise<ClubMember | null>;
  findMemberByUserId(userId: string): Promise<ClubMember | null>;
  findMemberByDeviceTokenHash(hash: string, touch?: boolean): Promise<ClubMember | null>;
  findMemberByCode(code: string): Promise<ClubMember | null>;
  resolveMember(input: ClubResolveInput & { deviceTokenHash?: string | null }): Promise<ClubMember | null>;
  listTransactions(memberId: string, limit: number): Promise<ClubTransaction[]>;
  recordTransaction(input: RecordClubTransactionCommand): Promise<RecordClubTransactionResult>;
}
