Skip to content

Commit

Permalink
feat: add tag type, deprecate category type (#691)
Browse files Browse the repository at this point in the history
* feat: add tag type, deprecate category type

* refactor: create tag file
  • Loading branch information
pyphilia authored Nov 8, 2024
1 parent 357b41d commit c684e64
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/categories/category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { DiscriminatedItem } from '@/item/item.js';
import { Member } from '@/member/member.js';
import { UUID } from '@/types.js';

/**
* @deprecated use TagCategory
*/
export enum CategoryType {
Level = 'level',
Discipline = 'discipline',
Expand All @@ -13,13 +16,17 @@ export enum CategoryType {
* `Category` represents a sort of "tag" for items.
* For example you can create a "math" category which would then relate to the `CategoryType` of "discipline"
* @field type is a foreign key to a `CategoryType` instance
* @deprecated use Tag
*/
export type Category = {
id: UUID;
name: string;
type: `${CategoryType}` | CategoryType;
};

/**
* @deprecated use Tag
*/
export type ItemCategory = {
id: UUID;
item: DiscriminatedItem;
Expand Down
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ export * from './array/array.js';
*/
export * from './categories/category.js';

/**
* Tag
*/
export * from './tag/tag.js';

/**
* Constants
*/
Expand Down
5 changes: 5 additions & 0 deletions src/tag/tag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum TagCategory {
Level = 'level',
Discipline = 'discipline',
ResourceType = 'resource-type',
}

0 comments on commit c684e64

Please sign in to comment.