ServiceChargeGeofence


Vincula un ServiceCharge con una BranchGeofence: es donde viven los tramos de tarifa de envío (deliveryFees) que aplican dentro de esa geocerca. is_enabled activa o desactiva el vínculo sin borrar los tramos configurados.

Estructura de Datos

Atributo Tipo Descripción
id int
service_charge_id int {@link ServiceCharge} al que pertenece el vínculo
branch_geofence_id int {@link \App\BranchGeofence} donde aplican los tramos
is_enabled bool Si el vínculo está activo
created_at datetime\|null
updated_at datetime\|null
allLogs ApiLog>
deliveryFees DeliveryFee> Tramos de tarifa de envío que aplican en la geocerca
geofence BranchGeofence Geocerca vinculada
logs ApiLog>
serviceCharge ServiceCharge {@link ServiceCharge} al que pertenece el vínculo
[]

Endpoints

Insertar ServiceChargeGeofence

Vincular geocerca al cargo de servicio

Crea un ServiceChargeGeofence entre el ServiceCharge y una BranchGeofence. Sobre este vínculo se definen luego los tramos de tarifa de envío (endpoints delivery-fees).

Método URI Cabeceras
POST /service-charges/{serviceCharge}/geofences/{branchGeofence} Authorization
{
    "is_enabled": "boolean"
}

Listar ServiceChargeGeofence

Listar geocercas del cargo de servicio

{info} Soporta: Paginación Filters Carga dinámica

Listado paginado de las geocercas vinculadas al ServiceCharge (registros ServiceChargeGeofence), ordenadas por estado.

Método URI Cabeceras
GET /service-charges/{serviceCharge}/geofences Authorization

Mostrar ServiceChargeGeofence

Mostrar geocerca del cargo de servicio

{info} Soporta: Carga dinámica

Devuelve el ServiceChargeGeofence entre el ServiceCharge y la BranchGeofence indicada.

Método URI Cabeceras
GET /service-charges/{serviceChargeId}/geofences/{branchGeofenceId} Authorization

Actualizar ServiceChargeGeofence

Actualizar geocerca del cargo de servicio

Cambia is_enabled del ServiceChargeGeofence, activando o desactivando los tramos de tarifa de esa geocerca sin borrarlos.

Método URI Cabeceras
PATCH /service-charges/{serviceChargeId}/geofences/{branchGeofenceId} Authorization
{
    "is_enabled": "boolean"
}

Eliminar ServiceChargeGeofence

Eliminar geocerca del cargo de servicio

Desvincula una BranchGeofence del ServiceCharge, borrando el ServiceChargeGeofence y los tramos de tarifa definidos en esa geocerca.

Método URI Cabeceras
DELETE /service-charges/{serviceChargeId}/geofences/{branchGeofenceId} Authorization

Acciones de ServiceChargeGeofence

Index For Service Charge Geofence

{info} Soporta: Paginación Filters Carga dinámica

Método URI Cabeceras
GET /service-charges/{serviceCharge}/branch-geofences/{branchGeofence}/delivery-fees Authorization

Store For Service Charge Geofence

Método URI Cabeceras
POST /service-charges/{serviceCharge}/branch-geofences/{branchGeofence}/delivery-fees Authorization
{
    "name": "required|string|max:32",
    "label": "string|max:32",
    "is_additional": "boolean",
    "distance_min": "required|integer|min:0",
    "distance_max": "required|integer|min:-1",
    "fee_min_e2": "integer|min:0",
    "human_fee_min_e2": "numeric|min:0.0",
    "fee_max_e2": "integer|min:0",
    "human_fee_max_e2": "numeric|min:0.0",
    "delivery_providers_prc": "numeric|between:0.0000,1.0000",
    "human_delivery_providers_prc": "numeric|between:0.00,100.00",
    "days": [
        "integer|min:0|max:6"
    ],
    "base_multiplier": "numeric|between:-1.0000,100.0000",
    "additional_multiplier": "numeric|between:-1.0000,100.0000",
    "hour_beg": {
        "string": true,
        "regex": "/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
    },
    "hour_end": {
        "string": true,
        "regex": "/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
    }
}

Store For Service Charge Geofence

Método URI Cabeceras
PUT /service-charges/{serviceCharge}/branch-geofences/{branchGeofence}/delivery-fees Authorization
[
    {
        "name": "required|string|max:32",
        "label": "string|max:32",
        "is_additional": "boolean",
        "distance_min": "required|integer|min:0",
        "distance_max": "required|integer|min:-1",
        "fee_min_e2": "integer|min:0",
        "human_fee_min_e2": "numeric|min:0.0",
        "fee_max_e2": "integer|min:0",
        "human_fee_max_e2": "numeric|min:0.0",
        "delivery_providers_prc": "numeric|between:0.0000,1.0000",
        "human_delivery_providers_prc": "numeric|between:0.00,100.00",
        "days": [
            "integer|min:0|max:6"
        ],
        "base_multiplier": "numeric|between:-1.0000,100.0000",
        "additional_multiplier": "numeric|between:-1.0000,100.0000",
        "hour_beg": {
            "string": true,
            "regex": "/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
        },
        "hour_end": {
            "string": true,
            "regex": "/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
        }
    }
]

Relaciones