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:
@@ -0,0 +1,6 @@
|
|||||||
|
-- Mobilfunknetz pro Mobilfunkvertrag (TELEKOM | VODAFONE | TELEFONICA,
|
||||||
|
-- NULL = nicht gewählt). String statt Enum, damit weitere Netze ohne
|
||||||
|
-- Migration ergänzbar sind.
|
||||||
|
|
||||||
|
ALTER TABLE `MobileContractDetails`
|
||||||
|
ADD COLUMN IF NOT EXISTS `mobileNetwork` VARCHAR(191) NULL;
|
||||||
@@ -970,6 +970,10 @@ model MobileContractDetails {
|
|||||||
contractId Int @unique
|
contractId Int @unique
|
||||||
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
|
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
|
||||||
requiresMultisim Boolean @default(false) // Multisim erforderlich?
|
requiresMultisim Boolean @default(false) // Multisim erforderlich?
|
||||||
|
// Physisches Mobilfunknetz, auf dem der Tarif läuft: TELEKOM | VODAFONE
|
||||||
|
// | TELEFONICA (null = nicht gewählt). Als String statt Enum gehalten,
|
||||||
|
// damit weitere Netze ohne Migration ergänzbar sind.
|
||||||
|
mobileNetwork String?
|
||||||
dataVolume Float?
|
dataVolume Float?
|
||||||
includedMinutes Int?
|
includedMinutes Int?
|
||||||
includedSMS Int?
|
includedSMS Int?
|
||||||
|
|||||||
@@ -279,6 +279,7 @@ interface ContractCreateData {
|
|||||||
};
|
};
|
||||||
mobileDetails?: {
|
mobileDetails?: {
|
||||||
requiresMultisim?: boolean;
|
requiresMultisim?: boolean;
|
||||||
|
mobileNetwork?: string | null;
|
||||||
dataVolume?: number;
|
dataVolume?: number;
|
||||||
includedMinutes?: number;
|
includedMinutes?: number;
|
||||||
includedSMS?: number;
|
includedSMS?: number;
|
||||||
@@ -386,6 +387,7 @@ export async function createContract(data: ContractCreateData) {
|
|||||||
mobileDetails: {
|
mobileDetails: {
|
||||||
create: {
|
create: {
|
||||||
requiresMultisim: mobileDetails.requiresMultisim,
|
requiresMultisim: mobileDetails.requiresMultisim,
|
||||||
|
mobileNetwork: mobileDetails.mobileNetwork ?? null,
|
||||||
dataVolume: mobileDetails.dataVolume,
|
dataVolume: mobileDetails.dataVolume,
|
||||||
includedMinutes: mobileDetails.includedMinutes,
|
includedMinutes: mobileDetails.includedMinutes,
|
||||||
includedSMS: mobileDetails.includedSMS,
|
includedSMS: mobileDetails.includedSMS,
|
||||||
|
|||||||
@@ -97,6 +97,17 @@ isolierte Instanz (keine Multi-Tenancy im Code), Provisioning + Abrechnung
|
|||||||
|
|
||||||
## ✅ Erledigt
|
## ✅ Erledigt
|
||||||
|
|
||||||
|
- [x] **📱 Mobilfunk: Feld „Mobilfunknetz" unter Anbieter & Tarif**
|
||||||
|
- Neues Dropdown „Mobilfunknetz" in der Anbieter-&-Tarif-Karte, nur
|
||||||
|
sichtbar wenn Vertragstyp = Mobilfunk. Optionen: Bitte auswählen
|
||||||
|
(leer), Telekom, Vodafone, Telefónica.
|
||||||
|
- Neues Feld `MobileContractDetails.mobileNetwork` (String, nullable,
|
||||||
|
speichert TELEKOM/VODAFONE/TELEFONICA) + Migration
|
||||||
|
`20260727100000_mobile_network` (`ADD COLUMN IF NOT EXISTS`).
|
||||||
|
String statt Enum, damit weitere Netze ohne Migration möglich sind.
|
||||||
|
- Anzeige in der Vertragsansicht (Mobilfunk-Details) mit lesbarem
|
||||||
|
Netz-Namen.
|
||||||
|
|
||||||
- [x] **🐞 Lieferbestätigung: eingegebenes Datum ändert Vertragsbeginn nicht**
|
- [x] **🐞 Lieferbestätigung: eingegebenes Datum ändert Vertragsbeginn nicht**
|
||||||
- Beim Upload einer Lieferbestätigung mit Datum wurde `startDate` nur
|
- Beim Upload einer Lieferbestätigung mit Datum wurde `startDate` nur
|
||||||
gesetzt, wenn es noch LEER war (`if (!contract.startDate)`). Hatte
|
gesetzt, wenn es noch LEER war (`if (!contract.startDate)`). Hatte
|
||||||
|
|||||||
@@ -3077,6 +3077,12 @@ export default function ContractDetail() {
|
|||||||
{c.mobileDetails && (
|
{c.mobileDetails && (
|
||||||
<Card className="mb-6" title="Mobilfunk-Details">
|
<Card className="mb-6" title="Mobilfunk-Details">
|
||||||
<dl className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
<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 && (
|
{c.mobileDetails.dataVolume && (
|
||||||
<div>
|
<div>
|
||||||
<dt className="text-sm text-gray-500">Datenvolumen</dt>
|
<dt className="text-sm text-gray-500">Datenvolumen</dt>
|
||||||
|
|||||||
@@ -345,6 +345,7 @@ export default function ContractForm() {
|
|||||||
activationCode: c.internetDetails?.activationCode || '',
|
activationCode: c.internetDetails?.activationCode || '',
|
||||||
// Mobile details
|
// Mobile details
|
||||||
requiresMultisim: c.mobileDetails?.requiresMultisim || false,
|
requiresMultisim: c.mobileDetails?.requiresMultisim || false,
|
||||||
|
mobileNetwork: c.mobileDetails?.mobileNetwork || '',
|
||||||
dataVolume: c.mobileDetails?.dataVolume || '',
|
dataVolume: c.mobileDetails?.dataVolume || '',
|
||||||
includedMinutes: c.mobileDetails?.includedMinutes || '',
|
includedMinutes: c.mobileDetails?.includedMinutes || '',
|
||||||
includedSMS: c.mobileDetails?.includedSMS || '',
|
includedSMS: c.mobileDetails?.includedSMS || '',
|
||||||
@@ -656,6 +657,7 @@ export default function ContractForm() {
|
|||||||
if (data.type === 'MOBILE') {
|
if (data.type === 'MOBILE') {
|
||||||
contractData.mobileDetails = {
|
contractData.mobileDetails = {
|
||||||
requiresMultisim: data.requiresMultisim || false,
|
requiresMultisim: data.requiresMultisim || false,
|
||||||
|
mobileNetwork: emptyToNull(data.mobileNetwork),
|
||||||
dataVolume: data.dataVolume ? parseFloat(data.dataVolume) : null,
|
dataVolume: data.dataVolume ? parseFloat(data.dataVolume) : null,
|
||||||
includedMinutes: safeParseInt(data.includedMinutes) ?? null,
|
includedMinutes: safeParseInt(data.includedMinutes) ?? null,
|
||||||
includedSMS: safeParseInt(data.includedSMS) ?? null,
|
includedSMS: safeParseInt(data.includedSMS) ?? null,
|
||||||
@@ -1019,6 +1021,18 @@ export default function ContractForm() {
|
|||||||
options={availableTariffs.map((t) => ({ value: t.id, label: t.name }))}
|
options={availableTariffs.map((t) => ({ value: t.id, label: t.name }))}
|
||||||
disabled={!selectedProviderId}
|
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="Kundennummer beim Anbieter" maxLength={100} {...register('customerNumberAtProvider')} />
|
||||||
<Input label="Vertragsnummer beim Anbieter" maxLength={100} {...register('contractNumberAtProvider')} />
|
<Input label="Vertragsnummer beim Anbieter" maxLength={100} {...register('contractNumberAtProvider')} />
|
||||||
<Input label="Auftragsnummer bei Vertriebsplattform" maxLength={100} {...register('orderNumberAtSalesPlatform')} />
|
<Input label="Auftragsnummer bei Vertriebsplattform" maxLength={100} {...register('orderNumberAtSalesPlatform')} />
|
||||||
|
|||||||
@@ -588,6 +588,8 @@ export interface MobileContractDetails {
|
|||||||
id: number;
|
id: number;
|
||||||
contractId: number;
|
contractId: number;
|
||||||
requiresMultisim?: boolean;
|
requiresMultisim?: boolean;
|
||||||
|
/** Physisches Mobilfunknetz: TELEKOM | VODAFONE | TELEFONICA (oder null). */
|
||||||
|
mobileNetwork?: string | null;
|
||||||
dataVolume?: number;
|
dataVolume?: number;
|
||||||
includedMinutes?: number;
|
includedMinutes?: number;
|
||||||
includedSMS?: number;
|
includedSMS?: number;
|
||||||
|
|||||||
Reference in New Issue
Block a user