export interface DocumentSequenceInput {
  documentType: string;
  branchId?: string | null;
  productType?: string | null;
  organizationId?: string;
  period?: string;
}

export interface DocumentSequenceRecord {
  id: string;
  organizationId: string;
  organizationName: string | null;
  organizationCode: string | null;
  branchId: string | null;
  branchCode: string | null;
  branchName: string | null;
  branchDisplayName: string | null;
  productType: string;
  productTypeLabel: string | null;
  productTypeSequenceCode: string | null;
  documentType: string;
  prefix: string;
  period: string;
  currentNumber: number;
  paddingLength: number;
  format: string;
  resetPolicy: string;
  isActive: boolean;
  createdAt: string;
  updatedAt: string;
}

export interface DocumentSequenceResult {
  code: string;
  documentType: string;
  productType: string;
  branchId: string | null;
  currentNumber: number;
  nextNumber: number;
  period: string;
  prefix: string;
}

export interface DocumentSequenceListItem extends DocumentSequenceRecord {
  nextPreview: string;
}

export interface DocumentSequenceBranchOption {
  id: string;
  code: string;
  name: string;
  displayName: string;
}

export interface DocumentSequenceProductTypeOption {
  code: string;
  label: string;
  sequenceCode: string | null;
}

export interface DocumentSequenceListResponse {
  success: boolean;
  time: string;
  message: string;
  items: DocumentSequenceListItem[];
}

export interface DocumentSequenceDetailResponse {
  success: boolean;
  time: string;
  message: string;
  sequence: DocumentSequenceRecord;
}

export interface DocumentSequencePreviewResponse {
  success: boolean;
  time: string;
  message: string;
  preview: DocumentSequenceResult;
}

export interface DocumentSequenceMutationPayload {
  documentType: string;
  productType: string;
  prefix: string;
  period: string;
  branchId?: string | null;
  currentNumber?: number;
  paddingLength: number;
  format?: string;
  resetPolicy?: string;
  isActive?: boolean;
}

export interface DocumentSequenceResetPayload {
  currentNumber: number;
}

export interface MutationSuccessResponse {
  success: boolean;
  message: string;
}
