PromotedBanner


Banner promocional para mostrar a clientes.

El action contiene la acción a realizar al hacer click. Actualmente soportados:

  • view: Visualizar la pantalla de detalles.

Para saber a qué pantalla debe dirigirse la aplicación, se utilizan los atributos target_type y target_id. El target_type indica el tipo de pantalla:

  • company: Lleva al Home de la aplicación.
  • branch_group: Lleva a un comercio específico. En este caso el target_id contiene el ID del Grupo de comercio. Con esto se puede encontrar al comercio correspondiente de los obtenidos en el Home donde target_id == branch.branch_group_id.
  • good: Lleva a un producto en específico. En este caso el target_id contiene el good_id del producto. Los pasos a seguir pueden ser los siguientes:
    1. Llamar al endpoint GET companies/companyId/goods/{target_id} obteniendo el good
    2. Usar good.branch_group_id para encontrar el comercio del Home, y así identificar al branch_id correspondiente.
    3. Entrar directamente a la vista del producto usando el good_id y branch_id.
  • branch_category: Lleva a una categoría de comercios, donde el target_id contiene el ID de la categoría.

Modelo PromotedBanner

{
    "id": 83,
    "banner_url": "http://127.0.0.1:8000/storage/companies/69/banner/banner_83_1724623630.jpg",
    "action": "view",
    "target_type": "branch_group",
    "target_id": 63,
    "created_at": "2021-03-12 17:30:52",
    "updated_at": "2025-02-17 18:23:07",
    "in_order": 2,
    "enabled": false,
    "name": "Mercado",
    "description": "Asdareghdtyjkuk",
    "hour_from": "15:00",
    "hour_to": "12:00",
    "vertical_banner_url": "http://127.0.0.1:8000/storage/companies/69/banner/banner_vertical_83_1631810497.jpg",
    "day_sunday": true,
    "day_monday": true,
    "day_tuesday": true,
    "day_wednesday": true,
    "day_thursday": true,
    "day_friday": true,
    "day_saturday": true
}
Atributo Tipo Descripción
id int -
banner_url string -
action string -
target_type string -
target_id int -
created_at datetime\|null -
updated_at datetime\|null -
in_order int -
enabled bool -
name string -
description string\|null -
hour_from string -
hour_to string -
vertical_banner_url string -
day_sunday bool BitMask (({@link self::days} & 0x1) !== 0)
day_monday bool BitMask (({@link self::days} & 0x2) !== 0)
day_tuesday bool BitMask (({@link self::days} & 0x4) !== 0)
day_wednesday bool BitMask (({@link self::days} & 0x8) !== 0)
day_thursday bool BitMask (({@link self::days} & 0x10) !== 0)
day_friday bool BitMask (({@link self::days} & 0x20) !== 0)
day_saturday bool BitMask (({@link self::days} & 0x40) !== 0)

Insertar PromotedBanner

Método URI Cabeceras
POST /companies/{companyId}/promoted-banners Authorization
{
    "action": "required|string|in:view",
    "target_type": "required|string|in:company,branch_group,good,branch_category,city",
    "target_id": "required|integer",
    "in_order": "integer",
    "enabled": "boolean",
    "name": "string|max:64",
    "description": "string|max:255",
    "hour_from": {
        "string": true,
        "regex": "/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
    },
    "hour_to": {
        "string": true,
        "regex": "/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
    },
    "tz": {
        "string": true,
        "regex": "/^[\+\-]([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
    },
    "day_sunday": "nullable|boolean",
    "day_monday": "nullable|boolean",
    "day_tuesday": "nullable|boolean",
    "day_wednesday": "nullable|boolean",
    "day_thursday": "nullable|boolean",
    "day_friday": "nullable|boolean",
    "day_saturday": "nullable|boolean"
}

Listar PromotedBanner

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

Método URI Cabeceras
GET /companies/{companyId}/promoted-banners N/A

Mostrar PromotedBanner

{info} Soporta: Carga dinámica

Método URI Cabeceras
GET /companies/{companyId}/promoted-banners/{promotedBannerId} N/A

Actualizar PromotedBanner

Método URI Cabeceras
PATCH /companies/{companyId}/promoted-banners/{promotedBannerId} Authorization
{
    "action": "string|in:view",
    "target_type": "string|in:company,branch_group,good,branch_category,city",
    "target_id": "integer",
    "in_order": "integer",
    "enabled": "boolean",
    "name": "string|max:64",
    "description": "string|max:255",
    "hour_from": {
        "string": true,
        "regex": "/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
    },
    "hour_to": {
        "string": true,
        "regex": "/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
    },
    "tz": {
        "string": true,
        "regex": "/^[\+\-]([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
    },
    "day_sunday": "nullable|boolean",
    "day_monday": "nullable|boolean",
    "day_tuesday": "nullable|boolean",
    "day_wednesday": "nullable|boolean",
    "day_thursday": "nullable|boolean",
    "day_friday": "nullable|boolean",
    "day_saturday": "nullable|boolean"
}

Vincular PromotedBanner

Vincular PromotedBanner de BranchCategory

Método URI Cabeceras
PUT /companies/{companyId}/branch-categories/{branchCategoryId}/promoted-banners/{promotedBannerId} Authorization

Desvincular PromotedBanner

Desvincular PromotedBanner de BranchCategory

Método URI Cabeceras
DELETE /companies/{companyId}/branch-categories/{branchCategoryId}/promoted-banners/{promotedBannerId} Authorization

Eliminar PromotedBanner

Método URI Cabeceras
DELETE /companies/{companyId}/promoted-banners/{promotedBannerId} Authorization

Acciones de PromotedBanner

Upload Banner

Método URI Cabeceras
POST /companies/{companyId}/promoted-banners/{promotedBannerId}/upload-banner Authorization
{
    "image": "required|image|mimes:jpeg,png,bmp|max:8192|dimensions:min_width=868,min_height=868"
}

Upload Banner

Método URI Cabeceras
POST /companies/{companyId}/promoted-banners/{promotedBannerId}/upload-vertical-banner Authorization
{
    "image": "required|image|mimes:jpeg,png,bmp|max:8192|dimensions:min_width=868,min_height=868"
}

Enlaces de PromotedBanner