schemas

package
v0.0.0-...-ee9efa2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2025 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddToWaitlist

type AddToWaitlist struct {
	Name      string `json:"name" validate:"required,min=3,max=1000" example:"John Doe"`
	Email     string `json:"email" validate:"required,email" example:"johndoe@example.com"`
	GenreSlug string `json:"genre_slug" validate:"required" example:"werewolf"`
}

type BookChapterCreateSchema

type BookChapterCreateSchema struct {
	Title string `json:"title" validate:"required,max=200"`
	Text  string `json:"text" validate:"required,max=100000"`
}

type BookCompletionStatusResponseSchema

type BookCompletionStatusResponseSchema struct {
	ResponseSchema
	Data BookCompletionStatusSchema `json:"data"`
}

type BookCompletionStatusSchema

type BookCompletionStatusSchema struct {
	Completed bool `json:"completed"`
}

type BookCreateSchema

type BookCreateSchema struct {
	Title         string          `form:"title" validate:"required,wordcount_max=50,wordcount_min=1"`
	Blurb         string          `form:"blurb" validate:"required,wordcount_max=1000,wordcount_min=100"`
	GenreSlug     string          `form:"genre_slug" validate:"required"`
	TagSlugs      []string        `form:"tag_slugs" validate:"required"`
	AgeDiscretion choices.AgeType `form:"age_discretion" validate:"required,age_discretion_validator"`
}

type BookDetailResponseSchema

type BookDetailResponseSchema struct {
	ResponseSchema
	Data BookDetailSchema `json:"data"`
}

type BookDetailSchema

type BookDetailSchema struct {
	BookSchema
	WordCount    int                       `json:"word_count"`
	LibraryCount int                       `json:"library_count"`
	Reviews      ReviewsResponseDataSchema `json:"reviews"`
}

func (BookDetailSchema) Init

func (b BookDetailSchema) Init(book models.Book, reviewsPaginatedData PaginatedResponseDataSchema, reviews []models.Comment) BookDetailSchema

type BookReadingProgressResponseSchema

type BookReadingProgressResponseSchema struct {
	ResponseSchema
	Data []BookReadingProgressSchema `json:"data"`
}

type BookReadingProgressSchema

type BookReadingProgressSchema struct {
	Label          string  `json:"label" example:"Jul or Mon or Week 1"`
	TotalReaders   int     `json:"total_readers" example:"1000"`
	CompletionRate float64 `json:"completion_rate" example:"70"`
	NewReaders     int     `json:"new_readers" example:"500"`
}

type BookReportSchema

type BookReportSchema struct {
	Reason                string  `json:"reason" validate:"required,max=1000"`
	AdditionalExplanation *string `json:"additional_explanation" validate:"omitempty,max=1000"`
}

type BookResponseSchema

type BookResponseSchema struct {
	ResponseSchema
	Data BookSchema `json:"data"`
}

type BookRetentionStatsResponseSchema

type BookRetentionStatsResponseSchema struct {
	ResponseSchema
	Data RetentionStatsSchema `json:"data"`
}

type BookSchema

