package deltaschema

import (
	deltalake "github.com/tidbcloud/metering/delta-rs-golang"
)

// NextGenMeteringDeltaSchema defines the unified Delta Lake schema for NextGen metering tables
var NextGenMeteringDeltaSchema = []deltalake.ColumnDefinition{
	{Name: "scheme_version", Type: "string", Nullable: false},
	{Name: "tenant_id", Type: "long", Nullable: false},
	{Name: "cost_id", Type: "string", Nullable: false},
	{Name: "cost_time_stamp", Type: "long", Nullable: false},
	{Name: "unit", Type: "string", Nullable: false},
	{Name: "unit_value", Type: "string", Nullable: false},
	{Name: "cost", Type: "long", Nullable: false},
	{Name: "labels", Type: "string", Nullable: false},
	{Name: "created_at", Type: "long", Nullable: false},
	// Note: cluster_id is now included in the labels field as JSON
	{Name: "sku_type", Type: "string", Nullable: false},
	{Name: "hour_dimension", Type: "string", Nullable: false},
}

// NextGenMeteringPartitionColumns defines the partition columns for the Delta table
var NextGenMeteringPartitionColumns = []string{"hour_dimension"}

// NextGenMeteringTableName defines the default table name
const NextGenMeteringTableName = "nextgen_metering_sku"
