Skip to content

Commit 88a1558

Browse files
committed
feat: source
1 parent c2558b2 commit 88a1558

File tree

136 files changed

+7181
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+7181
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Backendbase\Domain\IdentityAndAccess;
6+
7+
use Backendbase\Domain\IdentityAndAccess\User\Adapters\Persistence\Doctrine\IdentityAndAccessRepository as UserIdentityAndAccessRepositoryImp;
8+
use Backendbase\Domain\IdentityAndAccess\User\IdentityAndAccess as UserIdentityAndAccess;
9+
use Backendbase\Domain\IdentityAndAccess\User\IdentityAndAccessRepository as UserIdentityAndAccessRepository;
10+
use Backendbase\Domain\IdentityAndAccess\User\IdentityAndAccessService as UserIdentityAndAccessService;
11+
12+
class ServiceProvider implements \Backendbase\Shared\ServiceProvider
13+
{
14+
public static function getDefinitions(): iterable
15+
{
16+
return [
17+
UserIdentityAndAccessRepository::class => UserIdentityAndAccessRepositoryImp::class,
18+
UserIdentityAndAccessService::class => UserIdentityAndAccess::class,
19+
];
20+
}
21+
22+
public static function getEventSubscribers(): iterable
23+
{
24+
return [];
25+
}
26+
}
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Backendbase\Domain\IdentityAndAccess\User\Adapters\Persistence\Doctrine\Entity;
6+
7+
use Backendbase\Shared\Persistence\Doctrine\DoctrineEntity;
8+
use Backendbase\Shared\Persistence\DoctrineEntityMethods;
9+
use DateTimeImmutable;
10+
use Doctrine\DBAL\Types\Types;
11+
use Doctrine\ORM\Mapping\Column;
12+
use Doctrine\ORM\Mapping\Entity;
13+
use Doctrine\ORM\Mapping\GeneratedValue;
14+
use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
15+
use Doctrine\ORM\Mapping\Id;
16+
use Doctrine\ORM\Mapping\Index;
17+
use Doctrine\ORM\Mapping\PrePersist;
18+
use Doctrine\ORM\Mapping\Table;
19+
use Doctrine\ORM\Mapping\UniqueConstraint;
20+
21+
#[Entity]
22+
#[Table(name: 'contact_infos')]
23+
#[Index(columns:['type', 'contact_info', 'verification_code', 'is_verified', 'deleted_at'], name: 'contact_infos_search_idx')]
24+
#[UniqueConstraint(name: 'contact_infos_unq', columns: ['contact_info', 'deleted_at'])]
25+
#[HasLifecycleCallbacks]
26+
class ContactInfo implements DoctrineEntity
27+
{
28+
use DoctrineEntityMethods;
29+
30+
public const TABLE_NAME = 'contact_infos';
31+
public const VERIFIED = 1;
32+
public const NOT_VERIFIED = 0;
33+
34+
#[Id]
35+
#[Column(type: Types::BIGINT, options: ['unsigned' => true])]
36+
#[GeneratedValue]
37+
private int $id;
38+
39+
#[Column(type: Types::STRING, length: 32)]
40+
private string $type;
41+
42+
#[Column(name: 'contact_info', type: Types::STRING, length: 160)]
43+
private string $contactInfo;
44+
45+
#[Column(name: 'verification_code', type: Types::STRING, length: 16)]
46+
private string $verificationCode;
47+
48+
#[Column(name: 'is_verified', type: Types::INTEGER, length: 1, options: ['unsigned' => true, 'default' => 0])]
49+
private int $isVerified;
50+
51+
#[Column(name: 'updated_at', type: Types::DATETIME_IMMUTABLE, nullable: true)]
52+
private DateTimeImmutable $updatedAt;
53+
54+
#[Column(name: 'verified_at', type: Types::DATETIME_IMMUTABLE, nullable: true)]
55+
private DateTimeImmutable $verifiedAt;
56+
57+
#[Column(name: 'deleted_at', type: Types::DATETIME_IMMUTABLE, nullable: true)]
58+
private DateTimeImmutable $deletedAt;
59+
60+
#[Column(name: 'created_at', type: Types::DATETIME_IMMUTABLE)]
61+
private DateTimeImmutable $createdAt;
62+
63+
#[PrePersist]
64+
public function setCreatedAtValue(): void
65+
{
66+
$this->createdAt = new DateTimeImmutable();
67+
}
68+
69+
public function id(): int
70+
{
71+
return $this->id;
72+
}
73+
74+
public function setId(int $id): void
75+
{
76+
$this->id = $id;
77+
}
78+
79+
public function type(): string
80+
{
81+
return $this->type;
82+
}
83+
84+
public function setType(string $type): void
85+
{
86+
$this->type = $type;
87+
}
88+
89+
public function contactInfo(): string
90+
{
91+
return $this->contactInfo;
92+
}
93+
94+
public function setContactInfo(string $contactInfo): void
95+
{
96+
$this->contactInfo = $contactInfo;
97+
}
98+
99+
public function verificationCode(): string
100+
{
101+
return $this->verificationCode;
102+
}
103+
104+
public function setVerificationCode(string $verificationCode): void
105+
{
106+
$this->verificationCode = $verificationCode;
107+
}
108+
109+
public function isVerified(): int
110+
{
111+
return $this->isVerified;
112+
}
113+
114+
public function setIsVerified(int $isVerified): void
115+
{
116+
$this->isVerified = $isVerified;
117+
}
118+
119+
public function updatedAt(): DateTimeImmutable
120+
{
121+
return $this->updatedAt;
122+
}
123+
124+
public function setUpdatedAt(DateTimeImmutable $updatedAt): void
125+
{
126+
$this->updatedAt = $updatedAt;
127+
}
128+
129+
public function verifiedAt(): DateTimeImmutable
130+
{
131+
return $this->verifiedAt;
132+
}
133+
134+
public function setVerifiedAt(DateTimeImmutable $verifiedAt): void
135+
{
136+
$this->verifiedAt = $verifiedAt;
137+
}
138+
139+
public function deletedAt(): DateTimeImmutable
140+
{
141+
return $this->deletedAt;
142+
}
143+
144+
public function setDeletedAt(DateTimeImmutable|null $deletedAt): void
145+
{
146+
$this->deletedAt = $deletedAt;
147+
}
148+
149+
public function createdAt(): DateTimeImmutable
150+
{
151+
return $this->createdAt;
152+
}
153+
154+
public function setCreatedAt(DateTimeImmutable $createdAt): void
155+
{
156+
$this->createdAt = $createdAt;
157+
}
158+
}
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Backendbase\Domain\IdentityAndAccess\User\Adapters\Persistence\Doctrine\Entity;
6+
7+
use Backendbase\Shared\Persistence\Doctrine\DoctrineEntity;
8+
use Backendbase\Shared\Persistence\DoctrineEntityMethods;
9+
use DateTimeImmutable;
10+
use Doctrine\DBAL\Types\Types;
11+
use Doctrine\ORM\Mapping\Column;
12+
use Doctrine\ORM\Mapping\Entity;
13+
use Doctrine\ORM\Mapping\GeneratedValue;
14+
use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
15+
use Doctrine\ORM\Mapping\Id;
16+
use Doctrine\ORM\Mapping\Index;
17+
use Doctrine\ORM\Mapping\PrePersist;
18+
use Doctrine\ORM\Mapping\Table;
19+
use Doctrine\ORM\Mapping\UniqueConstraint;
20+
21+
#[Entity]
22+
#[Table(name: 'device_infos')]
23+
#[Index(columns:['user_id', 'app', 'deleted_at'], name: 'device_infos_token_idx')]
24+
#[UniqueConstraint(name: 'device_infos_unq', columns: ['device_token', 'app', 'deleted_at'])]
25+
#[HasLifecycleCallbacks]
26+
class DeviceInfo implements DoctrineEntity
27+
{
28+
use DoctrineEntityMethods;
29+
30+
public const TABLE_NAME = 'device_infos';
31+
32+
#[Id]
33+
#[Column(type: Types::BIGINT, options: ['unsigned' => true])]
34+
#[GeneratedValue]
35+
private int $id;
36+
37+
#[Column(name: 'user_id', type: Types::BIGINT, options: ['unsigned' => true])]
38+
private int $userId;
39+
40+
#[Column(name: 'device_token', type: Types::STRING, length: 255)]
41+
private string $deviceToken;
42+
#[Column(name: 'app', type: Types::STRING, length: 16, options: ['default' => 'mobile'])]
43+
private string $app;
44+
#[Column(name: 'device_type', type: Types::STRING, length: 16)]
45+
private string $deviceType;
46+
#[Column(name: 'device_brand', type: Types::STRING, length: 16)]
47+
private string $deviceBrand;
48+
#[Column(name: 'device_model', type: Types::STRING, length: 32)]
49+
private string $deviceModel;
50+
#[Column(name: 'device_os', type: Types::STRING, length: 16)]
51+
private string $deviceOs;
52+
#[Column(name: 'device_os_version', type: Types::STRING, length: 8)]
53+
private string $deviceOsVersion;
54+
#[Column(name: 'is_active', type: Types::SMALLINT, options: ['unsigned' => true])]
55+
private int $isActive;
56+
#[Column(name: 'deleted_at', type: Types::DATETIME_IMMUTABLE, nullable: true)]
57+
private DateTimeImmutable $deletedAt;
58+
59+
#[Column(name: 'created_at', type: Types::DATETIME_IMMUTABLE)]
60+
private DateTimeImmutable $createdAt;
61+
62+
#[PrePersist]
63+
public function setCreatedAtValue(): void
64+
{
65+
$this->createdAt = new DateTimeImmutable();
66+
}
67+
68+
public function id(): int
69+
{
70+
return $this->id;
71+
}
72+
73+
public function setId(int $id): void
74+
{
75+
$this->id = $id;
76+
}
77+
78+
public function userId(): int
79+
{
80+
return $this->userId;
81+
}
82+
83+
public function setUserId(int $userId): void
84+
{
85+
$this->userId = $userId;
86+
}
87+
88+
public function deviceToken(): string
89+
{
90+
return $this->deviceToken;
91+
}
92+
93+
public function app(): string
94+
{
95+
return $this->app;
96+
}
97+
98+
public function setApp(string $app): void
99+
{
100+
$this->app = $app;
101+
}
102+
103+
public function setDeviceToken(string $deviceToken): void
104+
{
105+
$this->deviceToken = $deviceToken;
106+
}
107+
108+
public function deviceType(): string
109+
{
110+
return $this->deviceType;
111+
}
112+
113+
public function setDeviceType(string $deviceType): void
114+
{
115+
$this->deviceType = $deviceType;
116+
}
117+
118+
public function deviceBrand(): string
119+
{
120+
return $this->deviceBrand;
121+
}
122+
123+
public function setDeviceBrand(string $deviceBrand): void
124+
{
125+
$this->deviceBrand = $deviceBrand;
126+
}
127+
128+
public function deviceModel(): string
129+
{
130+
return $this->deviceModel;
131+
}
132+
133+
public function setDeviceModel(string $deviceModel): void
134+
{
135+
$this->deviceModel = $deviceModel;
136+
}
137+
138+
public function deviceOs(): string
139+
{
140+
return $this->deviceOs;
141+
}
142+
143+
public function setDeviceOs(string $deviceOs): void
144+
{
145+
$this->deviceOs = $deviceOs;
146+
}
147+
148+
public function deviceOsVersion(): string
149+
{
150+
return $this->deviceOsVersion;
151+
}
152+
153+
public function setDeviceOsVersion(string $deviceOsVersion): void
154+
{
155+
$this->deviceOsVersion = $deviceOsVersion;
156+
}
157+
158+
public function isActive(): int
159+
{
160+
return $this->isActive;
161+
}
162+
163+
public function setIsActive(int $isActive): void
164+
{
165+
$this->isActive = $isActive;
166+
}
167+
168+
public function deletedAt(): DateTimeImmutable
169+
{
170+
return $this->deletedAt;
171+
}
172+
173+
public function setDeletedAt(DateTimeImmutable $deletedAt): void
174+
{
175+
$this->deletedAt = $deletedAt;
176+
}
177+
178+
public function createdAt(): DateTimeImmutable
179+
{
180+
return $this->createdAt;
181+
}
182+
183+
public function setCreatedAt(DateTimeImmutable $createdAt): void
184+
{
185+
$this->createdAt = $createdAt;
186+
}
187+
}

0 commit comments

Comments
 (0)