Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const kodeDokumen = "27";
- const tipeGate = "pembongkaran";
- /* LOGIC FUNCTION */
- const getProcessPos = (kodeDokumen, tipeGate) => {
- if (kodeDokumen === 30) {
- if (tipeGate === "gate-in") return 0;
- } else if (kodeDokumen === 33) {
- if (tipeGate === "gate-in") return 0;
- if (tipeGate === "pembongkaran") return 2;
- } else if (kodeDokumen === 331) {
- if (tipeGate === "stuffing") return 0;
- if (tipeGate === "gate-out") return 2;
- if (tipeGate === "gate-in") return 4;
- } else if (kodeDokumen === 20) {
- if (tipeGate === "gate-out") return 0;
- } else if (kodeDokumen === 28) {
- if (tipeGate === "area-transit") return 0;
- if (tipeGate === "gate-out") return 2;
- } else if (kodeDokumen === 16 || kodeDokumen === 23) {
- if (tipeGate === "gate-out") return 0;
- if (tipeGate === "gate-in") return 2;
- if (tipeGate === "pembongkaran") return 4;
- } else if (kodeDokumen === 25) {
- if (tipeGate === "stuffing") return 0;
- if (tipeGate === "gate-out") return 2;
- } else if (kodeDokumen === 27) {
- if (tipeGate === "stuffing") return 0;
- if (tipeGate === "gate-out") return 2;
- if (tipeGate === "gate-in") return 4;
- if (tipeGate === "pembongkaran") return 6;
- } else if (kodeDokumen === 40 || kodeDokumen === 262) {
- if (tipeGate === "gate-in") return 0;
- if (tipeGate === "pembongkaran") return 2;
- } else if (kodeDokumen === 41 || kodeDokumen === 261) {
- if (tipeGate === "stuffing") return 0;
- if (tipeGate === "gate-out") return 2;
- }
- };
- const result = getProcessPos(Number(kodeDokumen), tipeGate);
- console.log({
- catatan: "ELAINA POKOK PUNYA GUA!! TITIK!!!!",
- idProses: "11ef77b1-bf45-4930-b025-9659d5372e15",
- kodeDokumen: Number(kodeDokumen),
- prosesType: result,
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement