• Zamówienia

    1. Lista

      • route: {{ action('Orders\OrderController@items') }}
      • method: GET
      • parametry:
        Parametr Opis
        pagination czy zastosować paginację (niewymagane, domyślnie 1), 1|0
        per_page liczba elementów na stronie (niewymagane, domyślnie 20)
        order[] kolejność sortowania (tablica, niewymagane)
           column kolumna, domyślnie name
           direction kierunek, domyślnie ASC
        where[] tablica
           search wyszukiwany ciąg znaków
           status status, string lub tablica
           customer_id id klienta
           address_id id adresu
           user_id id użytkownika dodającego zamówienie
           shipment_id id metody wysyłki
           payment_id id metody płatności
      • response:
                                
                            
    2. Element

      • route: {{ action('Orders\OrderController@item', ['id' => 'ID']) }}
      • ID - id elementu
      • method: GET
      • response:
                                
                            
    3. Dodawanie/edycja

      • route: {{ action('Orders\OrderController@store') }} (dodwanie)
      • route: {{ action('Orders\OrderController@update', ['id' => 'ID']) }} (edycja)
      • ID - id elementu
      • method: POST
      • parametry:
        Parametr Opis
        customer_id id klienta, wymagany przy dodawaniu
        address_id id adresu klienta, wymagany
        shipment_id id metody wysyłki, wymagany
        payment_id id metody płatności, wymagany
        description opis zamówienia
        delivery_date data dostawy, format: Y-m-d, np. 2021-04-25
        products[] tablica produktów, wymagany
           id id produktu zamówienia
           product_id id produktu, wymagany
           price cena, wymagany
           price_before_discount cena przed rabatem, wymagany
           discount rabat procentowy, wymagany, min: 0.00
           vat_rate stawka vat, wymagany
           quantity liczba sztuk, wymagany
      • response:
                                
                            
    4. Usuwanie

      • route: {{ action('Orders\OrderController@delete', ['id' => 'ID']) }}
      • ID - id elementu
      • method: POST
      • response:
                                
                            
    5. Dodanie statusu

      • route: {{ action('Orders\OrderController@addStatus', ['id' => 'ID']) }}
      • ID - id elementu
      • method: POST
      • parametry:
        Parametr Opis
        status status, wymagany, NEW | IN_PREPARATION | WAITING_FOR_PAYMENT | TO_SEND | SENT
      • response: