Fix Commit
This commit is contained in:
parent
a520d0ed11
commit
9db3dcb472
@ -3,6 +3,8 @@ package contract
|
||||
import (
|
||||
"time"
|
||||
|
||||
"apskel-pos-be/internal/entities"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
@ -16,7 +18,7 @@ type CreateCampaignRequest struct {
|
||||
IsActive bool `json:"is_active"`
|
||||
ShowOnApp bool `json:"show_on_app"`
|
||||
Position int `json:"position" binding:"min=0"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Metadata *entities.Metadata `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateCampaignRequest struct {
|
||||
@ -29,7 +31,7 @@ type UpdateCampaignRequest struct {
|
||||
IsActive bool `json:"is_active"`
|
||||
ShowOnApp bool `json:"show_on_app"`
|
||||
Position int `json:"position" binding:"min=0"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Metadata *entities.Metadata `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
type ListCampaignsRequest struct {
|
||||
@ -60,7 +62,7 @@ type CreateCampaignRuleRequest struct {
|
||||
RewardValue *int64 `json:"reward_value,omitempty"`
|
||||
RewardSubtype *string `json:"reward_subtype,omitempty"`
|
||||
RewardRefID *uuid.UUID `json:"reward_ref_id,omitempty"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Metadata *entities.Metadata `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateCampaignRuleRequest struct {
|
||||
@ -72,7 +74,7 @@ type UpdateCampaignRuleRequest struct {
|
||||
RewardValue *int64 `json:"reward_value,omitempty"`
|
||||
RewardSubtype *string `json:"reward_subtype,omitempty"`
|
||||
RewardRefID *uuid.UUID `json:"reward_ref_id,omitempty"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Metadata *entities.Metadata `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
type ListCampaignRulesRequest struct {
|
||||
@ -102,7 +104,7 @@ type CampaignResponse struct {
|
||||
IsActive bool `json:"is_active"`
|
||||
ShowOnApp bool `json:"show_on_app"`
|
||||
Position int `json:"position"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Metadata *entities.Metadata `json:"metadata,omitempty"`
|
||||
Rules []CampaignRuleResponse `json:"rules,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
@ -117,7 +119,7 @@ type CampaignRuleResponse struct {
|
||||
RewardValue *int64 `json:"reward_value,omitempty"`
|
||||
RewardSubtype *string `json:"reward_subtype,omitempty"`
|
||||
RewardRefID *uuid.UUID `json:"reward_ref_id,omitempty"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Metadata *entities.Metadata `json:"metadata,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
@ -144,5 +146,5 @@ type CampaignRuleStruct struct {
|
||||
RewardValue *int64 `json:"reward_value,omitempty"`
|
||||
RewardSubtype *string `json:"reward_subtype,omitempty"`
|
||||
RewardRefID *uuid.UUID `json:"reward_ref_id,omitempty"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Metadata *entities.Metadata `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ type Campaign struct {
|
||||
IsActive bool `gorm:"type:boolean;default:true" json:"is_active"`
|
||||
ShowOnApp bool `gorm:"type:boolean;default:true" json:"show_on_app"`
|
||||
Position int `gorm:"type:int;default:0" json:"position"`
|
||||
Metadata *map[string]interface{} `gorm:"type:jsonb" json:"metadata,omitempty"`
|
||||
Metadata *Metadata `gorm:"type:jsonb" json:"metadata,omitempty"`
|
||||
CreatedAt time.Time `gorm:"type:timestamp;default:now()" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"type:timestamp;default:now()" json:"updated_at"`
|
||||
|
||||
@ -87,7 +87,7 @@ type CampaignRule struct {
|
||||
RewardValue *int64 `gorm:"type:bigint" json:"reward_value,omitempty"`
|
||||
RewardSubtype *RewardSubtype `gorm:"type:varchar(50)" json:"reward_subtype,omitempty"`
|
||||
RewardRefID *uuid.UUID `gorm:"type:uuid" json:"reward_ref_id,omitempty"`
|
||||
Metadata *map[string]interface{} `gorm:"type:jsonb" json:"metadata,omitempty"`
|
||||
Metadata *Metadata `gorm:"type:jsonb" json:"metadata,omitempty"`
|
||||
CreatedAt time.Time `gorm:"type:timestamp;default:now()" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"type:timestamp;default:now()" json:"updated_at"`
|
||||
|
||||
|
||||
@ -3,6 +3,8 @@ package models
|
||||
import (
|
||||
"time"
|
||||
|
||||
"apskel-pos-be/internal/entities"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
@ -15,7 +17,7 @@ type CreateCampaignRequest struct {
|
||||
IsActive bool `json:"is_active"`
|
||||
ShowOnApp bool `json:"show_on_app"`
|
||||
Position int `json:"position" binding:"min=0"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Metadata *entities.Metadata `json:"metadata,omitempty"`
|
||||
Rules []CampaignRuleStruct `json:"rules" binding:"required,min=1"`
|
||||
}
|
||||
|
||||
@ -29,7 +31,7 @@ type UpdateCampaignRequest struct {
|
||||
IsActive bool `json:"is_active"`
|
||||
ShowOnApp bool `json:"show_on_app"`
|
||||
Position int `json:"position" binding:"min=0"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Metadata *entities.Metadata `json:"metadata,omitempty"`
|
||||
Rules []CampaignRuleStruct `json:"rules" binding:"required,min=1"`
|
||||
}
|
||||
|
||||
@ -54,7 +56,7 @@ type CampaignResponse struct {
|
||||
IsActive bool `json:"is_active"`
|
||||
ShowOnApp bool `json:"show_on_app"`
|
||||
Position int `json:"position"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Metadata *entities.Metadata `json:"metadata,omitempty"`
|
||||
Rules []CampaignRuleResponse `json:"rules,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
@ -69,7 +71,7 @@ type CampaignRuleResponse struct {
|
||||
RewardValue *int64 `json:"reward_value,omitempty"`
|
||||
RewardSubtype *string `json:"reward_subtype,omitempty"`
|
||||
RewardRefID *uuid.UUID `json:"reward_ref_id,omitempty"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Metadata *entities.Metadata `json:"metadata,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
@ -90,7 +92,7 @@ type CreateCampaignRuleRequest struct {
|
||||
RewardValue *int64 `json:"reward_value,omitempty"`
|
||||
RewardSubtype *string `json:"reward_subtype,omitempty"`
|
||||
RewardRefID *uuid.UUID `json:"reward_ref_id,omitempty"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Metadata *entities.Metadata `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateCampaignRuleRequest struct {
|
||||
@ -102,7 +104,7 @@ type UpdateCampaignRuleRequest struct {
|
||||
RewardValue *int64 `json:"reward_value,omitempty"`
|
||||
RewardSubtype *string `json:"reward_subtype,omitempty"`
|
||||
RewardRefID *uuid.UUID `json:"reward_ref_id,omitempty"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Metadata *entities.Metadata `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
type ListCampaignRulesRequest struct {
|
||||
@ -128,5 +130,5 @@ type CampaignRuleStruct struct {
|
||||
RewardValue *int64 `json:"reward_value,omitempty"`
|
||||
RewardSubtype *string `json:"reward_subtype,omitempty"`
|
||||
RewardRefID *uuid.UUID `json:"reward_ref_id,omitempty"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Metadata *entities.Metadata `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user