Filippo Bertilotti
5 days ago 06f7b6188fe152cd561e60ff1abf2bac56773347
creazione seeder + ampliamento colonne tabelle
1 files added
4 files modified
149 ■■■■■ changed files
database/migrations/2023_05_02_170505_create_fakesso_products.php 38 ●●●● patch | view | raw | blame | history
database/migrations/2023_05_02_170506_create_fakesso_vodafoneusers.php 1 ●●●● patch | view | raw | blame | history
database/migrations/2023_05_02_170537_create_fakesso_msisdn.php 3 ●●●● patch | view | raw | blame | history
database/seeders/ProductsSeeder.php 1 ●●●● patch | view | raw | blame | history
database/seeders/VodafoneUserSeeder.php 106 ●●●●● patch | view | raw | blame | history
database/migrations/2023_05_02_170505_create_fakesso_products.php
@@ -10,16 +10,38 @@
        Schema::create('fakesso_products', function (Blueprint $table) {
            $table->increments('id')->comment('Identificatore univoco profilo');
            $table->string('productId', 255)->comment('identificatore del prodotto');
            //$table->integer('LinkedMSISDN')->unsigned()->comment('MSISDN di appartenenza');
            //$table->foreign('LinkedMSISDN')->references('id')->on('fakesso_msisdn');
            $table->string('tmProduct', 255)->nullable();
            $table->string('tmCode', 255)->nullable();
            $table->boolean('isService')->nullable();
            $table->string('activationDate', 255)->nullable();
            $table->string('changeStateDate', 255)->nullable();
            $table->string('inheritanceRule', 255)->nullable();
            $table->string('buyCost', 255)->nullable();
            $table->string('frequency', 255)->nullable();
            $table->string('infoRecurringFees', 255)->nullable();
            $table->string('invertStatus', 255)->nullable();
            $table->integer('maxNumOfTry')->nullable();
            $table->string('monopoliFlag', 255)->nullable();
            $table->string('longDescription', 255)->nullable();
            $table->string('longName', 255)->nullable();
            $table->integer('productPosition')->nullable();
            $table->integer('numberOfUsedTry')->nullable();
            $table->integer('numberOfTryAvailable')->nullable();
            $table->string('OMProductId', 255)->nullable();
            $table->string('OMSource', 255)->nullable();
            $table->string('Name', 255)->nullable();
            $table->string('Description', 255)->nullable();
            $table->string('activationDateTime', 255)->nullable();
            $table->string('productType', 255)->nullable();
            $table->string('shortDescription', 255)->nullable();
            $table->string('shortName', 255)->nullable();
            $table->string('productStateOnSim', 255)->nullable();
            $table->string('spyderId', 255)->nullable();
            $table->string('flagCommitment', 255)->nullable();
            $table->string('mm4MPromoId', 255)->nullable();
            $table->string('idJoin', 255)->nullable();
            $table->string('lastPaidFlag', 255)->nullable();
            $table->string('offerType', 255)->nullable();
            $table->string('lastChargeZeroReason', 255)->nullable();
            //tmProduct
            $table->string('tmCode', 255)->nullable();
            $table->string('tmDescription', 255)->nullable();
            $table->string('tmActivationDate', 255)->nullable();
            $table->string('____hashCodeCalc', 255)->nullable();
            $table->timestamps();
        });
    }
database/migrations/2023_05_02_170506_create_fakesso_vodafoneusers.php
@@ -24,6 +24,7 @@
            $table->string('ID_CSA', 255)->nullable();
            $table->string('Sex', 255)->nullable();
            $table->string('BirthProvinceName', 255)->nullable();
            $table->string('Birthdate', 255)->nullable();
            $table->string('BirthPlace', 255)->nullable();
            $table->string('HomeProvinceName', 255)->nullable();
            $table->string('MicroBusiness', 255)->nullable();
