Files
telecom-platform/apps/carrier-connector/internal/repository/profile.go
T
nutcas3 d27eb871e3 feat: Add DatabaseConfig to carrier-connector config and remove InMemoryProfileStore implementation for Postgres migration
- Add DatabaseConfig struct with DSN field for Postgres connection string
- Add package documentation comments for ES2Config/DatabaseConfig/LoadES2Config
- Normalize ES2Config field alignment for BaseURL/APIKey/InsecureSkipVerify/FunctionalityRequesterID
- Remove InMemoryProfileStore struct and all methods (Create/Get/List/UpdateState/Delete) from profile.go
- Remove sync package import
2026-04-24 08:59:44 +03:00

43 lines
1.2 KiB
Go

package repository
import (
"context"
"errors"
"time"
)
// ErrNotFound is returned when a profile lookup misses.
var ErrNotFound = errors.New("profile not found")
// Profile is the stored representation of an eSIM profile.
type Profile struct {
ICCID string `json:"iccid"`
EID string `json:"eid,omitempty"`
IMSI string `json:"imsi"`
MCC string `json:"mcc"`
MNC string `json:"mnc"`
ProfileType string `json:"profileType"`
State string `json:"state"`
TenantID string `json:"tenantId,omitempty"`
ActivationCode string `json:"activationCode,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
// ListFilter narrows the List query.
type ListFilter struct {
TenantID string
State string
Limit int
Offset int
}
// ProfileRepository is the storage contract for eSIM profiles.
type ProfileRepository interface {
Create(ctx context.Context, p *Profile) error
Get(ctx context.Context, iccid string) (*Profile, error)
List(ctx context.Context, f ListFilter) ([]*Profile, int, error)
UpdateState(ctx context.Context, iccid, state string) (*Profile, error)
Delete(ctx context.Context, iccid string) error
}