type BookSchema struct {
	Author             UserDataSchema         `json:"author"`
	Title              string                 `json:"title"`
	Slug               string                 `json:"slug"`
	Blurb              string                 `json:"blurb"`
	AgeDiscretion      choices.AgeType        `json:"age_discretion"`
	Genre              GenreWithoutTagSchema  `json:"genre"`
	SubSections        []BookSubSectionSchema `json:"sub_sections"`
	Tags               []TagSchema            `json:"tags"`
	ChaptersCount      int                    `json:"chapters_count"`
	PartialViewChapter *ChapterListSchema     `json:"partial_view_chapter"`
	CoverImage         string                 `json:"cover_image"`
	FullPrice          *int                   `json:"full_price"`
	ChapterPrice       int                    `json:"chapter_price"`
	Completed          bool                   `json:"completed"`
	Votes              int                    `json:"votes"`
	Reads              int                    `json:"reads"`
	AvgRating          float64                `json:"avg_rating"`
	CreatedAt          time.Time              `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
	UpdatedAt          time.Time              `json:"updated_at" example:"2024-06-05T02:32:34.462196+01:00"`
}

func (BookSchema) Init

func (b BookSchema) Init(book models.Book) BookSchema

type BookSubSectionSchema

type BookSubSectionSchema struct {
	Name    string        `json:"name"`
	Slug    string        `json:"slug"`
	Section SectionSchema `json:"section"`
}

func (BookSubSectionSchema) Init

type BookWithOrder

type BookWithOrder struct {
	models.Book
	OrderInSection uint      `json:"order_in_section"`
	AuthorID       uuid.UUID `json:"author_id"`
	AuthorName     string    `json:"author_name"`
	AuthorUsername string    `json:"author_username"`
	AuthorAvatar   string    `json:"author_avatar"`
}

type BookWithStats

type BookWithStats struct {
	Slug       string  `json:"slug"`
	Title      string  `json:"title"`
	CoverImage string  `json:"cover_image"`
	AuthorName string  `json:"author_name"`
	AvgRating  float64 `json:"avg_rating"`
	VotesCount int     `json:"votes_count"`
	ReadsCount int     `json:"reads_count"`
	GenreName  string  `json:"genre_name"`
	GenreSlug  string  `json:"genre_slug"`
}

type BooksResponseDataSchema

type BooksResponseDataSchema struct {
	PaginatedResponseDataSchema
	Items []BookSchema `json:"books"`
}

Book Responses

func (BooksResponseDataSchema) Init

type BooksResponseSchema

type BooksResponseSchema struct {
	ResponseSchema
	Data BooksResponseDataSchema `json:"data"`
}

type BuyCoinSchema

type BuyCoinSchema struct {
	// PaymentType choices.PaymentType `json:"payment_type" validate:"required,payment_type_validator" example:"STRIPE"` // This should be stripe by default
	Quantity int       `json:"quantity" validate:"required" example:"2"`
	CoinID   uuid.UUID `json:"coin_id" validate:"required" example:"19e8bd22-fab1-4bb4-ba82-77c41bea6b99"`
}

type ChapterCreateSchema

type ChapterCreateSchema struct {
	Title      string   `json:"title" validate:"required,max=100"`
	Paragraphs []string `json:"paragraphs" validate:"required"`
	IsLast     bool     `json:"is_last"`
}

type ChapterDetailSchema

type ChapterDetailSchema struct {
	ChapterListSchema
	Paragraphs []ParagraphSchema `json:"paragraphs"`
}

func (ChapterDetailSchema) Init

type ChapterListSchema

type ChapterListSchema struct {
	Title  string `json:"title"`
	Slug   string `json:"slug"`
	IsLast bool   `json:"is_last"`
}

func (ChapterListSchema) Init

type ChapterResponseSchema

type ChapterResponseSchema struct {
	ResponseSchema
	Data ChapterDetailSchema `json:"data"`
}

type ChaptersResponseDataSchema

type ChaptersResponseDataSchema struct {
	PaginatedResponseDataSchema
	Items []ChapterListSchema `json:"chapters"`
}

func (ChaptersResponseDataSchema) Init

type ChaptersResponseSchema

type ChaptersResponseSchema struct {
	ResponseSchema
	Data ChaptersResponseDataSchema `json:"data"`
}

type CoinSchema

type CoinSchema struct {
	ID     uuid.UUID       `json:"id" example:"19e8bd22-fab1-4bb4-ba82-77c41bea6b99"`
	Amount int             `json:"amount" example:"5"`
	Price  decimal.Decimal `json:"price" example:"10.45"`
}

func (CoinSchema) Init

func (c CoinSchema) Init(coin models.Coin) CoinSchema

type CoinsResponseSchema

type CoinsResponseSchema struct {
	ResponseSchema
	Data []CoinSchema `json:"data"`
}

RESPONSE SCHEMAS

func (CoinsResponseSchema) Init

type CommentSchema

type CommentSchema struct {
	ParagraphCommentAddSchema
	ID           uuid.UUID      `json:"id" example:"2b3bd817-135e-41bd-9781-33807c92ff40"`
	User         UserDataSchema `json:"user"`
	LikesCount   int            `json:"likes_count"`
	RepliesCount int            `json:"replies_count"`
	CreatedAt    time.Time      `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
	UpdatedAt    time.Time      `json:"updated_at" example:"2024-06-05T02:32:34.462196+01:00"`
}

func (CommentSchema) Init

func (p CommentSchema) Init(paragraphComment models.Comment) CommentSchema

type ContractCreateSchema

