Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 76ec8d5728 | |||
| 618296f0c1 | |||
| b9572a7698 | |||
| c7f67da9bf | |||
| ed95286050 |
@@ -0,0 +1,60 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
phpunit:
|
||||
name: PHPUnit
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mariadb:10.11
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: alrahma_test
|
||||
MYSQL_USER: alrahma
|
||||
MYSQL_PASSWORD: alrahma
|
||||
ports:
|
||||
- 3306:3306
|
||||
options: >-
|
||||
--health-cmd="mariadb-admin ping -h 127.0.0.1 -uroot -proot"
|
||||
--health-interval=10s
|
||||
--health-timeout=5s
|
||||
--health-retries=10
|
||||
|
||||
env:
|
||||
GIT_SSL_NO_VERIFY: 'true'
|
||||
CI_ENVIRONMENT: testing
|
||||
database.tests.hostname: 127.0.0.1
|
||||
database.tests.database: alrahma_test
|
||||
database.tests.username: alrahma
|
||||
database.tests.password: alrahma
|
||||
database.tests.DBDriver: MySQLi
|
||||
database.tests.DBPrefix: ''
|
||||
database.tests.port: 3306
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.2'
|
||||
extensions: dom, gd, intl, mbstring, mysqli, zip
|
||||
coverage: none
|
||||
|
||||
- name: Validate Composer config
|
||||
run: composer validate --no-check-publish --strict
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --no-interaction --prefer-dist --no-progress
|
||||
|
||||
- name: Run tests
|
||||
run: composer test
|
||||
@@ -1069,12 +1069,14 @@ $routes->match(['get', 'post'], 'whatsapp/update-membership', 'View\WhatsappCont
|
||||
|
||||
|
||||
//Attendance
|
||||
$routes->get('admin/teacher-attendance', 'View\AttendanceController::index', ['filter' => 'auth:admin']);
|
||||
$routes->post('admin/teacher-attendance/save', 'View\AttendanceController::save', ['filter' => 'auth:admin']);
|
||||
$staffAttendanceAccess = 'auth:admin|administrator|administrative staff|principal|vice principal';
|
||||
|
||||
$routes->get('admin/teacher-attendance', 'View\AttendanceController::index', ['filter' => $staffAttendanceAccess]);
|
||||
$routes->post('admin/teacher-attendance/save', 'View\AttendanceController::save', ['filter' => $staffAttendanceAccess]);
|
||||
// NEW: monthly overview (all sections)
|
||||
$routes->get('admin/teacher-attendance/month', 'View\AttendanceController::month', ['filter' => 'auth:admin']);
|
||||
$routes->get('admin/teacher-attendance/month.csv', 'View\AttendanceController::monthCsv', ['filter' => 'auth:admin']);
|
||||
$routes->get('api/admin/teacher-attendance/month', 'View\AttendanceController::monthData', ['filter' => 'auth:admin']);
|
||||
$routes->get('admin/teacher-attendance/month', 'View\AttendanceController::month', ['filter' => $staffAttendanceAccess]);
|
||||
$routes->get('admin/teacher-attendance/month.csv', 'View\AttendanceController::monthCsv', ['filter' => $staffAttendanceAccess]);
|
||||
$routes->get('api/admin/teacher-attendance/month', 'View\AttendanceController::monthData', ['filter' => $staffAttendanceAccess]);
|
||||
|
||||
|
||||
$routes->post('attendance/record', 'View\AttendanceTrackingController::record');
|
||||
|
||||
@@ -8,6 +8,10 @@ class AddBatchNumberToReimbursements extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
if (! $this->db->tableExists('reimbursements') || $this->db->fieldExists('batch_number', 'reimbursements')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$fields = [
|
||||
'batch_number' => [
|
||||
'type' => 'INT',
|
||||
@@ -24,7 +28,8 @@ class AddBatchNumberToReimbursements extends Migration
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn('reimbursements', 'batch_number');
|
||||
if ($this->db->tableExists('reimbursements') && $this->db->fieldExists('batch_number', 'reimbursements')) {
|
||||
$this->forge->dropColumn('reimbursements', 'batch_number');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+20
-12
@@ -8,25 +8,33 @@ class AddYearlyBatchNumberToReimbursementBatches extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$fields = [
|
||||
'yearly_batch_number' => [
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => true,
|
||||
'default' => 0,
|
||||
'null' => false,
|
||||
'after' => 'title',
|
||||
],
|
||||
];
|
||||
if (! $this->db->tableExists('reimbursement_batches')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->forge->addColumn('reimbursement_batches', $fields);
|
||||
if (! $this->db->fieldExists('yearly_batch_number', 'reimbursement_batches')) {
|
||||
$fields = [
|
||||
'yearly_batch_number' => [
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => true,
|
||||
'default' => 0,
|
||||
'null' => false,
|
||||
'after' => 'title',
|
||||
],
|
||||
];
|
||||
|
||||
$this->forge->addColumn('reimbursement_batches', $fields);
|
||||
}
|
||||
|
||||
$this->fillExistingBatchNumbers();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn('reimbursement_batches', 'yearly_batch_number');
|
||||
if ($this->db->tableExists('reimbursement_batches') && $this->db->fieldExists('yearly_batch_number', 'reimbursement_batches')) {
|
||||
$this->forge->dropColumn('reimbursement_batches', 'yearly_batch_number');
|
||||
}
|
||||
}
|
||||
|
||||
private function fillExistingBatchNumbers(): void
|
||||
|
||||
@@ -8,6 +8,10 @@ class CreateReimbursementBatchAdminFiles extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
if ($this->db->tableExists('reimbursement_batch_admin_files')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$fields = [
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
|
||||
Reference in New Issue
Block a user