Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Clubphp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Clubphp
Commits
4461e7e6
Commit
4461e7e6
authored
Apr 28, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xdsgjdfdhf
parent
6e46794f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
252 additions
and
22 deletions
+252
-22
ChildController.php
app/Modules/Children/Controllers/ChildController.php
+16
-14
PricingEngine.php
app/Modules/Pricing/Services/PricingEngine.php
+2
-2
SpouseController.php
app/Modules/Spouses/Controllers/SpouseController.php
+4
-3
Spouse.php
app/Modules/Spouses/Models/Spouse.php
+5
-3
Phase_40_001_seed_master_document_compliance.php
...se/seeds/Phase_40_001_seed_master_document_compliance.php
+225
-0
No files found.
app/Modules/Children/Controllers/ChildController.php
View file @
4461e7e6
...
@@ -11,6 +11,7 @@ use App\Core\EventBus;
...
@@ -11,6 +11,7 @@ use App\Core\EventBus;
use
App\Modules\Children\Models\Child
;
use
App\Modules\Children\Models\Child
;
use
App\Modules\Children\Services\ChildFeeCalculator
;
use
App\Modules\Children\Services\ChildFeeCalculator
;
use
App\Modules\Members\Services\NationalIdParser
;
use
App\Modules\Members\Services\NationalIdParser
;
use
App\Modules\Rules\Services\RuleEngine
;
class
ChildController
extends
Controller
class
ChildController
extends
Controller
...
@@ -83,31 +84,32 @@ class ChildController extends Controller
...
@@ -83,31 +84,32 @@ class ChildController extends Controller
$childAge
=
(
int
)
(
$data
[
'age_years'
]
??
0
);
$childAge
=
(
int
)
(
$data
[
'age_years'
]
??
0
);
// Children 16+ require NID
$nidRequiredAge
=
(
int
)
(
RuleEngine
::
getValue
(
'CHILD_NID_REQUIRED_AGE'
,
'value'
)
??
16
);
if
(
$childAge
>=
16
&&
$nid
===
''
)
{
if
(
$childAge
>=
$nidRequiredAge
&&
$nid
===
''
)
{
$errors
[]
=
'الأبناء فوق
16
سنة يجب أن يكون لديهم رقم قومي'
;
$errors
[]
=
'الأبناء فوق
'
.
$nidRequiredAge
.
'
سنة يجب أن يكون لديهم رقم قومي'
;
}
}
// Age gap validation
$minAgeGap
=
(
int
)
(
RuleEngine
::
getValue
(
'CHILD_MIN_AGE_GAP'
,
'value'
)
??
15
);
$maxAgeGap
=
(
int
)
(
RuleEngine
::
getValue
(
'CHILD_MAX_AGE_GAP'
,
'value'
)
??
60
);
if
(
!
empty
(
$data
[
'date_of_birth'
])
&&
!
empty
(
$member
[
'date_of_birth'
]))
{
if
(
!
empty
(
$data
[
'date_of_birth'
])
&&
!
empty
(
$member
[
'date_of_birth'
]))
{
$memberAge
=
age_from_dob
(
$member
[
'date_of_birth'
]);
$memberAge
=
age_from_dob
(
$member
[
'date_of_birth'
]);
$ageGap
=
$memberAge
[
'years'
]
-
$childAge
;
$ageGap
=
$memberAge
[
'years'
]
-
$childAge
;
if
(
$ageGap
<
15
)
{
if
(
$ageGap
<
$minAgeGap
)
{
$errors
[]
=
'الحد الأدنى لفرق السن بين العضو والابن
15
سنة'
;
$errors
[]
=
'الحد الأدنى لفرق السن بين العضو والابن
'
.
$minAgeGap
.
'
سنة'
;
}
}
if
(
$ageGap
>
60
)
{
if
(
$ageGap
>
$maxAgeGap
)
{
$errors
[]
=
'الحد الأقصى لفرق السن بين العضو والابن
60
سنة'
;
$errors
[]
=
'الحد الأقصى لفرق السن بين العضو والابن
'
.
$maxAgeGap
.
'
سنة'
;
}
}
}
}
// Stepchild age check
$stepchildMaxAge
=
(
int
)
(
RuleEngine
::
getValue
(
'STEPCHILD_MAX_AGE'
,
'value'
)
??
25
);
if
((
$data
[
'relationship'
]
??
''
)
===
'stepchild'
&&
$childAge
>=
25
)
{
$childMaxAge
=
(
int
)
(
RuleEngine
::
getValue
(
'CHILD_MAX_AGE'
,
'value'
)
??
RuleEngine
::
getValue
(
'CHILD_AUTO_DELETE_AGE'
,
'value'
)
??
25
);
$errors
[]
=
'أبناء الزوج/الزوجة لا يمكن أن يتجاوز عمرهم 25 سنة'
;
if
((
$data
[
'relationship'
]
??
''
)
===
'stepchild'
&&
$childAge
>=
$stepchildMaxAge
)
{
$errors
[]
=
'أبناء الزوج/الزوجة لا يمكن أن يتجاوز عمرهم '
.
$stepchildMaxAge
.
' سنة'
;
}
}
// Check age 25+ not accepted
if
(
$childAge
>=
$childMaxAge
&&
(
$data
[
'relationship'
]
??
''
)
!==
'stepchild'
)
{
if
(
$childAge
>=
25
&&
(
$data
[
'relationship'
]
??
''
)
!==
'stepchild'
)
{
$errors
[]
=
'لا يمكن إضافة أبناء فوق '
.
$childMaxAge
.
' سنة'
;
$errors
[]
=
'لا يمكن إضافة أبناء فوق 25 سنة'
;
}
}
if
(
!
empty
(
$errors
))
{
if
(
!
empty
(
$errors
))
{
...
...
app/Modules/Pricing/Services/PricingEngine.php
View file @
4461e7e6
...
@@ -38,8 +38,8 @@ final class PricingEngine
...
@@ -38,8 +38,8 @@ final class PricingEngine
public
static
function
calculateChildFee
(
string
$membershipValue
,
int
$childAge
,
int
$childOrder
)
:
array
public
static
function
calculateChildFee
(
string
$membershipValue
,
int
$childAge
,
int
$childOrder
)
:
array
{
{
$maxIncluded
=
RuleEngine
::
getValue
(
'CHILD_INCLUDED_MAX_COUNT'
,
'value'
)
??
3
;
$maxIncluded
=
(
int
)
(
RuleEngine
::
getValue
(
'INITIAL_FREE_CHILDREN_COUNT'
,
'value'
)
??
RuleEngine
::
getValue
(
'CHILD_INCLUDED_MAX_COUNT'
,
'value'
)
??
2
)
;
$maxIncludedAge
=
RuleEngine
::
getValue
(
'CHILD_INCLUDED_MAX_AGE'
,
'value'
)
??
18
;
$maxIncludedAge
=
(
int
)
(
RuleEngine
::
getValue
(
'CHILD_INCLUDED_MAX_AGE'
,
'value'
)
??
18
)
;
if
(
$childAge
<
$maxIncludedAge
&&
$childOrder
<=
$maxIncluded
)
{
if
(
$childAge
<
$maxIncludedAge
&&
$childOrder
<=
$maxIncluded
)
{
return
[
'fee'
=>
'0.00'
,
'rule_applied'
=>
'included'
,
'percentage'
=>
'0.00'
,
'classification'
=>
'included'
];
return
[
'fee'
=>
'0.00'
,
'rule_applied'
=>
'included'
,
'percentage'
=>
'0.00'
,
'classification'
=>
'included'
];
...
...
app/Modules/Spouses/Controllers/SpouseController.php
View file @
4461e7e6
...
@@ -11,6 +11,7 @@ use App\Core\EventBus;
...
@@ -11,6 +11,7 @@ use App\Core\EventBus;
use
App\Modules\Spouses\Models\Spouse
;
use
App\Modules\Spouses\Models\Spouse
;
use
App\Modules\Spouses\Services\SpouseFeeCalculator
;
use
App\Modules\Spouses\Services\SpouseFeeCalculator
;
use
App\Modules\Members\Services\NationalIdParser
;
use
App\Modules\Members\Services\NationalIdParser
;
use
App\Modules\Rules\Services\RuleEngine
;
class
SpouseController
extends
Controller
class
SpouseController
extends
Controller
...
@@ -122,9 +123,9 @@ class SpouseController extends Controller
...
@@ -122,9 +123,9 @@ class SpouseController extends Controller
$data
[
'age_months'
]
=
$age
[
'months'
];
$data
[
'age_months'
]
=
$age
[
'months'
];
}
}
// ── Minimum age check (18+) ──
$spouseMinAge
=
(
int
)
(
RuleEngine
::
getValue
(
'SPOUSE_MIN_AGE'
,
'value'
)
??
18
);
if
((
int
)
(
$data
[
'age_years'
]
??
0
)
<
18
)
{
if
((
int
)
(
$data
[
'age_years'
]
??
0
)
<
$spouseMinAge
)
{
$errors
[]
=
'الحد الأدنى للسن
18
سنة'
;
$errors
[]
=
'الحد الأدنى للسن
'
.
$spouseMinAge
.
'
سنة'
;
}
}
if
(
!
empty
(
$errors
))
{
if
(
!
empty
(
$errors
))
{
...
...
app/Modules/Spouses/Models/Spouse.php
View file @
4461e7e6
...
@@ -5,6 +5,7 @@ namespace App\Modules\Spouses\Models;
...
@@ -5,6 +5,7 @@ namespace App\Modules\Spouses\Models;
use
App\Core\Model
;
use
App\Core\Model
;
use
App\Core\App
;
use
App\Core\App
;
use
App\Modules\Rules\Services\RuleEngine
;
class
Spouse
extends
Model
class
Spouse
extends
Model
{
{
...
@@ -109,9 +110,10 @@ class Spouse extends Model
...
@@ -109,9 +110,10 @@ class Spouse extends Model
*/
*/
public
static
function
getMaxSpouses
(
string
$memberGender
)
:
int
public
static
function
getMaxSpouses
(
string
$memberGender
)
:
int
{
{
// Female member: max 1 husband
if
(
$memberGender
===
'female'
)
{
// Male member: max 4 wives (as per regulations)
return
(
int
)
(
RuleEngine
::
getValue
(
'MAX_SPOUSES_FEMALE_MEMBER'
,
'value'
)
??
1
);
return
$memberGender
===
'female'
?
1
:
4
;
}
return
(
int
)
(
RuleEngine
::
getValue
(
'MAX_SPOUSES_MALE_MEMBER'
,
'value'
)
??
4
);
}
}
/**
/**
...
...
database/seeds/Phase_40_001_seed_master_document_compliance.php
0 → 100644
View file @
4461e7e6
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment