presensi

package module
v0.0.40 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 20 Imported by: 8

README

presensi

Attendance Module

Release

go get -u all
go mod tidy
git tag                                 #check current version
git tag v0.0.3                          #set tag version
git push origin --tags                  #push tag version to repo
go list -m github.com/aiteung/presensi@v0.0.3   #publish to pkg dev, replace ORG/URL with your repo URL

Documentation

Index

Constants

View Source
const Keyword string = "adorable"

Variables

This section is empty.

Functions

func ButtonMessage added in v0.0.2

func ButtonMessage(Info *types.MessageInfo, Message *waProto.Message, whatsapp *whatsmeow.Client)

func ButtonMessageJamKerja added in v0.0.13

func ButtonMessageJamKerja(karyawan Karyawan, aktifjamkerja time.Duration, presensihariini Presensi, Info *types.MessageInfo, whatsapp *whatsmeow.Client)

func ButtonMessageMasukKerja added in v0.0.13

func ButtonMessageMasukKerja(karyawan Karyawan, id interface{}, lokasi string, Info *types.MessageInfo, whatsapp *whatsmeow.Client)

func ButtonMessagePulangKerja added in v0.0.13

func ButtonMessagePulangKerja(karyawan Karyawan, aktifjamkerja time.Duration, id interface{}, lokasi string, Info *types.MessageInfo, whatsapp *whatsmeow.Client)

func GenerateReportCurrentMonth

func GenerateReportCurrentMonth(MongoConn *mongo.Database, im model.IteungMessage, ApiWa string, ApiWaDoc string) atmessage.Response

func GetFirstLastDateCurrentMonth

func GetFirstLastDateCurrentMonth() (firstOfMonth, lastOfMonth time.Time)

func GetLiveLoc added in v0.0.35

func GetLiveLoc(Pesan model.IteungMessage) (lat, long float64)

func GetLokasi

func GetLokasi(mongoconn *mongo.Database, long float64, lat float64) (namalokasi string)

func GetNamaFromPhoneNumber

func GetNamaFromPhoneNumber(mongoconn *mongo.Database, phone_number string) (nama string)

func HadirHandler added in v0.0.35

func HadirHandler(Pesan model.IteungMessage, lokasi string, mongoconn *mongo.Database) (reply string)

func InsertPresensi added in v0.0.2

func InsertPresensi(Info *types.MessageInfo, Message *waProto.Message, Checkin string, mongoconn *mongo.Database) (InsertedID interface{})

func ListMessageJamKerja added in v0.0.4

func ListMessageJamKerja(karyawan Karyawan, aktifjamkerja time.Duration, presensihariini Presensi, Info *types.MessageInfo, whatsapp *whatsmeow.Client)

func ListMessageMasukKerja added in v0.0.4

func ListMessageMasukKerja(karyawan Karyawan, id interface{}, lokasi string, Info *types.MessageInfo, whatsapp *whatsmeow.Client)

func ListMessagePulangKerja added in v0.0.4

func ListMessagePulangKerja(karyawan Karyawan, aktifjamkerja time.Duration, id interface{}, lokasi string, Info *types.MessageInfo, whatsapp *whatsmeow.Client)

func LiveLocationMessage added in v0.0.2

func LiveLocationMessage(Info *types.MessageInfo, Message *waProto.Message, whatsapp *whatsmeow.Client, mongoconn *mongo.Database)

func Member added in v0.0.2

func Member(Info *types.MessageInfo, Message *waProto.Message, mongoconn *mongo.Database) (status bool)

func MessageJamKerja added in v0.0.4

func MessageJamKerja(karyawan Karyawan, aktifjamkerja time.Duration, presensihariini Presensi, Info *types.MessageInfo, whatsapp *whatsmeow.Client)

func MessageMasukKerja added in v0.0.4

func MessageMasukKerja(karyawan Karyawan, id interface{}, lokasi string, Info *types.MessageInfo, whatsapp *whatsmeow.Client)

func MessagePulangKerja added in v0.0.4

func MessagePulangKerja(karyawan Karyawan, aktifjamkerja time.Duration, id interface{}, lokasi string, Info *types.MessageInfo, whatsapp *whatsmeow.Client)

func MessageTidakMasukKerja added in v0.0.16

func MessageTidakMasukKerja(nama string, long, lat float64, Info *types.MessageInfo, whatsapp *whatsmeow.Client)

