v1

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrorResponse

func NewErrorResponse(c *gin.Context, code int, message string, err error)

Types

type AuthHandler

type AuthHandler struct {
	// contains filtered or unexported fields
}

func NewAuthHandler

func NewAuthHandler(cfg *config.Configuration, authService service.AuthService, logger *logger.Logger) *AuthHandler

func (*AuthHandler) Login

func (h *AuthHandler) Login(c *gin.Context)

@Summary Login @Description Login a user @Tags Auth @Accept json @Produce json @Param login body dto.LoginRequest true "Login request" @Success 200 {object} dto.AuthResponse @Failure 400 {object} ErrorResponse @Router /auth/login [post]

func (*AuthHandler) SignUp

func (h *AuthHandler) SignUp(c *gin.Context)

@Summary Sign up @Description Sign up a new user @Tags Auth @Accept json @Produce json @Param signup body dto.SignUpRequest true "Sign up request" @Success 200 {object} dto.AuthResponse @Failure 400 {object} ErrorResponse @Router /auth/signup [post]

type CustomerHandler

type CustomerHandler struct {
	// contains filtered or unexported fields
}

func NewCustomerHandler

func NewCustomerHandler(service service.CustomerService, log *logger.Logger) *CustomerHandler

func (*CustomerHandler) CreateCustomer

func (h *CustomerHandler) CreateCustomer(c *gin.Context)

@Summary Create a customer @Description Create a customer @Tags Customers @Accept json @Produce json @Security ApiKeyAuth @Param customer body dto.CreateCustomerRequest true "Customer" @Success 201 {object} dto.CustomerResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /customers [post]

func (*CustomerHandler) DeleteCustomer

func (h *CustomerHandler) DeleteCustomer(c *gin.Context)

@Summary Delete a customer @Description Delete a customer @Tags Customers @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Customer ID" @Success 204 @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /customers/{id} [delete]

func (*CustomerHandler) GetCustomer

func (h *CustomerHandler) GetCustomer(c *gin.Context)

@Summary Get a customer @Description Get a customer @Tags Customers @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Customer ID" @Success 200 {object} dto.CustomerResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /customers/{id} [get]

func (*CustomerHandler) GetCustomerByLookupKey

func (h *CustomerHandler) GetCustomerByLookupKey(c *gin.Context)

@Summary Get a customer by lookup key @Description Get a customer by lookup key (external_id) @Tags Customers @Accept json @Produce json @Security ApiKeyAuth @Param lookup_key path string true "Customer Lookup Key (external_id)" @Success 200 {object} dto.CustomerResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /customers/lookup/{lookup_key} [get]

func (*CustomerHandler) GetCustomers

func (h *CustomerHandler) GetCustomers(c *gin.Context)

@Summary Get customers @Description Get customers @Tags Customers @Accept json @Produce json @Security ApiKeyAuth @Param filter query types.CustomerFilter false "Filter" @Success 200 {object} dto.ListCustomersResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /customers [get]

func (*CustomerHandler) UpdateCustomer

func (h *CustomerHandler) UpdateCustomer(c *gin.Context)

@Summary Update a customer @Description Update a customer @Tags Customers @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Customer ID" @Param customer body dto.UpdateCustomerRequest true "Customer" @Success 200 {object} dto.CustomerResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /customers/{id} [put]

type EntitlementHandler

type EntitlementHandler struct {
	// contains filtered or unexported fields
}

func NewEntitlementHandler

func NewEntitlementHandler(service service.EntitlementService, log *logger.Logger) *EntitlementHandler

func (*EntitlementHandler) CreateEntitlement

func (h *EntitlementHandler) CreateEntitlement(c *gin.Context)

@Summary Create a new entitlement @Description Create a new entitlement with the specified configuration @Tags Entitlements @Accept json @Produce json @Security ApiKeyAuth @Param entitlement body dto.CreateEntitlementRequest true "Entitlement configuration" @Success 201 {object} dto.EntitlementResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /entitlements [post]

func (*EntitlementHandler) DeleteEntitlement

func (h *EntitlementHandler) DeleteEntitlement(c *gin.Context)

@Summary Delete an entitlement @Description Delete an entitlement @Tags Entitlements @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Entitlement ID" @Success 200 {object} gin.H @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /entitlements/{id} [delete]

func (*EntitlementHandler) GetEntitlement

func (h *EntitlementHandler) GetEntitlement(c *gin.Context)

@Summary Get an entitlement by ID @Description Get an entitlement by ID @Tags Entitlements @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Entitlement ID" @Success 200 {object} dto.EntitlementResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /entitlements/{id} [get]

func (*EntitlementHandler) ListEntitlements

func (h *EntitlementHandler) ListEntitlements(c *gin.Context)

@Summary Get entitlements @Description Get entitlements with the specified filter @Tags Entitlements @Accept json @Produce json @Security ApiKeyAuth @Param filter query types.EntitlementFilter true "Filter" @Success 200 {object} dto.ListEntitlementsResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /entitlements [get]

func (*EntitlementHandler) UpdateEntitlement

func (h *EntitlementHandler) UpdateEntitlement(c *gin.Context)

@Summary Update an entitlement @Description Update an entitlement with the specified configuration @Tags Entitlements @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Entitlement ID" @Param entitlement body dto.UpdateEntitlementRequest true "Entitlement configuration" @Success 200 {object} dto.EntitlementResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /entitlements/{id} [put]

type EnvironmentHandler

type EnvironmentHandler struct {
	// contains filtered or unexported fields
}

func NewEnvironmentHandler

func NewEnvironmentHandler(service service.EnvironmentService, log *logger.Logger) *EnvironmentHandler

func (*EnvironmentHandler) CreateEnvironment

func (h *EnvironmentHandler) CreateEnvironment(c *gin.Context)

@Summary Create an environment @Description Create an environment @Tags Environments @Accept json @Produce json @Security ApiKeyAuth @Param environment body dto.CreateEnvironmentRequest true "Environment" @Success 201 {object} dto.EnvironmentResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /environments [post]

func (*EnvironmentHandler) GetEnvironment

func (h *EnvironmentHandler) GetEnvironment(c *gin.Context)

@Summary Get an environment @Description Get an environment @Tags Environments @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Environment ID" @Success 200 {object} dto.EnvironmentResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /environments/{id} [get]

func (*EnvironmentHandler) GetEnvironments

func (h *EnvironmentHandler) GetEnvironments(c *gin.Context)

@Summary Get environments @Description Get environments @Tags Environments @Accept json @Produce json @Security ApiKeyAuth @Param filter query types.Filter false "Filter" @Success 200 {object} dto.ListEnvironmentsResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /environments [get]

func (*EnvironmentHandler) UpdateEnvironment

func (h *EnvironmentHandler) UpdateEnvironment(c *gin.Context)

@Summary Update an environment @Description Update an environment @Tags Environments @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Environment ID" @Param environment body dto.UpdateEnvironmentRequest true "Environment" @Success 200 {object} dto.EnvironmentResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /environments/{id} [put]

type ErrorResponse

type ErrorResponse struct {
	Error  string `json:"error" example:"Invalid request payload"`
	Detail string `json:"detail" example:"Invalid request payload"`
}

ErrorResponse represents the API error response structure

type EventsHandler

type EventsHandler struct {
	// contains filtered or unexported fields
}

func NewEventsHandler

func NewEventsHandler(eventService service.EventService, log *logger.Logger) *EventsHandler

func (*EventsHandler) GetEvents

func (h *EventsHandler) GetEvents(c *gin.Context)

@Summary Get raw events @Description Retrieve raw events with pagination and filtering @Tags Events @Produce json @Security ApiKeyAuth @Param external_customer_id query string false "External Customer ID" @Param event_name query string false "Event Name" @Param start_time query string false "Start Time (RFC3339)" @Param end_time query string false "End Time (RFC3339)" @Param iter_first_key query string false "Iter First Key (unix_timestamp_nanoseconds::event_id)" @Param iter_last_key query string false "Iter Last Key (unix_timestamp_nanoseconds::event_id)" @Param page_size query int false "Page Size (1-50)" @Success 200 {object} dto.GetEventsResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /events [get]

func (*EventsHandler) GetUsage

func (h *EventsHandler) GetUsage(c *gin.Context)

@Summary Get usage statistics @Description Retrieve aggregated usage statistics for events @Tags Events @Produce json @Security ApiKeyAuth @Param request body dto.GetUsageRequest true "Request body" @Success 200 {object} dto.GetUsageResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /events/usage [post]

func (*EventsHandler) GetUsageByMeter

func (h *EventsHandler) GetUsageByMeter(c *gin.Context)

@Summary Get usage by meter @Description Retrieve aggregated usage statistics using meter configuration @Tags Events @Produce json @Security ApiKeyAuth @Param request body dto.GetUsageByMeterRequest true "Request body" @Success 200 {object} dto.GetUsageResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /events/usage/meter [post]

func (*EventsHandler) IngestEvent

func (h *EventsHandler) IngestEvent(c *gin.Context)

@Summary Ingest event @Description Ingest a new event into the system @Tags Events @Accept json @Produce json @Security ApiKeyAuth @Param event body dto.IngestEventRequest true "Event data" @Success 202 {object} map[string]string "message:Event accepted for processing" @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /events [post]

type FeatureHandler

type FeatureHandler struct {
	// contains filtered or unexported fields
}

func NewFeatureHandler

func NewFeatureHandler(service service.FeatureService, log *logger.Logger) *FeatureHandler

