Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
327 commits
Select commit Hold shift + click to select a range
4c67da3
update
dnhdruk Jul 7, 2025
ba915fe
update
dnhdruk Jul 7, 2025
cfdaf7c
update
dnhdruk Jul 7, 2025
36fb75b
update
dnhdruk Jul 7, 2025
f9c777a
update
dnhdruk Jul 7, 2025
39aa661
update
dnhdruk Jul 7, 2025
a7be9e9
feat(SOURSD-1301): new route for org affiliations (#354)
calmacx Jul 8, 2025
430b8a7
Merge remote-tracking branch 'origin' into fix/REGISTRY-1462
calmacx Jul 8, 2025
50cba80
update
dnhdruk Jul 8, 2025
e0f9434
fix for getting spawing emails working
calmacx Jul 8, 2025
4701942
update
dnhdruk Jul 8, 2025
1caaac5
update
dnhdruk Jul 8, 2025
9b01089
fix for past/active
calmacx Jul 8, 2025
653ef41
remove PHO if no others
calmacx Jul 8, 2025
81c3811
update
dnhdruk Jul 8, 2025
94aa6dc
update
dnhdruk Jul 8, 2025
f40bff1
update
dnhdruk Jul 8, 2025
720036e
update
dnhdruk Jul 8, 2025
a909432
update
dnhdruk Jul 8, 2025
514aca7
update
dnhdruk Jul 8, 2025
f47620e
fix(SOURSD-1568): Fix filtering on dates (#357)
calmacx Jul 8, 2025
a1199c0
fix(SOURSD-1592): fix for getting spawing emails working again (#356)
calmacx Jul 8, 2025
efb9393
add training check observer
calmacx Jul 7, 2025
802b650
add a comment
calmacx Jul 7, 2025
c7b9c82
add training observer
calmacx Jul 7, 2025
27a5a09
new route for org affiliations
calmacx Jul 7, 2025
f10132f
update swagger
calmacx Jul 7, 2025
13dc801
fix for past/active
calmacx Jul 8, 2025
9269058
fix for getting spawing emails working
calmacx Jul 8, 2025
886904a
update
dnhdruk Jul 4, 2025
d31b49c
update
dnhdruk Jul 8, 2025
1bed600
update
dnhdruk Jul 8, 2025
a7231dc
update
dnhdruk Jul 8, 2025
fc94d34
update
dnhdruk Jul 8, 2025
3f068a8
update
dnhdruk Jul 8, 2025
41c0bc2
update
dnhdruk Jul 8, 2025
22d85b5
fix(SOURSD-1566): filter project users (#359)
peter-hammans Jul 8, 2025
994de81
add training check observer
calmacx Jul 7, 2025
0f1cbd3
fix(SOURSD-1566): filter project users (#359)
peter-hammans Jul 8, 2025
2dac15d
update
dnhdruk Jul 4, 2025
a859476
add training check observer
calmacx Jul 7, 2025
844bb5e
update
dnhdruk Jul 8, 2025
b0df6f6
fix(SOURSD-1577): filter (#360)
peter-hammans Jul 8, 2025
0e93a1a
update
dnhdruk Jul 8, 2025
8f78184
add training check observer
calmacx Jul 7, 2025
bdf80c6
fix(SOURSD-1577): filter (#360)
peter-hammans Jul 8, 2025
89ebc8a
update
dnhdruk Jul 4, 2025
a27709a
add training check observer
calmacx Jul 7, 2025
2f1b7e8
update
dnhdruk Jul 4, 2025
fdab85f
add training check observer
calmacx Jul 7, 2025
1ad0e5a
update
dnhdruk Jul 8, 2025
16ef611
update
dnhdruk Jul 8, 2025
7d73e23
update
dnhdruk Jul 8, 2025
7752796
update
dnhdruk Jul 8, 2025
30590b4
update
dnhdruk Jul 8, 2025
ffa6ab8
fix(SOURSD-1571): remove PHO if no others on the project with that af…
calmacx Jul 8, 2025
4353ef7
add training check observer
calmacx Jul 7, 2025
3073e6f
remove PHO if no others
calmacx Jul 8, 2025
d115f62
update
dnhdruk Jul 4, 2025
3263c34
update
dnhdruk Jul 4, 2025
9ad61db
update
dnhdruk Jul 7, 2025
e51fb47
add training check observer
calmacx Jul 7, 2025
ea4aea4
update
dnhdruk Jul 4, 2025
9dd2de0
add training check observer
calmacx Jul 7, 2025
8577939
add training check observer
calmacx Jul 7, 2025
e755f86
add training check observer
calmacx Jul 7, 2025
bed6473
update
dnhdruk Jul 4, 2025
c39db01
add training check observer
calmacx Jul 7, 2025
ab6d9ad
update
dnhdruk Jul 8, 2025
36c32a2
update
dnhdruk Jul 8, 2025
6b738cc
update
dnhdruk Jul 8, 2025
46e5b4f
update
dnhdruk Jul 8, 2025
712215a
update
dnhdruk Jul 8, 2025
9beaca5
update
calmacx Jul 9, 2025
4783a12
update code
calmacx Jul 9, 2025
7b0e875
fix tests
calmacx Jul 9, 2025
2a8936b
fix(SOURSD-1478): update completion upon seeding.. (#361)
calmacx Jul 9, 2025
4c402f6
fix(SOURSD-1462): Fixes for getting organisation users (#355)
calmacx Jul 9, 2025
c456e31
update
dnhdruk Jul 9, 2025
76a21c6
temporarily fixing
calmacx Jul 9, 2025
429aaa2
update test
calmacx Jul 9, 2025
dc735e7
fix for adding contacts
calmacx Jul 9, 2025
7cec5a8
remove dump
calmacx Jul 9, 2025
7bac89e
forgot to add file
calmacx Jul 9, 2025
1634e66
fix test
calmacx Jul 9, 2025
5347699
fix
calmacx Jul 9, 2025
8eccb7f
update
dnhdruk Jul 9, 2025
655868b
update
dnhdruk Jul 9, 2025
a74698c
update
dnhdruk Jul 9, 2025
3536d86
update
dnhdruk Jul 9, 2025
8ca383b
update
dnhdruk Jul 9, 2025
a888cc5
fix(SOURSD-1563): fix for adding contacts (#362)
calmacx Jul 9, 2025
5c3f810
Organisations | Profile | Data security compliance - upload and downl…
dnhdruk Jul 10, 2025
a74cd3f
update
dnhdruk Jul 10, 2025
e292c1f
update
dnhdruk Jul 10, 2025
6e8ec09
fix(SOURSD-1490): Remove old rules and change action logs (#363)
calmacx Jul 10, 2025
829f099
feat(SOURSD-1585): Organisations | Profile | Data security compliance…
dnhdruk Jul 10, 2025
8769e94
feat(SOURSD-1590): filter by affiliation status (#364)
peter-hammans Jul 11, 2025
f2af588
update
dnhdruk Jul 11, 2025
30374ad
update
dnhdruk Jul 11, 2025
151cea5
update
dnhdruk Jul 11, 2025
ad04220
update
dnhdruk Jul 11, 2025
8d66c0e
test-for-memory-leaks-rto
dnhdruk Jul 4, 2025
7f1c33a
update
dnhdruk Jul 4, 2025
9de55f1
update
dnhdruk Jul 4, 2025
c581a21
update
dnhdruk Jul 4, 2025
8d0c68d
update
dnhdruk Jul 4, 2025
ab10933
update
dnhdruk Jul 4, 2025
d6d8efe
update
dnhdruk Jul 4, 2025
8d1693e
update
dnhdruk Jul 4, 2025
da84825
update
dnhdruk Jul 4, 2025
6ae0067
update
dnhdruk Jul 4, 2025
8eda8c0
update
dnhdruk Jul 4, 2025
4d549be
update
dnhdruk Jul 4, 2025
741b9f9
update
dnhdruk Jul 4, 2025
65ac933
update
dnhdruk Jul 4, 2025
4676f1e
update
dnhdruk Jul 4, 2025
d9d113a
update
dnhdruk Jul 4, 2025
e184311
update
dnhdruk Jul 7, 2025
9beb7c5
update
dnhdruk Jul 7, 2025
f669e1d
update
dnhdruk Jul 7, 2025
7f2daf3
update
dnhdruk Jul 7, 2025
38f2c4a
update
dnhdruk Jul 7, 2025
70bebc6
update
dnhdruk Jul 7, 2025
456aa67
update
dnhdruk Jul 7, 2025
62392ff
update
dnhdruk Jul 7, 2025
a895654
update
dnhdruk Jul 7, 2025
0e0c1fc
update
dnhdruk Jul 7, 2025
f23ead5
update
dnhdruk Jul 7, 2025
65455f2
update
dnhdruk Jul 7, 2025
2933df5
update
dnhdruk Jul 7, 2025
d735d02
update
dnhdruk Jul 7, 2025
a6657ad
update
dnhdruk Jul 7, 2025
9e64de4
update
dnhdruk Jul 7, 2025
f5c6623
update
dnhdruk Jul 7, 2025
8f997e9
update
dnhdruk Jul 7, 2025
49d787a
update
dnhdruk Jul 7, 2025
025c537
update
dnhdruk Jul 7, 2025
e058ce1
update
dnhdruk Jul 7, 2025
8cade7c
update
dnhdruk Jul 7, 2025
186caa5
update
dnhdruk Jul 7, 2025
04ffce9
update
dnhdruk Jul 7, 2025
2b341df
update
dnhdruk Jul 7, 2025
12cb5e8
update
dnhdruk Jul 7, 2025
08f146f
update
dnhdruk Jul 7, 2025
8f5a9e7
update
dnhdruk Jul 7, 2025
62faf23
update
dnhdruk Jul 7, 2025
85ca35b
update
dnhdruk Jul 7, 2025
e1f2c27
update
dnhdruk Jul 7, 2025
0f3b1d4
update
dnhdruk Jul 7, 2025
35a441e
update
dnhdruk Jul 7, 2025
3cc21ce
update
dnhdruk Jul 7, 2025
d0debf9
update
dnhdruk Jul 7, 2025
0ae1be1
update
dnhdruk Jul 7, 2025
2fbae23
update
dnhdruk Jul 7, 2025
860258a
update
dnhdruk Jul 7, 2025
6a45c07
update
dnhdruk Jul 7, 2025
f0243e7
update
dnhdruk Jul 7, 2025
64be711
update
dnhdruk Jul 7, 2025
c68bfa1
update
dnhdruk Jul 7, 2025
ac5d8dd
update
dnhdruk Jul 7, 2025
d039378
update
dnhdruk Jul 7, 2025
5278ed0
update
dnhdruk Jul 7, 2025
6192537
update
dnhdruk Jul 7, 2025
81f210f
update
dnhdruk Jul 7, 2025
1108435
update
dnhdruk Jul 7, 2025
fd53868
update
dnhdruk Jul 7, 2025
381af97
update
dnhdruk Jul 7, 2025
380b608
update
dnhdruk Jul 7, 2025
25df380
update
dnhdruk Jul 7, 2025
a4b4dd8
update
dnhdruk Jul 7, 2025
d610771
update
dnhdruk Jul 7, 2025
1567e01
update
dnhdruk Jul 7, 2025
77cbc87
update
dnhdruk Jul 7, 2025
944a73a
update
dnhdruk Jul 7, 2025
2a2c5b6
update
dnhdruk Jul 7, 2025
68125d2
update
dnhdruk Jul 7, 2025
7dab535
update
dnhdruk Jul 8, 2025
dd592b3
update
dnhdruk Jul 8, 2025
f00a74f
update
dnhdruk Jul 8, 2025
f169188
update
dnhdruk Jul 8, 2025
dc49597
update
dnhdruk Jul 8, 2025
e0a01a6
update
dnhdruk Jul 8, 2025
fb2b5f6
update
dnhdruk Jul 8, 2025
dfd44f1
update
dnhdruk Jul 8, 2025
6902356
update
dnhdruk Jul 8, 2025
75d1e41
add training check observer
calmacx Jul 7, 2025
2d00e63
update
dnhdruk Jul 4, 2025
c700f55
update
dnhdruk Jul 8, 2025
a6fd7b3
update
dnhdruk Jul 8, 2025
790f1df
update
dnhdruk Jul 8, 2025
0275d85
update
dnhdruk Jul 8, 2025
2b64044
update
dnhdruk Jul 8, 2025
85c6dec
update
dnhdruk Jul 8, 2025
848837a
add training check observer
calmacx Jul 7, 2025
94f19f6
update
dnhdruk Jul 4, 2025
a2302c9
add training check observer
calmacx Jul 7, 2025
fa1a39d
update
dnhdruk Jul 8, 2025
4b77246
update
dnhdruk Jul 8, 2025
232a6e1
add training check observer
calmacx Jul 7, 2025
b66f820
update
dnhdruk Jul 4, 2025
3e37e91
add training check observer
calmacx Jul 7, 2025
8c44f0b
update
dnhdruk Jul 4, 2025
4a16e2f
add training check observer
calmacx Jul 7, 2025
97279e0
update
dnhdruk Jul 8, 2025
24a3c29
update
dnhdruk Jul 8, 2025
9e86b01
update
dnhdruk Jul 8, 2025
b1d4e5c
update
dnhdruk Jul 8, 2025
f8ac905
update
dnhdruk Jul 8, 2025
8cb8393
add training check observer
calmacx Jul 7, 2025
b90d6ad
update
dnhdruk Jul 4, 2025
9ae19a1
update
dnhdruk Jul 4, 2025
bbb1079
update
dnhdruk Jul 7, 2025
675d348
add training check observer
calmacx Jul 7, 2025
ee82c28
update
dnhdruk Jul 4, 2025
9155e54
add training check observer
calmacx Jul 7, 2025
dbca5aa
add training check observer
calmacx Jul 7, 2025
0b3d21b
add training check observer
calmacx Jul 7, 2025
c3c3308
update
dnhdruk Jul 4, 2025
539dfa0
add training check observer
calmacx Jul 7, 2025
de300e2
update
dnhdruk Jul 8, 2025
49c19cf
update
dnhdruk Jul 8, 2025
ff03f94
update
dnhdruk Jul 8, 2025
0c02a66
update
dnhdruk Jul 8, 2025
dd50b3f
update
dnhdruk Jul 8, 2025
5845eaa
update
dnhdruk Jul 9, 2025
17a8bef
update
dnhdruk Jul 9, 2025
5a2b6b4
update
dnhdruk Jul 9, 2025
73726d1
update
dnhdruk Jul 9, 2025
0161da7
update
dnhdruk Jul 9, 2025
6f61fab
update
dnhdruk Jul 9, 2025
b5c8d8b
update
dnhdruk Jul 11, 2025
c6c5795
update
dnhdruk Jul 11, 2025
510ada7
update
dnhdruk Jul 11, 2025
133c2af
update
dnhdruk Jul 11, 2025
1475041
update
dnhdruk Jul 11, 2025
d73b60d
update
dnhdruk Jul 11, 2025
e33d46e
update
dnhdruk Jul 11, 2025
1e6f1b5
update
dnhdruk Jul 11, 2025
ad6e43f
update
dnhdruk Jul 11, 2025
3a1bb25
update
dnhdruk Jul 11, 2025
5ca1033
update
dnhdruk Jul 11, 2025
631907a
update
dnhdruk Jul 11, 2025
21ce75a
update
dnhdruk Jul 11, 2025
01fbf3f
update
dnhdruk Jul 11, 2025
681e218
update
dnhdruk Jul 11, 2025
689724e
update
dnhdruk Jul 11, 2025
647accf
update
dnhdruk Jul 11, 2025
82c0463
update
dnhdruk Jul 11, 2025
1c2d84b
update
dnhdruk Jul 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ ORCID_CLIENT_SECRET=""
IDVT_ORG_SCANNER="http://soursd-ocr:8000/grab"
IDVT_COMPANIES_HOUSE_URL="https://find-and-update.company-information.service.gov.uk/company/"

OCTANE_SERVER=frankenphp
OCTANE_SERVER=swoole
OCTANE_HTTPS=false

RATE_LIMIT=10000
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/dev_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- dev # override for branch deployment
- 'bugfix/test-for-memory-leaks-rto'

env:
PROJECT_ID: '${{ secrets.PROJECT_ID }}'
Expand All @@ -26,7 +27,7 @@ jobs:
id: checkout
uses: actions/checkout@v4
with:
ref: dev # override for branch deployment
ref: bugfix/test-for-memory-leaks-rto # override for branch deployment

- name: Read VERSION file
id: getversion
Expand Down Expand Up @@ -76,7 +77,7 @@ jobs:
id: checkout
uses: actions/checkout@v4
with:
ref: dev # override for branch deployment
ref: bugfix/test-for-memory-leaks-rto # override for branch deployment

- name: Google Auth
id: auth
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ clean.sh
clean.shrr
frankenphp
_ide_helper_models.php

frankenphp-worker.php
17 changes: 0 additions & 17 deletions .rr.yaml

This file was deleted.

92 changes: 73 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Use PHP 8.3.3 FPM as base image
FROM php:8.3.3-fpm

# Set environment variables
ENV COMPOSER_PROCESS_TIMEOUT=600
ENV REBUILD_DB=1

# Set working directory
WORKDIR /var/www

COPY composer.* /var/www/

# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
nodejs \
npm \
libfreetype6-dev \
Expand All @@ -19,55 +22,106 @@ RUN apt-get update && apt-get install -y \
wget \
zlib1g-dev \
zip \
unzip \
git \
default-mysql-client \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd pdo pdo_mysql soap zip iconv bcmath \
supervisor \
procps \
psmisc \
apt-transport-https \
gnupg \
lsb-release \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Configure and install PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \
&& docker-php-ext-install sockets \
&& docker-php-ext-install exif \
&& docker-php-ext-configure pcntl --enable-pcntl \
&& docker-php-ext-install pcntl
&& docker-php-ext-install -j$(nproc) \
gd \
pdo \
pdo_mysql \
soap \
zip \
iconv \
bcmath \
sockets \
exif \
pcntl

# Create SSL certificate symlink
RUN mkdir -p /etc/pki/tls/certs && \
ln -s /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt

# Install Redis and Imagick
# Install Redis extension
RUN wget -O redis-5.3.7.tgz 'https://pecl.php.net/get/redis-5.3.7.tgz' \
&& pecl install redis-5.3.7.tgz \
&& rm -rf redis-5.3.7.tgz \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis

# Install FrankenPHP extension
RUN curl https://frankenphp.dev/install.sh | sh \
&& mv frankenphp /usr/local/bin/frankenphp \
&& chmod +x /usr/local/bin/frankenphp

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- \
--install-dir=/usr/local/bin --filename=composer

# Send update for php.ini
# Copy composer files first for better caching
COPY composer.* /var/www/

# Copy PHP configuration
COPY ./init/php.development.ini /usr/local/etc/php/php.ini

# Copy the application
COPY . /var/www

RUN curl https://frankenphp.dev/install.sh | sh \
&& mv frankenphp /usr/local/bin/frankenphp \
&& chmod +x /usr/local/bin/frankenphp

# Composer & laravel
RUN composer install \
&& php artisan octane:install \
RUN composer install --optimize-autoloader \
&& npm install --save-dev chokidar \
# && php artisan octane:install \
&& php artisan storage:link \
&& php artisan optimize:clear \
&& php artisan optimize \
&& php artisan config:clear \
&& php artisan octane:install --server=frankenphp \
&& chmod -R 777 storage bootstrap/cache \
&& chown -R www-data:www-data storage \
&& composer dumpautoload

# Generate Swagger
# Generate Swagger documentation
RUN php artisan l5-swagger:generate

# Starts both, laravel server and job queue
CMD ["/var/www/docker/start.sh"]
# Create supervisor directories and log files
RUN mkdir -p /var/log/supervisor /var/run/supervisor \
&& touch /var/log/supervisor/supervisord.log \
&& touch /var/log/supervisor/octane.log \
&& touch /var/log/supervisor/horizon.log

# Copy Supervisor configuration
RUN groupadd -r supervisor || true
RUN usermod -a -G supervisor www-data || true
COPY ./docker/supervisord.conf /etc/supervisor/supervisord.conf

COPY ./docker/Caddyfile /var/www/docker/Caddyfile

COPY ./docker/resource-monitor.sh /var/www/docker/resource-monitor.sh
RUN chmod +x /var/www/docker/resource-monitor.sh \
&& chown www-data:www-data /var/www/docker/resource-monitor.sh

COPY ./docker/run-scheduler.sh /var/www/docker/run-scheduler.sh
RUN chmod +x /var/www/docker/run-scheduler.sh \
&& chown www-data:www-data /var/www/docker/run-scheduler.sh

# Set proper permissions for www-data user
RUN chown -R www-data:www-data /var/www \
&& chmod -R 755 /var/www

# Expose port
EXPOSE 8100
EXPOSE 8100

# Start supervisord
CMD ["sh", "-c", "/usr/bin/supervisord -c /etc/supervisor/supervisord.conf"]
7 changes: 4 additions & 3 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ class Kernel extends ConsoleKernel
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
$schedule->call(function () {
UpdateActionNotifications::dispatch();
})->everyMinute();
// $schedule->call(function () {
// UpdateActionNotifications::dispatch();
// })->everyMinute();
// $schedule->job(new UpdateActionNotifications)->everyMinute();

}

Expand Down
File renamed without changes.
102 changes: 102 additions & 0 deletions app/Http/Controllers/Api/V1/AffiliationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,96 @@ public function indexByRegistryId(Request $request, int $registryId): JsonRespon
], 200);
}

/**
* @OA\Get(
* path="/api/v1/affiliations/{registryId}/organisation/{organisationId}",
* operationId="getOrganisationAffiliation",
* summary="Return a specific organisation's affiliation by registry ID and organisation ID",
* description="Get a specific organisation's affiliation for a given registry",
* tags={"Affiliations"},
* security={{"bearerAuth":{}}},
* @OA\Parameter(
* name="registryId",
* in="path",
* required=true,
* description="Registry ID",
* example=1,
* @OA\Schema(type="integer")
* ),
* @OA\Parameter(
* name="organisationId",
* in="path",
* required=true,
* description="Organisation ID",
* example=100,
* @OA\Schema(type="integer")
* ),
* @OA\Response(
* response=200,
* description="Success",
* @OA\JsonContent(
* @OA\Property(property="message", type="string", example="success"),
* @OA\Property(property="data", type="object",
* @OA\Property(property="id", type="integer", example=123),
* @OA\Property(property="registry_id", type="integer", example=1),
* @OA\Property(property="organisation_id", type="integer", example=100),
* @OA\Property(property="model_state_id", type="integer", example=2),
* @OA\Property(property="model_state", type="object",
* @OA\Property(property="id", type="integer", example=2),
* @OA\Property(property="state_id", type="integer", example=5),
* @OA\Property(property="state", type="object",
* @OA\Property(property="id", type="integer", example=5),
* @OA\Property(property="name", type="string", example="Approved")
* )
* ),
* @OA\Property(property="organisation", type="object",
* @OA\Property(property="id", type="integer", example=100),
* @OA\Property(property="organisation_name", type="string", example="Example Org"),
* @OA\Property(property="unclaimed", type="boolean", example=false),
* @OA\Property(property="lead_applicant_email", type="string", example="lead@example.org")
* )
* )
* )
* ),
* @OA\Response(
* response=404,
* description="Affiliation not found",
* @OA\JsonContent(
* @OA\Property(property="message", type="string", example="Affiliation not found")
* )
* )
* )
*/
public function getOrganisationAffiliation(Request $request, int $registryId, int $organisationId): JsonResponse
{
$affiliation = Affiliation::with(
[
'modelState.state',
'organisation' => function ($query) {
$query->select(
'id',
'organisation_name',
'unclaimed',
'lead_applicant_email'
);
},
]
)
->where(
[
'registry_id' => $registryId,
'organisation_id' => $organisationId
]
)
->first();


return response()->json([
'message' => 'success',
'data' => $affiliation,
], 200);
}

/**
* @OA\Post(
* path="/api/v1/affiliations/{registryId}",
Expand Down Expand Up @@ -328,4 +418,16 @@ public function updateRegistryAffiliation(Request $request, int $registryId, int
return $this->ErrorResponse($e->getMessage());
}
}

public function getWorkflowStates(Request $request)
{
$model = new Affiliation();
return $this->OKResponse($model->getAllStates());
}

public function getWorkflowTransitions(Request $request)
{
$model = new Affiliation();
return $this->OKResponse($model->getTransitions());
}
}
Loading