import {
	Association,
	BelongsToManyGetAssociationsMixin,
	DataTypes,
	InferAttributes,
	InferCreationAttributes,
	Model,
	NonAttribute,
} from "@sequelize/core";
import { Post } from "./Post";

import {
	Attribute,
	AutoIncrement,
	PrimaryKey,
	Unique,
} from "@sequelize/core/decorators-legacy";
export class Tag extends Model<
	InferAttributes<Tag>,
	InferCreationAttributes<Tag>
> {
	@PrimaryKey
	@AutoIncrement
	@Attribute(DataTypes.INTEGER)
	@Unique
	declare id: number;
	/** Defined by {@link Post.postTags} */
	declare taggedPosts?: NonAttribute<Post[]>;
	declare getPosts: BelongsToManyGetAssociationsMixin<Post>;

	declare static associations: {
		posts: Association<Post, Tag>;
	};
}
