Giter Club home page Giter Club logo

data-penduduk-pascal-9's Introduction

Livecode 2 - Data Penduduk

Kendala

Kamu sedang bertugas sebagai Tenaga Ahli di Dinas Kependudukan dan Pencatatan Sipil. Suatu ketika Kepala Dinas meminta mu membuat kan sebuah aplikasi yang bisa mendata penduduk dan menggenerate NIK (Nomor Induk Kependudukan) dimana NIK tersebut terdiri dari:

  1. tidak lebih dan kurang dari 16 digit
  2. digit pertama merupakan kode provinsi
  3. digit berikutnya merupakan kode kab/kota
  4. digit berikutnya merupakan kecamatan
  5. digit berikutnya terdiri dari tanggal-bulan-tahun dimana jika:
    • gender perempuan maka tanggal ditambahkan 40 e.g tanggal 4 jadi 4 + 40 = 44
    • gender pria tetap
  6. digtt terakhir adalah urutan (random/increment), 0001, 0002, 0003 dst 7 hasil akhir adalah 1801053303921003

Kriteria

  1. CRUD Data Provinsi (membutuhkan waktu 1000ms)
  2. CRUD Data Kabupaten/Kota (membutuhkan waktu 1000ms)
  3. CRUD Data Kecamatanm(membutuhkan waktu 1000ms)
  4. Register Penduduk sekaligus Generate NIKm(membutuhkan waktu 5000ms)
  5. Buat dengan menggunakan proses Asynchronous
  6. Penggunaan Class atau function di bebaskan
  7. Validasi untuk Jam Layanan yaitu hanya pada jam 8 - 14 selain itu keluarkan pesan Layanan Pembuatan KTP Sudah tutup
  8. Validasi untuk Hari Layanan yaitu hanya ada Senin-Jumat selain itu keluarkan pesan Layanan Pembuatan KTP hanya Senin-Jumat
  9. Cek NIK jika sudah pernah buat atau terdaftar maka keluarkan pesan NIK anda sudah terdaftar
  10. Terapkan Module Export dan Require

Model

class Province {
    constructor(id,name) {
        this.id = id;
        this.name = name;
    }
}

class City {
    constructor(id,name,provinceCode) {
        this.id = id;
        this.name = name;
        this.provinceCode = provinceCode;
    }
}

class District {
    constructor(id,name,citiyCode) {
        this.id = id;
        this.name = name;
        this.citiyCode = citiyCode;
    }
}

class People {
    constructor(id,name,gender,nik,birthDate,placeOfBirth,provinceId,CityId,districtId) {
        this.id = id;
        this.name = name;
        this.gender = gender;
        this.nik = nik;
        this.birthDate = birthDate;
        this.placeOfBirth = placeOfBirth;
        this.provinceId = provinceId;
        this.CityId = CityId;
        this.districtId = districtId;
    }
}

Service

class BaseService {
   add(data) {}
   get() {}
   getById(id) {}
   delete(id) {}
   update(data) {}
}

class ProvinceService extend BaseService {
    constructor() {
        this.province = [];
    }
}

class CityService extend BaseService {
    constructor() {
        this.cities = [];
    }
}

class DistrictService extend BaseService {
    constructor() {
        this.districts = [];
    }
}

class PeopleService {
    constructor() {
        this.people = [];
    }
    register(people) {}
    get() {}
    getByNIK(nik) {}
}

data-penduduk-pascal-9's People

Contributors

jutionck avatar

Watchers

 avatar Reynaldi Akbar Maulana avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.