type ContractCreateSchema struct {
	FullName             string                       `form:"full_name" validate:"required,max=1000"`
	Email                string                       `form:"email" validate:"required,email"`
	PenName              string                       `form:"pen_name" validate:"required,max=1000"`
	Age                  uint                         `form:"age" validate:"required"`
	Country              string                       `form:"country" validate:"required,max=1000"`
	Address              string                       `form:"address" validate:"required,max=1000"`
	City                 string                       `form:"city" validate:"required,max=1000"`
	State                string                       `form:"state" validate:"required,max=1000"`
	PostalCode           string                       `form:"postal_code" validate:"required"`
	TelephoneNumber      string                       `form:"telephone_number" validate:"required,max=20"`
	IDType               choices.ContractIDTypeChoice `form:"id_type" validate:"required,contract_id_type_validator"`
	BookAvailabilityLink *string                      `form:"book_availability_link"`
	PlannedLength        uint                         `form:"planned_length" validate:"required"`
	AverageChapter       uint                         `form:"average_chapter" validate:"required"`
	UpdateRate           uint                         `form:"update_rate" validate:"required"`
	IntendedContract     choices.ContractTypeChoice   `form:"intended_contract" validate:"required,contract_type_validator"`
	FullPurchaseMode     bool                         `form:"full_purchase_mode"`
}

type ContractResponseSchema

type ContractResponseSchema struct {
	ResponseSchema
	Data ContractSchema `json:"data"`
}

type ContractSchema

type ContractSchema struct {
	FullName             string                       `json:"full_name"`
	Email                string                       `json:"email"`
	PenName              string                       `json:"pen_name"`
	Age                  uint                         `json:"age"`
	Country              string                       `json:"country"`
	Address              string                       `json:"address"`
	City                 string                       `json:"city"`
	State                string                       `json:"state"`
	PostalCode           string                       `json:"postal_code"`
	TelephoneNumber      string                       `json:"telephone_number"`
	IDType               choices.ContractIDTypeChoice `json:"id_type"`
	IDFrontImage         string                       `json:"id_front_image"`
	IDBackImage          string                       `json:"id_back_image"`
	BookAvailabilityLink *string                      `json:"book_availability_link"`
	PlannedLength        uint                         `json:"planned_length"`
	AverageChapter       uint                         `json:"average_chapter"`
	UpdateRate           uint                         `json:"update_rate"`
	IntendedContract     choices.ContractTypeChoice   `json:"intended_contract"`
	FullPurchaseMode     bool                         `json:"full_purchase_mode"`
	ContractStatus       choices.ContractStatusChoice `json:"contract_status"`
	FullPrice            *int                         `json:"full_price"`
	ChapterPrice         int                          `json:"chapter_price"`
}

func (ContractSchema) Init

type ContractSchema2

type ContractSchema2 struct {
	FullName             string                       `json:"full_name"`
	Email                string                       `json:"email"`
	PenName              string                       `json:"pen_name"`
	Age                  uint                         `json:"age"`
	Country              string                       `json:"country"`
	Address              string                       `json:"address"`
	City                 string                       `json:"city"`
	State                string                       `json:"state"`
	PostalCode           uint                         `json:"postal_code"`
	TelephoneNumber      string                       `json:"telephone_number"`
	IDType               choices.ContractIDTypeChoice `json:"id_type"`
	IDFrontImage         string                       `json:"id_front_image"`
	IDBackImage          string                       `json:"id_back_image"`
	BookAvailabilityLink *string                      `json:"book_availability_link"`
	PlannedLength        uint                         `json:"planned_length"`
	AverageChapter       uint                         `json:"average_chapter"`
	UpdateRate           uint                         `json:"update_rate"`
	IntendedContract     choices.ContractTypeChoice   `json:"intended_contract"`
	FullPrice            *int                         `json:"full_price"`
	ChapterPrice         int                          `json:"chapter_price"`
	FullPurchaseMode     bool                         `json:"full_purchase_mode"`
	ContractStatus       choices.ContractStatusChoice `json:"contract_status"`
}

type ContractsResponseDataSchema

type ContractsResponseDataSchema struct {
	PaginatedResponseDataSchema
	Items []ContractSchema `json:"contracts"`
}

func (ContractsResponseDataSchema) Init

type ContractsResponseSchema

type ContractsResponseSchema struct {
	ResponseSchema
	Data ContractsResponseDataSchema `json:"data"`
}

type CreateICPWallet

type CreateICPWallet struct {
	Username string `json:"username" validate:"required,max=1000" example:"john-doe"`
}

type CreateSubscriptionSchema

type CreateSubscriptionSchema struct {
	SubType            choices.SubscriptionTypeChoice `json:"subtype" validate:"required,subscription_type_validator"`
	PaymentMethodToken string                         `json:"payment_method_token" validate:"required"`
}

type DashboardResponseDataSchema

