import { users } from '@prisma/client';

export type UserToken = {
  sub: string;
} & users;

export type AuthProvider = 'google' | 'facebook' | 'apple' | 'email';

export type SocialUser = {
  name: string;
  email: string;
  profilePic: string | null | undefined;
  provider: AuthProvider;
  providerId: string;
};


export type User = {
  id: string;
  name: string;
  email: string;
  phone: string;
  isEmailVerified: boolean;
  role: string;
};

export interface Client {
  id: string;
  name: string;
  phone: string;
  email: string;
  address: string;
  createdAt: string;
}


export interface Cylinderlog {
  id: string;
  cylinderId: string;
  cylinder: {
    rfid: string
  };
  scannedBy: string;
  movement: "INSIDE" | "OUTSIDE";
  scannedAt: string;
}

export interface Cylinder {
   id: string;

  // Identification
  rfid: string;
  item_id: string;

  // Added Fields (from updated form)
  manufacturerName?: string;                 // Name of Manufacturer
  serialNumber?: string ;                     // Cylinder Sr. No
  manufacturingDate?: string;                // Date of Manufacturing
  isSpecification?: string;                  // IS Specification
  testPressure?: string;                     // Test Pressure
  tareWeight?: string;                       // Tare Weight
  hydrostaticTestDate?: string;              // Hydrostatic Stretch Test Date
  hydrostaticDueDate?: string;               // Hydrostatic Stretch Due Date
  waterCapacity?: string;                    // Water Capacity

  // Status
  status: 'INSIDE' | 'OUTSIDE';
  is_client_owned?: number;

  // Default
  createdAt: string;

  // Warehouse
  warehouse?: {
    id: string;
    name: string;
  };
}


export interface MaintenanceHistory {
  id: string;
  cylinderId: string;
  workType: string;
  date: string;
  createdBy: string;
  createdByName: string;
  dueDate: string;
  remark: string;
  cylinder: {
    rfid: string
  };
}