2
0
Files
gitcaddy-server/modules/structs/wishlist.go
logikonline 36f5d77c9f
Some checks failed
Build and Release / Lint (push) Failing after 5m36s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, darwin, macos) (push) Has been skipped
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin, macos) (push) Has been skipped
Build and Release / Build Binary (linux/arm64) (push) Has been skipped
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 2m37s
Build and Release / Create Release (push) Has been skipped
Build and Release / Unit Tests (push) Successful in 3m39s
feat(wishlist): add wishlist feature for feature requests
Implements comprehensive wishlist/feature request system for repositories. Includes categories with colors, voting system, importance ratings (1-5 stars), status tracking (open/planned/in-progress/completed/declined), threaded comments with reactions, and release linking. Adds v2 API endpoints for CRUD operations. Includes repository settings toggle, header tab, and full UI templates for list/view/create. Supports vote counts, importance averages, and comment reactions.
2026-02-02 15:15:56 -05:00

92 lines
3.3 KiB
Go

// Copyright 2026 MarketAlly. All rights reserved.
// SPDX-License-Identifier: MIT
package structs
import "time"
// WishlistCategoryV2 represents a wishlist category in the V2 API.
type WishlistCategoryV2 struct {
ID int64 `json:"id"`
Name string `json:"name"`
Color string `json:"color"`
SortOrder int `json:"sort_order"`
}
// WishlistItemV2 represents a wishlist item in the V2 API.
type WishlistItemV2 struct {
ID int64 `json:"id"`
Title string `json:"title"`
Content string `json:"content,omitempty"`
Status string `json:"status"`
VoteCount int `json:"vote_count"`
Category *WishlistCategoryV2 `json:"category,omitempty"`
Author *BlogAuthorV2 `json:"author,omitempty"`
Release *WishlistReleaseRefV2 `json:"release,omitempty"`
Importance *WishlistImportanceV2 `json:"importance,omitempty"`
CommentCount int64 `json:"comment_count"`
UserVoted bool `json:"user_voted,omitempty"`
UserImportance *int `json:"user_importance,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClosedAt *time.Time `json:"closed_at,omitempty"`
HTMLURL string `json:"html_url"`
}
// WishlistReleaseRefV2 is a reference to a release.
type WishlistReleaseRefV2 struct {
ID int64 `json:"id"`
TagName string `json:"tag_name"`
Title string `json:"title"`
HTMLURL string `json:"html_url"`
}
// WishlistImportanceV2 holds importance summary counts.
type WishlistImportanceV2 struct {
NotInterested int64 `json:"not_interested"`
Important int64 `json:"important"`
Required int64 `json:"required"`
}
// WishlistItemListV2 is the response for listing wishlist items.
type WishlistItemListV2 struct {
Items []*WishlistItemV2 `json:"items"`
TotalCount int64 `json:"total_count"`
HasMore bool `json:"has_more"`
}
// WishlistCommentV2 represents a comment in the V2 API.
type WishlistCommentV2 struct {
ID int64 `json:"id"`
Content string `json:"content"`
Author *BlogAuthorV2 `json:"author,omitempty"`
Likes int64 `json:"likes"`
Dislikes int64 `json:"dislikes"`
UserLiked *bool `json:"user_liked,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// CreateWishlistItemV2Option is the request for creating a wishlist item.
type CreateWishlistItemV2Option struct {
Title string `json:"title" binding:"Required;MaxSize(255)"`
Content string `json:"content" binding:"Required"`
CategoryID int64 `json:"category_id"`
}
// SetWishlistImportanceV2Option is the request for setting importance.
type SetWishlistImportanceV2Option struct {
Rating int `json:"rating" binding:"Range(0,2)"`
}
// CloseWishlistItemV2Option is the request for closing an item.
type CloseWishlistItemV2Option struct {
Status string `json:"status" binding:"Required"` // "completed" or "will_not_do"
ReleaseID int64 `json:"release_id"`
}
// CreateWishlistCommentV2Option is the request for creating a comment.
type CreateWishlistCommentV2Option struct {
Content string `json:"content" binding:"Required"`
}