Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Book ¶
type Book struct { BaseModel AuthorID uuid.UUID Author User `gorm:"foreignKey:AuthorID;constraint:OnDelete:SET NULL;<-:false"` Title string `gorm:"type: varchar(255)"` Slug string `gorm:"unique"` Blurb string `gorm:"type: varchar(255)"` AgeDiscretion choices.AgeType GenreID uuid.UUID `json:"genre_id"` Genre Genre `gorm:"foreignKey:GenreID;constraint:OnDelete:SET NULL;<-:false"` Tags []Tag `gorm:"many2many:book_tags;<-:false"` Chapters []Chapter `gorm:"<-:false"` CoverImage string `gorm:"type:varchar(10000)"` Completed bool `gorm:"default:false"` Views string `gorm:"type:varchar(10000000)"` Reviews []Review `gorm:"<-:false"` Votes []Vote `gorm:"<-:false"` // BOOK CONTRACT FullName string `gorm:"type: varchar(1000)"` Email string PenName string `gorm:"type: varchar(1000)"` Age uint Country string `gorm:"type: varchar(1000)"` Address string `gorm:"type: varchar(1000)"` City string `gorm:"type: varchar(1000)"` State string `gorm:"type: varchar(1000)"` PostalCode uint TelephoneNumber string `gorm:"type: varchar(20)"` IDType choices.ContractIDTypeChoice `gorm:"type: varchar(100)"` IDFrontImage string IDBackImage string BookAvailabilityLink *string PlannedLength uint AverageChapter uint UpdateRate uint Synopsis string Outline string IntendedContract choices.ContractTypeChoice FullPrice *int ChapterPrice int FullPurchaseMode bool `gorm:"default:false"` ContractStatus choices.ContractStatusChoice `gorm:"default:PENDING"` }
func (Book) ChaptersCount ¶
func (Book) ViewsCount ¶
func (Book) VotesCount ¶
type BoughtChapter ¶
type BoughtChapter struct { BaseModel BuyerID uuid.UUID `gorm:"index:,unique,composite:buyer_id_chapter_id_bought_chapter"` Buyer User `gorm:"foreignKey:BuyerID;constraint:OnDelete:CASCADE;<-:false"` ChapterID uuid.UUID `gorm:"index:,unique,composite:buyer_id_chapter_id_bought_chapter"` Chapter Chapter `gorm:"foreignKey:ChapterID;constraint:OnDelete:CASCADE;<-:false"` }
type Chapter ¶
type Chapter struct { BaseModel BookID uuid.UUID `json:"book_id"` Book Book `gorm:"foreignKey:BookID;constraint:OnDelete:CASCADE;<-:false"` Title string `json:"title" gorm:"type: varchar(255)"` Slug string `gorm:"unique"` Text string `json:"text" gorm:"type: varchar(100000)"` ChapterStatus choices.ChapterStatus `gorm:"type:varchar(100); default:DRAFT" json:"chapter_status"` }
type Genre ¶
type Gift ¶
type Notification ¶
type Notification struct { BaseModel SenderID uuid.UUID Sender User `gorm:"foreignKey:SenderID;constraint:OnDelete:CASCADE;<-:false"` ReceiverID uuid.UUID Receiver User `gorm:"foreignKey:ReceiverID;constraint:OnDelete:CASCADE;<-:false"` Ntype choices.NotificationTypeChoice Text string BookID *uuid.UUID Book *Book `gorm:"foreignKey:BookID;constraint:OnDelete:CASCADE;<-:false"` ReviewID *uuid.UUID Review *Review `gorm:"foreignKey:ReviewID;constraint:OnDelete:SET NULL;<-:false"` ReplyID *uuid.UUID Reply *Reply `gorm:"foreignKey:ReplyID;constraint:OnDelete:SET NULL;<-:false"` SentGiftID *uuid.UUID SentGift *SentGift `gorm:"foreignKey:SentGiftID;constraint:OnDelete:CASCADE;<-:false"` IsRead bool `gorm:"default:false"` }
type Reply ¶
type Reply struct { BaseModel UserID uuid.UUID User User `gorm:"foreignKey:UserID;constraint:OnDelete:CASCADE;<-:false"` ReviewID uuid.UUID Review Review `gorm:"foreignKey:ReviewID;constraint:OnDelete:CASCADE;<-:false"` Likes []User `gorm:"many2many:review_reply_likes;<-:false"` Text string `gorm:"type:varchar(10000)"` }
func (Reply) LikesCount ¶
type Review ¶
type Review struct { BaseModel UserID uuid.UUID `gorm:"index:,unique,composite:user_id_book_id_reviews"` User User `gorm:"foreignKey:UserID;constraint:OnDelete:CASCADE;<-:false"` BookID uuid.UUID `gorm:"index:,unique,composite:user_id_book_id_reviews"` Book Book `gorm:"foreignKey:BookID;constraint:OnDelete:CASCADE;<-:false"` Rating choices.RatingChoice Likes []User `gorm:"many2many:review_likes;<-:false"` Text string `gorm:"type:varchar(10000)"` Replies []Reply `gorm:"<-:false"` }
func (Review) LikesCount ¶
func (Review) RepliesCount ¶
type SentGift ¶
type SentGift struct { BaseModel SenderID uuid.UUID Sender User `gorm:"foreignKey:SenderID;constraint:OnDelete:CASCADE;<-:false"` ReceiverID uuid.UUID Receiver User `gorm:"foreignKey:ReceiverID;constraint:OnDelete:CASCADE;<-:false"` GiftID uuid.UUID Gift Gift `gorm:"foreignKey:GiftID;constraint:OnDelete:CASCADE;<-:false"` Claimed bool `gorm:"default:false"` }
type SiteDetail ¶
type SiteDetail struct { BaseModel Name string `json:"name" gorm:"default:LitPad;type:varchar(50);not null"` Email string `json:"email" gorm:"default:litpad@gmail.com;not null" example:"litpad@gmail.com"` Phone string `json:"phone" gorm:"default:+23412344343545;type:varchar(20);not null" example:"+234345434343"` Address string `json:"address" gorm:"default:234, Lagos, Nigeria;not null" example:"234, Lagos, Nigeria"` Fb string `json:"fb" gorm:"default:https://facebook.com;not null" example:"https://facebook.com"` Tw string `json:"tw" gorm:"default:https://twitter.com;not null" example:"https://twitter.com"` Wh string `json:"wh" gorm:"default:https://wa.me/2348133831036;not null" example:"https://wa.me/2348133831036"` Ig string `json:"ig" gorm:"default:https://instagram.com;not null" example:"https://instagram.com"` }
type Subscriber ¶
type SubscriptionPlan ¶
type SubscriptionPlan struct { BaseModel Amount decimal.Decimal `gorm:"default:0"` SubType choices.SubscriptionTypeChoice `gorm:"default:MONTHLY;unique"` }
type Tag ¶
type Token ¶
type Token struct { BaseModel UserId uuid.UUID `gorm:"unique"` User User `gorm:"foreignKey:UserId;constraint:OnDelete:CASCADE"` TokenString string }
func (Token) CheckExpiration ¶
type Transaction ¶
type Transaction struct { BaseModel Reference string `gorm:"type: varchar(1000);not null"` // payment id UserID uuid.UUID `json:"user_id"` User User `gorm:"foreignKey:UserID;constraint:OnDelete:CASCADE"` // FOR COINS CoinID *uuid.UUID `json:"coin_id"` Coin *Coin `gorm:"foreignKey:CoinID;constraint:OnDelete:SET NULL"` Quantity int `gorm:"default:1"` // FOR SUBSCRIPTION SubscriptionPlanID *uuid.UUID `json:"subscription_plan_id"` SubscriptionPlan *SubscriptionPlan `gorm:"foreignKey:SubscriptionPlanID;constraint:OnDelete:SET NULL"` PaymentType choices.PaymentType `json:"payment_type"` PaymentPurpose choices.PaymentPurpose `json:"payment_purpose"` PaymentStatus choices.PaymentStatus `json:"payment_status" gorm:"default:PENDING"` ClientSecret string }
func (Transaction) CoinsTotal ¶
func (t Transaction) CoinsTotal() *int
type User ¶
type User struct { BaseModel FirstName string `gorm:"type: varchar(255);not null"` LastName string `gorm:"type: varchar(255);not null"` Username string `gorm:"type: varchar(1000);not null;unique;"` Email string `gorm:"not null;unique;"` Password string `gorm:"not null"` IsEmailVerified bool `gorm:"default:false"` IsSuperuser bool `gorm:"default:false"` IsStaff bool `gorm:"default:false"` IsActive bool `gorm:"default:true"` TermsAgreement bool `gorm:"default:false"` Avatar string `gorm:"type:varchar(1000);null;"` Access *string `gorm:"type:varchar(1000);null;"` Refresh *string `gorm:"type:varchar(1000);null;"` SocialLogin bool `gorm:"default:false"` Bio *string `gorm:"type:varchar(1000);null;"` AccountType choices.AccType `gorm:"type:varchar(100); default:READER"` Followings []User `gorm:"many2many:user_followers;foreignKey:ID;joinForeignKey:Follower;References:ID;joinReferences:Following"` Followers []User `gorm:"many2many:user_followers;foreignKey:ID;joinForeignKey:Following;References:ID;joinReferences:Follower"` Coins int `gorm:"default:0"` Lanterns int `gorm:"default:0"` LikeNotification bool `gorm:"default:false"` ReplyNotification bool `gorm:"default:false"` SubscriptionExpiry *time.Time `gorm:"null"` // Back referenced Books []Book `gorm:"foreignKey:AuthorID"` }
func (User) BooksCount ¶
func (User) FollowersCount ¶
func (User) FollowingsCount ¶
func (User) SubscriptionExpired ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.