• Klienci

    1. Lista

      • route: {{ action('Customers\CustomerController@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
           worker_id id pracownika (użytkownika systemu)
           with_debt czy wylistować klientów z zadłużeniem
      • response:
                                
                            
    2. Lista wszystkich klientów

      • route: {{ action('Customers\CustomerController@allItems') }}
      • method: GET
      • parametry:
        Parametr Opis
        order[] kolejność sortowania (tablica, niewymagane)
           column kolumna, domyślnie name
           direction kierunek, domyślnie ASC
      • response:
                                
                            
    3. Element

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

      • route: {{ action('Customers\CustomerController@store') }} (dodwanie)
      • route: {{ action('Customers\CustomerController@update', ['id' => 'ID']) }} (edycja)
      • ID - id elementu
      • method: POST
      • parametry: {{----}}
        Parametr Opis
        worker_id id pracownika (użytkownika systemu)
        name imię, wymagany
        surname nazwisko, wymagany
        email adres e-mail, wymagany
        phone nr telefonu, wymagany
        discount rabat, liczba naturalna
        street ulica, wymagany
        building_number nr budynku, wymagany
        house_number nr lokalu
        post_code kod pocztowy, wymagany
        city miejscowość, wymagany
        invoice_company nazwa firmy, wymagany
        invoice_name imię
        invoice_surname nazwisko
        invoice_street ulica, wymagany
        invoice_building_number nr budynku, wymagany
        invoice_house_number nr lokalu
        invoice_post_code kod pocztowy, wymagany
        invoice_city miejscowość, wymagany
        invoice_nip NIP, wymagany
        send_products_stock czy wysyłać e-mail z dostępnością produktów, wymagany, 0 | 1
        payments tablica z id metod płatności, np. [1, 4]
        categories[] tablica z kategoriami do rabatu
           id id kategorii, wymagany
           discount kwota, liczba nieujemna, wymagany
        manufacturers[] tablica z producentami do rabatu
           id id producenta, wymagany
           discount kwota, liczba nieujemna, wymagany
        exclude_products[] tablica z id produktów wykoczonych z rabatu
        products[] tablica z produktami do rabatu
           id id produktu, wymagany
           discount kwota, liczba nieujemna, wymagany
      • response:
                                
                            
    5. Usuwanie

      • route: {{ action('Customers\CustomerController@delete', ['id' => 'ID']) }}
      • ID - id elementu
      • method: POST
      • response:
                                
                            
    6. Szukanie po NIP

      • route: {{ action('Customers\CustomerController@findByNip') }}
      • ID - id elementu
      • method: POST
      • parametry:
        Parametr Opis
        nip numer nip
      • response: