Skip to content

Commit

Permalink
Add Bitrix24Account Events and update documentation
Browse files Browse the repository at this point in the history
Signed-off-by: mesilov <mesilov.maxim@gmail.com>
  • Loading branch information
mesilov committed Jul 10, 2024
1 parent 93bf2aa commit a362fa3
Showing 9 changed files with 173 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -64,3 +64,31 @@ stateDiagram-v2
- `findByDomain(string $domainUrl, ?Bitrix24AccountStatus $status = null, ?bool $isAdmin = null): array`
- use case ChangeDomainUrl
- `findOneAdminByMemberId(string $memberId): ?Bitrix24AccountInterface`

## Events
```mermaid
%%{init: { 'logLevel': 'debug', 'theme': 'neutral' } }%%
timeline
title Bitrix24 account timeline
section Application installation period
Create new account when install start : Bitrix24 Account Created Event
Activate account if install finish : Bitrix24 Account Application Installed Event
Block Account if install failure : Bitrix24 Account Blocked Event
section Application active period
Change domain URL if portal renamed : Bitrix24 Account DomainUrl Changed Event
Block Account : Bitrix24 Account Blocked Event
Unblock Account : Bitrix24 Account Unblocked Event
Update Application Version : Bitrix24 Account Application Version Updated Event
section Application uninstall period
Administrator Uninstalled Application : Bitrix24 Account Application Uninstalled Event
Delete account : Bitrix24 Account Deleted Event
```

- `Bitrix24AccountCreatedEvent` — event is triggered when a new Bitrix24 account is created. The account is initially in a `New` state, and the installation process has begun.
- `Bitrix24AccountApplicationInstalledEvent` — event is triggered when an application is successfully installed. It signifies that account finish installation flow.
- `Bitrix24AccountDomainUrlChangedEvent` — event is triggered when the domain URL associated with a Bitrix24 account is modified.
- `Bitrix24AccountBlockedEvent` — event occurs when a Bitrix24 account is blocked. This could be due to various reasons such as lost auth token, policy violations, or at the request of the account owner.
- `Bitrix24AccountUnblockedEvent` — event is triggered when a previously blocked Bitrix24 account is unblocked and restored to normal functioning.
- `Bitrix24AccountApplicationVersionUpdatedEvent` — event is triggered when an installed application within a Bitrix24 account is updated to a newer version. It signifies that the application has been successfully upgraded with new features or fixes.
- `Bitrix24AccountApplicationUninstalledEvent` — event is triggered when an application uninstalled from a Bitrix24 account.
- `Bitrix24AccountDeletedEvent` — event is triggered when a Bitrix24 account is permanently deleted. This likely represents the final stage in an account's lifecycle and might involve data removal and cleanup processes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events;

use Carbon\CarbonImmutable;
use Symfony\Component\Uid\Uuid;
use Symfony\Contracts\EventDispatcher\Event;

class Bitrix24AccountApplicationInstalledEvent extends Event
{
public function __construct(
public readonly Uuid $bitrix24AccountId,
public readonly CarbonImmutable $timestamp)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events;

use Carbon\CarbonImmutable;
use Symfony\Component\Uid\Uuid;
use Symfony\Contracts\EventDispatcher\Event;

class Bitrix24AccountApplicationUninstalledEvent extends Event
{
public function __construct(
public readonly Uuid $bitrix24AccountId,
public readonly CarbonImmutable $timestamp
)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events;

use Carbon\CarbonImmutable;
use Symfony\Component\Uid\Uuid;
use Symfony\Contracts\EventDispatcher\Event;

class Bitrix24AccountApplicationVersionUpdatedEvent extends Event
{
public function __construct(
public readonly Uuid $bitrix24AccountId,
public readonly CarbonImmutable $timestamp)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events;

use Carbon\CarbonImmutable;
use Symfony\Component\Uid\Uuid;
use Symfony\Contracts\EventDispatcher\Event;

class Bitrix24AccountBlockedEvent extends Event
{
public function __construct(
public readonly Uuid $bitrix24AccountId,
public readonly CarbonImmutable $timestamp)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events;

use Carbon\CarbonImmutable;
use Symfony\Component\Uid\Uuid;
use Symfony\Contracts\EventDispatcher\Event;

class Bitrix24AccountCreatedEvent extends Event
{
public function __construct(
public readonly Uuid $bitrix24AccountId,
public readonly CarbonImmutable $timestamp)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events;

use Carbon\CarbonImmutable;
use Symfony\Component\Uid\Uuid;
use Symfony\Contracts\EventDispatcher\Event;

class Bitrix24AccountDeletedEvent extends Event
{
public function __construct(
public readonly Uuid $bitrix24AccountId,
public readonly CarbonImmutable $timestamp)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events;

use Carbon\CarbonImmutable;
use Symfony\Component\Uid\Uuid;
use Symfony\Contracts\EventDispatcher\Event;

class Bitrix24AccountDomainUrlChangedEvent extends Event
{
public function __construct(
public readonly Uuid $bitrix24AccountId,
public readonly CarbonImmutable $timestamp)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events;

use Carbon\CarbonImmutable;
use Symfony\Component\Uid\Uuid;
use Symfony\Contracts\EventDispatcher\Event;

class Bitrix24AccountUnblockedEvent extends Event
{
public function __construct(
public readonly Uuid $bitrix24AccountId,
public readonly CarbonImmutable $timestamp)
{
}
}

0 comments on commit a362fa3

Please sign in to comment.