Documentation ¶
Index ¶
- type Admin
- type BaseModel
- type BaseModelSoftDelete
- type BlogPost
- type Business
- type Country
- type Customer
- type Document
- type Faq
- type Lawyer
- type LegalArea
- type NewsletterSubscribers
- type Package
- type PackageService
- type PackageServiceType
- type Payment
- type PaymentStatus
- type Service
- type ServiceType
- type Servicing
- type ServicingField
- type ServicingStatus
- type Subscription
- type SubscriptionStatus
- type Tag
- type Trademark
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type Admin struct { BaseModelSoftDelete FullName string `gorm:"not null;"` Email string `gorm:"not null;unique"` Password string `gorm:"not null;"` Role string `gorm:"not null;"` Phone *string `gorm:"unique"` PhoneVerifiedAt *time.Time CreatedByID *string CreatedBy *Admin SuspendedAt *time.Time SuspendedReason *string SuspendByID *string SuspendBy *Admin }
Admin defines a administrators who are to manage the app
func (*Admin) BeforeCreate ¶
BeforeCreate hook is called before the data is persisted to db
type BaseModel ¶
type BaseModel struct { // ID should use uuid_generate_v4() for the pk's ID uuid.UUID `gorm:"primary_key;type:uuid;default:uuid_generate_v4()"` CreatedAt time.Time `gorm:"index;not null;default:CURRENT_TIMESTAMP"` UpdatedAt time.Time `gorm:"index;not null;default:CURRENT_TIMESTAMP"` }
BaseModel defines the common columns that all db structs should hold, usually db structs based on this have no soft delete
type BaseModelSoftDelete ¶
BaseModelSoftDelete defines the common columns that all db structs should hold, usually. This struct also defines the fields for GORM triggers to detect the entity should soft delete
type BlogPost ¶
type BlogPost struct { BaseModelSoftDelete Title string `gorm:"not null;"` Image *string Status string `gorm:"not null;"` // active, draft TagID string Tag Tag Details string `gorm:"not null;"` CreatedByID string CreatedBy Admin }
BlogPost defines a blog post
type Country ¶
type Country struct { BaseModelSoftDelete Name string `gorm:"not null;unique"` Description *string Currency *string Image *string CreatedByID string CreatedBy Admin }
Country defines countries we are working with
type Customer ¶
type Customer struct { BaseModelSoftDelete UserID string `gorm:"not null;"` User User LawyerID *string Lawyer User Type *string // business, individual TIN *string // For address DigitalAddress *string AddressCountry *string AddressCity *string AddressStreetName *string AddressNumber *string // Company CompanyName *string CompanyEntityType *string CompanyEntityTypeOther *string CompanyCountryOfRegistration *string CompanyDateOfRegistration *time.Time CompanyRegistrationNumber *string }
Customer defines customers in the system. They could be businesses or individuals
type Faq ¶
type Faq struct { BaseModel Question string `gorm:"not null;"` Answer string `gorm:"not null;"` CreatedByID string CreatedBy Admin }
Faq defines structure of frequently asked questions
type Lawyer ¶
type Lawyer struct { BaseModelSoftDelete UserID string `gorm:"not null;"` User User // For address DigitalAddress *string AddressCountry *string AddressCity *string AddressStreetName *string AddressNumber *string // lawyer stuff FirstYearOfBarAdmission *string LicenseNumber *string TIN *string // Uploads NationalIDFront *string NationalIDBack *string BARMembershipCard *string LawCertificate *string CV *string CoverLetter *string ApprovedAt *time.Time ApprovedByID *string ApprovedBy *Admin }
Lawyer defines the registred laywers in the system
type LegalArea ¶
type LegalArea struct { BaseModelSoftDelete Name string `gorm:"not null;"` Image *string Description *string CreatedByID string CreatedBy Admin }
LegalArea defines the legal areas in the system
type NewsletterSubscribers ¶
type NewsletterSubscribers struct { BaseModel Email string `gorm:"not null;unique"` Type string `gorm:"not null;"` // anon, user }
NewsletterSubscribers defines those who have subscribed for newsletters
type Package ¶
type Package struct { BaseModelSoftDelete Name string `gorm:"not null;"` Description *string AmountPerMonth *int AmountPerYear *int Status string // pending, approved CreatedByID *string CreatedBy Admin RequestedByID *string //when they are creating a custom package RequestedBy User }
Package defines packages a user can subscribe to
type PackageService ¶
type PackageServiceType ¶
type PackageServiceType string
const ( Boolean PackageServiceType = "BOOLEAN" Number PackageServiceType = "NUMBER" )
type Payment ¶
type Payment struct { BaseModelSoftDelete Code uuid.UUID `gorm:"primary_key;type:uuid;default:uuid_generate_v4()"` Amount float64 `gorm:"not null;"` ServicingID *string Servicing Servicing SubscriptionID *string Subscription Subscription AuthorizationUrl string `gorm:"not null;"` AccessCode string `gorm:"not null;"` Status PaymentStatus `gorm:"default:PENDING"` CreatedByID string CreatedBy User }
Payment defines payments a user creates
type PaymentStatus ¶
type PaymentStatus string
const ( PaymentPending PaymentStatus = "PENDING" PaymentSuccess PaymentStatus = "SUCCESS" PaymentFailed PaymentStatus = "FAILED" )
type Service ¶
type Service struct { BaseModelSoftDelete Name string `gorm:"not null;"` Price *float64 Description *string Type ServiceType `gorm:"default:SUBSCRIBE"` // subscribe/unsubscribe/both Variant string // BOOLEAN/NUMBER CreatedByID string CreatedBy Admin }
Service defines services a user can subscribe to
type ServiceType ¶
type ServiceType string
const ( Subscribe ServiceType = "SUBSCRIBE" Unsubscribe ServiceType = "UNSUBSCRIBE" Both ServiceType = "BOTH" )
type Servicing ¶
type Servicing struct { BaseModelSoftDelete ServiceID string `gorm:"not null;"` Service Service Cost *float64 `gorm:"not null;"` // PaymentID *string // Payment Payment Status ServicingStatus `gorm:"default:PENDING"` SubscriptionID *string Subscription Subscription LawyerID *string Lawyer User CreatedByID string CreatedBy User ServiceFieldsID string ServiceFields ServicingField }
Servicing defines each single services user has made
type ServicingField ¶
type ServicingField struct { BaseModelSoftDelete Business Business `gorm:"embedded; embeddedPrefix:business_"` Trademark Trademark `gorm:"embedded; embeddedPrefix:trademark_"` Document Document `gorm:"embedded; embeddedPrefix:document_"` }
type ServicingStatus ¶
type ServicingStatus string
const ( ServicingPending ServicingStatus = "PENDING" ServicingPaid ServicingStatus = "PAID" ServicingActive ServicingStatus = "ACTIVE" ServicingDone ServicingStatus = "DONE" )
type Subscription ¶
type Subscription struct { BaseModelSoftDelete PackageID string `gorm:"not null;"` Package Package // PaymentID *string // Payment Payment Status SubscriptionStatus `gorm:"default:PENDING"` SubscribeAt time.Time ExpiresAt time.Time CreatedByID string CreatedBy User }
Subscription defines what the user has subscribed
type SubscriptionStatus ¶
type SubscriptionStatus string
const ( SubscriptionPending SubscriptionStatus = "PENDING" SubscriptionActive SubscriptionStatus = "ACTIVE" SubscriptionExpired SubscriptionStatus = "EXPIRED" )
type Tag ¶
type Tag struct { BaseModelSoftDelete Name string `gorm:"not null;"` CreatedByID string CreatedBy Admin }
Tag defines categoru of a certain blog post
type User ¶
type User struct { BaseModelSoftDelete Type string `gorm:"not null;"` // customer, lawyer LastName *string FirstName *string OtherNames *string Email string `gorm:"not null;unique"` Password string `gorm:"not null;"` Phone *string `gorm:"unique"` EmailVerifiedAt *time.Time PhoneVerifiedAt *time.Time SetupAt *time.Time SuspendedAt *time.Time SuspendedReason *string SuspendedByID *string SuspendedBy *Admin }
User defines the two typa users in the system (Lawyers and normal clients)