Files
Kiro/internal/models/tag.go
Daniel Romischer 9f07b0c6f9 Complete tasks 3.2-3.3: Data models and DynamoDB table schemas
- Defined all 8 data models (Page, Widget, Bookmark, Note, TagAssociation, Group, Share, Preferences)
- Implemented DynamoDB table creation for all tables with proper schemas
- Added GSIs for efficient querying (UserBookmarksIndex, UserNotesIndex, TagItemsIndex, UserSharesIndex)
- Comprehensive test coverage for all table schemas
- Updated init-db command to create all tables
2026-02-18 22:55:06 -05:00

30 lines
819 B
Go

package models
import (
"time"
)
// ItemType represents the type of item that can be tagged
type ItemType string
const (
ItemTypeBookmark ItemType = "bookmark"
ItemTypeNote ItemType = "note"
)
// TagAssociation represents a many-to-many relationship between tags and items
type TagAssociation struct {
ItemID string `dynamodbav:"item_id" json:"item_id"`
TagName string `dynamodbav:"tag_name" json:"tag_name"`
UserID string `dynamodbav:"user_id" json:"user_id"`
ItemType ItemType `dynamodbav:"item_type" json:"item_type"`
CreatedAt time.Time `dynamodbav:"created_at" json:"created_at"`
}
// TagInfo represents tag metadata with usage statistics
type TagInfo struct {
Name string `json:"name"`
Count int `json:"count"`
ItemTypes []ItemType `json:"item_types"`
}