Update Doctor Resource
This commit is contained in:
@@ -80,6 +80,8 @@ class DoctorController extends Controller
|
||||
'practitionerRoles.metas',
|
||||
'practitionerRoles.speciality',
|
||||
'practitionerRoles.organization',
|
||||
'practitionerRoles.practices',
|
||||
'practitionerRoles.availabilities',
|
||||
'person',
|
||||
'metas',
|
||||
])
|
||||
|
||||
@@ -29,10 +29,10 @@ Route::prefix('linksehat')->group(function () {
|
||||
Route::get('hospitals', [HospitalController::class, 'index']);
|
||||
Route::get('hospitals/{id}', [HospitalController::class, 'show']);
|
||||
|
||||
Route::get('doctors/online', [DoctorController::class, 'index']);
|
||||
Route::get('doctors', [DoctorController::class, 'index']);
|
||||
Route::get('doctors/{id}', [DoctorController::class, 'show']);
|
||||
Route::get('doctors/{id}/schedule', [DoctorController::class, 'schedule']);
|
||||
Route::get('doctors/online', [DoctorController::class, 'index'])->name('doctors.online');
|
||||
Route::get('doctors', [DoctorController::class, 'index'])->name('doctors.index');
|
||||
Route::get('doctors/{id}', [DoctorController::class, 'show'])->name('doctors.show');
|
||||
Route::get('doctors/{id}/schedule', [DoctorController::class, 'schedule'])->name('doctors.schedule');
|
||||
|
||||
// Route::middleware('auth:api')->get('/linksehat', function (Request $request) {
|
||||
// return $request->user();
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Modules\Linksehat\Transformers;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class DoctorResource extends JsonResource
|
||||
{
|
||||
@@ -21,7 +22,12 @@ class DoctorResource extends JsonResource
|
||||
'hospital_id' => $practitionerRole->organization_id,
|
||||
'speciality_id' => $practitionerRole->speciality_id,
|
||||
'hospital' => HospitalResource::make($practitionerRole->organization),
|
||||
'speciality' => SpecialityResource::make($practitionerRole->speciality)
|
||||
'speciality' => SpecialityResource::make($practitionerRole->speciality),
|
||||
|
||||
'is_chat_available' => $practitionerRole->is_chat_available,
|
||||
'is_video_available' => $practitionerRole->is_video_available,
|
||||
'is_walkin_available' => $practitionerRole->is_walkin_available,
|
||||
'is_instant_chat_available' => $practitionerRole->is_instant_chat_available,
|
||||
];
|
||||
});
|
||||
|
||||
@@ -32,12 +38,12 @@ class DoctorResource extends JsonResource
|
||||
'name' => $this->person->name ?? null,
|
||||
'name_suffix' => $this->person->name_suffix ?? null,
|
||||
'gender' => $this->person->gender ?? null,
|
||||
// 'speciality_name' => !empty($this->speciality->name ?? null) ? 'Spesialis '. $this->speciality->name : 'Spesialis Empty',
|
||||
'is_online' => false,
|
||||
'is_insurance_covered' => rand(0,1) == 1,
|
||||
// 'price_range' => 'Rp 100.000 - Rp 350.000',
|
||||
// 'price_start' => '100000',
|
||||
// 'price_end' => '350000',
|
||||
'price_range' => 'Rp 100.000 - Rp 350.000',
|
||||
'price_start' => '100000',
|
||||
'price_end' => '350000',
|
||||
'currency' => 'IDR',
|
||||
'avatar_url' => asset('images/default-doctor-avatar.png'),
|
||||
'education' => $this->meta->education ?? '',
|
||||
'medical_treatment' => $this->meta->medical_treatment ?? '',
|
||||
@@ -45,7 +51,8 @@ class DoctorResource extends JsonResource
|
||||
'work_experience' => $this->meta->work_experience ?? '',
|
||||
'keilmuan' => $this->meta->keilmuan ?? '',
|
||||
'description' => $this->meta->description ?? '',
|
||||
'practices' => $practices
|
||||
'practices' => $practices,
|
||||
'rating' => rand(350, 500) / 10,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,9 @@ class HospitalResource extends JsonResource
|
||||
'address' => $this->currentAddress->text ?? null,
|
||||
'lat' => $this->currentAddress->lat ?? null,
|
||||
'lng' => $this->currentAddress->lng ?? null,
|
||||
'distance' => isset($this->distance_km) ? round($this->distance_km) . ' km' : '-',
|
||||
'city_name' => 'Kota Tangerang',
|
||||
'distance' => isset($this->distance_km) ? round($this->distance_km) . ' km' : null,
|
||||
'city_name' => $this->currentAddress->city->name ?? null,
|
||||
'rating' => rand(350, 500) / 10,
|
||||
'phone' => $this->meta->phone,
|
||||
'photo_url' => asset('images/default-hospital-image.png'),
|
||||
'photos' => [
|
||||
|
||||
@@ -27,6 +27,7 @@ class PractitionerRoleToDoctorDetailResource extends JsonResource
|
||||
'price_range' => 'Rp 100.000 - Rp 350.000',
|
||||
'price_start' => '100000',
|
||||
'price_end' => '350000',
|
||||
'currency' => 'IDR',
|
||||
'avatar_url' => asset('images/default-doctor-avatar.png'),
|
||||
'education' => $this->meta->education ?? '',
|
||||
'medical_treatment' => $this->meta->medical_treatment ?? '',
|
||||
@@ -34,6 +35,12 @@ class PractitionerRoleToDoctorDetailResource extends JsonResource
|
||||
'work_experience' => $this->meta->work_experience ?? '',
|
||||
'keilmuan' => $this->meta->keilmuan ?? '',
|
||||
'description' => $this->meta->description ?? '',
|
||||
'rating' => rand(350, 500) / 10,
|
||||
|
||||
'is_chat_available' => $this->is_chat_available,
|
||||
'is_video_available' => $this->is_video_available,
|
||||
'is_walkin_available' => $this->is_walkin_available,
|
||||
'is_instant_chat_available' => $this->is_instant_chat_available,
|
||||
];
|
||||
|
||||
return parent::toArray($request);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Modules\Linksehat\Transformers;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Route;
|
||||
|
||||
class PractitionerRoleToDoctorResource extends JsonResource
|
||||
{
|
||||
@@ -41,14 +42,21 @@ class PractitionerRoleToDoctorResource extends JsonResource
|
||||
'name_suffix' => $this->practitioner->person->name_suffix,
|
||||
'gender' => $this->practitioner->person->gender,
|
||||
// 'speciality_name' => !empty($this->speciality->name ?? null) ? 'Spesialis '. $this->speciality->name : 'Spesialis Empty',
|
||||
'is_online' => false,
|
||||
'is_insurance_covered' => rand(0,1) == 1,
|
||||
'is_online' => Route::getCurrentRoute()->action['as'] == 'doctors.online',
|
||||
'is_insurance_covered' => (rand(0,1) == 1),
|
||||
'price_range' => 'Rp 100.000 - Rp 350.000',
|
||||
'price_start' => '100000',
|
||||
'price_end' => '350000',
|
||||
'currency' => 'IDR',
|
||||
'avatar_url' => asset('images/default-doctor-avatar.png'),
|
||||
'hospital' => $organization,
|
||||
'speciality' => $speciality,
|
||||
'rating' => rand(350, 500) / 10,
|
||||
|
||||
'is_chat_available' => $this->is_chat_available,
|
||||
'is_video_available' => $this->is_video_available,
|
||||
'is_walkin_available' => $this->is_walkin_available,
|
||||
'is_instant_chat_available' => $this->is_instant_chat_available,
|
||||
];
|
||||
return parent::toArray($request);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,10 @@ class SpecialityResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return parent::toArray($request);
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'code' => $this->code,
|
||||
'name' => $this->name,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +32,24 @@ class Address extends Model
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
public function province()
|
||||
{
|
||||
return $this->belongsTo(Province::class, 'province_id');
|
||||
}
|
||||
|
||||
public function city()
|
||||
{
|
||||
return $this->belongsTo(City::class, 'city_id');
|
||||
}
|
||||
|
||||
public function district()
|
||||
{
|
||||
return $this->belongsTo(District::class, 'district_id');
|
||||
}
|
||||
|
||||
public function village()
|
||||
{
|
||||
return $this->belongsTo(Village::class, 'village_id');
|
||||
}
|
||||
}
|
||||
|
||||
27
app/Models/City.php
Normal file
27
app/Models/City.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class City extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'province_id',
|
||||
'name'
|
||||
];
|
||||
|
||||
public function district()
|
||||
{
|
||||
return $this->hasMany(District::class, 'city_id');
|
||||
}
|
||||
|
||||
public function province()
|
||||
{
|
||||
return $this->belongsTo(Province::class, 'province_id');
|
||||
}
|
||||
}
|
||||
27
app/Models/District.php
Normal file
27
app/Models/District.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class District extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'city_id',
|
||||
'name'
|
||||
];
|
||||
|
||||
public function city()
|
||||
{
|
||||
return $this->belongsTo(City::class, 'city_id');
|
||||
}
|
||||
|
||||
public function villages()
|
||||
{
|
||||
return $this->hasMany(Village::class, 'district_id');
|
||||
}
|
||||
}
|
||||
25
app/Models/Practice.php
Normal file
25
app/Models/Practice.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Practice extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'practitioner_role_id',
|
||||
'service_code',
|
||||
'active',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by'
|
||||
];
|
||||
|
||||
public function prices()
|
||||
{
|
||||
return $this->morphMany(Price::class, 'priceable');
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,26 @@ class PractitionerRole extends Model
|
||||
'period_end',
|
||||
'active',
|
||||
];
|
||||
|
||||
public function getIsChatAvailableAttribute()
|
||||
{
|
||||
return $this->practices->where('service_code', 'chat')->where('active', 1)->count() >= 1;
|
||||
}
|
||||
|
||||
public function getIsWalkinAvailableAttribute()
|
||||
{
|
||||
return $this->practices->where('service_code', 'walkin')->where('active', 1)->count() >= 1;
|
||||
}
|
||||
|
||||
public function getIsVideoAvailableAttribute()
|
||||
{
|
||||
return $this->practices->where('service_code', 'video')->where('active', 1)->count() >= 1;
|
||||
}
|
||||
|
||||
public function getIsInstantChatAvailableAttribute()
|
||||
{
|
||||
return $this->practices->where('service_code', 'instant-chat')->where('active', 1)->count() >= 1;
|
||||
}
|
||||
|
||||
public function metas()
|
||||
{
|
||||
@@ -38,4 +58,14 @@ class PractitionerRole extends Model
|
||||
{
|
||||
return $this->belongsTo(Speciality::class, 'speciality_id');
|
||||
}
|
||||
|
||||
public function practices()
|
||||
{
|
||||
return $this->hasMany(Practice::class, 'practitioner_role_id');
|
||||
}
|
||||
|
||||
public function availabilities()
|
||||
{
|
||||
return $this->hasMany(PractitionerRoleAvailability::class, 'practitioner_role_id');
|
||||
}
|
||||
}
|
||||
|
||||
28
app/Models/PractitionerRoleAvailability.php
Normal file
28
app/Models/PractitionerRoleAvailability.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PractitionerRoleAvailability extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'practitioner_role_id',
|
||||
'all_day',
|
||||
'start_time',
|
||||
'end_time',
|
||||
];
|
||||
|
||||
public function days()
|
||||
{
|
||||
return $this->hasMany('days');
|
||||
}
|
||||
|
||||
public function practitionerRole()
|
||||
{
|
||||
return $this->belongsTo(PractitionerRole::class, 'practitioner_role_id');
|
||||
}
|
||||
}
|
||||
21
app/Models/PractitionerRoleAvailabilityDay.php
Normal file
21
app/Models/PractitionerRoleAvailabilityDay.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PractitionerRoleAvailabilityDay extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'availability_id',
|
||||
'day',
|
||||
];
|
||||
|
||||
public function availability()
|
||||
{
|
||||
return $this->belongsTo(PractitionerRoleAvailability::class, 'availability_id');
|
||||
}
|
||||
}
|
||||
31
app/Models/Price.php
Normal file
31
app/Models/Price.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Price extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'priceable',
|
||||
'price_group_id',
|
||||
'price_gross',
|
||||
'price_net',
|
||||
'has_tax',
|
||||
'discount_type',
|
||||
'discount_percentage',
|
||||
'discount_absolute',
|
||||
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
public function priceable()
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
}
|
||||
21
app/Models/Province.php
Normal file
21
app/Models/Province.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Province extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $protected = [
|
||||
'id',
|
||||
'name'
|
||||
];
|
||||
|
||||
public function cities()
|
||||
{
|
||||
return $this->hasMany(City::class, 'province_id');
|
||||
}
|
||||
}
|
||||
22
app/Models/Village.php
Normal file
22
app/Models/Village.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Village extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'district_id',
|
||||
'name'
|
||||
];
|
||||
|
||||
public function district()
|
||||
{
|
||||
return $this->belongsTo(District::class, 'district_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('practices', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('practitioner_role_id');
|
||||
$table->string('service_code');
|
||||
$table->boolean('active')->default(1);
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->foreignId('created_by')->nullable()->index();
|
||||
$table->foreignId('updated_by')->nullable()->index();
|
||||
$table->foreignId('deleted_by')->nullable()->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('practices');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('prices', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->morphs('priceable');
|
||||
$table->foreignId('price_group_id');
|
||||
$table->string('price_gross');
|
||||
$table->string('price_net');
|
||||
$table->boolean('has_tax');
|
||||
$table->string('discount_type');
|
||||
$table->string('discount_percentage');
|
||||
$table->string('discount_absolute');
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->foreignId('created_by')->nullable()->index();
|
||||
$table->foreignId('updated_by')->nullable()->index();
|
||||
$table->foreignId('deleted_by')->nullable()->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('prices');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('practitioner_role_availabilities', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('practitioner_role_id');
|
||||
$table->boolean('all_day');
|
||||
$table->time('start_time')->nullable();
|
||||
$table->time('end_time')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->foreignId('created_by')->nullable()->index();
|
||||
$table->foreignId('updated_by')->nullable()->index();
|
||||
$table->foreignId('deleted_by')->nullable()->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('practitioner_role_availabilities');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('practitioner_role_availability_days', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('availability_id');
|
||||
$table->string('day');
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->foreignId('created_by')->nullable()->index();
|
||||
$table->foreignId('updated_by')->nullable()->index();
|
||||
$table->foreignId('deleted_by')->nullable()->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('practitioner_role_availability_days');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('provinces', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('provinces');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('cities', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('province_id');
|
||||
$table->string('name');
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('cities');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('districts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('city_id');
|
||||
$table->string('name');
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('districts');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('villages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('district_id');
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('villages');
|
||||
}
|
||||
};
|
||||
54
database/seeders/CitySeeder.php
Normal file
54
database/seeders/CitySeeder.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\City;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class CitySeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
City::truncate();
|
||||
|
||||
$chunks = [];
|
||||
$time = now();
|
||||
if (($handle = fopen(resource_path('files/city.csv'), "r")) !== FALSE) {
|
||||
$firstline = true;
|
||||
while (($data = fgetcsv($handle, 0, ",")) !== FALSE) {
|
||||
if (!$firstline) {
|
||||
$d = explode(';', $data[0]);
|
||||
|
||||
$row = [
|
||||
"id" => $d[0],
|
||||
"province_id" => $d[1],
|
||||
"name" => ucwords(strtolower($d[2])),
|
||||
"created_at" => $time,
|
||||
"updated_at" => $time
|
||||
];
|
||||
|
||||
$chunks[] = $row;
|
||||
}
|
||||
$firstline = false;
|
||||
|
||||
if ($chunks && count($chunks) == 100) {
|
||||
City::insert($chunks);
|
||||
$chunks = [];
|
||||
}
|
||||
}
|
||||
|
||||
if ($chunks && count($chunks) > 0) {
|
||||
City::insert($chunks);
|
||||
$chunks = [];
|
||||
}
|
||||
|
||||
fclose($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,10 @@ class DatabaseSeeder extends Seeder
|
||||
IcdSeeder::class,
|
||||
ServiceSeeder::class,
|
||||
SpecialitiesSeeder::class,
|
||||
ProvinceSeeder::class,
|
||||
CitySeeder::class,
|
||||
DistrictSeeder::class,
|
||||
VillageSeeder::class
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
54
database/seeders/DistrictSeeder.php
Normal file
54
database/seeders/DistrictSeeder.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\District;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DistrictSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
District::truncate();
|
||||
|
||||
$chunks = [];
|
||||
$time = now();
|
||||
if (($handle = fopen(resource_path('files/district.csv'), "r")) !== FALSE) {
|
||||
$firstline = true;
|
||||
while (($data = fgetcsv($handle, 0, ",")) !== FALSE) {
|
||||
if (!$firstline) {
|
||||
$d = explode(';', $data[0]);
|
||||
|
||||
$row = [
|
||||
"id" => $d[0],
|
||||
"city_id" => $d[1],
|
||||
"name" => ucwords(strtolower($d[2])),
|
||||
"created_at" => $time,
|
||||
"updated_at" => $time
|
||||
];
|
||||
|
||||
$chunks[] = $row;
|
||||
}
|
||||
$firstline = false;
|
||||
|
||||
if ($chunks && count($chunks) == 100) {
|
||||
District::insert($chunks);
|
||||
$chunks = [];
|
||||
}
|
||||
}
|
||||
|
||||
if ($chunks && count($chunks) > 0) {
|
||||
District::insert($chunks);
|
||||
$chunks = [];
|
||||
}
|
||||
|
||||
fclose($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
86
database/seeders/PractitionerRoleDummySeeder.php
Normal file
86
database/seeders/PractitionerRoleDummySeeder.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Practice;
|
||||
use App\Models\PractitionerRole;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class PractitionerRoleDummySeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Practice::truncate();
|
||||
|
||||
$times = [
|
||||
'07:00:00',
|
||||
'07:30:00',
|
||||
'08:00:00',
|
||||
'08:30:00',
|
||||
'09:00:00',
|
||||
'09:30:00',
|
||||
'10:00:00',
|
||||
'10:30:00',
|
||||
'11:00:00',
|
||||
'11:30:00',
|
||||
'12:00:00',
|
||||
'12:30:00',
|
||||
'13:00:00',
|
||||
'13:30:00',
|
||||
'14:00:00',
|
||||
'14:30:00',
|
||||
'15:00:00',
|
||||
'15:30:00',
|
||||
'16:00:00',
|
||||
'16:30:00',
|
||||
'17:00:00',
|
||||
'17:30:00',
|
||||
'18:00:00',
|
||||
'18:30:00',
|
||||
];
|
||||
|
||||
PractitionerRole::chunk(100, function($chunkedPractitionerRoles) use ($times) {
|
||||
foreach ($chunkedPractitionerRoles as $practitionerRole) {
|
||||
$practitionerRole->practices()->insert([
|
||||
[
|
||||
'practitioner_role_id' => $practitionerRole->id,
|
||||
'service_code' => 'instant-chat',
|
||||
'active' => 1,
|
||||
],
|
||||
[
|
||||
'practitioner_role_id' => $practitionerRole->id,
|
||||
'service_code' => 'chat',
|
||||
'active' => 1,
|
||||
],
|
||||
[
|
||||
'practitioner_role_id' => $practitionerRole->id,
|
||||
'service_code' => 'video',
|
||||
'active' => 1,
|
||||
],
|
||||
[
|
||||
'practitioner_role_id' => $practitionerRole->id,
|
||||
'service_code' => 'walkin',
|
||||
'active' => 1,
|
||||
],
|
||||
]);
|
||||
|
||||
$availabilities_data = [];
|
||||
foreach($times as $time) {
|
||||
$availabilities_data[] = [
|
||||
'practitioner_role_id' => $practitionerRole->id,
|
||||
'all_day' => 0,
|
||||
'start_time' => $time
|
||||
];
|
||||
}
|
||||
|
||||
$practitionerRole->availabilities()->insert($availabilities_data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
58
database/seeders/ProvinceSeeder.php
Normal file
58
database/seeders/ProvinceSeeder.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Province;
|
||||
use Box\Spout\Reader\Common\Creator\ReaderEntityFactory;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class ProvinceSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Province::truncate();
|
||||
|
||||
$chunks = [];
|
||||
$time = now();
|
||||
if (($handle = fopen(resource_path('files/province.csv'), "r")) !== FALSE) {
|
||||
$firstline = true;
|
||||
while (($data = fgetcsv($handle, 0, ",")) !== FALSE) {
|
||||
if (!$firstline) {
|
||||
$d = explode(';', $data[0]);
|
||||
|
||||
$row = [
|
||||
"id" => $d[0],
|
||||
"name" => ucwords(strtolower($d[1])),
|
||||
"created_at" => $time,
|
||||
"updated_at" => $time
|
||||
];
|
||||
|
||||
if ($row['name'] == 'Dki Jakarta') {
|
||||
$row['name'] = 'DKI Jakarta';
|
||||
}
|
||||
|
||||
$chunks[] = $row;
|
||||
}
|
||||
$firstline = false;
|
||||
|
||||
if ($chunks && count($chunks) == 100) {
|
||||
Province::insert($chunks);
|
||||
$chunks = [];
|
||||
}
|
||||
}
|
||||
|
||||
if ($chunks && count($chunks) > 0) {
|
||||
Province::insert($chunks);
|
||||
$chunks = [];
|
||||
}
|
||||
|
||||
fclose($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
50
database/seeders/UpdateOrganizationCities.php
Normal file
50
database/seeders/UpdateOrganizationCities.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\District;
|
||||
use App\Models\Organization;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class UpdateOrganizationCities extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$organizations = Organization::with('currentAddress')->get();
|
||||
|
||||
$districtsMap = [
|
||||
'ORG000C' => "367111",
|
||||
'ORG000D' => "327504",
|
||||
'ORG000E' => "317105",
|
||||
'ORG000F' => "737109",
|
||||
'ORG000M' => "327501",
|
||||
'ORG000O' => "732402",
|
||||
'ORG000P' => "327503",
|
||||
'ORG000Q' => "321503",
|
||||
'ORG000N' => "627103",
|
||||
'ORG000SG' => "337410",
|
||||
'ORG000BW' => "197104",
|
||||
'ORG000SK' => "320233",
|
||||
'ORG000PK' => "360312",
|
||||
'ORG000CK' => "317106",
|
||||
];
|
||||
|
||||
foreach ($organizations as $organization) {
|
||||
$district = District::with([
|
||||
'city',
|
||||
'city.province'
|
||||
])->find($districtsMap[$organization->code]);
|
||||
|
||||
$organization->currentAddress->district_id = $district->id ?? null;
|
||||
$organization->currentAddress->city_id = $district->city->id ?? null;
|
||||
$organization->currentAddress->province_id = $district->city->province->id ?? null;
|
||||
$organization->currentAddress->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
54
database/seeders/VillageSeeder.php
Normal file
54
database/seeders/VillageSeeder.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Village;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class VillageSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Village::truncate();
|
||||
|
||||
$chunks = [];
|
||||
$time = now();
|
||||
if (($handle = fopen(resource_path('files/village.csv'), "r")) !== FALSE) {
|
||||
$firstline = true;
|
||||
while (($data = fgetcsv($handle, 0, ",")) !== FALSE) {
|
||||
if (!$firstline) {
|
||||
$d = explode(';', $data[0]);
|
||||
|
||||
$row = [
|
||||
"id" => $d[0],
|
||||
"district_id" => $d[1],
|
||||
"name" => ucwords(strtolower($d[2])),
|
||||
"created_at" => $time,
|
||||
"updated_at" => $time
|
||||
];
|
||||
|
||||
$chunks[] = $row;
|
||||
}
|
||||
$firstline = false;
|
||||
|
||||
if ($chunks && count($chunks) == 100) {
|
||||
Village::insert($chunks);
|
||||
$chunks = [];
|
||||
}
|
||||
}
|
||||
|
||||
if ($chunks && count($chunks) > 0) {
|
||||
Village::insert($chunks);
|
||||
$chunks = [];
|
||||
}
|
||||
|
||||
fclose($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
515
resources/files/city.csv
Normal file
515
resources/files/city.csv
Normal file
@@ -0,0 +1,515 @@
|
||||
id;province_id;name
|
||||
1101;11;KAB. ACEH SELATAN
|
||||
1102;11;KAB. ACEH TENGGARA
|
||||
1103;11;KAB. ACEH TIMUR
|
||||
1104;11;KAB. ACEH TENGAH
|
||||
1105;11;KAB. ACEH BARAT
|
||||
1106;11;KAB. ACEH BESAR
|
||||
1107;11;KAB. PIDIE
|
||||
1108;11;KAB. ACEH UTARA
|
||||
1109;11;KAB. SIMEULUE
|
||||
1110;11;KAB. ACEH SINGKIL
|
||||
1111;11;KAB. BIREUEN
|
||||
1112;11;KAB. ACEH BARAT DAYA
|
||||
1113;11;KAB. GAYO LUES
|
||||
1114;11;KAB. ACEH JAYA
|
||||
1115;11;KAB. NAGAN RAYA
|
||||
1116;11;KAB. ACEH TAMIANG
|
||||
1117;11;KAB. BENER MERIAH
|
||||
1118;11;KAB. PIDIE JAYA
|
||||
1171;11;KOTA BANDA ACEH
|
||||
1172;11;KOTA SABANG
|
||||
1173;11;KOTA LHOKSEUMAWE
|
||||
1174;11;KOTA LANGSA
|
||||
1175;11;KOTA SUBULUSSALAM
|
||||
1201;12;KAB. TAPANULI TENGAH
|
||||
1202;12;KAB. TAPANULI UTARA
|
||||
1203;12;KAB. TAPANULI SELATAN
|
||||
1204;12;KAB. NIAS
|
||||
1205;12;KAB. LANGKAT
|
||||
1206;12;KAB. KARO
|
||||
1207;12;KAB. DELI SERDANG
|
||||
1208;12;KAB. SIMALUNGUN
|
||||
1209;12;KAB. ASAHAN
|
||||
1210;12;KAB. LABUHANBATU
|
||||
1211;12;KAB. DAIRI
|
||||
1212;12;KAB. TOBA SAMOSIR
|
||||
1213;12;KAB. MANDAILING NATAL
|
||||
1214;12;KAB. NIAS SELATAN
|
||||
1215;12;KAB. PAKPAK BHARAT
|
||||
1216;12;KAB. HUMBANG HASUNDUTAN
|
||||
1217;12;KAB. SAMOSIR
|
||||
1218;12;KAB. SERDANG BEDAGAI
|
||||
1219;12;KAB. BATU BARA
|
||||
1220;12;KAB. PADANG LAWAS UTARA
|
||||
1221;12;KAB. PADANG LAWAS
|
||||
1222;12;KAB. LABUHANBATU SELATAN
|
||||
1223;12;KAB. LABUHANBATU UTARA
|
||||
1224;12;KAB. NIAS UTARA
|
||||
1225;12;KAB. NIAS BARAT
|
||||
1271;12;KOTA MEDAN
|
||||
1272;12;KOTA PEMATANGSIANTAR
|
||||
1273;12;KOTA SIBOLGA
|
||||
1274;12;KOTA TANJUNG BALAI
|
||||
1275;12;KOTA BINJAI
|
||||
1276;12;KOTA TEBING TINGGI
|
||||
1277;12;KOTA PADANG SIDEMPUAN
|
||||
1278;12;KOTA GUNUNGSITOLI
|
||||
1301;13;KAB. PESISIR SELATAN
|
||||
1302;13;KAB. SOLOK
|
||||
1303;13;KAB. SIJUNJUNG
|
||||
1304;13;KAB. TANAH DATAR
|
||||
1305;13;KAB. PADANG PARIAMAN
|
||||
1306;13;KAB. AGAM
|
||||
1307;13;KAB. LIMA PULUH KOTA
|
||||
1308;13;KAB. PASAMAN
|
||||
1309;13;KAB. KEPULAUAN MENTAWAI
|
||||
1310;13;KAB. DHARMASRAYA
|
||||
1311;13;KAB. SOLOK SELATAN
|
||||
1312;13;KAB. PASAMAN BARAT
|
||||
1371;13;KOTA PADANG
|
||||
1372;13;KOTA SOLOK
|
||||
1373;13;KOTA SAWAHLUNTO
|
||||
1374;13;KOTA PADANG PANJANG
|
||||
1375;13;KOTA BUKITTINGGI
|
||||
1376;13;KOTA PAYAKUMBUH
|
||||
1377;13;KOTA PARIAMAN
|
||||
1401;14;KAB. KAMPAR
|
||||
1402;14;KAB. INDRAGIRI HULU
|
||||
1403;14;KAB. BENGKALIS
|
||||
1404;14;KAB. INDRAGIRI HILIR
|
||||
1405;14;KAB. PELALAWAN
|
||||
1406;14;KAB. ROKAN HULU
|
||||
1407;14;KAB. ROKAN HILIR
|
||||
1408;14;KAB. SIAK
|
||||
1409;14;KAB. KUANTAN SINGINGI
|
||||
1410;14;KAB. KEPULAUAN MERANTI
|
||||
1471;14;KOTA PEKANBARU
|
||||
1472;14;KOTA DUMAI
|
||||
1501;15;KAB. KERINCI
|
||||
1502;15;KAB. MERANGIN
|
||||
1503;15;KAB. SAROLANGUN
|
||||
1504;15;KAB. BATANGHARI
|
||||
1505;15;KAB. MUARO JAMBI
|
||||
1506;15;KAB. TANJUNG JABUNG BARAT
|
||||
1507;15;KAB. TANJUNG JABUNG TIMUR
|
||||
1508;15;KAB. BUNGO
|
||||
1509;15;KAB. TEBO
|
||||
1571;15;KOTA JAMBI
|
||||
1572;15;KOTA SUNGAI PENUH
|
||||
1601;16;KAB. OGAN KOMERING ULU
|
||||
1602;16;KAB. OGAN KOMERING ILIR
|
||||
1603;16;KAB. MUARA ENIM
|
||||
1604;16;KAB. LAHAT
|
||||
1605;16;KAB. MUSI RAWAS
|
||||
1606;16;KAB. MUSI BANYUASIN
|
||||
1607;16;KAB. BANYUASIN
|
||||
1608;16;KAB. OGAN KOMERING ULU TIMUR
|
||||
1609;16;KAB. OGAN KOMERING ULU SELATAN
|
||||
1610;16;KAB. OGAN ILIR
|
||||
1611;16;KAB. EMPAT LAWANG
|
||||
1612;16;KAB. PENUKAL ABAB LEMATANG ILIR
|
||||
1613;16;KAB. MUSI RAWAS UTARA
|
||||
1671;16;KOTA PALEMBANG
|
||||
1672;16;KOTA PAGAR ALAM
|
||||
1673;16;KOTA LUBUK LINGGAU
|
||||
1674;16;KOTA PRABUMULIH
|
||||
1701;17;KAB. BENGKULU SELATAN
|
||||
1702;17;KAB. REJANG LEBONG
|
||||
1703;17;KAB. BENGKULU UTARA
|
||||
1704;17;KAB. KAUR
|
||||
1705;17;KAB. SELUMA
|
||||
1706;17;KAB. MUKO MUKO
|
||||
1707;17;KAB. LEBONG
|
||||
1708;17;KAB. KEPAHIANG
|
||||
1709;17;KAB. BENGKULU TENGAH
|
||||
1771;17;KOTA BENGKULU
|
||||
1801;18;KAB. LAMPUNG SELATAN
|
||||
1802;18;KAB. LAMPUNG TENGAH
|
||||
1803;18;KAB. LAMPUNG UTARA
|
||||
1804;18;KAB. LAMPUNG BARAT
|
||||
1805;18;KAB. TULANG BAWANG
|
||||
1806;18;KAB. TANGGAMUS
|
||||
1807;18;KAB. LAMPUNG TIMUR
|
||||
1808;18;KAB. WAY KANAN
|
||||
1809;18;KAB. PESAWARAN
|
||||
1810;18;KAB. PRINGSEWU
|
||||
1811;18;KAB. MESUJI
|
||||
1812;18;KAB. TULANG BAWANG BARAT
|
||||
1813;18;KAB. PESISIR BARAT
|
||||
1871;18;KOTA BANDAR LAMPUNG
|
||||
1872;18;KOTA METRO
|
||||
1901;19;KAB. BANGKA
|
||||
1902;19;KAB. BELITUNG
|
||||
1903;19;KAB. BANGKA SELATAN
|
||||
1904;19;KAB. BANGKA TENGAH
|
||||
1905;19;KAB. BANGKA BARAT
|
||||
1906;19;KAB. BELITUNG TIMUR
|
||||
1971;19;KOTA PANGKAL PINANG
|
||||
2101;21;KAB. BINTAN
|
||||
2102;21;KAB. KARIMUN
|
||||
2103;21;KAB. NATUNA
|
||||
2104;21;KAB. LINGGA
|
||||
2105;21;KAB. KEPULAUAN ANAMBAS
|
||||
2171;21;KOTA BATAM
|
||||
2172;21;KOTA TANJUNG PINANG
|
||||
3101;31;KAB. ADM. KEP. SERIBU
|
||||
3171;31;KOTA ADM. JAKARTA PUSAT
|
||||
3172;31;KOTA ADM. JAKARTA UTARA
|
||||
3173;31;KOTA ADM. JAKARTA BARAT
|
||||
3174;31;KOTA ADM. JAKARTA SELATAN
|
||||
3175;31;KOTA ADM. JAKARTA TIMUR
|
||||
3201;32;KAB. BOGOR
|
||||
3202;32;KAB. SUKABUMI
|
||||
3203;32;KAB. CIANJUR
|
||||
3204;32;KAB. BANDUNG
|
||||
3205;32;KAB. GARUT
|
||||
3206;32;KAB. TASIKMALAYA
|
||||
3207;32;KAB. CIAMIS
|
||||
3208;32;KAB. KUNINGAN
|
||||
3209;32;KAB. CIREBON
|
||||
3210;32;KAB. MAJALENGKA
|
||||
3211;32;KAB. SUMEDANG
|
||||
3212;32;KAB. INDRAMAYU
|
||||
3213;32;KAB. SUBANG
|
||||
3214;32;KAB. PURWAKARTA
|
||||
3215;32;KAB. KARAWANG
|
||||
3216;32;KAB. BEKASI
|
||||
3217;32;KAB. BANDUNG BARAT
|
||||
3218;32;KAB. PANGANDARAN
|
||||
3271;32;KOTA BOGOR
|
||||
3272;32;KOTA SUKABUMI
|
||||
3273;32;KOTA BANDUNG
|
||||
3274;32;KOTA CIREBON
|
||||
3275;32;KOTA BEKASI
|
||||
3276;32;KOTA DEPOK
|
||||
3277;32;KOTA CIMAHI
|
||||
3278;32;KOTA TASIKMALAYA
|
||||
3279;32;KOTA BANJAR
|
||||
3301;33;KAB. CILACAP
|
||||
3302;33;KAB. BANYUMAS
|
||||
3303;33;KAB. PURBALINGGA
|
||||
3304;33;KAB. BANJARNEGARA
|
||||
3305;33;KAB. KEBUMEN
|
||||
3306;33;KAB. PURWOREJO
|
||||
3307;33;KAB. WONOSOBO
|
||||
3308;33;KAB. MAGELANG
|
||||
3309;33;KAB. BOYOLALI
|
||||
3310;33;KAB. KLATEN
|
||||
3311;33;KAB. SUKOHARJO
|
||||
3312;33;KAB. WONOGIRI
|
||||
3313;33;KAB. KARANGANYAR
|
||||
3314;33;KAB. SRAGEN
|
||||
3315;33;KAB. GROBOGAN
|
||||
3316;33;KAB. BLORA
|
||||
3317;33;KAB. REMBANG
|
||||
3318;33;KAB. PATI
|
||||
3319;33;KAB. KUDUS
|
||||
3320;33;KAB. JEPARA
|
||||
3321;33;KAB. DEMAK
|
||||
3322;33;KAB. SEMARANG
|
||||
3323;33;KAB. TEMANGGUNG
|
||||
3324;33;KAB. KENDAL
|
||||
3325;33;KAB. BATANG
|
||||
3326;33;KAB. PEKALONGAN
|
||||
3327;33;KAB. PEMALANG
|
||||
3328;33;KAB. TEGAL
|
||||
3329;33;KAB. BREBES
|
||||
3371;33;KOTA MAGELANG
|
||||
3372;33;KOTA SURAKARTA
|
||||
3373;33;KOTA SALATIGA
|
||||
3374;33;KOTA SEMARANG
|
||||
3375;33;KOTA PEKALONGAN
|
||||
3376;33;KOTA TEGAL
|
||||
3401;34;KAB. KULON PROGO
|
||||
3402;34;KAB. BANTUL
|
||||
3403;34;KAB. GUNUNGKIDUL
|
||||
3404;34;KAB. SLEMAN
|
||||
3471;34;KOTA YOGYAKARTA
|
||||
3501;35;KAB. PACITAN
|
||||
3502;35;KAB. PONOROGO
|
||||
3503;35;KAB. TRENGGALEK
|
||||
3504;35;KAB. TULUNGAGUNG
|
||||
3505;35;KAB. BLITAR
|
||||
3506;35;KAB. KEDIRI
|
||||
3507;35;KAB. MALANG
|
||||
3508;35;KAB. LUMAJANG
|
||||
3509;35;KAB. JEMBER
|
||||
3510;35;KAB. BANYUWANGI
|
||||
3511;35;KAB. BONDOWOSO
|
||||
3512;35;KAB. SITUBONDO
|
||||
3513;35;KAB. PROBOLINGGO
|
||||
3514;35;KAB. PASURUAN
|
||||
3515;35;KAB. SIDOARJO
|
||||
3516;35;KAB. MOJOKERTO
|
||||
3517;35;KAB. JOMBANG
|
||||
3518;35;KAB. NGANJUK
|
||||
3519;35;KAB. MADIUN
|
||||
3520;35;KAB. MAGETAN
|
||||
3521;35;KAB. NGAWI
|
||||
3522;35;KAB. BOJONEGORO
|
||||
3523;35;KAB. TUBAN
|
||||
3524;35;KAB. LAMONGAN
|
||||
3525;35;KAB. GRESIK
|
||||
3526;35;KAB. BANGKALAN
|
||||
3527;35;KAB. SAMPANG
|
||||
3528;35;KAB. PAMEKASAN
|
||||
3529;35;KAB. SUMENEP
|
||||
3571;35;KOTA KEDIRI
|
||||
3572;35;KOTA BLITAR
|
||||
3573;35;KOTA MALANG
|
||||
3574;35;KOTA PROBOLINGGO
|
||||
3575;35;KOTA PASURUAN
|
||||
3576;35;KOTA MOJOKERTO
|
||||
3577;35;KOTA MADIUN
|
||||
3578;35;KOTA SURABAYA
|
||||
3579;35;KOTA BATU
|
||||
3601;36;KAB. PANDEGLANG
|
||||
3602;36;KAB. LEBAK
|
||||
3603;36;KAB. TANGERANG
|
||||
3604;36;KAB. SERANG
|
||||
3671;36;KOTA TANGERANG
|
||||
3672;36;KOTA CILEGON
|
||||
3673;36;KOTA SERANG
|
||||
3674;36;KOTA TANGERANG SELATAN
|
||||
5101;51;KAB. JEMBRANA
|
||||
5102;51;KAB. TABANAN
|
||||
5103;51;KAB. BADUNG
|
||||
5104;51;KAB. GIANYAR
|
||||
5105;51;KAB. KLUNGKUNG
|
||||
5106;51;KAB. BANGLI
|
||||
5107;51;KAB. KARANGASEM
|
||||
5108;51;KAB. BULELENG
|
||||
5171;51;KOTA DENPASAR
|
||||
5201;52;KAB. LOMBOK BARAT
|
||||
5202;52;KAB. LOMBOK TENGAH
|
||||
5203;52;KAB. LOMBOK TIMUR
|
||||
5204;52;KAB. SUMBAWA
|
||||
5205;52;KAB. DOMPU
|
||||
5206;52;KAB. BIMA
|
||||
5207;52;KAB. SUMBAWA BARAT
|
||||
5208;52;KAB. LOMBOK UTARA
|
||||
5271;52;KOTA MATARAM
|
||||
5272;52;KOTA BIMA
|
||||
5301;53;KAB. KUPANG
|
||||
5302;53;KAB TIMOR TENGAH SELATAN
|
||||
5303;53;KAB. TIMOR TENGAH UTARA
|
||||
5304;53;KAB. BELU
|
||||
5305;53;KAB. ALOR
|
||||
5306;53;KAB. FLORES TIMUR
|
||||
5307;53;KAB. SIKKA
|
||||
5308;53;KAB. ENDE
|
||||
5309;53;KAB. NGADA
|
||||
5310;53;KAB. MANGGARAI
|
||||
5311;53;KAB. SUMBA TIMUR
|
||||
5312;53;KAB. SUMBA BARAT
|
||||
5313;53;KAB. LEMBATA
|
||||
5314;53;KAB. ROTE NDAO
|
||||
5315;53;KAB. MANGGARAI BARAT
|
||||
5316;53;KAB. NAGEKEO
|
||||
5317;53;KAB. SUMBA TENGAH
|
||||
5318;53;KAB. SUMBA BARAT DAYA
|
||||
5319;53;KAB. MANGGARAI TIMUR
|
||||
5320;53;KAB. SABU RAIJUA
|
||||
5321;53;KAB. MALAKA
|
||||
5371;53;KOTA KUPANG
|
||||
6101;61;KAB. SAMBAS
|
||||
6102;61;KAB. MEMPAWAH
|
||||
6103;61;KAB. SANGGAU
|
||||
6104;61;KAB. KETAPANG
|
||||
6105;61;KAB. SINTANG
|
||||
6106;61;KAB. KAPUAS HULU
|
||||
6107;61;KAB. BENGKAYANG
|
||||
6108;61;KAB. LANDAK
|
||||
6109;61;KAB. SEKADAU
|
||||
6110;61;KAB. MELAWI
|
||||
6111;61;KAB. KAYONG UTARA
|
||||
6112;61;KAB. KUBU RAYA
|
||||
6171;61;KOTA PONTIANAK
|
||||
6172;61;KOTA SINGKAWANG
|
||||
6201;62;KAB. KOTAWARINGIN BARAT
|
||||
6202;62;KAB. KOTAWARINGIN TIMUR
|
||||
6203;62;KAB. KAPUAS
|
||||
6204;62;KAB. BARITO SELATAN
|
||||
6205;62;KAB. BARITO UTARA
|
||||
6206;62;KAB. KATINGAN
|
||||
6207;62;KAB. SERUYAN
|
||||
6208;62;KAB. SUKAMARA
|
||||
6209;62;KAB. LAMANDAU
|
||||
6210;62;KAB. GUNUNG MAS
|
||||
6211;62;KAB. PULANG PISAU
|
||||
6212;62;KAB. MURUNG RAYA
|
||||
6213;62;KAB. BARITO TIMUR
|
||||
6271;62;KOTA PALANGKARAYA
|
||||
6301;63;KAB. TANAH LAUT
|
||||
6302;63;KAB. KOTABARU
|
||||
6303;63;KAB. BANJAR
|
||||
6304;63;KAB. BARITO KUALA
|
||||
6305;63;KAB. TAPIN
|
||||
6306;63;KAB. HULU SUNGAI SELATAN
|
||||
6307;63;KAB. HULU SUNGAI TENGAH
|
||||
6308;63;KAB. HULU SUNGAI UTARA
|
||||
6309;63;KAB. TABALONG
|
||||
6310;63;KAB. TANAH BUMBU
|
||||
6311;63;KAB. BALANGAN
|
||||
6371;63;KOTA BANJARMASIN
|
||||
6372;63;KOTA BANJARBARU
|
||||
6401;64;KAB. PASER
|
||||
6402;64;KAB. KUTAI KARTANEGARA
|
||||
6403;64;KAB. BERAU
|
||||
6407;64;KAB. KUTAI BARAT
|
||||
6408;64;KAB. KUTAI TIMUR
|
||||
6409;64;KAB. PENAJAM PASER UTARA
|
||||
6411;64;KAB. MAHAKAM ULU
|
||||
6471;64;KOTA BALIKPAPAN
|
||||
6472;64;KOTA SAMARINDA
|
||||
6474;64;KOTA BONTANG
|
||||
6501;65;KAB. BULUNGAN
|
||||
6502;65;KAB. MALINAU
|
||||
6503;65;KAB. NUNUKAN
|
||||
6504;65;KAB. TANA TIDUNG
|
||||
6571;65;KOTA TARAKAN
|
||||
7101;71;KAB. BOLAANG MONGONDOW
|
||||
7102;71;KAB. MINAHASA
|
||||
7103;71;KAB. KEPULAUAN SANGIHE
|
||||
7104;71;KAB. KEPULAUAN TALAUD
|
||||
7105;71;KAB. MINAHASA SELATAN
|
||||
7106;71;KAB. MINAHASA UTARA
|
||||
7107;71;KAB. MINAHASA TENGGARA
|
||||
7108;71;KAB. BOLAANG MONGONDOW UTARA
|
||||
7109;71;KAB. KEP. SIAU TAGULANDANG BIARO
|
||||
7110;71;KAB. BOLAANG MONGONDOW TIMUR
|
||||
7111;71;KAB. BOLAANG MONGONDOW SELATAN
|
||||
7171;71;KOTA MANADO
|
||||
7172;71;KOTA BITUNG
|
||||
7173;71;KOTA TOMOHON
|
||||
7174;71;KOTA KOTAMOBAGU
|
||||
7201;72;KAB. BANGGAI
|
||||
7202;72;KAB. POSO
|
||||
7203;72;KAB. DONGGALA
|
||||
7204;72;KAB. TOLI TOLI
|
||||
7205;72;KAB. BUOL
|
||||
7206;72;KAB. MOROWALI
|
||||
7207;72;KAB. BANGGAI KEPULAUAN
|
||||
7208;72;KAB. PARIGI MOUTONG
|
||||
7209;72;KAB. TOJO UNA UNA
|
||||
7210;72;KAB. SIGI
|
||||
7211;72;KAB. BANGGAI LAUT
|
||||
7212;72;KAB. MOROWALI UTARA
|
||||
7271;72;KOTA PALU
|
||||
7301;73;KAB. KEPULAUAN SELAYAR
|
||||
7302;73;KAB. BULUKUMBA
|
||||
7303;73;KAB. BANTAENG
|
||||
7304;73;KAB. JENEPONTO
|
||||
7305;73;KAB. TAKALAR
|
||||
7306;73;KAB. GOWA
|
||||
7307;73;KAB. SINJAI
|
||||
7308;73;KAB. BONE
|
||||
7309;73;KAB. MAROS
|
||||
7310;73;KAB. PANGKAJENE KEPULAUAN
|
||||
7311;73;KAB. BARRU
|
||||
7312;73;KAB. SOPPENG
|
||||
7313;73;KAB. WAJO
|
||||
7314;73;KAB. SIDENRENG RAPPANG
|
||||
7315;73;KAB. PINRANG
|
||||
7316;73;KAB. ENREKANG
|
||||
7317;73;KAB. LUWU
|
||||
7318;73;KAB. TANA TORAJA
|
||||
7322;73;KAB. LUWU UTARA
|
||||
7324;73;KAB. LUWU TIMUR
|
||||
7326;73;KAB. TORAJA UTARA
|
||||
7371;73;KOTA MAKASSAR
|
||||
7372;73;KOTA PARE PARE
|
||||
7373;73;KOTA PALOPO
|
||||
7401;74;KAB. KOLAKA
|
||||
7402;74;KAB. KONAWE
|
||||
7403;74;KAB. MUNA
|
||||
7404;74;KAB. BUTON
|
||||
7405;74;KAB. KONAWE SELATAN
|
||||
7406;74;KAB. BOMBANA
|
||||
7407;74;KAB. WAKATOBI
|
||||
7408;74;KAB. KOLAKA UTARA
|
||||
7409;74;KAB. KONAWE UTARA
|
||||
7410;74;KAB. BUTON UTARA
|
||||
7411;74;KAB. KOLAKA TIMUR
|
||||
7412;74;KAB. KONAWE KEPULAUAN
|
||||
7413;74;KAB. MUNA BARAT
|
||||
7414;74;KAB. BUTON TENGAH
|
||||
7415;74;KAB. BUTON SELATAN
|
||||
7471;74;KOTA KENDARI
|
||||
7472;74;KOTA BAU BAU
|
||||
7501;75;KAB. GORONTALO
|
||||
7502;75;KAB. BOALEMO
|
||||
7503;75;KAB. BONE BOLANGO
|
||||
7504;75;KAB. PAHUWATO
|
||||
7505;75;KAB. GORONTALO UTARA
|
||||
7571;75;KOTA GORONTALO
|
||||
7601;76;KAB. PASANGKAYU
|
||||
7602;76;KAB. MAMUJU
|
||||
7603;76;KAB. MAMASA
|
||||
7604;76;KAB. POLEWALI MANDAR
|
||||
7605;76;KAB. MAJENE
|
||||
7606;76;KAB. MAMUJU TENGAH
|
||||
8101;81;KAB. MALUKU TENGAH
|
||||
8102;81;KAB. MALUKU TENGGARA
|
||||
8103;81;KAB. KEPULAUAN TANIMBAR
|
||||
8104;81;KAB. BURU
|
||||
8105;81;KAB. SERAM BAGIAN TIMUR
|
||||
8106;81;KAB. SERAM BAGIAN BARAT
|
||||
8107;81;KAB. KEPULAUAN ARU
|
||||
8108;81;KAB. MALUKU BARAT DAYA
|
||||
8109;81;KAB. BURU SELATAN
|
||||
8171;81;KOTA AMBON
|
||||
8172;81;KOTA TUAL
|
||||
8201;82;KAB. HALMAHERA BARAT
|
||||
8202;82;KAB. HALMAHERA TENGAH
|
||||
8203;82;KAB. HALMAHERA UTARA
|
||||
8204;82;KAB. HALMAHERA SELATAN
|
||||
8205;82;KAB. KEPULAUAN SULA
|
||||
8206;82;KAB. HALMAHERA TIMUR
|
||||
8207;82;KAB. PULAU MOROTAI
|
||||
8208;82;KAB. PULAU TALIABU
|
||||
8271;82;KOTA TERNATE
|
||||
8272;82;KOTA TIDORE KEPULAUAN
|
||||
9101;91;KAB. MERAUKE
|
||||
9102;91;KAB. JAYAWIJAYA
|
||||
9103;91;KAB. JAYAPURA
|
||||
9104;91;KAB. NABIRE
|
||||
9105;91;KAB. KEPULAUAN YAPEN
|
||||
9106;91;KAB. BIAK NUMFOR
|
||||
9107;91;KAB. PUNCAK JAYA
|
||||
9108;91;KAB. PANIAI
|
||||
9109;91;KAB. MIMIKA
|
||||
9110;91;KAB. SARMI
|
||||
9111;91;KAB. KEEROM
|
||||
9112;91;KAB PEGUNUNGAN BINTANG
|
||||
9113;91;KAB. YAHUKIMO
|
||||
9114;91;KAB. TOLIKARA
|
||||
9115;91;KAB. WAROPEN
|
||||
9116;91;KAB. BOVEN DIGOEL
|
||||
9117;91;KAB. MAPPI
|
||||
9118;91;KAB. ASMAT
|
||||
9119;91;KAB. SUPIORI
|
||||
9120;91;KAB. MAMBERAMO RAYA
|
||||
9121;91;KAB. MAMBERAMO TENGAH
|
||||
9122;91;KAB. YALIMO
|
||||
9123;91;KAB. LANNY JAYA
|
||||
9124;91;KAB. NDUGA
|
||||
9125;91;KAB. PUNCAK
|
||||
9126;91;KAB. DOGIYAI
|
||||
9127;91;KAB. INTAN JAYA
|
||||
9128;91;KAB. DEIYAI
|
||||
9171;91;KOTA JAYAPURA
|
||||
9201;92;KAB. SORONG
|
||||
9202;92;KAB. MANOKWARI
|
||||
9203;92;KAB. FAK FAK
|
||||
9204;92;KAB. SORONG SELATAN
|
||||
9205;92;KAB. RAJA AMPAT
|
||||
9206;92;KAB. TELUK BINTUNI
|
||||
9207;92;KAB. TELUK WONDAMA
|
||||
9208;92;KAB. KAIMANA
|
||||
9209;92;KAB. TAMBRAUW
|
||||
9210;92;KAB. MAYBRAT
|
||||
9211;92;KAB. MANOKWARI SELATAN
|
||||
9212;92;KAB. PEGUNUNGAN ARFAK
|
||||
9271;92;KOTA SORONG
|
||||
|
7231
resources/files/district.csv
Normal file
7231
resources/files/district.csv
Normal file
File diff suppressed because it is too large
Load Diff
35
resources/files/province.csv
Normal file
35
resources/files/province.csv
Normal file
@@ -0,0 +1,35 @@
|
||||
id;name
|
||||
11;ACEH
|
||||
12;SUMATERA UTARA
|
||||
13;SUMATERA BARAT
|
||||
14;RIAU
|
||||
15;JAMBI
|
||||
16;SUMATERA SELATAN
|
||||
17;BENGKULU
|
||||
18;LAMPUNG
|
||||
19;KEPULAUAN BANGKA BELITUNG
|
||||
21;KEPULAUAN RIAU
|
||||
31;DKI JAKARTA
|
||||
32;JAWA BARAT
|
||||
33;JAWA TENGAH
|
||||
34;DAERAH ISTIMEWA YOGYAKARTA
|
||||
35;JAWA TIMUR
|
||||
36;BANTEN
|
||||
51;BALI
|
||||
52;NUSA TENGGARA BARAT
|
||||
53;NUSA TENGGARA TIMUR
|
||||
61;KALIMANTAN BARAT
|
||||
62;KALIMANTAN TENGAH
|
||||
63;KALIMANTAN SELATAN
|
||||
64;KALIMANTAN TIMUR
|
||||
65;KALIMANTAN UTARA
|
||||
71;SULAWESI UTARA
|
||||
72;SULAWESI TENGAH
|
||||
73;SULAWESI SELATAN
|
||||
74;SULAWESI TENGGARA
|
||||
75;GORONTALO
|
||||
76;SULAWESI BARAT
|
||||
81;MALUKU
|
||||
82;MALUKU UTARA
|
||||
91;PAPUA
|
||||
92;PAPUA BARAT
|
||||
|
83442
resources/files/village.csv
Normal file
83442
resources/files/village.csv
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user