Documentation ¶
Index ¶
- func TagFieldToNames(tags []*TagField) []string
- func TagToNames(tags []*Tag) []string
- type Account
- type AddToFavoriteReq
- type AdminCreateCategoryReq
- type AdminCreateTagReq
- type AdminDeleteCategoryReq
- type AdminDeleteEntity
- type AdminDeleteEntityRespond
- type AdminDeleteTagReq
- type AdminDeleteUser
- type AdminDeleteUserRespond
- type AdminEntityRespond
- type AdminGetEntity
- type AdminGetEntityRespond
- type AdminGetTransfer
- type AdminGetUser
- type AdminGetUserRespond
- type AdminSearchEntityReq
- type AdminSearchEntityRespond
- type AdminSearchLogReq
- type AdminSearchTransferReq
- type AdminSearchTransferRespond
- type AdminSearchUserReq
- type AdminTransferReq
- type AdminTransferRespond
- type AdminTransferUserReq
- type AdminUpdateCategoryReq
- type AdminUpdateEntityJSON
- type AdminUpdateEntityReq
- type AdminUpdateEntityRespond
- type AdminUpdateTagReq
- type AdminUpdateUserJSON
- type AdminUpdateUserReq
- type AdminUser
- type AdminUserRespond
- type BalanceLimit
- type BalanceReq
- type Category
- type CategoryRespond
- type ESSearchEntityResult
- type ESSearchJournalResult
- type ESSearchUserActionResult
- type ESSearchUserResult
- type EmailReq
- type Entity
- type EntityESRecord
- type EntityRespond
- type FindCategoryResult
- type FindTagResult
- type GetEntity
- type Journal
- type JournalESRecord
- type LoginInfo
- type LoginReq
- type LostPassword
- type MatchedTags
- type PasswordChange
- type Posting
- type ProposeTransferRespond
- type ResetPasswordReq
- type SearchCategoryReq
- type SearchEntityReq
- type SearchEntityRespond
- type SearchEntityResult
- type SearchTagReq
- type SearchTransferReq
- type SearchTransferRespond
- type SearchUserResult
- type SignupReq
- type Tag
- type TagESRecord
- type TagField
- type TagRespond
- type TransferReq
- type TransferRespond
- type TransferUserReq
- type UpdateOfferAndWants
- type UpdateTransferReq
- type UpdateUserEntityJSON
- type UpdateUserEntityReq
- type UpdateUserReq
- type User
- type UserAction
- type UserActionESRecord
- type UserESRecord
- type UserRespond
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TagFieldToNames ¶
func TagToNames ¶
Types ¶
type AddToFavoriteReq ¶
type AddToFavoriteReq struct { AddToEntityID string `json:"addToEntityID"` FavoriteEntityID string `json:"favoriteEntityID"` Favorite *bool `json:"favorite"` }
func NewAddToFavoriteReq ¶
func NewAddToFavoriteReq(r *http.Request) (*AddToFavoriteReq, []error)
type AdminCreateCategoryReq ¶
type AdminCreateCategoryReq struct {
Name string `json:"name"`
}
func NewAdminCreateCategoryReq ¶
func NewAdminCreateCategoryReq(r *http.Request) (*AdminCreateCategoryReq, []error)
type AdminCreateTagReq ¶
type AdminCreateTagReq struct {
Name string `json:"name"`
}
func NewAdminCreateTagReq ¶
func NewAdminCreateTagReq(r *http.Request) (*AdminCreateTagReq, []error)
type AdminDeleteCategoryReq ¶
func NewAdminDeleteCategoryReq ¶
func NewAdminDeleteCategoryReq(r *http.Request) (*AdminDeleteCategoryReq, []error)
type AdminDeleteEntity ¶
func NewAdminDeleteEntity ¶
func NewAdminDeleteEntity(r *http.Request) (*AdminDeleteEntity, []error)
type AdminDeleteEntityRespond ¶
type AdminDeleteEntityRespond struct { ID string `json:"id"` AccountNumber string `json:"accountNumber"` Name string `json:"name"` Email string `json:"email,omitempty"` Telephone string `json:"telephone"` IncType string `json:"incType"` CompanyNumber string `json:"companyNumber"` Website string `json:"website"` DeclaredTurnover *int `json:"declaredTurnover"` Description string `json:"description"` Address string `json:"address"` City string `json:"city"` Region string `json:"region"` PostalCode string `json:"postalCode"` Country string `json:"country"` Status string `json:"status"` Offers []string `json:"offers,omitempty"` Wants []string `json:"wants,omitempty"` Categories []string `json:"categories,omitempty"` ShowTagsMatchedSinceLastLogin bool `json:"showTagsMatchedSinceLastLogin"` ReceiveDailyMatchNotificationEmail bool `json:"receiveDailyMatchNotificationEmail"` }
func NewAdminDeleteEntityRespond ¶
func NewAdminDeleteEntityRespond(entity *Entity) *AdminDeleteEntityRespond
type AdminDeleteTagReq ¶
func NewAdminDeleteTagReq ¶
func NewAdminDeleteTagReq(r *http.Request) (*AdminDeleteTagReq, []error)
type AdminDeleteUser ¶
func NewAdminDeleteUserReq ¶
func NewAdminDeleteUserReq(r *http.Request) (*AdminDeleteUser, []error)
type AdminDeleteUserRespond ¶
type AdminDeleteUserRespond struct { ID string `json:"id"` Email string `json:"email"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Telephone string `json:"telephone"` LastLoginIP string `json:"lastLoginIP"` LastLoginDate time.Time `json:"lastLoginDate"` }
func NewAdminDeleteUserRespond ¶
func NewAdminDeleteUserRespond(user *User) *AdminDeleteUserRespond
type AdminEntityRespond ¶
type AdminEntityRespond struct { ID string `json:"id"` AccountNumber string `json:"accountNumber"` Name string `json:"name"` Email string `json:"email,omitempty"` Telephone string `json:"telephone"` IncType string `json:"incType"` CompanyNumber string `json:"companyNumber"` Website string `json:"website"` DeclaredTurnover *int `json:"declaredTurnover"` Description string `json:"description"` Address string `json:"address"` City string `json:"city"` Region string `json:"region"` PostalCode string `json:"postalCode"` Country string `json:"country"` Status string `json:"status"` Offers []string `json:"offers,omitempty"` Wants []string `json:"wants,omitempty"` Categories []string `json:"categories,omitempty"` ShowTagsMatchedSinceLastLogin bool `json:"showTagsMatchedSinceLastLogin"` ReceiveDailyMatchNotificationEmail bool `json:"receiveDailyMatchNotificationEmail"` }
func NewAdminEntityRespond ¶
func NewAdminEntityRespond(entity *Entity) *AdminEntityRespond
type AdminGetEntity ¶
type AdminGetEntity struct {
EntityID string
}
func NewAdminGetEntityReq ¶
func NewAdminGetEntityReq(r *http.Request) (*AdminGetEntity, []error)
type AdminGetEntityRespond ¶
type AdminGetEntityRespond struct { ID string `json:"id"` AccountNumber string `json:"accountNumber"` Name string `json:"name"` Email string `json:"email,omitempty"` Telephone string `json:"telephone"` IncType string `json:"incType"` CompanyNumber string `json:"companyNumber"` Website string `json:"website"` DeclaredTurnover *int `json:"declaredTurnover"` Description string `json:"description"` Address string `json:"address"` City string `json:"city"` Region string `json:"region"` PostalCode string `json:"postalCode"` Country string `json:"country"` Status string `json:"status"` Offers []string `json:"offers,omitempty"` Wants []string `json:"wants,omitempty"` Categories []string `json:"categories,omitempty"` ShowTagsMatchedSinceLastLogin bool `json:"showTagsMatchedSinceLastLogin"` ReceiveDailyMatchNotificationEmail bool `json:"receiveDailyMatchNotificationEmail"` Balance float64 `json:"balance"` MaxPositiveBalance float64 `json:"maxPositiveBalance"` MaxNegativeBalance float64 `json:"maxNegativeBalance"` PendingTransfers []*AdminTransferRespond `json:"pendingTransfers"` Users []*AdminUserRespond `json:"users"` }
func NewAdminGetEntityRespond ¶
func NewAdminGetEntityRespond( entity *Entity, users []*User, account *Account, balanceLimit *BalanceLimit, pendingTransfers []*AdminTransferRespond, ) *AdminGetEntityRespond
type AdminGetTransfer ¶
type AdminGetTransfer struct {
TransferID string
}
func NewAdminGetTransfer ¶
func NewAdminGetTransfer(r *http.Request) (*AdminGetTransfer, []error)
type AdminGetUser ¶
func NewAdminGetUserReq ¶
func NewAdminGetUserReq(r *http.Request) (*AdminGetUser, []error)
type AdminGetUserRespond ¶
type AdminGetUserRespond struct { ID string `json:"id"` Email string `json:"email"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Telephone string `json:"telephone"` LastLoginIP string `json:"lastLoginIP"` LastLoginDate time.Time `json:"lastLoginDate"` Entities []*AdminEntityRespond `json:"entities"` }
func NewAdminGetUserRespond ¶
func NewAdminGetUserRespond(user *User, entities []*Entity) *AdminGetUserRespond
type AdminSearchEntityReq ¶
type AdminSearchEntityReq struct { Page int PageSize int Name string Email string Statuses []string Offers []string Wants []string TaggedSince time.Time Category string City string Region string Country string AccountNumber string Balance *float64 MaxPosBal *float64 MaxNegBal *float64 }
func NewAdminSearchEntityReq ¶
func NewAdminSearchEntityReq(r *http.Request) (*AdminSearchEntityReq, []error)
type AdminSearchEntityRespond ¶
type AdminSearchEntityRespond struct { ID string `json:"id"` AccountNumber string `json:"accountNumber"` Name string `json:"name"` Email string `json:"email,omitempty"` Telephone string `json:"telephone"` IncType string `json:"incType"` CompanyNumber string `json:"companyNumber"` Website string `json:"website"` DeclaredTurnover *int `json:"declaredTurnover"` Description string `json:"description"` Address string `json:"address"` City string `json:"city"` Region string `json:"region"` PostalCode string `json:"postalCode"` Country string `json:"country"` Status string `json:"status"` Offers []string `json:"offers,omitempty"` Wants []string `json:"wants,omitempty"` Categories []string `json:"categories,omitempty"` ShowTagsMatchedSinceLastLogin bool `json:"showTagsMatchedSinceLastLogin"` ReceiveDailyMatchNotificationEmail bool `json:"receiveDailyMatchNotificationEmail"` Balance float64 `json:"balance"` MaxPositiveBalance float64 `json:"maxPositiveBalance"` MaxNegativeBalance float64 `json:"maxNegativeBalance"` Users []*AdminUserRespond `json:"users"` }
func NewAdminSearchEntityRespond ¶
func NewAdminSearchEntityRespond( entity *Entity, users []*User, account *Account, balanceLimit *BalanceLimit, ) *AdminSearchEntityRespond
type AdminSearchLogReq ¶
type AdminSearchLogReq struct { Page int PageSize int Offset int Email string Categories []string Action string Detail string DateFrom time.Time DateTo time.Time }
func NewAdminSearchLog ¶
func NewAdminSearchLog(r *http.Request) (*AdminSearchLogReq, []error)
type AdminSearchTransferReq ¶
type AdminSearchTransferReq struct { Page int PageSize int Offset int Status []string AccountNumber string DateFrom time.Time DateTo time.Time }
func NewAdminSearchTransferQuery ¶
func NewAdminSearchTransferQuery(r *http.Request) (*AdminSearchTransferReq, []error)
type AdminSearchTransferRespond ¶
type AdminSearchTransferRespond struct { Transfers []*AdminTransferRespond NumberOfResults int TotalPages int }
type AdminSearchUserReq ¶
type AdminSearchUserReq struct { Email string `json:"email"` LastName string `json:"last_name"` Page int PageSize int }
func NewAdminSearchUserReq ¶
func NewAdminSearchUserReq(r *http.Request) (*AdminSearchUserReq, []error)
type AdminTransferReq ¶
type AdminTransferReq struct { PayerEntity *Entity PayeeEntity *Entity TransferType string // "Transfer" / "AdminTranser" Amount float64 Description string }
func NewAdminTransferReq ¶
func NewAdminTransferReq(userReq *AdminTransferUserReq, payerEntity *Entity, payeeEntity *Entity) (*AdminTransferReq, []error)
func (*AdminTransferReq) Validate ¶
func (req *AdminTransferReq) Validate() []error
type AdminTransferRespond ¶
type AdminTransferRespond struct { TransferID string `json:"id"` FromAccountNumber string `json:"fromAccountNumber"` FromEntityName string `json:"fromEntityName"` ToAccountNumber string `json:"toAccountNumber"` ToEntityName string `json:"toEntityName"` Amount float64 `json:"amount"` Description string `json:"description"` Type string `json:"type,omitempty"` Status string `json:"status"` CancellationReason string `json:"cancellationReason,omitempty"` CreatedAt *time.Time `json:"dateProposed,omitempty"` CompletedAt *time.Time `json:"dateCompleted,omitempty"` }
func NewJournalToAdminTransferRespond ¶
func NewJournalToAdminTransferRespond(j *Journal) *AdminTransferRespond
func NewJournalsToAdminTransfersRespond ¶
func NewJournalsToAdminTransfersRespond(journals []*Journal) []*AdminTransferRespond
type AdminTransferUserReq ¶
type AdminUpdateCategoryReq ¶
func NewAdminUpdateCategoryReq ¶
func NewAdminUpdateCategoryReq(r *http.Request) (*AdminUpdateCategoryReq, []error)
type AdminUpdateEntityJSON ¶
type AdminUpdateEntityJSON struct { Status string `json:"status"` Name string `json:"name"` Email string `json:"email"` Telephone string `json:"telephone"` IncType string `json:"incType"` CompanyNumber string `json:"companyNumber"` Website string `json:"website"` DeclaredTurnover *int `json:"declaredTurnover"` Description string `json:"description"` Users *[]string `json:"users"` // Tags Offers *[]string `json:"offers"` Wants *[]string `json:"wants"` Categories *[]string `json:"categories"` // Address Address string `json:"address"` City string `json:"city"` Region string `json:"region"` PostalCode string `json:"postalCode"` Country string `json:"country"` // flags ReceiveDailyMatchNotificationEmail *bool `json:"receiveDailyMatchNotificationEmail"` ShowTagsMatchedSinceLastLogin *bool `json:"showTagsMatchedSinceLastLogin"` // Account MaxPosBal *float64 `json:"maxPositiveBalance"` MaxNegBal *float64 `json:"maxNegativeBalance"` // Useless (Do not use it) ID string `json:"id"` AccountNumber string `json:"accountNumber"` }
type AdminUpdateEntityReq ¶
type AdminUpdateEntityReq struct { OriginEntity *Entity OriginBalanceLimit *BalanceLimit Status string Name string Email string Telephone string IncType string CompanyNumber string Website string DeclaredTurnover *int Description string ReceiveDailyMatchNotificationEmail *bool ShowTagsMatchedSinceLastLogin *bool // Users Users *[]string AddedUsers []primitive.ObjectID RemovedUsers []primitive.ObjectID // Tags Offers *[]string AddedOffers []string RemovedOffers []string Wants *[]string AddedWants []string RemovedWants []string Categories *[]string // Address Address string City string Region string PostalCode string Country string // Account MaxPosBal *float64 MaxNegBal *float64 }
func NewAdminUpdateEntityReq ¶
func NewAdminUpdateEntityReq(j AdminUpdateEntityJSON, originEntity *Entity, originBalanceLimit *BalanceLimit) (*AdminUpdateEntityReq, []error)
type AdminUpdateEntityRespond ¶
type AdminUpdateEntityRespond struct { ID string `json:"id"` AccountNumber string `json:"accountNumber"` Name string `json:"name"` Email string `json:"email,omitempty"` Telephone string `json:"telephone"` IncType string `json:"incType"` CompanyNumber string `json:"companyNumber"` Website string `json:"website"` DeclaredTurnover *int `json:"declaredTurnover"` Description string `json:"description"` Address string `json:"address"` City string `json:"city"` Region string `json:"region"` PostalCode string `json:"postalCode"` Country string `json:"country"` Status string `json:"status"` Offers []string `json:"offers,omitempty"` Wants []string `json:"wants,omitempty"` Categories []string `json:"categories,omitempty"` ShowTagsMatchedSinceLastLogin bool `json:"showTagsMatchedSinceLastLogin"` ReceiveDailyMatchNotificationEmail bool `json:"receiveDailyMatchNotificationEmail"` MaxPositiveBalance float64 `json:"maxPositiveBalance"` MaxNegativeBalance float64 `json:"maxNegativeBalance"` Users []*AdminUserRespond `json:"users"` // To log user action. BalanceLimit *BalanceLimit `json:"-"` }
func NewAdminUpdateEntityRespond ¶
func NewAdminUpdateEntityRespond(users []*User, entity *Entity, balanceLimit *BalanceLimit) *AdminUpdateEntityRespond
type AdminUpdateTagReq ¶
func NewAdminUpdateTagReq ¶
func NewAdminUpdateTagReq(r *http.Request) (*AdminUpdateTagReq, []error)
type AdminUpdateUserJSON ¶
type AdminUpdateUserReq ¶
type AdminUpdateUserReq struct { OriginUser *User Email string FirstName string LastName string Telephone string Password string // Entity Entity *[]string AddedEntities []primitive.ObjectID RemovedEntities []primitive.ObjectID }
func NewAdminUpdateUserReq ¶
func NewAdminUpdateUserReq(j AdminUpdateUserJSON, originUser *User) (*AdminUpdateUserReq, []error)
type AdminUser ¶
type AdminUser struct { ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty" bson:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty" bson:"updatedAt,omitempty"` DeletedAt time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"` Email string `json:"email,omitempty" bson:"email,omitempty"` Name string `json:"name,omitempty" bson:"name,omitempty"` Password string `json:"password,omitempty" bson:"password,omitempty"` Roles []string `json:"roles,omitempty" bson:"roles,omitempty"` CurrentLoginIP string `json:"currentLoginIP,omitempty" bson:"currentLoginIP,omitempty"` CurrentLoginDate time.Time `json:"currentLoginDate,omitempty" bson:"currentLoginDate,omitempty"` LastLoginIP string `json:"lastLoginIP,omitempty" bson:"lastLoginIP,omitempty"` LastLoginDate time.Time `json:"lastLoginDate,omitempty" bson:"lastLoginDate,omitempty"` }
AdminUser is the model representation of an admin user in the data model.
type AdminUserRespond ¶
type AdminUserRespond struct { ID string `json:"id"` Email string `json:"email"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Telephone string `json:"telephone"` LastLoginIP string `json:"lastLoginIP"` LastLoginDate time.Time `json:"lastLoginDate"` }
func NewAdminUserRespond ¶
func NewAdminUserRespond(user *User) *AdminUserRespond
type BalanceLimit ¶
type BalanceLimit struct { gorm.Model // `BalanceLimit` belongs to `Account`, `AccountID` is the foreign key Account Account AccountNumber string `json:"accountNumber,omitempty" gorm:"type:varchar(16);not null;unique_index"` MaxNegBal float64 `json:"maxNegBal,omitempty" gorm:"type:real;not null"` MaxPosBal float64 `json:"maxPosBal,omitempty" gorm:"type:real;not null"` }
type BalanceReq ¶
type BalanceReq struct {
QueryingEntityID string
}
func NewBalanceQuery ¶
func NewBalanceQuery(r *http.Request) (*BalanceReq, []error)
func (*BalanceReq) Validate ¶
func (query *BalanceReq) Validate() []error
type Category ¶
type Category struct { ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty" bson:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty" bson:"updatedAt,omitempty"` DeletedAt time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"` Name string `json:"name,omitempty" bson:"name,omitempty"` }
type CategoryRespond ¶
func NewCategoryRespond ¶
func NewCategoryRespond(category *Category) *CategoryRespond
func NewSearchCategoryRespond ¶
func NewSearchCategoryRespond(categories []*Category) []*CategoryRespond
type ESSearchEntityResult ¶
type ESSearchJournalResult ¶
type ESSearchUserActionResult ¶
type ESSearchUserActionResult struct { UserActions []*UserActionESRecord NumberOfResults int TotalPages int }
type ESSearchUserResult ¶
type EmailReq ¶
type Entity ¶
type Entity struct { ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty" bson:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty" bson:"updatedAt,omitempty"` DeletedAt time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"` Users []primitive.ObjectID `json:"users,omitempty" bson:"users,omitempty"` Name string `json:"name,omitempty" bson:"name,omitempty"` Telephone string `json:"telephone,omitempty" bson:"telephone,omitempty"` Email string `json:"email,omitempty" bson:"email,omitempty"` IncType string `json:"incType,omitempty" bson:"incType,omitempty"` CompanyNumber string `json:"companyNumber,omitempty" bson:"companyNumber,omitempty"` Website string `json:"website,omitempty" bson:"website,omitempty"` DeclaredTurnover *int `json:"declaredTurnover,omitempty" bson:"declaredTurnover,omitempty"` Offers []*TagField `json:"offers,omitempty" bson:"offers,omitempty"` Wants []*TagField `json:"wants,omitempty" bson:"wants,omitempty"` Description string `json:"description,omitempty" bson:"description,omitempty"` Address string `json:"address,omitempty" bson:"address,omitempty"` City string `json:"city,omitempty" bson:"city,omitempty"` Region string `json:"region,omitempty" bson:"region,omitempty"` PostalCode string `json:"postalCode,omitempty" bson:"postalCode,omitempty"` Country string `json:"country,omitempty" bson:"country,omitempty"` Status string `json:"status,omitempty" bson:"status,omitempty"` Categories []string `json:"categories,omitempty" bson:"categories,omitempty"` // Timestamp when trading status applied MemberStartedAt time.Time `json:"memberStartedAt,omitempty" bson:"memberStartedAt,omitempty"` // flags ShowTagsMatchedSinceLastLogin *bool `json:"showTagsMatchedSinceLastLogin,omitempty" bson:"showTagsMatchedSinceLastLogin,omitempty"` ReceiveDailyMatchNotificationEmail *bool `json:"receiveDailyMatchNotificationEmail,omitempty" bson:"receiveDailyMatchNotificationEmail,omitempty"` LastNotificationSentDate time.Time `json:"lastNotificationSentDate,omitempty" bson:"lastNotificationSentDate,omitempty"` AccountNumber string `json:"accountNumber,omitempty" bson:"accountNumber,omitempty"` FavoriteEntities []primitive.ObjectID `json:"favoriteEntities,omitempty" bson:"favoriteEntities,omitempty"` }
Entity is the model representation of a entity in the data model.
type EntityESRecord ¶
type EntityESRecord struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` Status string `json:"status,omitempty"` // Tags Offers []*TagField `json:"offers,omitempty"` Wants []*TagField `json:"wants,omitempty"` Categories []string `json:"categories,omitempty"` // Address City string `json:"city,omitempty"` Region string `json:"region,omitempty"` Country string `json:"country,omitempty"` // Account AccountNumber string `json:"accountNumber,omitempty"` Balance *float64 `json:"balance,omitempty"` MaxNegBal *float64 `json:"maxNegBal,omitempty"` MaxPosBal *float64 `json:"maxPosBal,omitempty"` }
EntityESRecord is the data that will store into the elastic search.
type EntityRespond ¶
type EntityRespond struct { ID string `json:"id"` AccountNumber string `json:"accountNumber"` Name string `json:"name"` Email string `json:"email,omitempty"` Telephone string `json:"telephone"` IncType string `json:"incType"` CompanyNumber string `json:"companyNumber"` Website string `json:"website"` DeclaredTurnover *int `json:"declaredTurnover"` Description string `json:"description"` Address string `json:"address"` City string `json:"city"` Region string `json:"region"` PostalCode string `json:"postalCode"` Country string `json:"country"` Status string `json:"status"` ShowTagsMatchedSinceLastLogin bool `json:"showTagsMatchedSinceLastLogin"` ReceiveDailyMatchNotificationEmail bool `json:"receiveDailyMatchNotificationEmail"` Offers []string `json:"offers"` Wants []string `json:"wants"` Categories []string `json:"categories"` Balance float64 `json:"balance"` MaxPositiveBalance float64 `json:"maxPositiveBalance"` MaxNegativeBalance float64 `json:"maxNegativeBalance"` PendingTransfers []*TransferRespond `json:"pendingTransfers"` }
func NewEntityRespond ¶
func NewEntityRespond( entity *Entity, account *Account, balanceLimit *BalanceLimit, pendingTransfers []*TransferRespond, ) *EntityRespond
type FindCategoryResult ¶
type FindTagResult ¶
type Journal ¶
type Journal struct { gorm.Model // Journal has many postings, JournalID is the foreign key Postings []Posting TransferID string `gorm:"type:varchar(27);not null;default:''"` InitiatedBy string `gorm:"varchar(16);not null;default:''"` FromAccountNumber string `gorm:"varchar(16);not null;default:''"` FromEntityName string `gorm:"type:varchar(120);not null;default:''"` ToAccountNumber string `gorm:"varchar(16);not null;default:''"` ToEntityName string `gorm:"type:varchar(120);not null;default:''"` Amount float64 `gorm:"not null;default:0"` Description string `gorm:"type:varchar(510);not null;default:''"` Type string `gorm:"type:varchar(31);not null;default:'transfer'"` Status string `gorm:"type:varchar(31);not null;default:''"` CompletedAt time.Time CancellationReason string `gorm:"type:varchar(510);not null;default:''"` }
type JournalESRecord ¶
type LoginInfo ¶
type LoginInfo struct { CurrentLoginIP string `json:"currentLoginIP,omitempty" bson:"currentLoginIP,omitempty"` CurrentLoginDate time.Time `json:"currentLoginDate,omitempty" bson:"currentLoginDate,omitempty"` LastLoginIP string `json:"lastLoginIP,omitempty" bson:"lastLoginIP,omitempty"` LastLoginDate time.Time `json:"lastLoginDate,omitempty" bson:"lastLoginDate,omitempty"` }
LoginInfo is shared by user and admin user model.
type LostPassword ¶
type LostPassword struct { ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty" bson:"createdAt,omitempty"` Email string `json:"email,omitempty" bson:"email,omitempty"` Token string `json:"token,omitempty" bson:"token,omitempty"` TokenUsed bool `json:"tokenUsed,omitempty" bson:"tokenUsed,omitempty"` }
LostPassword is the model representation of a lost password in the data model.
type MatchedTags ¶
type PasswordChange ¶
type PasswordChange struct {
Password string `json:"password"`
}
func (*PasswordChange) Validate ¶
func (req *PasswordChange) Validate() []error
type ProposeTransferRespond ¶
type ProposeTransferRespond struct { ID string `json:"id"` From string `json:"from"` To string `json:"to"` Amount float64 `json:"amount"` Description string `json:"description"` Status string `json:"status"` CreatedAt *time.Time `json:"dateProposed,omitempty"` }
func NewProposeTransferRespond ¶
func NewProposeTransferRespond(journal *Journal) *ProposeTransferRespond
type ResetPasswordReq ¶
type ResetPasswordReq struct {
Password string `json:"password"`
}
func (*ResetPasswordReq) Validate ¶
func (req *ResetPasswordReq) Validate() []error
type SearchCategoryReq ¶
type SearchCategoryReq struct { Fragment string `json:"fragment"` Prefix string `json:"prefix"` Page int `json:"page"` PageSize int `json:"pageSize"` }
func NewSearchCategoryReq ¶
func NewSearchCategoryReq(q url.Values) (*SearchCategoryReq, error)
func (*SearchCategoryReq) Validate ¶
func (query *SearchCategoryReq) Validate() []error
type SearchEntityReq ¶
type SearchEntityReq struct { QueryingEntityID string Page int PageSize int Name string Wants []string Offers []string Category string FavoriteEntities []primitive.ObjectID FavoritesOnly bool TaggedSince time.Time Statuses []string Country string City string }
func NewSearchEntityReq ¶
func NewSearchEntityReq(q url.Values) (*SearchEntityReq, error)
func (*SearchEntityReq) Validate ¶
func (query *SearchEntityReq) Validate() []error
type SearchEntityRespond ¶
type SearchEntityRespond struct { ID string `json:"id"` AccountNumber string `json:"accountNumber"` Name string `json:"name"` Email string `json:"email,omitempty"` Telephone string `json:"telephone"` IncType string `json:"incType"` CompanyNumber string `json:"companyNumber"` Website string `json:"website"` DeclaredTurnover *int `json:"declaredTurnover"` Description string `json:"description"` Address string `json:"address"` City string `json:"city"` Region string `json:"region"` PostalCode string `json:"postalCode"` Country string `json:"country"` Status string `json:"status"` Offers []string `json:"offers"` Wants []string `json:"wants"` Categories []string `json:"categories"` IsFavorite bool `json:"isFavorite"` }
func NewSearchEntityRespond ¶
func NewSearchEntityRespond(entity *Entity, queryingEntityStatus string, favoriteEntities []primitive.ObjectID) *SearchEntityRespond
type SearchEntityResult ¶
type SearchTagReq ¶
type SearchTagReq struct { Fragment string `json:"fragment"` Page int `json:"page"` PageSize int `json:"pageSize"` }
func NewSearchTagReq ¶
func NewSearchTagReq(q url.Values) (*SearchTagReq, error)
func (*SearchTagReq) Validate ¶
func (q *SearchTagReq) Validate() []error
type SearchTransferReq ¶
type SearchTransferReq struct { Page int PageSize int Status string QueryingEntityID string QueryingAccountNumber string Offset int }
func NewSearchTransferQuery ¶
func NewSearchTransferQuery(r *http.Request, entity *Entity) (*SearchTransferReq, []error)
type SearchTransferRespond ¶
type SearchTransferRespond struct { Transfers []*TransferRespond NumberOfResults int TotalPages int }
type SearchUserResult ¶
type SignupReq ¶
type SignupReq struct { UserEmail string `json:"userEmail"` EntityEmail string `json:"entityEmail"` Password string `json:"password"` FirstName string `json:"firstName"` LastName string `json:"lastName"` UserPhone string `json:"userPhone"` EntityName string `json:"entityName"` IncType string `json:"incType"` CompanyNumber string `json:"companyNumber"` EntityPhone string `json:"entityPhone"` Website string `json:"website"` DeclaredTurnover *int `json:"declaredTurnover"` Description string `json:"description"` Address string `json:"address"` City string `json:"city"` Region string `json:"region"` PostalCode string `json:"postalCode"` Country string `json:"country"` Offers []string `json:"offers"` Wants []string `json:"wants"` // flags ShowTagsMatchedSinceLastLogin *bool `json:"showTagsMatchedSinceLastLogin"` ReceiveDailyMatchNotificationEmail *bool `json:"receiveDailyMatchNotificationEmail"` }
type Tag ¶
type Tag struct { ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty" bson:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty" bson:"updatedAt,omitempty"` DeletedAt time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"` Name string `json:"name,omitempty" bson:"name,omitempty"` OfferAddedAt time.Time `json:"offerAddedAt,omitempty" bson:"offerAddedAt,omitempty"` WantAddedAt time.Time `json:"wantAddedAt,omitempty" bson:"wantAddedAt,omitempty"` }
type TagESRecord ¶
type TagField ¶
type TagField struct { Name string `json:"name,omitempty" bson:"name,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty" bson:"createdAt,omitempty"` }
func ToTagFields ¶
ToTagFields converts tags into TagFields.
type TagRespond ¶
func NewSearchTagRespond ¶
func NewSearchTagRespond(tags []*Tag) []*TagRespond
func NewTagRespond ¶
func NewTagRespond(tag *Tag) *TagRespond
type TransferReq ¶
type TransferReq struct { TransferDirection string // "in" or "out" TransferType string // "Transfer" / "AdminTranser" InitiatorAccountNumber string ReceiverAccountNumber string Amount float64 Description string InitiatorEmail string InitiatorEntityName string ReceiverEmail string ReceiverEntityName string FromAccountNumber string FromEmail string FromEntityName string FromStatus string ToAccountNumber string ToEmail string ToEntityName string ToStatus string InitiatorEntity *Entity ReceiverEntity *Entity }
func NewTransferReq ¶
func NewTransferReq(userReq *TransferUserReq, initiatorEntity *Entity, receiverEntity *Entity) (*TransferReq, []error)
func (*TransferReq) Validate ¶
func (req *TransferReq) Validate() []error
type TransferRespond ¶
type TransferRespond struct { TransferID string `json:"id"` Transfer string `json:"transfer"` IsInitiator bool `json:"isInitiator"` AccountNumber string `json:"accountNumber"` EntityName string `json:"entityName"` Amount float64 `json:"amount"` Description string `json:"description"` Status string `json:"status"` CancellationReason string `json:"cancellationReason,omitempty"` CreatedAt *time.Time `json:"dateProposed,omitempty"` CompletedAt *time.Time `json:"dateCompleted,omitempty"` }
func NewJournalsToTransfersRespond ¶
func NewJournalsToTransfersRespond(journals []*Journal, queryingAccountNumber string) []*TransferRespond
type TransferUserReq ¶
type UpdateOfferAndWants ¶
type UpdateTransferReq ¶
type UpdateTransferReq struct { TransferID string Action string CancellationReason string LoggedInUserID string Journal *Journal InitiateEntity *Entity FromEntity *Entity ToEntity *Entity }
func NewUpdateTransferReq ¶
func (*UpdateTransferReq) Validate ¶
func (req *UpdateTransferReq) Validate() []error
type UpdateUserEntityJSON ¶
type UpdateUserEntityJSON struct { Name string `json:"name"` Email string `json:"email"` Telephone string `json:"telephone"` IncType string `json:"incType"` CompanyNumber string `json:"companyNumber"` Website string `json:"website"` DeclaredTurnover *int `json:"declaredTurnover"` Description string `json:"description"` Address string `json:"address"` City string `json:"city"` Region string `json:"region"` PostalCode string `json:"postalCode"` Country string `json:"country"` // Tags Offers *[]string `json:"offers"` Wants *[]string `json:"wants"` // flags ShowTagsMatchedSinceLastLogin *bool `json:"showTagsMatchedSinceLastLogin"` ReceiveDailyMatchNotificationEmail *bool `json:"receiveDailyMatchNotificationEmail"` // Not allow to change ID string `json:"id"` Status string `json:"status"` }
type UpdateUserEntityReq ¶
type UpdateUserEntityReq struct { OriginEntity *Entity Name string Email string Telephone string IncType string CompanyNumber string Website string DeclaredTurnover *int Description string // Address Address string City string Region string PostalCode string Country string // Tags Offers *[]string AddedOffers []string RemovedOffers []string Wants *[]string AddedWants []string RemovedWants []string // flags ShowTagsMatchedSinceLastLogin *bool `json:"showTagsMatchedSinceLastLogin"` ReceiveDailyMatchNotificationEmail *bool `json:"receiveDailyMatchNotificationEmail"` }
func NewUpdateUserEntityReq ¶
func NewUpdateUserEntityReq(j UpdateUserEntityJSON, originEntity *Entity) (*UpdateUserEntityReq, []error)
type UpdateUserReq ¶
type UpdateUserReq struct { ID string `json:"id"` Email string `json:"email"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Telephone string `json:"telephone"` }
func NewUpdateUserReq ¶
func NewUpdateUserReq(r *http.Request) (*UpdateUserReq, []error)
type User ¶
type User struct { ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty" bson:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty" bson:"updatedAt,omitempty"` DeletedAt time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"` FirstName string `json:"firstName,omitempty" bson:"firstName,omitempty"` LastName string `json:"lastName,omitempty" bson:"lastName,omitempty"` Email string `json:"email,omitempty" bson:"email,omitempty"` Password string `json:"password,omitempty" bson:"password,omitempty"` Telephone string `json:"telephone,omitempty" bson:"telephone,omitempty"` Entities []primitive.ObjectID `json:"entities,omitempty" bson:"entities,omitempty"` CurrentLoginIP string `json:"currentLoginIP,omitempty" bson:"currentLoginIP,omitempty"` CurrentLoginDate time.Time `json:"currentLoginDate,omitempty" bson:"currentLoginDate,omitempty"` LastLoginIP string `json:"lastLoginIP,omitempty" bson:"lastLoginIP,omitempty"` LastLoginDate time.Time `json:"lastLoginDate,omitempty" bson:"lastLoginDate,omitempty"` }
User is the model representation of an user in the data model.
type UserAction ¶
type UserAction struct { ID primitive.ObjectID `bson:"_id,omitempty"` UserID primitive.ObjectID `bson:"userID,omitempty"` Email string `bson:"email,omitempty"` Action string `bson:"action,omitempty"` Detail string `bson:"detail,omitempty"` Category string `bson:"category,omitempty"` CreatedAt time.Time `bson:"createdAt,omitempty"` }
type UserActionESRecord ¶
type UserESRecord ¶
type UserESRecord struct { UserID string `json:"userID"` FirstName string `json:"firstName,omitempty"` LastName string `json:"lastName,omitempty"` Email string `json:"email,omitempty"` }
UserESRecord is the data that will store into the elastic search.
type UserRespond ¶
type UserRespond struct { ID string `json:"id"` Email string `json:"email"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Telephone string `json:"telephone"` LastLoginIP string `json:"lastLoginIP"` LastLoginDate time.Time `json:"lastLoginDate"` }
func NewUserRespond ¶
func NewUserRespond(user *User) *UserRespond
Source Files ¶
- api_request_body.go
- api_respond_body.go
- es_entity.go
- es_journal.go
- es_tag.go
- es_user.go
- es_user_action.go
- mongo_admin_user.go
- mongo_category.go
- mongo_entity.go
- mongo_login_info.go
- mongo_lost_password.go
- mongo_tag.go
- mongo_tag_field.go
- mongo_user.go
- mongo_user_action.go
- pg_account.go
- pg_balance_limit.go
- pg_journal.go
- pg_posting.go
Click to show internal directories.
Click to hide internal directories.