import { PrimaryColumn, Entity, Index, Column } from "typeorm";
import { id } from "../id.js";

@Entity()
export class Plan {
	@PrimaryColumn(id())
	public id: string;

	@Index()
	@Column("timestamp with time zone", {
		comment: "The created date of the Plan.",
	})
	public createdAt: Date;

	@Column("timestamp with time zone", {
		nullable: true,
	})
	public updatedAt: Date | null;

	@Index({ unique: true })
	@Column("varchar", {
		length: 128,
	})
	public name: string;

	@Column("varchar", {
		length: 64,
	})
	public icon: string;

	@Column("varchar", {
		length: 512,
		default: "",
	})
	public description: string;
}