func (*FeatureHandler) CreateFeature

func (h *FeatureHandler) CreateFeature(c *gin.Context)

CreateFeature godoc @Summary Create a new feature @Description Create a new feature with the specified configuration @Tags Features @Accept json @Produce json @Security ApiKeyAuth @Param feature body dto.CreateFeatureRequest true "Feature configuration" @Success 201 {object} dto.FeatureResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /features [post]

func (*FeatureHandler) DeleteFeature

func (h *FeatureHandler) DeleteFeature(c *gin.Context)

DeleteFeature godoc @Summary Delete a feature @Description Delete a feature @Tags Features @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Feature ID" @Success 200 {object} gin.H @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /features/{id} [delete]

func (*FeatureHandler) GetFeature

func (h *FeatureHandler) GetFeature(c *gin.Context)

GetFeature godoc @Summary Get a feature by ID @Description Get a feature by ID @Tags Features @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Feature ID" @Success 200 {object} dto.FeatureResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /features/{id} [get]

func (*FeatureHandler) GetFeatures

func (h *FeatureHandler) GetFeatures(c *gin.Context)

GetFeatures godoc @Summary Get features @Description Get features with the specified filter @Tags Features @Accept json @Produce json @Security ApiKeyAuth @Param filter query types.FeatureFilter true "Filter" @Success 200 {object} dto.ListFeaturesResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /features [get]

func (*FeatureHandler) UpdateFeature

func (h *FeatureHandler) UpdateFeature(c *gin.Context)

UpdateFeature godoc @Summary Update a feature @Description Update a feature with the specified configuration @Tags Features @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Feature ID" @Param feature body dto.UpdateFeatureRequest true "Feature configuration" @Success 200 {object} dto.FeatureResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /features/{id} [put]

type HealthHandler

type HealthHandler struct {
	// contains filtered or unexported fields
}

func NewHealthHandler

func NewHealthHandler(
	logger *logger.Logger,
) *HealthHandler

func (*HealthHandler) Health

func (h *HealthHandler) Health(c *gin.Context)

@Summary Health check @Description Health check @Tags Health @Accept json @Produce json @Success 200 {object} map[string]string

type InvoiceHandler

type InvoiceHandler struct {
	// contains filtered or unexported fields
}

func NewInvoiceHandler

func NewInvoiceHandler(invoiceService service.InvoiceService, temporalService *temporal.Service, logger *logger.Logger) *InvoiceHandler

func (*InvoiceHandler) CreateInvoice

func (h *InvoiceHandler) CreateInvoice(c *gin.Context)

CreateInvoice godoc @Summary Create a new invoice @Description Create a new invoice with the provided details @Tags Invoices @Accept json @Produce json @Param invoice body dto.CreateInvoiceRequest true "Invoice details" @Success 201 {object} dto.InvoiceResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /invoices [post]

func (*InvoiceHandler) FinalizeInvoice

func (h *InvoiceHandler) FinalizeInvoice(c *gin.Context)

FinalizeInvoice godoc @Summary Finalize an invoice @Description Finalize a draft invoice @Tags Invoices @Accept json @Produce json @Param id path string true "Invoice ID" @Success 200 {object} gin.H @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /invoices/{id}/finalize [post]

func (*InvoiceHandler) GenerateInvoice

func (h *InvoiceHandler) GenerateInvoice(c *gin.Context)

GenerateInvoice handles manual invoice generation requests

func (*InvoiceHandler) GetCustomerInvoiceSummary

func (h *InvoiceHandler) GetCustomerInvoiceSummary(c *gin.Context)

GetCustomerInvoiceSummary godoc @Summary Get a customer invoice summary @Description Get a customer invoice summary @Tags Invoices @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Customer ID" @Success 200 {object} dto.CustomerMultiCurrencyInvoiceSummary @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /customers/{id}/invoices/summary [get]

func (*InvoiceHandler) GetInvoice

func (h *InvoiceHandler) GetInvoice(c *gin.Context)

GetInvoice godoc @Summary Get an invoice by ID @Description Get detailed information about an invoice @Tags Invoices @Accept json @Produce json @Param id path string true "Invoice ID" @Success 200 {object} dto.InvoiceResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /invoices/{id} [get]

func (*InvoiceHandler) GetPreviewInvoice

func (h *InvoiceHandler) GetPreviewInvoice(c *gin.Context)

GetPreviewInvoice godoc @Summary Get a preview invoice @Description Get a preview invoice @Tags Invoices @Accept json @Produce json @Param request body dto.GetPreviewInvoiceRequest true "Preview Invoice Request" @Success 200 {object} dto.InvoiceResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /invoices/preview [post]

func (*InvoiceHandler) ListInvoices

func (h *InvoiceHandler) ListInvoices(c *gin.Context)