type DashboardResponseDataSchema struct {
	Username                        string                          `json:"username"`
	Avatar                          string                          `json:"avatar"`
	TotalUsers                      int64                           `json:"total_users"`
	ActiveSubscribers               int64                           `json:"active_subscribers"`
	SubscriptionRevenue             float64                         `json:"subscription_revenue"`
	UserSubscriptionPlanPercentages SubscriptionPlansAndPercentages `json:"user_subscription_plan_percentages"`
	UserGrowthData                  []UserGrowthData                `json:"user_growth_data"`
	Books                           []BookWithStats                 `json:"books"`
}

type DashboardResponseSchema

type DashboardResponseSchema struct {
	ResponseSchema
	Data DashboardResponseDataSchema `json:"data"`
}

type EmailRequestSchema

type EmailRequestSchema struct {
	Email string `json:"email" validate:"required,min=5,email" example:"johndoe@email.com"`
}

type FeaturedContentBookSchema

type FeaturedContentBookSchema struct {
	Title      string `json:"title"`
	Slug       string `json:"slug"`
	CoverImage string `json:"cover_image"`
	Blurb      string `json:"blurb"`
}

type FeaturedContentEntrySchema

type FeaturedContentEntrySchema struct {
	Location choices.FeaturedContentLocationChoice `json:"location" validate:"featured_content_location_choice_validator"`
	BookSlug string                                `json:"book_slug" validate:"required"`
	Desc     string                                `json:"desc" validate:"required"`
}

type FeaturedContentResponseSchema

type FeaturedContentResponseSchema struct {
	ResponseSchema
	Data FeaturedContentSchema `json:"data"`
}

type FeaturedContentSchema

type FeaturedContentSchema struct {
	ID       uuid.UUID                             `json:"id"`
	Location choices.FeaturedContentLocationChoice `json:"location"`
	Desc     string                                `json:"desc"`
	Book     FeaturedContentBookSchema             `json:"book"`
	IsActive bool                                  `json:"is_active"`
}

func (FeaturedContentSchema) Init

type FeaturedContentsResponseSchema

type FeaturedContentsResponseSchema struct {
	ResponseSchema
	Data []FeaturedContentSchema `json:"data"`
}

func (FeaturedContentsResponseSchema) Init

type FollowerData

type FollowerData struct {
	Name           *string         `json:"name"`
	Username       string          `json:"username"`
	AccountType    choices.AccType `json:"account_type"`
	Avatar         *string         `json:"avatar"`
	FollowersCount int             `json:"followers_count"`
	StoriesCount   int             `json:"stories_count"`
}

func (FollowerData) FromModel

func (dto FollowerData) FromModel(user models.User) FollowerData

type GenreSchema

type GenreSchema struct {
	GenreWithoutTagSchema
	Tags []TagSchema `json:"tags"`
}

func (GenreSchema) Init

func (g GenreSchema) Init(genre models.Genre) GenreSchema

type GenreWithoutTagSchema

type GenreWithoutTagSchema struct {
	Name string `json:"name"`
	Slug string `json:"slug"`
}

func (GenreWithoutTagSchema) Init

type GenresResponseSchema

type GenresResponseSchema struct {
	ResponseSchema
	Data []GenreSchema `json:"data"`
}

func (GenresResponseSchema) Init

type GiftSchema

type GiftSchema struct {
	Name     string `json:"name" example:"Red rose"`
	Slug     string `json:"slug" example:"red-rose"`
	Price    int    `json:"price" example:"500"`
	Image    string `json:"image" example:"https://img.url"`
	Lanterns int    `json:"lanterns" example:"2"`
}

type GiftsResponseSchema

type GiftsResponseSchema struct {
	ResponseSchema
	Data []GiftSchema `json:"data"`
}

func (GiftsResponseSchema) Init

type ICPTransferResponseSchema

type ICPTransferResponseSchema struct {
	Amount string `json:"amount"`
	From   string `json:"from"`
	To     string `json:"to"`
	Time   string `json:"time"`
	ID     string `json:"_id"`
}

type ICPWalletResponseSchema

type ICPWalletResponseSchema struct {
	PublicKey string  `json:"public_key"`
	Balance   float64 `json:"balance"`
	AccountID string  `json:"account_id"`
}

type InviteAdminSchema

type InviteAdminSchema struct {
	Email  string `json:"email" validate:"email,required"`
	Admin  bool   `json:"admin" validate:"required"`
	Author bool   `json:"author" validate:"required"`
}

type LoginResponseSchema

type LoginResponseSchema struct {
	ResponseSchema
	Data TokensResponseSchema `json:"data"`
}

type LoginSchema

type LoginSchema struct {
	Email    string `json:"email" validate:"required,email" example:"johndoe@email.com"`
	Password string `json:"password" validate:"required" example:"password"`
}

type NotificationBookSchema

