A
90490e649c
Add a subscribers.status column ('available'|'claimed') with migration for
legacy DBs, plus add_available_subscriber, count_available, and claim_available
(atomic BEGIN IMMEDIATE select+update so concurrent claims can't double-hand-out
a profile). On-demand add_subscriber stays 'claimed'. Tests: +7; 115 pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
17 lines
353 B
Python
17 lines
353 B
Python
from dataclasses import dataclass
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
|
|
@dataclass
|
|
class Subscriber:
|
|
id: Optional[int]
|
|
imsi: str
|
|
iccid: str
|
|
ki: str # hex string
|
|
opc: str # hex string
|
|
mac_address: Optional[str]
|
|
created_at: datetime
|
|
synced_to_core: bool
|
|
status: str = "claimed"
|