mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-12 13:46:51 +00:00
28 lines
941 B
Go
28 lines
941 B
Go
package cron
|
|
|
|
// func JobMonthlyBookingReport() error {
|
|
// _ = godotenv.Load()
|
|
// db, err := gorm.Open(postgres.Open(os.Getenv("DATABASE_URL")), &gorm.Config{})
|
|
// if err != nil {
|
|
// return fmt.Errorf("error connecting to the database %s", err)
|
|
// }
|
|
//
|
|
// now := time.Now()
|
|
// log.Println("Start Monthly Booking Report job at:", now)
|
|
// service, _ := booking.NewService(db)
|
|
// report := service.BuildReport("monthly", int(now.Month()), now.Year())
|
|
//
|
|
// ps, err := pdf.NewPdfService(
|
|
// os.Getenv("HTMLDOCS_PROJECT_ID"),
|
|
// os.Getenv("HTMLDOCS_REPORT_PROJECT_ID"),
|
|
// os.Getenv("HTMLDOCS_URL"),
|
|
// os.Getenv("HTMLDOCS_KEY"),
|
|
// )
|
|
// if err != nil {
|
|
// return fmt.Errorf("error starting pdf service %s", err)
|
|
// }
|
|
//
|
|
// _ = ps.BuildReport(report, "", int(now.Month()), now.Year())
|
|
// log.Printf("Executed Monthly Booking Report job at %v with errors: %s:", time.Now().Format(time.DateTime), err)
|
|
// return err
|
|
// }
|