type NotificationBookSchema struct {
	Title      string `json:"title"`
	Slug       string `json:"slug"`
	CoverImage string `json:"cover_image"`
}

NOTIFICATIONS

type NotificationSchema

type NotificationSchema struct {
	ID         uuid.UUID                      `json:"id" example:"2b3bd817-135e-41bd-9781-33807c92ff40"`
	Sender     UserDataSchema                 `json:"sender"`
	ReceiverID *uuid.UUID                     `json:"receiver_id,omitempty"`
	Ntype      choices.NotificationTypeChoice `json:"ntype"`
	Text       string                         `json:"text"`
	Book       *NotificationBookSchema        `json:"book"`                                                        // Bought book, vote, comment and reply
	CommentID  *uuid.UUID                     `json:"comment_id" example:"2b3bd817-135e-41bd-9781-33807c92ff40"`   // reviewed, reply, like
	SentGiftID *uuid.UUID                     `json:"sent_gift_id" example:"2b3bd817-135e-41bd-9781-33807c92ff40"` // If someone sent you a gift
	IsRead     bool                           `json:"is_read"`
	CreatedAt  time.Time                      `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
}

func (NotificationSchema) Init

func (n NotificationSchema) Init(notification models.Notification, showReceiver ...bool) NotificationSchema

type NotificationsResponseDataSchema

type NotificationsResponseDataSchema struct {
	PaginatedResponseDataSchema
	Items []NotificationSchema `json:"notifications"`
}

func (NotificationsResponseDataSchema) Init

type NotificationsResponseSchema

type NotificationsResponseSchema struct {
	ResponseSchema
	Data NotificationsResponseDataSchema `json:"data"`
}

type PaginatedResponseDataSchema

type PaginatedResponseDataSchema struct {
	PerPage     uint `json:"per_page" example:"100"`
	CurrentPage uint `json:"current_page" example:"1"`
	LastPage    uint `json:"last_page" example:"100"`
}

type ParagraphCommentAddSchema

type ParagraphCommentAddSchema struct {
	Text string `json:"text" validate:"required,max=10000"`
}

type ParagraphCommentResponseDataSchema

type ParagraphCommentResponseDataSchema struct {
	PaginatedResponseDataSchema
	Items []CommentSchema `json:"items"`
}

type ParagraphCommentResponseSchema

type ParagraphCommentResponseSchema struct {
	ResponseSchema
	Data CommentSchema `json:"data"`
}

type ParagraphCommentsResponseDataSchema

type ParagraphCommentsResponseDataSchema struct {
	PaginatedResponseDataSchema
	Items []CommentSchema `json:"comments"`
}

func (ParagraphCommentsResponseDataSchema) Init

type ParagraphCommentsResponseSchema

type ParagraphCommentsResponseSchema struct {
	ResponseSchema
	Data ParagraphCommentsResponseDataSchema `json:"data"`
}

type ParagraphSchema

type ParagraphSchema struct {
	Index         uint   `json:"index"`
	Text          string `json:"text"`
	CommentsCount int    `json:"comments_count"`
}

type PaymentResponseSchema

type PaymentResponseSchema struct {
	ResponseSchema
	Data TransactionSchema `json:"data"`
}

type ReadNotificationSchema

type ReadNotificationSchema struct {
	MarkAllAsRead bool       `json:"mark_all_as_read" example:"false"`
	ID            *uuid.UUID `json:"id" validate:"required_if=MarkAllAsRead false,omitempty" example:"d10dde64-a242-4ed0-bd75-4c759644b3a6"`
}

type RefreshTokenSchema

type RefreshTokenSchema struct {
	Refresh string `` /* 172-byte string literal not displayed */
}

type RegisterResponseSchema

type RegisterResponseSchema struct {
	ResponseSchema
	Data EmailRequestSchema `json:"data"`
}

RESPONSE BODY SCHEMAS

type RegisterUser

type RegisterUser struct {
	Email    string `json:"email" validate:"required,min=5,email" example:"johndoe@email.com"`
	Password string `json:"password" validate:"required,min=8,max=50" example:"strongpassword"`
}

REQUEST BODY SCHEMAS

type RepliesResponseDataSchema

type RepliesResponseDataSchema struct {
	PaginatedResponseDataSchema
	Items []ReplySchema `json:"replies"`
}

func (RepliesResponseDataSchema) Init

type RepliesResponseSchema

type RepliesResponseSchema struct {
	ResponseSchema
	Data RepliesResponseDataSchema `json:"data"`
}

type ReplyEditSchema

type ReplyEditSchema struct {
	Text string `json:"text" validate:"required,max=10000"`
}

type ReplyResponseSchema

type ReplyResponseSchema struct {
	ResponseSchema
	Data ReplySchema `json:"data"`
}

type ReplyReviewOrCommentSchema

type ReplyReviewOrCommentSchema struct {
	ReplyEditSchema
	Type choices.ReplyType `json:"type" validate:"required,reply_type_validator"`
}

type ReplySchema

type ReplySchema struct {
	ID         uuid.UUID      `json:"id" example:"2b3bd817-135e-41bd-9781-33807c92ff40"`
	User       UserDataSchema `json:"user"`
	Text       string         `json:"text"`
	LikesCount int            `json:"likes_count"`
	CreatedAt  time.Time      `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
	UpdatedAt  time.Time      `json:"updated_at" example:"2024-06-05T02:32:34.462196+01:00"`
}

