Mobilfunk: Feld "Mobilfunknetz" unter Anbieter & Tarif
Neues Dropdown "Mobilfunknetz" in der Anbieter-&-Tarif-Karte, nur sichtbar bei Vertragstyp Mobilfunk. Optionen: Bitte auswählen (leer), Telekom, Vodafone, Telefónica. Neues Feld MobileContractDetails.mobileNetwork (String nullable, speichert TELEKOM/VODAFONE/TELEFONICA) + idempotente Migration (ADD COLUMN IF NOT EXISTS). String statt Enum, damit weitere Netze ohne Migration ergänzbar sind. Anzeige in der Vertragsansicht mit lesbarem Netz-Namen. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -3077,6 +3077,12 @@ export default function ContractDetail() {
|
||||
{c.mobileDetails && (
|
||||
<Card className="mb-6" title="Mobilfunk-Details">
|
||||
<dl className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
{c.mobileDetails.mobileNetwork && (
|
||||
<div>
|
||||
<dt className="text-sm text-gray-500">Mobilfunknetz</dt>
|
||||
<dd>{({ TELEKOM: 'Telekom', VODAFONE: 'Vodafone', TELEFONICA: 'Telefónica' } as Record<string, string>)[c.mobileDetails.mobileNetwork] || c.mobileDetails.mobileNetwork}</dd>
|
||||
</div>
|
||||
)}
|
||||
{c.mobileDetails.dataVolume && (
|
||||
<div>
|
||||
<dt className="text-sm text-gray-500">Datenvolumen</dt>
|
||||
|
||||
@@ -345,6 +345,7 @@ export default function ContractForm() {
|
||||
activationCode: c.internetDetails?.activationCode || '',
|
||||
// Mobile details
|
||||
requiresMultisim: c.mobileDetails?.requiresMultisim || false,
|
||||
mobileNetwork: c.mobileDetails?.mobileNetwork || '',
|
||||
dataVolume: c.mobileDetails?.dataVolume || '',
|
||||
includedMinutes: c.mobileDetails?.includedMinutes || '',
|
||||
includedSMS: c.mobileDetails?.includedSMS || '',
|
||||
@@ -656,6 +657,7 @@ export default function ContractForm() {
|
||||
if (data.type === 'MOBILE') {
|
||||
contractData.mobileDetails = {
|
||||
requiresMultisim: data.requiresMultisim || false,
|
||||
mobileNetwork: emptyToNull(data.mobileNetwork),
|
||||
dataVolume: data.dataVolume ? parseFloat(data.dataVolume) : null,
|
||||
includedMinutes: safeParseInt(data.includedMinutes) ?? null,
|
||||
includedSMS: safeParseInt(data.includedSMS) ?? null,
|
||||
@@ -1019,6 +1021,18 @@ export default function ContractForm() {
|
||||
options={availableTariffs.map((t) => ({ value: t.id, label: t.name }))}
|
||||
disabled={!selectedProviderId}
|
||||
/>
|
||||
{contractType === 'MOBILE' && (
|
||||
<Select
|
||||
label="Mobilfunknetz"
|
||||
{...register('mobileNetwork')}
|
||||
options={[
|
||||
{ value: 'TELEKOM', label: 'Telekom' },
|
||||
{ value: 'VODAFONE', label: 'Vodafone' },
|
||||
{ value: 'TELEFONICA', label: 'Telefónica' },
|
||||
]}
|
||||
placeholder="Bitte auswählen"
|
||||
/>
|
||||
)}
|
||||
<Input label="Kundennummer beim Anbieter" maxLength={100} {...register('customerNumberAtProvider')} />
|
||||
<Input label="Vertragsnummer beim Anbieter" maxLength={100} {...register('contractNumberAtProvider')} />
|
||||
<Input label="Auftragsnummer bei Vertriebsplattform" maxLength={100} {...register('orderNumberAtSalesPlatform')} />
|
||||
|
||||
@@ -588,6 +588,8 @@ export interface MobileContractDetails {
|
||||
id: number;
|
||||
contractId: number;
|
||||
requiresMultisim?: boolean;
|
||||
/** Physisches Mobilfunknetz: TELEKOM | VODAFONE | TELEFONICA (oder null). */
|
||||
mobileNetwork?: string | null;
|
||||
dataVolume?: number;
|
||||
includedMinutes?: number;
|
||||
includedSMS?: number;
|
||||
|
||||
Reference in New Issue
Block a user