ListInvoices godoc @Summary List invoices @Description List invoices with optional filtering @Tags Invoices @Accept json @Produce json @Param filter query types.InvoiceFilter false "Filter" @Success 200 {object} dto.ListInvoicesResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /invoices [get]

func (*InvoiceHandler) UpdatePaymentStatus

func (h *InvoiceHandler) UpdatePaymentStatus(c *gin.Context)

UpdatePaymentStatus godoc @Summary Update invoice payment status @Description Update the payment status of an invoice @Tags Invoices @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Invoice ID" @Param request body dto.UpdatePaymentStatusRequest true "Payment Status Update Request" @Success 200 {object} dto.InvoiceResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /invoices/{id}/payment [put]

func (*InvoiceHandler) VoidInvoice

func (h *InvoiceHandler) VoidInvoice(c *gin.Context)

VoidInvoice godoc @Summary Void an invoice @Description Void an invoice that hasn't been paid @Tags Invoices @Accept json @Produce json @Param id path string true "Invoice ID" @Success 200 {object} gin.H @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /invoices/{id}/void [post]

type MeterHandler

type MeterHandler struct {
	// contains filtered or unexported fields
}

func NewMeterHandler

func NewMeterHandler(service service.MeterService, log *logger.Logger) *MeterHandler

func (*MeterHandler) CreateMeter

func (h *MeterHandler) CreateMeter(c *gin.Context)

@Summary Create meter @Description Create a new meter with the specified configuration @Tags Meters @Accept json @Produce json @Security ApiKeyAuth @Param meter body dto.CreateMeterRequest true "Meter configuration" @Success 201 {object} dto.MeterResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /meters [post]

func (*MeterHandler) DeleteMeter

func (h *MeterHandler) DeleteMeter(c *gin.Context)

@Summary Delete meter @Description Delete an existing meter @Tags Meters @Produce json @Security ApiKeyAuth @Param id path string true "Meter ID" @Success 200 {object} map[string]string "message:Meter deleted successfully" @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /meters/{id} [delete]

func (*MeterHandler) DisableMeter

func (h *MeterHandler) DisableMeter(c *gin.Context)

@Summary Disable meter [TODO: Deprecate] @Description Disable an existing meter @Tags Meters @Produce json @Security ApiKeyAuth @Param id path string true "Meter ID" @Success 200 {object} map[string]string "message:Meter disabled successfully" @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /meters/{id}/disable [post]

func (*MeterHandler) GetAllMeters

func (h *MeterHandler) GetAllMeters(c *gin.Context)

@Summary List meters @Description Get all meters @Tags Meters @Produce json @Security ApiKeyAuth @Param filter query types.MeterFilter false "Filter" @Success 200 {array} dto.MeterResponse @Failure 500 {object} ErrorResponse @Router /meters [get]

func (*MeterHandler) GetMeter

func (h *MeterHandler) GetMeter(c *gin.Context)

@Summary Get meter @Description Get a specific meter by ID @Tags Meters @Produce json @Security ApiKeyAuth @Param id path string true "Meter ID" @Success 200 {object} dto.MeterResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /meters/{id} [get]

func (*MeterHandler) UpdateMeter

func (h *MeterHandler) UpdateMeter(c *gin.Context)

@Summary Update meter @Description Update an existing meter @Tags Meters @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Meter ID" @Param meter body dto.UpdateMeterRequest true "Meter configuration" @Success 200 {object} dto.MeterResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /meters/{id} [put]

type PaymentHandler

type PaymentHandler struct {
	// contains filtered or unexported fields
}

func NewPaymentHandler

func NewPaymentHandler(service service.PaymentService, processor service.PaymentProcessorService, log *logger.Logger) *PaymentHandler

func (*PaymentHandler) CreatePayment

func (h *PaymentHandler) CreatePayment(c *gin.Context)

@Summary Create a new payment @Description Create a new payment with the specified configuration @Tags Payments @Accept json @Produce json @Security ApiKeyAuth @Param payment body dto.CreatePaymentRequest true "Payment configuration" @Success 201 {object} dto.PaymentResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /payments [post]

func (*PaymentHandler) DeletePayment

func (h *PaymentHandler) DeletePayment(c *gin.Context)

@Summary Delete a payment @Description Delete a payment @Tags Payments @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Payment ID" @Success 200 {object} gin.H @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /payments/{id} [delete]

func (*PaymentHandler) GetPayment

func (h *PaymentHandler) GetPayment(c *gin.Context)

@Summary Get a payment by ID @Description Get a payment by ID @Tags Payments @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Payment ID" @Success 200 {object} dto.PaymentResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /payments/{id} [get]

func (*PaymentHandler) ListPayments

func (h *PaymentHandler) ListPayments(c *gin.Context)