func (ReplySchema) Init

func (r ReplySchema) Init(reply models.Comment) ReplySchema

type ResponseSchema

type ResponseSchema struct {
	Status  string `json:"status" example:"success"`
	Message string `json:"message" example:"Data fetched/created/updated/deleted"`
}

func (ResponseSchema) Init

func (obj ResponseSchema) Init() ResponseSchema

type RetentionStatsSchema

type RetentionStatsSchema struct {
	Completed  float64 `json:"completed" example:"35"`
	InProgress float64 `json:"in_progress" example:"45"`
	Dropped    float64 `json:"dropped" example:"20"`
	Total      float64 `json:"-"`
}

type ReviewBookSchema

type ReviewBookSchema struct {
	Rating choices.RatingChoice `json:"rating" validate:"required,rating_choice_validator"`
	Text   string               `json:"text" validate:"required,max=10000"`
}

type ReviewResponseSchema

type ReviewResponseSchema struct {
	ResponseSchema
	Data ReviewSchema `json:"data"`
}

type ReviewSchema

type ReviewSchema struct {
	ReviewBookSchema
	ID           uuid.UUID      `json:"id" example:"2b3bd817-135e-41bd-9781-33807c92ff40"`
	User         UserDataSchema `json:"user"`
	LikesCount   int            `json:"likes_count"`
	RepliesCount int            `json:"replies_count"`
	CreatedAt    time.Time      `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
	UpdatedAt    time.Time      `json:"updated_at" example:"2024-06-05T02:32:34.462196+01:00"`
}

func (ReviewSchema) Init

func (r ReviewSchema) Init(review models.Comment) ReviewSchema

type ReviewsResponseDataSchema

type ReviewsResponseDataSchema struct {
	PaginatedResponseDataSchema
	Items []ReviewSchema `json:"items"`
}

type SectionSchema

type SectionSchema struct {
	Name string `json:"name"`
	Slug string `json:"slug"`
}

func (SectionSchema) Init

func (s SectionSchema) Init(section models.Section) SectionSchema

type SectionWithSubsectionsSchema

type SectionWithSubsectionsSchema struct {
	Name             string             `json:"name"`
	Slug             string             `json:"slug"`
	SubSections      []SubSectionSchema `json:"sub_sections"`
	SubSectionsCount int                `json:"sub_sections_count"`
	CreatedAt        time.Time          `json:"created_at"`
	UpdatedAt        time.Time          `json:"updated_at"`
}

func (SectionWithSubsectionsSchema) Init

type SectionsResponseSchema

type SectionsResponseSchema struct {
	ResponseSchema
	Data []SectionSchema `json:"data"`
}

func (SectionsResponseSchema) Init

type SectionsWithSubSectionsSchema

type SectionsWithSubSectionsSchema struct {
	ResponseSchema
	Data []SectionWithSubsectionsSchema `json:"data"`
}

func (SectionsWithSubSectionsSchema) Init

type SentGiftResponseSchema

type SentGiftResponseSchema struct {
	ResponseSchema
	Data SentGiftSchema `json:"data"`
}

type SentGiftSchema

type SentGiftSchema struct {
	ID        uuid.UUID      `json:"id" example:"2b3bd817-135e-41bd-9781-33807c92ff40"`
	Sender    UserDataSchema `json:"sender"`
	Receiver  UserDataSchema `json:"receiver"`
	Item      GiftSchema     `json:"gift"`
	Claimed   bool           `json:"claimed"`
	CreatedAt time.Time      `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
}

func (SentGiftSchema) Init

func (s SentGiftSchema) Init(sentGift models.SentGift) SentGiftSchema

type SentGiftsResponseDataSchema

type SentGiftsResponseDataSchema struct {
	PaginatedResponseDataSchema
	Items []SentGiftSchema `json:"gifts"`
}