database/migrations/2023_05_02_170537_create_fakesso_msisdn.php
@@ -16,7 +16,8 @@
            $table->string('IdPiano', 255)->nullable();
            $table->string('VodafoneOne', 255)->nullable();
            $table->string('TopClub', 255)->nullable();
            $table->string('SenioriryCluster', 255)->nullable();
            $table->string('SeniorityCluster', 255)->nullable();
            $table->string('SimSeniorityDate', 255)->nullable();
            $table->timestamps();
        });
    }
database/seeders/ProductsSeeder.php
@@ -2,7 +2,6 @@
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
database/seeders/VodafoneUserSeeder.php
New file
@@ -0,0 +1,106 @@
<?php
namespace Database\Seeders;
use App\Models\Msisdn;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class VodafoneUserSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $currentDate = date("Y-m-d H:i:s");
        $userID = DB::table('fakesso_vodafoneusers')->insertGetId([
            'EmailAddress' => 'davide.cucurnia@vola.it',
            'Sex' => '',
            'Surname' => 'Sandrelli',
            'BirthProvinceName' => 'LUCCA',
            'BirthPlace' => 'VIAREGGIO',
            'Type_ID' => '2',
            'Birthdate' => 'Fri Apr 16 00:00:00 MET 1971',
            'HomeProvinceName' => 'LUCCA',
            'Custcode' => '5.49275',
            'ProfileIdentifier' => 'BUSINESS_EMPLOYEE',
            'MicroBusiness' => 'false',
            'HomePhone' => '',
            'Address' => 'VIA BERNARDINO',
            'FiscalCode' => 'MNCCST71D16L833U',
            'Name' => 'Paola',
            'Username' => 'FAKE_SSO_1',
            'created_at' => $currentDate,
            'updated_at' => $currentDate
        ]);
        $msisdnID = DB::table('fakesso_msisdn')->insertGetId([
            'CardType' => 'Ric',
            'SimSeniorityDate' => '03/08/2016',
            'MSISDN' => '3464232371',
            'TopClub' => 'false',
            'IdPiano' => '2491',
            'SeniorityCluster' => '',
            'LinkedUser' => $userID,
            'created_at' => $currentDate,
            'updated_at' => $currentDate
        ]);
        $productID_1 = DB::table('fakesso_products')->insertGetId([
            'productId' => '2583',
            'activationDate' => '1702249200000',
            'changeStateDate' => '1702249200000',
            'inheritanceRule' => '',
            'buyCost' => '0.0',
            'frequency' => '',
            'infoRecurringFees' => 'N',
            'invertStatus' => 'N',
            'maxNumOfTry' => 0,
            'monopoliFlag' => 'N',
            'longDescription' => 'Abilita la SIM alla distinzione del traffico personale da quello aziendale',
            'longName' => 'Autorizzazione Dual',
            'productPosition' => 1,
            'numberOfUsedTry' => 0,
            'numberOfTryAvailable' => 0,
            'OMProductId' => '2156',
            'OMSource' => 'CCBS',
            'productType' => 'Service',
            'shortDescription' => 'Abilita la SIM alla distinzione del traffico personale da quello aziendale',
            'shortName' => 'Autorizzazione Dual',
            'productStateOnSim' => 'ACTIVE',
            'spyderId' => '',
            'flagCommitment' => '',
            'mm4MPromoId' => '',
            'idJoin' => '',
            'lastPaidFlag' => '',
            'offerType' => '',
            'lastChargeZeroReason' => '',
            'created_at' => $currentDate,
            'updated_at' => $currentDate
        ]);
        $msisdn = Msisdn::find($msisdnID);
        $msisdn->products()->attach($productID_1);
        // scrivo l'utente
        // scrivo le sim associate all'utente
        // PRESUMENDO CHE I PRODOTTI MENZIONATI ESISTANO GIA cerco i prodotti che dovrei associare alla sim
        // scrivo relazioni prodotti - sim
        // scrivo l'utente
        // scrivo le sim associate all'utente
        // PRESUMENDO CHE I PRODOTTI MENZIONATI ESISTANO GIA cerco i prodotti che dovrei associare alla sim
        // scrivo relazioni prodotti - sim
    }
}