package common

type (
	YaTidakCode          byte
	SudahBelumCode       byte
	AktifSimpelCode      byte
	AktifAdvanceCode     byte
	TersediaCode         byte
	DayCode              byte
	ActiveStatusCode     string
	DataStatusCode       string
	UserStatusCode       string
	TimeUnitCode         string
	PaymentMethodCode    string
	DataAvailabilityCode string
	DataVerifiedCode     string
	CrudCode             string
	DataApprovalCode     string
	ProcessStatusCode    string
	DocFormatTypeCode    string
)

const (
	TTTidak YaTidakCode = iota
	TTYa
)

const (
	BSBelum SudahBelumCode = iota
	BSSudah
)
const (
	ASCInaktif AktifSimpelCode = iota
	ASCAktif
)
const (
	AACBaru AktifAdvanceCode = iota
	AACAktif
	AACBlokir
	AACHapus
)

const (
	TCTidakTersedia TersediaCode = iota
	TCTersedia
)

const (
	DCMinggu DayCode = iota
	DCSenin
	DCSelasa
	DCRabu
	DCKamis
	DCJumat
	DCSabtu
)

const (
	SCActive   ActiveStatusCode = "active"   // Aktif
	SCInactive ActiveStatusCode = "inactive" // Tidak aktif

	DSCNew      DataStatusCode = "new"      // Baru
	DSCSubmited DataStatusCode = "submited" // Submited
	DSCReview   DataStatusCode = "review"   // Review
	DSCProcess  DataStatusCode = "process"  // Proses
	DSCDone     DataStatusCode = "done"     // Selesai
	DSCCancel   DataStatusCode = "cancel"   // Dibatalkan
	DSCRejected DataStatusCode = "rejected" // Ditolak
	DSCSkipped  DataStatusCode = "skipped"  // Dilewati

	DACReview      DataAvailabilityCode = "review"      // Konfirmasi
	DACAvailable   DataAvailabilityCode = "available"   // Tersedia
	DACUnavailable DataAvailabilityCode = "unavailable" // Tidak Tersedia

	DVCNew       DataVerifiedCode = "new"       // Baru
	DVCVerified  DataVerifiedCode = "verified"  // Terverifikasi
	DVCValidated DataVerifiedCode = "validated" // Tervalidasi
	DVCCancelled DataVerifiedCode = "cancelled" // Dibatalkan
	DVCRejected  DataVerifiedCode = "rejected"  // Ditolak

	USCNew       UserStatusCode = "new"       // Baru
	USCActive    UserStatusCode = "active"    // Aktif
	USCInactive  UserStatusCode = "inactive"  // Tidak aktif
	USCBlocked   UserStatusCode = "blocked"   // Diblokir
	USCSuspended UserStatusCode = "suspended" // Dibekukan

	TUCSec   TimeUnitCode = "sec"   // Detik
	TUCMin   TimeUnitCode = "min"   // Menit
	TUCHour  TimeUnitCode = "hour"  // Jam
	TUCDay   TimeUnitCode = "day"   // Hari
	TUCWeek  TimeUnitCode = "week"  // Minggu
	TUCMonth TimeUnitCode = "month" // Bulan
	TUCYear  TimeUnitCode = "year"  // Tahun

	PMCCash       PaymentMethodCode = "cash"       // Tunai
	PMCDebit      PaymentMethodCode = "debit"      // Debet
	PMCCredit     PaymentMethodCode = "credit"     // Kredit
	PMCInsurance  PaymentMethodCode = "insurance"  // Asuransi
	PMCMembership PaymentMethodCode = "membership" // Member

	CCCreate CrudCode = "c" // Create
	CCRead   CrudCode = "r" // Read
	CCUpdate CrudCode = "u" // Update
	CCDelete CrudCode = "d" // Delete

	DACNew      DataApprovalCode = "new"
	DACApproved DataApprovalCode = "approved"
	DACRejected DataApprovalCode = "rejected"
	DACCanceled DataApprovalCode = "canceled"

	PSCSuccess ProcessStatusCode = "success"
	PSCFailed  ProcessStatusCode = "failed"

	DFTCPDF   DocFormatTypeCode = "pdf"
	DFTCTXLSX DocFormatTypeCode = "xlsx"
	DFTCTCSV  DocFormatTypeCode = "csv"
	DFTCTXLS  DocFormatTypeCode = "xls"
)

func GetDayCodes() map[DayCode]string {
	return map[DayCode]string{
		DCMinggu: "Minggu",
		DCSenin:  "Senin",
		DCSelasa: "Selasa",
		DCRabu:   "Rabu",
		DCKamis:  "Kamis",
		DCJumat:  "Jumat",
		DCSabtu:  "Sabtu",
	}
}

func (obj DayCode) String() string {
	return GetDayCodes()[obj]
}