@Summary List payments @Description List payments with the specified filter @Tags Payments @Accept json @Produce json @Security ApiKeyAuth @Param filter query types.PaymentFilter true "Filter" @Success 200 {object} dto.ListPaymentsResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /payments [get]

func (*PaymentHandler) ProcessPayment

func (h *PaymentHandler) ProcessPayment(c *gin.Context)

@Summary Process a payment @Description Process a payment @Tags Payments @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Payment ID" @Success 200 {object} dto.PaymentResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /payments/{id}/process [post]

func (*PaymentHandler) UpdatePayment

func (h *PaymentHandler) UpdatePayment(c *gin.Context)

@Summary Update a payment @Description Update a payment with the specified configuration @Tags Payments @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Payment ID" @Param payment body dto.UpdatePaymentRequest true "Payment configuration" @Success 200 {object} dto.PaymentResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /payments/{id} [put]

type PlanHandler

type PlanHandler struct {
	// contains filtered or unexported fields
}

func NewPlanHandler

func NewPlanHandler(
	service service.PlanService,
	entitlementService service.EntitlementService,
	log *logger.Logger,
) *PlanHandler

func (*PlanHandler) CreatePlan

func (h *PlanHandler) CreatePlan(c *gin.Context)

@Summary Create a new plan @Description Create a new plan with the specified configuration @Tags Plans @Accept json @Produce json @Security ApiKeyAuth @Param plan body dto.CreatePlanRequest true "Plan configuration" @Success 201 {object} dto.PlanResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /plans [post]

func (*PlanHandler) DeletePlan

func (h *PlanHandler) DeletePlan(c *gin.Context)

@Summary Delete a plan by ID @Description Delete a plan by ID @Tags Plans @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Plan ID" @Success 200 {object} gin.H @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /plans/{id} [delete]

func (*PlanHandler) GetPlan

func (h *PlanHandler) GetPlan(c *gin.Context)

@Summary Get a plan by ID @Description Get a plan by ID @Tags Plans @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Plan ID" @Success 200 {object} dto.PlanResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /plans/{id} [get]

func (*PlanHandler) GetPlanEntitlements

func (h *PlanHandler) GetPlanEntitlements(c *gin.Context)

@Summary Get plan entitlements @Description Get all entitlements for a plan @Tags Entitlements @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Plan ID" @Success 200 {object} dto.PlanResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /plans/{id}/entitlements [get]

func (*PlanHandler) GetPlans

func (h *PlanHandler) GetPlans(c *gin.Context)

@Summary Get plans @Description Get plans with the specified filter @Tags Plans @Accept json @Produce json @Security ApiKeyAuth @Param filter query types.PlanFilter false "Filter" @Success 200 {object} dto.ListPlansResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /plans [get]

func (*PlanHandler) UpdatePlan

func (h *PlanHandler) UpdatePlan(c *gin.Context)

@Summary Update a plan by ID @Description Update a plan by ID @Tags Plans @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Plan ID" @Param plan body dto.UpdatePlanRequest true "Plan configuration" @Success 200 {object} dto.PlanResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /plans/{id} [put]

type PriceHandler

type PriceHandler struct {
	// contains filtered or unexported fields
}

func NewPriceHandler

func NewPriceHandler(service service.PriceService, log *logger.Logger) *PriceHandler

func (*PriceHandler) CreatePrice

func (h *PriceHandler) CreatePrice(c *gin.Context)

@Summary Create a new price @Description Create a new price with the specified configuration @Tags Prices @Accept json @Produce json @Security ApiKeyAuth @Param price body dto.CreatePriceRequest true "Price configuration" @Success 201 {object} dto.PriceResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /prices [post]

func (*PriceHandler) DeletePrice

func (h *PriceHandler) DeletePrice(c *gin.Context)

@Summary Delete a price @Description Delete a price @Tags Prices @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Price ID" @Success 200 {object} gin.H @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /prices/{id} [delete]

func (*PriceHandler) GetPrice

func (h *PriceHandler) GetPrice(c *gin.Context)

@Summary Get a price by ID @Description Get a price by ID @Tags Prices @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Price ID" @Success 200 {object} dto.PriceResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /prices/{id} [get]

func (*PriceHandler) GetPrices

func (h *PriceHandler) GetPrices(c *gin.Context)

@Summary Get prices @Description Get prices with the specified filter @Tags Prices @Accept json @Produce json @Security ApiKeyAuth @Param filter query types.PriceFilter false "Filter" @Success 200 {object} dto.ListPricesResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /prices [get]

func (*PriceHandler) UpdatePrice

func (h *PriceHandler) UpdatePrice(c *gin.Context)

@Summary Update a price @Description Update a price with the specified configuration @Tags Prices @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Price ID" @Param price body dto.UpdatePriceRequest true "Price configuration" @Success 200 {object} dto.PriceResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /prices/{id} [put]