func (SentGiftsResponseDataSchema) Init

type SentGiftsResponseSchema

type SentGiftsResponseSchema struct {
	ResponseSchema
	Data SentGiftsResponseDataSchema `json:"data"`
}

type SetNewPasswordSchema

type SetNewPasswordSchema struct {
	EmailRequestSchema
	TokenString string `` /* 150-byte string literal not displayed */
	Password    string `json:"password" validate:"required,min=8,max=50" example:"newstrongpassword"`
}

type SiteDetailResponseSchema

type SiteDetailResponseSchema struct {
	ResponseSchema
	Data models.SiteDetail `json:"data"`
}

type SocialLoginSchema

type SocialLoginSchema struct {
	DeviceType choices.DeviceType `json:"device_type" validate:"device_type_validator"`
	Token      string             `` /* 177-byte string literal not displayed */
}

type SubSectionBookResponseSchema

type SubSectionBookResponseSchema struct {
	PaginatedResponseDataSchema
	Items []SubSectionBookSchema `json:"items"`
}

type SubSectionBookSchema

type SubSectionBookSchema struct {
	OrderInSection uint           `json:"order_in_section"`
	Title          string         `json:"title"`
	Author         UserDataSchema `json:"author"`
}

type SubSectionSchema

type SubSectionSchema struct {
	Name       string `json:"name"`
	Slug       string `json:"slug"`
	BooksCount int    `json:"books_count"`
}

func (SubSectionSchema) Init

func (s SubSectionSchema) Init(subSection *models.SubSection) SubSectionSchema

type SubSectionWithBooksResponseSchema

type SubSectionWithBooksResponseSchema struct {
	ResponseSchema
	Data SubSectionWithBooksSchema `json:"data"`
}

type SubSectionWithBooksSchema

type SubSectionWithBooksSchema struct {
	SubSectionSchema
	Section string                       `json:"section"`
	Books   SubSectionBookResponseSchema `json:"books"`
}

func (SubSectionWithBooksSchema) Init

type SubSectionsResponseSchema

type SubSectionsResponseSchema struct {
	ResponseSchema
	Data []SubSectionSchema `json:"data"`
}

func (SubSectionsResponseSchema) Init

type SubscriberResponseSchema

type SubscriberResponseSchema struct {
	ResponseSchema
	Data models.Subscriber `json:"data"`
}

type SubscriptionPlanResponseSchema

type SubscriptionPlanResponseSchema struct {
	ResponseSchema
	Data SubscriptionPlanSchema `json:"data"`
}

type SubscriptionPlanSchema

type SubscriptionPlanSchema struct {
	Amount  decimal.Decimal                `json:"amount" validate:"required"`
	SubType choices.SubscriptionTypeChoice `json:"subtype" validate:"required,subscription_type_validator"`
}

func (SubscriptionPlanSchema) Init

type SubscriptionPlansAndPercentages

type SubscriptionPlansAndPercentages struct {
	FreeTier float64 `json:"free_tier"`
	Monthly  float64 `json:"monthly"`
	Annual   float64 `json:"annual"`
}

type SubscriptionPlansResponseSchema

type SubscriptionPlansResponseSchema struct {
	ResponseSchema
	Data []SubscriptionPlanSchema `json:"data"`
}

func (SubscriptionPlansResponseSchema) Init

type TagSchema

type TagSchema struct {
	Name       string `json:"name"`
	Slug       string `json:"slug"`
	BooksCount int    `json:"books_count"`
}

func (TagSchema) Init

func (t TagSchema) Init(tag models.Tag) TagSchema

type TagsAddSchema

type TagsAddSchema struct {
	Name string `json:"name" validate:"required"`
}

type TagsResponseSchema

type TagsResponseSchema struct {
	ResponseSchema
	Data []TagSchema `json:"data"`
}

func (TagsResponseSchema) Init

type TokensResponseSchema

type TokensResponseSchema struct {
	UserProfile
	Access           string                  `` /* 151-byte string literal not displayed */
	Refresh          string                  `` /* 152-byte string literal not displayed */
	FeaturedContents []FeaturedContentSchema `json:"featured_contents"`
}

func (TokensResponseSchema) Init

type TransactionSchema

