/**
 * Arsitektur Skema Database Supabase untuk BPI SmartSchool
 * Digunakan untuk integrasi Type-Safe Supabase Client di masa depan.
 */

export type Json =
  | string
  | number
  | boolean
  | null
  | { [key: string]: Json | undefined }
  | Json[];

export interface Database {
  public: {
    Tables: {
      users: {
        Row: {
          id: string;
          email: string;
          full_name: string;
          role: string;
          created_at: string;
          updated_at: string;
        };
        Insert: {
          id?: string;
          email: string;
          full_name: string;
          role: string;
          created_at?: string;
          updated_at?: string;
        };
        Update: {
          id?: string;
          email?: string;
          full_name?: string;
          role?: string;
          updated_at?: string;
        };
      };
      students: {
        Row: {
          id: string;
          user_id: string | null;
          nisn: string;
          nis: string;
          full_name: string;
          gender: string;
          class_id: string | null;
          status: string;
          created_at: string;
        };
        Insert: {
          id?: string;
          user_id?: string | null;
          nisn: string;
          nis: string;
          full_name: string;
          gender: string;
          class_id?: string | null;
          status?: string;
          created_at?: string;
        };
        Update: {
          id?: string;
          user_id?: string | null;
          nisn?: string;
          nis?: string;
          full_name?: string;
          gender?: string;
          class_id?: string | null;
          status?: string;
        };
      };
      teachers: {
        Row: {
          id: string;
          user_id: string | null;
          nip: string | null;
          full_name: string;
          title: string | null;
          gender: string;
          created_at: string;
        };
        Insert: {
          id?: string;
          user_id?: string | null;
          nip?: string | null;
          full_name: string;
          title?: string | null;
          gender: string;
          created_at?: string;
        };
        Update: {
          id?: string;
          user_id?: string | null;
          nip?: string | null;
          full_name?: string;
          title?: string | null;
          gender?: string;
        };
      };
      classes: {
        Row: {
          id: string;
          name: string;
          grade_level: string;
          academic_year_id: string;
          homeroom_teacher_id: string | null;
        };
        Insert: {
          id?: string;
          name: string;
          grade_level: string;
          academic_year_id: string;
          homeroom_teacher_id?: string | null;
        };
        Update: {
          id?: string;
          name?: string;
          grade_level?: string;
          academic_year_id?: string;
          homeroom_teacher_id?: string | null;
        };
      };
    };
  };
}