type SecretHandler

type SecretHandler struct {
	// contains filtered or unexported fields
}

func NewSecretHandler

func NewSecretHandler(service service.SecretService, logger *logger.Logger) *SecretHandler

func (*SecretHandler) CreateAPIKey

func (h *SecretHandler) CreateAPIKey(c *gin.Context)

CreateAPIKey godoc @Summary Create a new API key @Description Create a new API key with the specified type and permissions @Tags secrets @Accept json @Produce json @Param request body dto.CreateAPIKeyRequest true "API key creation request" @Success 201 {object} dto.CreateAPIKeyResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /secrets/api/keys [post]

func (*SecretHandler) CreateIntegration

func (h *SecretHandler) CreateIntegration(c *gin.Context)

CreateIntegration godoc @Summary Create or update an integration @Description Create or update integration credentials @Tags secrets @Accept json @Produce json @Param provider path string true "Integration provider" @Param request body dto.CreateIntegrationRequest true "Integration creation request" @Success 201 {object} dto.SecretResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /secrets/integrations/{provider} [post]

func (*SecretHandler) DeleteAPIKey

func (h *SecretHandler) DeleteAPIKey(c *gin.Context)

DeleteAPIKey godoc @Summary Delete an API key @Description Delete an API key by ID @Tags secrets @Accept json @Produce json @Param id path string true "API key ID" @Success 204 "No Content" @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /secrets/api/keys/{id} [delete]

func (*SecretHandler) DeleteIntegration

func (h *SecretHandler) DeleteIntegration(c *gin.Context)

DeleteIntegration godoc @Summary Delete an integration @Description Delete integration credentials @Tags secrets @Accept json @Produce json @Param id path string true "Integration ID" @Success 204 "No Content" @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /secrets/integrations/{id} [delete]

func (*SecretHandler) GetIntegration

func (h *SecretHandler) GetIntegration(c *gin.Context)

GetIntegration godoc @Summary Get integration details @Description Get details of a specific integration @Tags secrets @Accept json @Produce json @Param provider path string true "Integration provider" @Success 200 {object} dto.SecretResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /secrets/integrations/{provider} [get]

func (*SecretHandler) ListAPIKeys

func (h *SecretHandler) ListAPIKeys(c *gin.Context)

ListAPIKeys godoc @Summary List API keys @Description Get a paginated list of API keys @Tags secrets @Accept json @Produce json @Param limit query int false "Limit" @Param offset query int false "Offset" @Param status query string false "Status (published/archived)" @Success 200 {object} dto.ListSecretsResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /secrets/api/keys [get]

func (*SecretHandler) ListLinkedIntegrations

func (h *SecretHandler) ListLinkedIntegrations(c *gin.Context)

ListLinkedIntegrations godoc @Summary List linked integrations @Description Get a list of unique providers which have a valid linked integration secret @Tags secrets @Accept json @Produce json @Success 200 {object} dto.LinkedIntegrationsResponse @Failure 500 {object} ErrorResponse @Router /secrets/integrations/linked [get]

type SubscriptionHandler

type SubscriptionHandler struct {
	// contains filtered or unexported fields
}

func NewSubscriptionHandler

func NewSubscriptionHandler(service service.SubscriptionService, log *logger.Logger) *SubscriptionHandler

func (*SubscriptionHandler) CancelSubscription

func (h *SubscriptionHandler) CancelSubscription(c *gin.Context)

@Summary Cancel subscription @Description Cancel a subscription @Tags Subscriptions @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Subscription ID" @Param cancel_at_period_end query bool false "Cancel at period end" @Success 200 {object} gin.H @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /subscriptions/{id}/cancel [post]

func (*SubscriptionHandler) CreateSubscription

func (h *SubscriptionHandler) CreateSubscription(c *gin.Context)

@Summary Create subscription @Description Create a new subscription @Tags Subscriptions @Accept json @Produce json @Security ApiKeyAuth @Param subscription body dto.CreateSubscriptionRequest true "Subscription Request" @Success 201 {object} dto.SubscriptionResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /subscriptions [post]

func (*SubscriptionHandler) GetSubscription

func (h *SubscriptionHandler) GetSubscription(c *gin.Context)

@Summary Get subscription @Description Get a subscription by ID @Tags Subscriptions @Produce json @Security ApiKeyAuth @Param id path string true "Subscription ID" @Success 200 {object} dto.SubscriptionResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /subscriptions/{id} [get]

func (*SubscriptionHandler) GetSubscriptions

func (h *SubscriptionHandler) GetSubscriptions(c *gin.Context)

@Summary List subscriptions @Description Get subscriptions with optional filtering @Tags Subscriptions @Produce json @Security ApiKeyAuth @Param filter query types.SubscriptionFilter false "Filter" @Success 200 {object} dto.ListSubscriptionsResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /subscriptions [get]

