mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-12 13:46:51 +00:00
32 lines
970 B
Go
32 lines
970 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 %w", err)
|
|
// }
|
|
|
|
// now := time.Now()
|
|
// log.Println("Start Monthly Booking Report job at:", now)
|
|
|
|
// ps, err := pdf.NewPdfClient(
|
|
// 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 %w", err)
|
|
// }
|
|
|
|
// service, _ := booking.NewService(db, nil, ps)
|
|
// period := "monthly"
|
|
// month := int(now.Month())
|
|
// year := now.Year()
|
|
|
|
// err = service.BuildReport(service.Report(period, month, year), period, month, year)
|
|
|
|
// log.Printf("Executed Monthly Booking Report job at %v with errors: %s:", time.Now().Format(time.DateTime), err)
|
|
// return err
|
|
// }
|