Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
BoundedContextDefinition
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getId
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 createRandom
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace Apie\Maker\BoundedContext\Resources;
4
5use Apie\Core\Attributes\CmsIcon;
6use Apie\Core\Attributes\FakeCount;
7use Apie\Core\Attributes\FakeMethod;
8use Apie\Core\Attributes\Internal;
9use Apie\Core\Identifiers\Identifier;
10use Apie\Core\Identifiers\Ulid;
11use Apie\Maker\BoundedContext\Identifiers\BoundedContextDefinitionIdentifier;
12use Faker\Generator;
13
14#[FakeCount(2)]
15#[FakeMethod('createRandom')]
16#[CmsIcon('fluent-mdl2:build-definition')]
17class BoundedContextDefinition implements \Apie\Core\Entities\EntityInterface
18{
19    private const EXAMPLE_NAMES = [
20        'usermanagement',
21        'customersupport',
22        'orderprocessing',
23        'paymentprocessing',
24        'inventorymanagement',
25        'productcatalog',
26        'shippinganddelivery',
27        'suppliermanagement',
28        'warehousemanagement',
29        'sales',
30        'marketing',
31        'advertising',
32        'customerrelationshipmanagement',
33        'subscriptionmanagement',
34        'billingandinvoicing',
35        'financialaccounting',
36        'expensetracking',
37        'humanresources',
38        'employeemanagement',
39        'projectmanagement',
40        'taskmanagement',
41        'teamcollaboration',
42        'legalcompliance',
43        'contractmanagement',
44        'riskmanagement',
45        'policymanagement',
46        'claimsprocessing',
47        'insurancemanagement',
48        'investmentmanagement',
49        'taxreporting',
50        'regulatorycompliance',
51        'eventplanning',
52        'resourcemanagement',
53        'documentmanagement',
54        'contentmanagement',
55        'filestorage',
56        'versioncontrol',
57        'auditlogging',
58        'configurationmanagement',
59        'systemmonitoring',
60        'userauthentication',
61        'accesscontrol',
62        'notificationservice',
63        'feedbackandreviews',
64        'customerengagement',
65        'loyaltyprograms',
66        'promotionsanddiscounts',
67        'surveymanagement',
68        'analyticsandreporting',
69        'businessintelligence',
70        'forecasting',
71        'budgeting',
72        'inventoryreplenishment',
73        'orderfulfillment',
74        'returnsmanagement',
75        'customeronboarding',
76        'supportticketing',
77        'issuetracking',
78        'servicedesk',
79        'complianceauditing',
80        'securitymanagement',
81        'qualityassurance',
82        'testingandvalidation',
83        'releasemanagement',
84        'continuousintegration',
85        'deploymentautomation',
86        'devops',
87        'itservicemanagement',
88        'incidentmanagement',
89        'problemmanagement',
90        'changemanagement',
91        'capacityplanning',
92        'assetmanagement',
93        'resourceallocation',
94        'supplieronboarding',
95        'procurement',
96        'contractnegotiation',
97        'vendormanagement',
98        'demandplanning',
99        'supplychainmanagement',
100        'productionscheduling',
101        'manufacturingexecution',
102        'qualitycontrol',
103        'maintenancemanagement',
104        'facilitiesmanagement',
105        'energymanagement',
106        'environmentalcompliance',
107        'sustainabilityreporting',
108        'customersuccess',
109        'partnermanagement',
110        'channelmanagement',
111        'salesoperations',
112        'leadgeneration',
113        'pipelinemanagement',
114        'accountmanagement'
115    ];
116    private BoundedContextDefinitionIdentifier $id;
117
118    public function __construct(public Identifier $name)
119    {
120        $this->id = BoundedContextDefinitionIdentifier::fromNameAndUlid($name, Ulid::createRandom());
121    }
122
123    public function getId(): BoundedContextDefinitionIdentifier
124    {
125        return $this->id;
126    }
127
128    #[Internal]
129    public static function createRandom(Generator $faker): static
130    {
131        return new static(new Identifier($faker->randomElement(self::EXAMPLE_NAMES)));
132    }
133}