DONE: layout letter with letterhead and footer, notification for newly...
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Transformers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class MembershipApplicationApplicantResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'email' => $this->email,
|
||||
'ic_number' => $this->ic_number,
|
||||
'birth_date' => $this->birth_date,
|
||||
'birth_place' => $this->birth_place,
|
||||
'gender' => $this->gender,
|
||||
'marriage_status' => $this->marriage_status,
|
||||
'address' => $this->address,
|
||||
'phone_number' => $this->phone_number,
|
||||
'office_number' => $this->office_number,
|
||||
'postcode' => $this->postcode,
|
||||
'employer_name' => $this->employer_name,
|
||||
'employer_address' => $this->employer_address,
|
||||
'current_position' => $this->current_position,
|
||||
'start_work_date' => $this->start_work_date?->toDateString(),
|
||||
'stock_monthly_contribution' => $this->stock_monthly_contribution,
|
||||
'fee_monthly_contribution' => $this->fee_monthly_contribution,
|
||||
];
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Transformers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class MembershipApplicationDocumentResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'type' => $this->type,
|
||||
'mime_type' => $this->mime_type,
|
||||
'file_size' => $this->file_size,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Transformers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class MembershipApplicationHeirResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'ic_number' => $this->ic_number,
|
||||
'relationship' => $this->relationship,
|
||||
'phone_number' => $this->phone_number,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Transformers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class MembershipApplicationListResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'application_number' => $this->application_number,
|
||||
'status' => $this->status?->value ?? $this->status,
|
||||
'board_result' => $this->board_result ?: null,
|
||||
'submitted_at' => $this->submitted_at,
|
||||
'applicant' => $this->whenLoaded('applicant', fn () => [
|
||||
'name' => $this->applicant->name,
|
||||
'email' => $this->applicant->email,
|
||||
'ic_number' => $this->applicant->ic_number,
|
||||
]),
|
||||
'created_at' => $this->created_at?->toISOString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Transformers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class MembershipApplicationReferenceResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'reference_type' => $this->reference_type?->value ?? $this->reference_type,
|
||||
'user_id' => $this->user_id,
|
||||
'member' => $this->whenLoaded('member', fn () => [
|
||||
'id' => $this->member->id,
|
||||
'name' => $this->member->name,
|
||||
'ic_number' => $this->member->ic_number,
|
||||
]),
|
||||
'assigned_by' => $this->assigned_by,
|
||||
'assigned_at' => $this->assigned_at?->toISOString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Transformers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class MembershipApplicationResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'application_number' => $this->application_number,
|
||||
'status' => $this->status?->value ?? $this->status,
|
||||
'board_result' => $this->board_result ?: null,
|
||||
'submitted_at' => $this->submitted_at,
|
||||
'completed_at' => $this->completed_at ?: null,
|
||||
'applicant' => new MembershipApplicationApplicantResource($this->whenLoaded('applicant')),
|
||||
'heirs' => MembershipApplicationHeirResource::collection($this->whenLoaded('heirs')),
|
||||
'references' => MembershipApplicationReferenceResource::collection($this->whenLoaded('references')),
|
||||
'documents' => MembershipApplicationDocumentResource::collection($this->whenLoaded('documents')),
|
||||
'reviews' => MembershipApplicationReviewResource::collection($this->whenLoaded('reviews')),
|
||||
'created_at' => $this->created_at?->toISOString(),
|
||||
'updated_at' => $this->updated_at?->toISOString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Transformers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class MembershipApplicationReviewResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'stage' => $this->stage?->value ?? $this->stage,
|
||||
'decision' => $this->decision,
|
||||
'remarks' => $this->remarks,
|
||||
'reviewer' => $this->whenLoaded('reviewer', fn () => [
|
||||
'id' => $this->reviewer->id,
|
||||
'name' => $this->reviewer->name,
|
||||
]),
|
||||
'reviewed_at' => $this->reviewed_at?->toISOString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user