type TransactionSchema struct {
	Reference      string                 `json:"reference"`
	Coins          *int                   `json:"coins" example:"10"`
	CoinsTotal     *int                   `json:"coins_total" example:"30"`
	PaymentType    choices.PaymentType    `json:"payment_type" example:"STRIPE"`
	PaymentPurpose choices.PaymentPurpose `json:"payment_purpose" example:"SUBSCRIPTION"`
	Quantity       int                    `json:"quantity" example:"10"`
	Amount         decimal.Decimal        `json:"amount" example:"10.35"`
	AmountTotal    decimal.Decimal        `json:"amount_total" example:"30.35"`
	PaymentStatus  choices.PaymentStatus  `json:"payment_status"`
	ClientSecret   string                 `json:"client_secret"`
	CreatedAt      time.Time              `json:"created_at"`
	UpdatedAt      time.Time              `json:"updated_at"`
}

func (TransactionSchema) Init

type TransactionsResponseDataSchema

type TransactionsResponseDataSchema struct {
	PaginatedResponseDataSchema
	Items []TransactionSchema `json:"transactions"`
}

func (TransactionsResponseDataSchema) Init

type TransactionsResponseSchema

type TransactionsResponseSchema struct {
	ResponseSchema
	Data TransactionsResponseDataSchema `json:"data"`
}

type UpdatePasswordSchema

type UpdatePasswordSchema struct {
	NewPassword string `json:"new_password" validate:"required,min=8,max=50" example:"oldpassword"`
	OldPassword string `json:"old_password" validate:"required,min=8,max=50" example:"newstrongpassword"`
}

type UpdateUserProfileSchema

type UpdateUserProfileSchema struct {
	Name     *string `json:"name,omitempty" validate:"min=3,max=1000" example:"John Doe"`
	Bio      *string `json:"bio,omitempty" validate:"min=3,max=1000" example:"I'm here to read good books"`
	Username *string `json:"username,omitempty" validate:"min=3,max=1000" example:"johndoe"`
}

type UpdateUserRoleSchema

type UpdateUserRoleSchema struct {
	AccountType choices.AccType `json:"account_type" validate:"account_type_validator" example:"WRITER"`
}

type UserDataSchema

type UserDataSchema struct {
	// For short user data
	Name     *string `json:"name"`
	Username string  `json:"username"`
	Avatar   string  `json:"avatar"`
}

func (UserDataSchema) Init

type UserGrowthData

type UserGrowthData struct {
	Period string `json:"period"` // e.g., "Jan 2025", "Week 1", etc.
	Count  int    `json:"count"`  // Number of new users
}

type UserProfile

type UserProfile struct {
	Name         *string                         `json:"name"`
	Username     string                          `json:"username"`
	Email        string                          `json:"email"`
	Avatar       *string                         `json:"avatar"`
	Bio          *string                         `json:"bio"`
	AccountType  choices.AccType                 `json:"account_type"`
	StoriesCount int                             `json:"stories_count"`
	Followers    []FollowerData                  `json:"followers"`
	Followings   []FollowerData                  `json:"followings"`
	CreatedAt    time.Time                       `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
	CurrentPlan  *choices.SubscriptionTypeChoice `json:"current_plan"`
	IsFollowing  bool                            `json:"is_following"`
	IsActive     bool                            `json:"is_active"`
}

func (UserProfile) Init

func (u UserProfile) Init(user models.User, currentUser *models.User) UserProfile

type UserProfileResponseSchema

type UserProfileResponseSchema struct {
	ResponseSchema
	Data UserProfile `json:"data"`
}

type UserProfilesResponseDataSchema

type UserProfilesResponseDataSchema struct {
	PaginatedResponseDataSchema
	Items []UserProfile `json:"users"`
}

func (UserProfilesResponseDataSchema) Init

type UserProfilesResponseSchema

type UserProfilesResponseSchema struct {
	ResponseSchema
	Data UserProfilesResponseDataSchema `json:"data"`
}

type VerifyEmailRequestSchema

type VerifyEmailRequestSchema struct {
	EmailRequestSchema
	Otp uint `json:"otp" validate:"required" example:"123456"`
}

type WaitlistListResponseSchema

type WaitlistListResponseSchema struct {
	ResponseSchema
	Data WaitlistResponseDataSchema `json:"data"`
}

type WaitlistResponse

type WaitlistResponse struct {
	ID        uuid.UUID `json:"id"`
	Name      string    `json:"name"`
	Email     string    `json:"email"`
	GenreID   uuid.UUID `json:"genre_id"`
	GenreName string    `json:"genre_name"`
	CreatedAt time.Time `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
}

func (WaitlistResponse) Init

type WaitlistResponseDataSchema

type WaitlistResponseDataSchema struct {
	PaginatedResponseDataSchema
	Items []WaitlistResponse `json:"waitlist"`
}

func (WaitlistResponseDataSchema) Init

type WaitlistResponseSchema

type WaitlistResponseSchema struct {
	ResponseSchema
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL