import { DataTableRecord } from '../../../shared/components/data-table/data-table.types';

export enum TenantStatus { Trial = 0, Active = 1, Suspended = 2, Cancelled = 3 }

export interface TenantDto {
    id: string;
    code: string;
    name: string;
    status: TenantStatus;
    defaultLanguageId: string;
    defaultLanguageName: string | null;
    defaultDbConnectionId: string | null;
    defaultDbConnectionName: string | null;
    defaultCurrencyId: string;
    defaultCurrencyName: string | null;
    defaultTimezoneId: string;
    defaultTimezoneName: string | null;
    dataRegion: string;
    isActive: boolean;
    createdOn?: string;
    modifiedOn?: string | null;
}

export interface TenantLookupDto {
    id: string;
    name: string;
    code: string;
}

export interface CreateTenantRequest {
    code: string;
    name: string;
    status: TenantStatus;
    defaultLanguageId: string;
    defaultCurrencyId: string;
    defaultTimezoneId: string;
    dataRegion: string;
}

export interface UpdateTenantRequest {
    code: string;
    name: string;
    status: TenantStatus;
    defaultLanguageId: string;
    defaultCurrencyId: string;
    defaultTimezoneId: string;
    defaultDbConnectionId: string | null;
    dataRegion: string;
    isActive: boolean;
}


export interface TenantTableRow extends DataTableRecord {
  readonly id: string;
  readonly code: string;
  readonly name: string;
  readonly status: TenantStatus;
  readonly dataRegion: string;
  readonly isActive: boolean;
  readonly serialNumber: number;
  readonly createdOn?: string;
  readonly modifiedOn?: string | null;
  readonly defaultLanguageName: string | null;
  readonly defaultCurrencyName: string | null;
  readonly defaultTimezoneName: string | null;
}

export type TenantModalMode = 'create' | 'edit';