func (*SubscriptionHandler) GetUsageBySubscription

func (h *SubscriptionHandler) GetUsageBySubscription(c *gin.Context)

@Summary Get usage by subscription @Description Get usage by subscription @Tags Subscriptions @Produce json @Security ApiKeyAuth @Param request body dto.GetUsageBySubscriptionRequest true "Request" @Success 200 {object} dto.GetUsageBySubscriptionResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /subscriptions/usage [post]

type SubscriptionPauseHandler

type SubscriptionPauseHandler struct {
	// contains filtered or unexported fields
}

SubscriptionPauseHandler handles API requests for subscription pauses

func NewSubscriptionPauseHandler

func NewSubscriptionPauseHandler(service service.SubscriptionService, log *logger.Logger) *SubscriptionPauseHandler

NewSubscriptionPauseHandler creates a new subscription pause handler

func (*SubscriptionPauseHandler) ListPauses

func (h *SubscriptionPauseHandler) ListPauses(c *gin.Context)

@Summary List all pauses for a subscription @Description List all pauses for a subscription @Tags Subscriptions @Produce json @Param id path string true "Subscription ID" @Success 200 {array} dto.ListSubscriptionPausesResponse @Failure 400 {object} ierr.ErrorResponse @Failure 404 {object} ierr.ErrorResponse @Failure 500 {object} ierr.ErrorResponse @Router /subscriptions/{id}/pauses [get]

func (*SubscriptionPauseHandler) PauseSubscription

func (h *SubscriptionPauseHandler) PauseSubscription(c *gin.Context)

@Summary Pause a subscription @Description Pause a subscription with the specified parameters @Tags Subscriptions @Accept json @Produce json @Param id path string true "Subscription ID" @Param request body dto.PauseSubscriptionRequest true "Pause subscription request" @Success 200 {object} dto.SubscriptionPauseResponse @Failure 400 {object} ierr.ErrorResponse @Failure 404 {object} ierr.ErrorResponse @Failure 500 {object} ierr.ErrorResponse @Router /subscriptions/{id}/pause [post]

func (*SubscriptionPauseHandler) ResumeSubscription

func (h *SubscriptionPauseHandler) ResumeSubscription(c *gin.Context)

@Summary Resume a paused subscription @Description Resume a paused subscription with the specified parameters @Tags Subscriptions @Accept json @Produce json @Param id path string true "Subscription ID" @Param request body dto.ResumeSubscriptionRequest true "Resume subscription request" @Success 200 {object} dto.SubscriptionPauseResponse @Failure 400 {object} ierr.ErrorResponse @Failure 404 {object} ierr.ErrorResponse @Failure 500 {object} ierr.ErrorResponse @Router /subscriptions/{id}/resume [post]

type TaskHandler

type TaskHandler struct {
	// contains filtered or unexported fields
}

func NewTaskHandler

func NewTaskHandler(taskService service.TaskService, logger *logger.Logger) *TaskHandler

func (*TaskHandler) CreateTask

func (h *TaskHandler) CreateTask(c *gin.Context)

CreateTask godoc @Summary Create a new task @Description Create a new import/export task @Tags Tasks @Accept json @Produce json @Param task body dto.CreateTaskRequest true "Task details" @Success 201 {object} dto.TaskResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /tasks [post]

func (*TaskHandler) GetTask

func (h *TaskHandler) GetTask(c *gin.Context)

GetTask godoc @Summary Get a task by ID @Description Get detailed information about a task @Tags Tasks @Accept json @Produce json @Param id path string true "Task ID" @Success 200 {object} dto.TaskResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /tasks/{id} [get]

func (*TaskHandler) ListTasks

func (h *TaskHandler) ListTasks(c *gin.Context)

ListTasks godoc @Summary List tasks @Description List tasks with optional filtering @Tags Tasks @Accept json @Produce json @Param filter query types.TaskFilter false "Filter" @Success 200 {object} dto.ListTasksResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /tasks [get]

func (*TaskHandler) ProcessTask

func (h *TaskHandler) ProcessTask(c *gin.Context)

ProcessTask godoc @Summary Process a task @Description Start processing a task @Tags Tasks @Accept json @Produce json @Param id path string true "Task ID" @Success 202 {object} gin.H @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /tasks/{id}/process [post]

func (*TaskHandler) UpdateTaskStatus

func (h *TaskHandler) UpdateTaskStatus(c *gin.Context)

UpdateTaskStatus godoc @Summary Update task status @Description Update the status of a task @Tags Tasks @Accept json @Produce json @Param id path string true "Task ID" @Param status body dto.UpdateTaskStatusRequest true "New status" @Success 200 {object} dto.TaskResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /tasks/{id}/status [put]

