Initial commit: Horux Backend API

- API REST para gestion de facturas electronicas mexicanas (CFDI)
- Laravel 9 con autenticacion OAuth 2.0 (Passport)
- Integracion con Syntage, Clerk y Facturama
- 30 modelos Eloquent, 39 controladores
- Documentacion completa en /docs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-18 07:44:29 +00:00
commit 61320b44d8
191 changed files with 22895 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Imports;
use App\Models\UnitCode;
use Carbon\Carbon;
use Maatwebsite\Excel\Concerns\ToModel;
use Maatwebsite\Excel\Concerns\WithChunkReading;
use Maatwebsite\Excel\Concerns\WithStartRow;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
class UnitCodesImport implements ToModel, WithChunkReading, WithHeadingRow, WithStartRow
{
/**
* Método para indicar desde qué fila comenzar a leer.
*/
public function startRow(): int
{
return 2; // Si tienes encabezados, comienza en la fila 2
}
public function model(array $row)
{
return UnitCode::updateOrCreate(
['id' => $row['id']],
['description' => $this->emptyToNull($row['description'])]
);
}
private function emptyToNull($value)
{
return $value === '' ? null : $value;
}
/**
* Devuelve el tamaño del chunk (en filas) a leer.
*/
public function chunkSize(): int
{
return 5000; // Ajusta el tamaño según tus necesidades
}
}