Advertisement
Sam1D

getProcessPos.lib

Aug 11th, 2020 (edited)
1,060
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const kodeDokumen = "27";
  2. const tipeGate = "pembongkaran";
  3.  
  4. /* LOGIC FUNCTION */
  5. const getProcessPos = (kodeDokumen, tipeGate) => {
  6.   if (kodeDokumen === 30) {
  7.     if (tipeGate === "gate-in") return 0;
  8.   } else if (kodeDokumen === 33) {
  9.     if (tipeGate === "gate-in") return 0;
  10.     if (tipeGate === "pembongkaran") return 2;
  11.   } else if (kodeDokumen === 331) {
  12.     if (tipeGate === "stuffing") return 0;
  13.     if (tipeGate === "gate-out") return 2;
  14.     if (tipeGate === "gate-in") return 4;
  15.   } else if (kodeDokumen === 20) {
  16.     if (tipeGate === "gate-out") return 0;
  17.   } else if (kodeDokumen === 28) {
  18.     if (tipeGate === "area-transit") return 0;
  19.     if (tipeGate === "gate-out") return 2;
  20.   } else if (kodeDokumen === 16 || kodeDokumen === 23) {
  21.     if (tipeGate === "gate-out") return 0;
  22.     if (tipeGate === "gate-in") return 2;
  23.     if (tipeGate === "pembongkaran") return 4;
  24.   } else if (kodeDokumen === 25) {
  25.     if (tipeGate === "stuffing") return 0;
  26.     if (tipeGate === "gate-out") return 2;
  27.   } else if (kodeDokumen === 27) {
  28.     if (tipeGate === "stuffing") return 0;
  29.     if (tipeGate === "gate-out") return 2;
  30.     if (tipeGate === "gate-in") return 4;
  31.     if (tipeGate === "pembongkaran") return 6;
  32.   } else if (kodeDokumen === 40 || kodeDokumen === 262) {
  33.     if (tipeGate === "gate-in") return 0;
  34.     if (tipeGate === "pembongkaran") return 2;
  35.   } else if (kodeDokumen === 41 || kodeDokumen === 261) {
  36.     if (tipeGate === "stuffing") return 0;
  37.     if (tipeGate === "gate-out") return 2;
  38.   }
  39. };
  40.  
  41. const result = getProcessPos(Number(kodeDokumen), tipeGate);
  42. console.log({
  43.   catatan: "ELAINA POKOK PUNYA GUA!! TITIK!!!!",
  44.   idProses: "11ef77b1-bf45-4930-b025-9659d5372e15",
  45.   kodeDokumen: Number(kodeDokumen),
  46.   prosesType: result,
  47. });
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement