0.1.60 • Published 2 months ago

@isi-hrms/hrmscorefunction v0.1.60

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

coreFunction

Ini adalah kumpulan beberapa lib untuk hrms

Setup :

npm i hrms_corefunction@0.0.x (newest version)
please setup db connection on app/config

List function

module.exports = {
  notifLib: (req, callback)=>{
    return new Promise((resolve, reject) => {
      controller.test_lab_ctrl(req, message => {
        return resolve(message);
      });
    })
  },
  notifLeaveOnly: (req, callback)=>{
    return new Promise((resolve, reject) => {
      controller.notif_leave_only_ctrl(req, message => {
        return resolve(message);
      });
    })
  },
  pool_update: (req, callback)=>{
    controller.pool_update(req, message => {
      return message;
    })
  },
  calculation: (req, callback)=>{
    controller.calculation(req, (err, message) => {
      return message;
    })
  },
  check_previllage_request: (req, callback)=>{
    controller.check_previllage_request(req, (err, message) => {
      return message;
    })
  },
}

Cara pakai :

  1. config set di dalam libnya
mysql 	: {
		host 		: ENV.DB_HOST 		|| "192.168.1.xx", // ip database
		port 		: ENV.DB_PORT 		|| "3306",
		user 		: ENV.DB_USER 		|| "root",
		password	: ENV.DB_PASSWORD 	|| "yourpassword",
		database 	: 'database', // DB
	},
  1. require dulu
const library   = require('hrmscorefunction');
  1. cara pakai
let val_notif = {
    type: value.type,
    name: value.name,
    local_it: 'local', // memang nilainya harcode kaya gini
    user: 'user', // memang nilainya harcode kaya gini
    from_type: 'attendance', // memang nilainya harcode kaya gini
    swap: value.swap // beri nilai null jika bukan swap shift
};
// panggil si notif
let notif = await library.notifLib(val_notif);

console.log(notif.jsonData, '===== LURR');
0.1.60

2 months ago

0.1.59

3 months ago

0.1.58

3 months ago

0.1.57

3 months ago

0.1.56

3 months ago

0.1.55

3 months ago

0.1.54

3 months ago

0.1.53

4 months ago

0.1.52

5 months ago

0.1.51

5 months ago

0.1.42

9 months ago

0.1.43

8 months ago

0.1.44

8 months ago

0.1.45

8 months ago

0.1.46

7 months ago

0.1.47

7 months ago

0.1.48

7 months ago

0.1.50

6 months ago

0.1.49

6 months ago

0.1.41

1 year ago

0.1.40

1 year ago

0.1.39

1 year ago

0.1.38

1 year ago

0.1.37

1 year ago

0.1.36

1 year ago

0.1.35

1 year ago