<?php

namespace Opencart\Extension\Alsendo\Models;

class ShippingMethod
{
    private ?int $id;
    private ?string $serviceId;
    private ?string $name;
    private ?float $price;
    private bool $hasMap = false;
    private int $regionId;
    private ?int $shippingViaPickupPoint = null;
    private ?int $pickupRequest = null;

    public function __construct(
        int $regionId,
        ?int $id = null,
        ?string $serviceId = null,
        ?string $name = null,
        ?float $price = null,
        bool $hasMap = false,
        ?int $shippingViaPickupPoint = null,
        ?int $pickupRequest = null,
    ) {
        $this->regionId = $regionId;
        $this->id = $id;
        $this->serviceId = $serviceId;
        $this->name = $name;
        $this->price = $price;
        $this->hasMap = $hasMap;
        $this->shippingViaPickupPoint = $shippingViaPickupPoint;
        $this->pickupRequest = $pickupRequest;
    }

    public function getRegionId(): int {
        return $this->regionId;
    }

    public function setRegionId(int $regionId): void {
        $this->regionId = $regionId;
    }

    public function getId(): ?int
    {
        return $this->id;
    }

    public function setId(int $id): void
    {
        $this->id = $id;
    }

    public function getServiceId(): ?string
    {
        return $this->serviceId;
    }

    public function setServiceId(?string $serviceId): void
    {
        $this->serviceId = $serviceId;
    }

    public function getName(): ?string
    {
        return $this->name;
    }

    public function setName(?string $name): void
    {
        $this->name = $name;
    }

    public function getPrice(): ?float
    {
        return $this->price;
    }

    public function setPrice(?float $price): void
    {
        $this->price = $price;
    }

    public function setHasMap(bool $hasMap): void
    {
        $this->hasMap = $hasMap;
    }

    public function getHasMap(): bool
    {
        return $this->hasMap;
    }

    public function getShippingViaPickupPoint(): ?int
    {
        return $this->shippingViaPickupPoint;
    }

    public function setShippingViaPickupPoint(?int $v): void
    {
        $this->shippingViaPickupPoint = $v;
    }

    public function getPickupRequest(): ?int
    {
        return $this->pickupRequest;
    }

    public function setPickupRequest(?int $v): void
    {
        $this->pickupRequest = $v;
    }

    public function toArray(): array
    {
        return [
            'id' => $this->id,
            'service_id' => $this->serviceId,
            'name' => $this->name,
            'region_id' => $this->regionId,
        ];
    }
}
