2017 © Pedro Peláez
 

library front-desk

Front Desk Library

image

openclassrooms/front-desk

Front Desk Library

  • Monday, November 20, 2017
  • by openclassrooms-admin
  • Repository
  • 14 Watchers
  • 1 Stars
  • 3,899 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 18 Versions
  • 0 % Grown

The README.md

Build Status SensioLabsInsight Coverage Status, (*1)

FrontDesk

This is a PHP5 library that provides FrontDesk Core API functionality in your application., (*2)

Install

The easiest way to install FrontDesk Library is via composer., (*3)

Create the following composer.json file and run the php composer.phar install command to install it., (*4)

{
    "require": {
        "openclassrooms/front-desk": "*"
    }
}

```php <?php require 'vendor/autoload.php';, (*5)

use OpenClassrooms\FrontDesk\Services\PackService; use OpenClassrooms\FrontDesk\Services\PersonService;, (*6)

//do things, (*7)


## USAGE ### Instanciation If you plan to use FrontDesk in a Symfony2 project, check out the [FrontDeskBundle](https://github.com/OpenClassrooms/FrontDeskBundle). The bundle provides an easy configuration option for this library. ##### Factory The library provides a factory to create a client ```php use OpenClassrooms\FrontDesk\Client\Impl\ClientFactoryImpl; $factory = new ClientFactoryImpl();
 $client = $factory->createCoreApi('your_front_desk_server_name', 'your_token'); \\ $client = $factory->createReportingApi('your_front_desk_server_name', 'your_token');

ENDPOINTS

ENROLLMENT

Gateway

use OpenClassrooms\FrontDesk\Repository\PackRepository;

$enrollmentGateway = new EnrollmentRepository();
        
$enrollmentGateway->setReportingApiClient($client);
  

Services

Services Instanciation
use OpenClassrooms\FrontDesk\Services\Impl\EnrollmentServiceImpl;

$service = new EnrollmentServiceImpl();
$service->setEnrollmentGateway($enrollmentGateway);
Create Query
...
$service->query($field, $filter, $limit); 

PACK

Gateway

use OpenClassrooms\FrontDesk\Repository\PackRepository;

$packGateway = new PackRepository();
        
$packGateway->setCoreApiClient($client);
   

Builder

use OpenClassrooms\FrontDesk\Models\PersonBuilder;

$pack = $packBuilder
            ->create()
            ->withCount(5)
            ->withEndDate(new \DateTime())
            ->withPersonIds([21987])
            ->withStartDate(new \DateTime())
            ->build();

Services

Services Instanciation
use OpenClassrooms\FrontDesk\Services\Impl\PackServiceImpl;

$service = new PackServiceImpl();
$service->setPackGateway($packGateway);
Create Pack
...
$service->create($pack, $packProductId); 
Delete Pack by id
...
$service->deletePack($packId); 

PERSON

Gateway

use OpenClassrooms\FrontDesk\Repository\PersonRepository;

$personGateway = new PersonRepository();
        
$personGateway->setCoreApiClient($client);

$personGateway->setPersonBuilder(new PersonBuilderImpl());            

Builder

The library provides a builder to create a Person:, (*8)

use OpenClassrooms\FrontDesk\Models\PersonBuilder;

$person = $personBuilder->create()
                        ->withAddress('address')
                        ->withEmail('email')
                        ->withFirstName('first_name')
                        ->withJoinedAt(new \DateTime())
                        ->withLastName('last_name')
                        ...
                        ->build();

Services

Services Instanciation
use OpenClassrooms\FrontDesk\Services\Impl\PersonServiceImpl;

$service = new PersonServiceImpl();
$service->setPersonGateway($personGateway);
Post a person
$service->create($person);
Put a person
$service->update($person);
Get person by id
$service->find($personId);
Get all the people
$service->findAll($page);
Search person by query
$service->search($query);

PLAN

Gateway

Gateway

The library provides Gateway for a person, a pack, a plan and a visit:, (*9)

$planGateway = new PlanRepository();
        
$planGateway->setCoreApiClient($client);
 
$planGateway->setPlanBuilder(new PlanBuilderImpl());        

Services

Services Instanciation
$service = new PlanServiceImpl();
$service->setPlanGateway($planGateway);
Get Plans by person id
$service->getPlans($personId);

VISIT

Gateway

use OpenClassrooms\FrontDesk\Repository\VisitRepository;

$visitGateway = new VisitRepository();
        
$visitGateway->setCoreApiClient($client);
 
$visitGateway->setVisitBuilder(new VisitBuilderImpl());

Services

Services Instanciation
$service = new VisitServiceImpl();
$service->setVisitGateway($visitGateway);
Get Visit by person id
$service->getVisits($personId, $from, $to);
Delete Visit by id
$service->deleteVisit($visitId);

The Versions

20/11 2017

dev-master

9999999-dev

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

20/11 2017

v1.1.6

1.1.6.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

24/10 2017

dev-test_mentoring_prod_data

dev-test_mentoring_prod_data

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

11/05 2017

v1.1.5

1.1.5.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

05/05 2017

dev-add_primary_staff_member_in_person

dev-add_primary_staff_member_in_person

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

06/01 2017

v1.1.4

1.1.4.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

30/12 2016

v1.1.3

1.1.3.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

28/12 2016

v1.1.2

1.1.2.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

21/12 2016

v1.1.1

1.1.1.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

19/12 2016

v1.1.0

1.1.0.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

05/12 2016

v1.0.7

1.0.7.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

05/12 2016

v1.0.6

1.0.6.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

02/12 2016

v1.0.5

1.0.5.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

16/11 2016

v1.0.4

1.0.4.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

15/11 2016

v1.0.3

1.0.3.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

28/10 2016

v1.0.2

1.0.2.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

14/10 2016

v1.0.1

1.0.1.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot

05/10 2016

v1.0.0

1.0.0.0

Front Desk Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by OpenClassrooms
by Killian Herbunot