feat: add CSV export for approved orders && add non-delivery reason modal for livreurs

This commit is contained in:
2026-05-03 13:23:20 +02:00
parent a273484659
commit 7dc2686f6c
8 changed files with 233 additions and 14 deletions
+6
View File
@@ -265,6 +265,12 @@ func (d *Database) CreateCommandWithAddress(username, deliveryAddress string) (*
return command, nil
}
func (d *Database) GetApprovedCommands() ([]models.Command, error) {
var commands []models.Command
err := d.GDB.Where("status = ?", "approved").Order("created_at DESC").Find(&commands).Error
return commands, err
}
func (d *Database) GetAllCommands(status, username string) ([]map[string]any, error) {
if username != "" {
if err := validateUsername(username); err != nil {