Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Validate ¶
func Validate(m *EntityIntegrationMapping) error
Validate validates the EntityIntegrationMapping
func ValidateEntityType ¶
func ValidateEntityType(entityType types.IntegrationEntityType) bool
ValidateEntityType validates the entity type
func ValidateProviderType ¶
ValidateProviderType validates the provider type
Types ¶
type EntityIntegrationMapping ¶
type EntityIntegrationMapping struct {
// ID is the unique identifier for the mapping
ID string `db:"id" json:"id"`
// EntityID is the FlexPrice entity ID (e.g., customer_id, plan_id, etc.)
EntityID string `db:"entity_id" json:"entity_id"`
// EntityType is the type of entity (e.g., customer, plan, invoice, subscription, etc.)
EntityType types.IntegrationEntityType `db:"entity_type" json:"entity_type"`
// ProviderType is the payment provider type (e.g., stripe, razorpay, etc.)
ProviderType string `db:"provider_type" json:"provider_type"`
// ProviderEntityID is the provider's entity ID (e.g., stripe_customer_id, etc.)
ProviderEntityID string `db:"provider_entity_id" json:"provider_entity_id"`
// Metadata contains provider-specific data
Metadata map[string]interface{} `db:"metadata" json:"metadata"`
// EnvironmentID is the environment identifier
EnvironmentID string `db:"environment_id" json:"environment_id"`
types.BaseModel
}
EntityIntegrationMapping represents an entity integration mapping in the system
func FromEnt ¶
func FromEnt(e *ent.EntityIntegrationMapping) *EntityIntegrationMapping
FromEnt converts an ent EntityIntegrationMapping to a domain EntityIntegrationMapping
func FromEntList ¶
func FromEntList(mappings []*ent.EntityIntegrationMapping) []*EntityIntegrationMapping
FromEntList converts a list of ent EntityIntegrationMapping to domain EntityIntegrationMapping
type Repository ¶
type Repository interface {
Create(ctx context.Context, mapping *EntityIntegrationMapping) error
Get(ctx context.Context, id string) (*EntityIntegrationMapping, error)
List(ctx context.Context, filter *types.EntityIntegrationMappingFilter) ([]*EntityIntegrationMapping, error)
Count(ctx context.Context, filter *types.EntityIntegrationMappingFilter) (int, error)
Update(ctx context.Context, mapping *EntityIntegrationMapping) error
Delete(ctx context.Context, mapping *EntityIntegrationMapping) error
}
Repository defines the interface for entity integration mapping data access
Click to show internal directories.
Click to hide internal directories.