func ReplyMessageJamKerja added in v0.0.35

func ReplyMessageJamKerja(karyawan Karyawan, aktifjamkerja time.Duration, presensihariini Presensi) string

func ReplyMessageMasukKerja added in v0.0.35

func ReplyMessageMasukKerja(karyawan Karyawan, id interface{}, lokasi string) string

func ReplyMessagePulangKerja added in v0.0.35

func ReplyMessagePulangKerja(karyawan Karyawan, aktifjamkerja time.Duration, id interface{}, lokasi string) string

func ReplyMessageTidakMasukKerja added in v0.0.35

func ReplyMessageTidakMasukKerja(nama string, long, lat float64) string

func ReportHandlerBulanIni added in v0.0.37

func ReportHandlerBulanIni(mongoconn *mongo.Database, im model.IteungMessage, ApiWa string, ApiWaDoc string) string

func TidakhadirHandler added in v0.0.35

func TidakhadirHandler(Pesan model.IteungMessage, mongoconn *mongo.Database) string

Types

type Geometry

type Geometry struct {
	Type        string      `json:"type" bson:"type"`
	Coordinates interface{} `json:"coordinates" bson:"coordinates"`
}

type JamKerja

type JamKerja struct {
	Durasi     int      `bson:"durasi,omitempty"`
	Jam_masuk  string   `bson:"jam_masuk,omitempty"`
	Jam_keluar string   `bson:"jam_keluar,omitempty"`
	Gmt        int      `bson:"gmt,omitempty"`
	Hari       []string `bson:"hari,omitempty"`
	Shift      int      `bson:"shift,omitempty"`
	Piket_tim  string   `bson:"piket_tim,omitempty"`
}

type Karyawan

type Karyawan struct {
	ID           primitive.ObjectID `bson:"_id,omitempty"`
	Nama         string             `bson:"nama,omitempty"`
	Phone_number string             `bson:"phone_number,omitempty"`
	Jabatan      string             `bson:"jabatan,omitempty"`
	Jam_kerja    []JamKerja         `bson:"jam_kerja,omitempty"`
	Hari_kerja   []string           `bson:"hari_kerja,omitempty"`
}

func GetBiodataFromPhoneNumber

func GetBiodataFromPhoneNumber(mongoconn *mongo.Database, phone_number string) (staf Karyawan)

func GetKaryawanFromPhoneNumber

func GetKaryawanFromPhoneNumber(mongoconn *mongo.Database, phone_number string) (staf Karyawan)

type Lokasi

type Lokasi struct {
	ID       primitive.ObjectID `bson:"_id,omitempty"`
	Nama     string             `bson:"nama,omitempty"`
	Batas    Geometry           `bson:"batas,omitempty"`
	Kategori string             `bson:"kategori,omitempty"`
}

type Presensi

type Presensi struct {
	ID           primitive.ObjectID `bson:"_id,omitempty"`
	Longitude    float64            `bson:"longitude,omitempty"`
	Latitude     float64            `bson:"latitude,omitempty"`
	Location     string             `bson:"location,omitempty"`
	Phone_number string             `bson:"phone_number,omitempty"`
	Datetime     primitive.DateTime `bson:"datetime,omitempty"`
	Checkin      string             `bson:"checkin,omitempty"`
	Biodata      Karyawan           `bson:"biodata,omitempty"`
}

func FillStructPresensi added in v0.0.35

func FillStructPresensi(Pesan model.IteungMessage, Checkin string, mongoconn *mongo.Database) (presensi Presensi)

func GetPresensiCurrentMonth

func GetPresensiCurrentMonth(mongoconn *mongo.Database) (allpresensi []Presensi)

func GetPresensiTodayFromPhoneNumber

func GetPresensiTodayFromPhoneNumber(mongoconn *mongo.Database, phone_number string) (presensi Presensi)

type RekapPresensi

type RekapPresensi struct {
	ID            primitive.ObjectID `bson:"_id,omitempty"`
	In            Presensi           `bson:"in,omitempty"`
	Out           Presensi           `bson:"out,omitempty"`
	Lembur        Presensi           `bson:"lembur,omitempty"`
	Keterangan    string             `bson:"keterangan,omitempty"`
	TotalJamKerja primitive.DateTime `bson:"totaljamkerja,omitempty"`
	Late          primitive.DateTime `bson:"late,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL