Documentation
¶
Index ¶
- type Auditable
- type Category
- type EditEventParams
- type Event
- type Gender
- type Location
- type NewEventParams
- type NewTicketParams
- type NewTransactionParams
- type Notification
- type OneTimePassword
- type Payment
- type Role
- type Ticket
- type Timetable
- type Token
- type TokenAction
- type Topic
- type Transaction
- type UpdateTransactionParams
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auditable ¶
type Auditable struct {
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `json:"deleted_at"`
}
func NewAuditable ¶
func NewAuditable() Auditable
func UpdateAuditable ¶
func UpdateAuditable() Auditable
type Category ¶
func NewCategory ¶
type EditEventParams ¶
type Event ¶
type Event struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
Address string `json:"address"`
AddressLink string `json:"address_link"`
Organizer string `json:"organizer"`
OrganizerLogo *string `json:"organizer_logo,omitempty"`
Cover *string `json:"cover,omitempty"`
Description string `json:"description"`
TermAndCondition string `json:"term_and_condition"`
IsPaid bool `json:"is_paid"`
IsPublic bool `json:"is_public"`
IsApproved bool `json:"is_approved"`
ApprovedAt *time.Time `json:"approved_at,omitempty"`
UserID uuid.UUID `json:"-"`
User *User `gorm:"foreignKey:UserID;references:ID" json:"user,omitempty"`
LocationID int64 `json:"-"`
Location *Location `gorm:"foreignKey:LocationID;references:ID" json:"location,omitempty"`
CategoryID int64 `json:"-"`
Category *Category `gorm:"foreignKey:CategoryID;references:ID" json:"category,omitempty"`
TopicID int64 `json:"-"`
Topic *Topic `gorm:"foreignKey:TopicID;references:ID" json:"topic,omitempty"`
Timetables *[]Timetable `gorm:"foreignKey:EventID;references:ID" json:"timetables,omitempty"`
Auditable
}
func ApproveEvent ¶
func EditEvent ¶
func EditEvent(params EditEventParams) *Event
func NewEvent ¶
func NewEvent(params NewEventParams) *Event
type Location ¶
func NewLocation ¶
type NewEventParams ¶
type NewEventParams struct {
Name string
UserID uuid.UUID
LocationID int64
CategoryID int64
TopicID int64
Start time.Time
End time.Time
Address string
AddressLink string
Organizer string
Description string
Cover *string
OrganizerLogo *string
TermAndCondition string
IsPaid bool
IsPublic bool
IsApproved bool
}
NewEventParams Struct untuk menyimpan parameter NewEvent
type NewTicketParams ¶
type NewTransactionParams ¶
type Notification ¶
type Notification struct {
ID uuid.UUID `json:"id"`
UserID uuid.UUID `json:"user_id"`
Title string `json:"title"`
Detail string `json:"detail,omitempty"`
IsRead bool `json:"is_read"`
Auditable
}
func NewNotification ¶
func NewNotification(userId uuid.UUID, title, detail string) *Notification
func ReadNotification ¶
func ReadNotification(id uuid.UUID) *Notification
type OneTimePassword ¶
type OneTimePassword struct {
ID uuid.UUID `json:"id"`
OTPCode string `json:"otp_code" length:"8"`
Email string `json:"email"`
ExpiresAt time.Time `json:"expires_at" sql:"expires_at"`
Auditable
}
func NewOneTimePassword ¶
func NewOneTimePassword(otpCode, email string) *OneTimePassword
type Ticket ¶
type Ticket struct {
ID uuid.UUID `json:"id"`
NoTicket string `json:"no_ticket"`
Name string `json:"name"`
PersonalNo *string `json:"personal_no,omitempty"`
Birthdate time.Time `json:"birthdate"`
Phone *string `json:"phone,omitempty"`
Email string `json:"email"`
Gender *Gender `json:"gender,omitempty"`
Price int64 `json:"price"`
IsValid bool `json:"is_valid"`
TransactionID uuid.UUID `json:"-"`
Transaction *Transaction `gorm:"foreignKey:TransactionID;references:ID" json:"transaction,omitempty"`
TimetableID uuid.UUID `json:"-"`
Timetable *Timetable `gorm:"foreignKey:TimetableID;references:ID" json:"timetable,omitempty"`
Auditable
}
func NewTicket ¶
func NewTicket(params NewTicketParams) *Ticket
func UsedTicket ¶
type Timetable ¶
type Timetable struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
Description *string `json:"description,omitempty"`
Stock int32 `json:"stock"`
Price *int64 `json:"price,omitempty"`
EventID uuid.UUID `json:"-"`
Event *Event `json:"event,omitempty"`
Tickets *[]Ticket `gorm:"TimetableID;references:ID" json:"tickets,omitempty"`
Auditable
}
func EditTimetable ¶
func NewTimetable ¶
type Token ¶
type Token struct {
ID uuid.UUID `json:"id"`
Email string `json:"email"`
Action TokenAction `json:"action"`
ExpiresAt time.Time `json:"expires_at" sql:"expires_at"`
Auditable
}
func NewToken ¶
func NewToken(email string, action TokenAction) *Token
type TokenAction ¶
type TokenAction string
const ( Register TokenAction = "register" ForgotPassword TokenAction = "forgot-password" )
type Transaction ¶
type Transaction struct {
ID uuid.UUID `json:"id"`
Invoice string `json:"invoice"`
GrandTotal int64 `json:"grand_total"`
SnapToken *string `json:"snap_token,omitempty"`
Status string `json:"status"`
UserID uuid.UUID `json:"-"`
User *User `gorm:"foreignKey:UserID;references:ID" json:"user,omitempty"`
Tickets []Ticket `gorm:"foreignKey:TransactionID;references:ID" json:"tickets,omitempty"`
Auditable
}
func NewTransaction ¶
func NewTransaction(params NewTransactionParams) *Transaction
func UpdateStatusTransaction ¶
func UpdateStatusTransaction(id uuid.UUID, status string) *Transaction
func UpdateTransaction ¶
func UpdateTransaction(params UpdateTransactionParams) *Transaction
type UpdateTransactionParams ¶
type User ¶
type User struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Password string `json:"-"`
Role Role `json:"role"`
Phone *string `json:"phone,omitempty"`
Address *string `json:"address,omitempty"`
Avatar *string `json:"avatar,omitempty"`
Birthdate *time.Time `json:"birthdate,omitempty"`
Gender *Gender `json:"gender,omitempty"`
Notifications *[]Notification `gorm:"foreignKey:UserID;references:ID" json:"notifications,omitempty"`
Transactions *[]Transaction `json:"transactions,omitempty"`
Auditable
}
Click to show internal directories.
Click to hide internal directories.