mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-03 02:12:20 +00:00
- 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
43 lines
1.2 KiB
Go
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
|
|
}
|