kanvas/guild

Kanvas Guild is a Customer relationship management package.

Maintainers

Details

github.com/bakaphp/guild

Source

Issues

Installs: 1 129

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:project

0.1.x-dev 2023-01-06 16:57 UTC

This package is auto-updated.

Last update: 2024-11-06 20:50:39 UTC


README

Guild

Guild is a Customer relationship management package that allows the user to manage his leads and deals, similar to a guild that manages its members and their assignments, as well as the reports and plans related to them.

Providing methods to manage and get leads and CRM related functions.

Methods

Leads

Create a new lead

/**
 * Create a new Lead
 *
 * @param UserInterface $user
 * @param string $title
 * @param ModelsStages $pipelineStage
 * @param LeadsRotationsAgents $agent
 * @param Organizations $organization
 * @param Types $leadType
 * @param Status $leadStatus
 * @param Source $leadSource
 * @param boolean $isDuplicate
 * @param string $description
 * @return ModelsLeads
 */

    $leads = Leads::create(
        $user,
        $title,
        $modelPipelineStage,
        $leadRotationsAgent,
        $organization,
        $leadType,
        $leadStatus,
        $leadSource,
        $isDuplicate,
        $descriptions
    );

Create a new Lead Attempt

$data = [
    'request' => 'Request Data',
    'ip' => '123.456.789',
    'header' => 'Request Header',
    'source' => 'Source',
    'public_key' => 'Key',
    'processed' => 0,
]

/**
 * Create a new lead attempt
 *
 * @param UserInterface $user
 * @param array $data
 * @param Leads|null $lead
 * @return ModelAttempts
 */
Leads::attempt($user, $data, $lead);

Update

// find a lead by id

$lead = Leads::getById(4, $user);
$lead->Title = 'new Title';
$lead->saveOrFail();

Get Leads

//Get all the leads
$page = 1;
$limit = 10;
$leads = Leads::getAll($user, $page, $limit);

//Get Leads by id
$leads = Leads::getById(4);

//Get leads by status
$leads = Leads::getByStatus(LeadStatus::LOSE, $user, $page, $limit);
$leads = Leads::getByStatus(LeadStatus::WIN, $user, $page, $limit);

Organizations

Create

//Create a new organization by an array of data
$organization = Organization::create($data, $user);

Update

$organization = Organization::getById(3, $user);
Organization::update($organization, $data);

OR

$organization = Organization::getById(3)->update($data);

Get

//Get Organization by its id
$organization = Organization::getById(3, $user);

//Get All organization
$page = 1;
$limit = 10;
$organization = Organization::getAll($user, $page, $limit);

Add Peoples to organization

//Get the people and the organization
$people = Peoples::getById(3);
$organization = Organization::getById(3, $user);

// Add a new people to an organization
Organization::addPeople($organization, $people);

Or

$organization = Organization::getById(3);
$organization->addPeople($people);

Get Peoples from an Organization

$organization = Organization::getById(3);
$organization->getPeoples();

Peoples

Create

$data = [
    'name' => 'Romeo',
    'email' => 'Romeo@mail.com'
];

$people = People::create($data, $user)

Update

$people = People::getById(1, $user);

$people->name = 'New juan';
$people->saveOrFail();

Or

$people = People::getById(1, $user)->update($data);

Create Contact

// @people People user data for the new contact
// @contactType
Contacts::createNewContact($people, $contactType, $value);

Update Contact

Deals

Create

$lead = Lead::getById(1, $user);
$newDeal = Deal::create($user, $lead)

Get by Lead

$lead = Lead::getById(1, $user);
$deal = $lead->getDeal();

Get

$deal = Deal::getById(2, $user); 
$page = 1;
$limit = 10;
$deal = Deal::getAll($user, $page, $limit);

Update

Deal::update(Deal::getById(2), $data);

Pipelines

Create

$pipelines = Pipelines::create($name, $entity, $user);

Get

$page = 1;
$limit = 10;
$pipelines = Pipelines::getAll($user, $page, $limit);

Or

$pipeline = Pipelines::getById($name);

Update

$pipeline = Pipelines::getById(1);
Pipelines::update($pipeline, $name);

Create Stage

// $pipeline Pipeline Object
// $name string
// $hasRotting boolean
// $rottingDays int
Pipelines::createStage($pipeline, $name, $hasRotting, $rottingDays);

Get Stage

$pipelineStage = Pipelines::getStageById(1);

Or

$pipelineStage = Pipelines::getStagesByPipeline($pipeline);

Update Stage

$pipelineStage = Pipelines::getStageById(1);
Pipelines::updateStage($pipelineStage, $data)

Rotations

Create

$pipelines = Rotations::create($name, $user);

Update

$rotation = Rotations::getById(1);
Rotations::update($rotation, $name);

Get

$rotation = Rotations::getById(1, $user);

$rotation = Rotation::getByName($name, $user);

Agents

Add

Agents::create($rotation, $user, $receiver, $percent, $hits);

Get Agents

Agents::getAllAgents($rotation, $page, $limit);

Agents::getAgentsFromRotation($rotation, $page, $limit);

Agents::getAgentById(2, $user);

Update Agent

$agent = Rotation::getAgentById(2, $user);
Rotations::update($agent, $data);

Get current agent rotation

Rotation::getAgent($rotation);

Activities

Create

$activity = Activities::create(
    $user,
    "Title",
    $startDate,
    $endDate,
    $lead,
    $activityType,
    $isComplete,
    $appId
);

Create Activity Type

$type = Activities::createType($user, $name, $description);

Update

$activityEdited = Activities::update($activity, $data);

Get

// Get activity by id
Activities::getById(1, $user);

// Get all activities
Activities::getAll($user, $page, $limit);

// Get leads activities
$lead = Leads::getById(1);

$lead->getActivities();