Mhamdans17 commited on
Commit ·
1328d27
1
Parent(s): c6a3ee4
fix: add missing wallet and fee fields to ListCompanies
Browse files
controllers/company_controller.go
CHANGED
|
@@ -25,6 +25,14 @@ type CompanyResponse struct {
|
|
| 25 |
LogoURL string `json:"logo_url"`
|
| 26 |
IsActive bool `json:"is_active"`
|
| 27 |
FeePercentage float64 `json:"fee_percentage"`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
ApprovedAt *time.Time `json:"approved_at"`
|
| 29 |
OwnerVerified *bool `json:"owner_verified,omitempty"`
|
| 30 |
OwnerName string `json:"owner_name,omitempty"`
|
|
@@ -91,7 +99,7 @@ func ListCompanies(c *gin.Context) {
|
|
| 91 |
searchQuery := c.Query("search")
|
| 92 |
|
| 93 |
query := config.DB.Model(&models.Company{}).
|
| 94 |
-
Select("id, name, bank_account_number, bank_name, address, email, phone, logo_url, is_active, fee_percentage, approved_at, created_at")
|
| 95 |
|
| 96 |
if searchQuery != "" {
|
| 97 |
query = query.Where("name ILIKE ? OR email ILIKE ? OR phone ILIKE ? OR address ILIKE ?",
|
|
@@ -192,6 +200,14 @@ func ListCompanies(c *gin.Context) {
|
|
| 192 |
OwnerEmail: ownerEmail,
|
| 193 |
OwnerPhone: ownerPhone,
|
| 194 |
PointRules: comp.PointRules,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
CreatedAt: comp.CreatedAt,
|
| 196 |
})
|
| 197 |
}
|
|
|
|
| 25 |
LogoURL string `json:"logo_url"`
|
| 26 |
IsActive bool `json:"is_active"`
|
| 27 |
FeePercentage float64 `json:"fee_percentage"`
|
| 28 |
+
CashFeeRules string `json:"cash_fee_rules"`
|
| 29 |
+
QrisFeePercentage float64 `json:"qris_fee_percentage"`
|
| 30 |
+
QrisFeeFixed int `json:"qris_fee_fixed"`
|
| 31 |
+
QrisFeeMin int `json:"qris_fee_min"`
|
| 32 |
+
QrisMinTransaction int `json:"qris_min_transaction"`
|
| 33 |
+
AllowQrisBelowMin bool `json:"allow_qris_below_min"`
|
| 34 |
+
WalletBalance float64 `json:"wallet_balance"`
|
| 35 |
+
WalletLimit float64 `json:"wallet_limit"`
|
| 36 |
ApprovedAt *time.Time `json:"approved_at"`
|
| 37 |
OwnerVerified *bool `json:"owner_verified,omitempty"`
|
| 38 |
OwnerName string `json:"owner_name,omitempty"`
|
|
|
|
| 99 |
searchQuery := c.Query("search")
|
| 100 |
|
| 101 |
query := config.DB.Model(&models.Company{}).
|
| 102 |
+
Select("id, name, bank_account_number, bank_name, address, email, phone, logo_url, is_active, fee_percentage, cash_fee_rules, qris_fee_percentage, qris_fee_fixed, qris_fee_min, qris_min_transaction, allow_qris_below_min, wallet_balance, wallet_limit, approved_at, created_at")
|
| 103 |
|
| 104 |
if searchQuery != "" {
|
| 105 |
query = query.Where("name ILIKE ? OR email ILIKE ? OR phone ILIKE ? OR address ILIKE ?",
|
|
|
|
| 200 |
OwnerEmail: ownerEmail,
|
| 201 |
OwnerPhone: ownerPhone,
|
| 202 |
PointRules: comp.PointRules,
|
| 203 |
+
CashFeeRules: comp.CashFeeRules,
|
| 204 |
+
QrisFeePercentage: comp.QrisFeePercentage,
|
| 205 |
+
QrisFeeFixed: comp.QrisFeeFixed,
|
| 206 |
+
QrisFeeMin: comp.QrisFeeMin,
|
| 207 |
+
QrisMinTransaction: comp.QrisMinTransaction,
|
| 208 |
+
AllowQrisBelowMin: comp.AllowQrisBelowMin,
|
| 209 |
+
WalletBalance: comp.WalletBalance,
|
| 210 |
+
WalletLimit: comp.WalletLimit,
|
| 211 |
CreatedAt: comp.CreatedAt,
|
| 212 |
})
|
| 213 |
}
|