type TenantHandler

type TenantHandler struct {
	// contains filtered or unexported fields
}

func NewTenantHandler

func NewTenantHandler(service service.TenantService, log *logger.Logger) *TenantHandler

func (*TenantHandler) CreateTenant

func (h *TenantHandler) CreateTenant(c *gin.Context)

@Summary Create a new tenant @Description Create a new tenant @Tags Tenants @Accept json @Produce json @Security ApiKeyAuth @Param request body dto.CreateTenantRequest true "Create tenant request" @Success 201 {object} dto.TenantResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /tenants [post]

func (*TenantHandler) GetTenantByID

func (h *TenantHandler) GetTenantByID(c *gin.Context)

@Summary Get tenant by ID @Description Get tenant by ID @Tags Tenants @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Tenant ID" @Success 200 {object} dto.TenantResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /tenants/{id} [get]

type UserHandler

type UserHandler struct {
	// contains filtered or unexported fields
}

func NewUserHandler

func NewUserHandler(userService service.UserService, logger *logger.Logger) *UserHandler

func (*UserHandler) GetUserInfo

func (h *UserHandler) GetUserInfo(c *gin.Context)

@Summary Get user info @Description Get the current user's information @Tags Users @Accept json @Produce json @Security ApiKeyAuth @Success 200 {object} dto.UserResponse @Failure 401 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/me [get]

type WalletHandler

type WalletHandler struct {
	// contains filtered or unexported fields
}

WalletHandler handles wallet-related HTTP requests

func NewWalletHandler

func NewWalletHandler(walletService service.WalletService, logger *logger.Logger) *WalletHandler

NewWalletHandler creates a new wallet handler

func (*WalletHandler) CreateWallet

func (h *WalletHandler) CreateWallet(c *gin.Context)

CreateWallet godoc @Summary Create a new wallet @Description Create a new wallet for a customer @Tags Wallets @Accept json @Produce json @Security ApiKeyAuth @Param request body dto.CreateWalletRequest true "Create wallet request" @Success 200 {object} dto.WalletResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /wallets [post]

func (*WalletHandler) GetWalletBalance

func (h *WalletHandler) GetWalletBalance(c *gin.Context)

GetWalletBalance godoc @Summary Get wallet balance @Description Get real-time balance of a wallet @Tags Wallets @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Wallet ID" @Success 200 {object} dto.WalletBalanceResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /wallets/{id}/balance/real-time [get]

func (*WalletHandler) GetWalletByID

func (h *WalletHandler) GetWalletByID(c *gin.Context)

GetWalletByID godoc @Summary Get wallet by ID @Description Get a wallet by its ID @Tags Wallets @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Wallet ID" @Success 200 {object} dto.WalletResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /wallets/{id} [get]

func (*WalletHandler) GetWalletTransactions

func (h *WalletHandler) GetWalletTransactions(c *gin.Context)

GetWalletTransactions godoc @Summary Get wallet transactions @Description Get transactions for a wallet with pagination @Tags Wallets @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Wallet ID" @Param filter query types.WalletTransactionFilter false "Filter" @Success 200 {object} dto.ListWalletTransactionsResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /wallets/{id}/transactions [get]

func (*WalletHandler) GetWalletsByCustomerID

func (h *WalletHandler) GetWalletsByCustomerID(c *gin.Context)

GetWalletsByCustomerID godoc @Summary Get wallets by customer ID @Description Get all wallets for a customer @Tags Wallets @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Customer ID" @Success 200 {array} dto.WalletResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /customers/{id}/wallets [get]

func (*WalletHandler) TerminateWallet

func (h *WalletHandler) TerminateWallet(c *gin.Context)

TerminateWallet godoc @Summary Terminate a wallet @Description Terminates a wallet by closing it and debiting remaining balance @Tags Wallets @Accept json @Produce json @Param id path string true "Wallet ID" @Success 200 {object} dto.WalletResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /wallets/{id}/terminate [post]

func (*WalletHandler) TopUpWallet

func (h *WalletHandler) TopUpWallet(c *gin.Context)

TopUpWallet godoc @Summary Top up wallet @Description Add credits to a wallet @Tags Wallets @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "Wallet ID" @Param request body dto.TopUpWalletRequest true "Top up request" @Success 200 {object} dto.WalletResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /wallets/{id}/top-up [post]

func (*WalletHandler) UpdateWallet

func (h *WalletHandler) UpdateWallet(c *gin.Context)

UpdateWallet godoc @Summary Update a wallet @Description Update a wallet's details including auto top-up configuration @Tags Wallets @Accept json @Produce json @Param id path string true "Wallet ID" @Param request body dto.UpdateWalletRequest true "Update wallet request" @Success 200 {object} dto.WalletResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /wallets/{id} [put]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL