Claim broker mapped
This commit is contained in:
parent
8147eb6c4a
commit
0d9fd30276
@ -69,6 +69,7 @@ class ClaimController extends ResourceController
|
|||||||
i.short_name as insurer_short_name,
|
i.short_name as insurer_short_name,
|
||||||
pct.claim_type as claim_type_value,
|
pct.claim_type as claim_type_value,
|
||||||
pa.name as agent_name,
|
pa.name as agent_name,
|
||||||
|
pb.name as broker_name,
|
||||||
tcs.claim_status as claim_status_value,
|
tcs.claim_status as claim_status_value,
|
||||||
pp.start_date as policy_start_date,
|
pp.start_date as policy_start_date,
|
||||||
pp.end_date as policy_end_date,
|
pp.end_date as policy_end_date,
|
||||||
@ -76,6 +77,7 @@ class ClaimController extends ResourceController
|
|||||||
->join('insurers i', 'i.id = pc.insurer_id', 'left')
|
->join('insurers i', 'i.id = pc.insurer_id', 'left')
|
||||||
->join('partner_claim_type_master pct', 'pct.id = pc.claim_type', 'left')
|
->join('partner_claim_type_master pct', 'pct.id = pc.claim_type', 'left')
|
||||||
->join('partner_agent pa', 'pa.id = pc.agent_id', 'left')
|
->join('partner_agent pa', 'pa.id = pc.agent_id', 'left')
|
||||||
|
->join('partner_brokers pb', 'pb.id = pc.broker_id', 'left')
|
||||||
->join('ticket_claim_status tcs', 'tcs.id = pc.claim_status_id AND tcs.ticket_type = ' . self::CLAIM_TICKET_TYPE, 'left')
|
->join('ticket_claim_status tcs', 'tcs.id = pc.claim_status_id AND tcs.ticket_type = ' . self::CLAIM_TICKET_TYPE, 'left')
|
||||||
->join('partner_policy pp', 'pp.id = pc.policy_id', 'left')
|
->join('partner_policy pp', 'pp.id = pc.policy_id', 'left')
|
||||||
->join('vehicle v', 'v.id = pp.vehicle_id', 'left')
|
->join('vehicle v', 'v.id = pp.vehicle_id', 'left')
|
||||||
@ -152,7 +154,7 @@ class ClaimController extends ResourceController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$policy = $this->PolicyModel
|
$policy = $this->PolicyModel
|
||||||
->select('partner_policy.*, Q.insurer_id, E.mobile as client_mobile, E.email as client_email')
|
->select('partner_policy.*, Q.insurer_id, E.mobile as client_mobile, E.email as client_email, E.broker_id')
|
||||||
->join('partner_quotation Q', 'Q.id = partner_policy.quotation_id AND Q.status = "Accepted"', 'left')
|
->join('partner_quotation Q', 'Q.id = partner_policy.quotation_id AND Q.status = "Accepted"', 'left')
|
||||||
->join('partner_enquiry E', 'E.id = partner_policy.enquiry_id', 'left')
|
->join('partner_enquiry E', 'E.id = partner_policy.enquiry_id', 'left')
|
||||||
->where('partner_policy.policy_number', $reqData['policy_number'])
|
->where('partner_policy.policy_number', $reqData['policy_number'])
|
||||||
@ -177,6 +179,7 @@ class ClaimController extends ResourceController
|
|||||||
'policy_id' => $policy['id'],
|
'policy_id' => $policy['id'],
|
||||||
'policy_no' => $policy['policy_number'],
|
'policy_no' => $policy['policy_number'],
|
||||||
'insurer_id' => $policy['insurer_id'] ?? null,
|
'insurer_id' => $policy['insurer_id'] ?? null,
|
||||||
|
'broker_id' => $reqData['broker_id'] ?? $policy['broker_id'] ?? null,
|
||||||
'insured_name' => $reqData['insured_name'] ?? $policy['insured_name'] ?? null,
|
'insured_name' => $reqData['insured_name'] ?? $policy['insured_name'] ?? null,
|
||||||
'mobile' => $reqData['mobile'] ?? $policy['client_mobile'] ?? null,
|
'mobile' => $reqData['mobile'] ?? $policy['client_mobile'] ?? null,
|
||||||
'mail' => $reqData['mail'] ?? $policy['client_email'] ?? null,
|
'mail' => $reqData['mail'] ?? $policy['client_email'] ?? null,
|
||||||
@ -190,6 +193,7 @@ class ClaimController extends ResourceController
|
|||||||
'spot_surveyor_contact' => $reqData['spot_surveyor_contact'] ?? null,
|
'spot_surveyor_contact' => $reqData['spot_surveyor_contact'] ?? null,
|
||||||
'workshop_surveyor_name' => $reqData['workshop_surveyor_name'] ?? null,
|
'workshop_surveyor_name' => $reqData['workshop_surveyor_name'] ?? null,
|
||||||
'workshop_surveyor_contact'=> $reqData['workshop_surveyor_contact'] ?? null,
|
'workshop_surveyor_contact'=> $reqData['workshop_surveyor_contact'] ?? null,
|
||||||
|
'remark' => $reqData['remark'] ?? null,
|
||||||
'is_active' => 1,
|
'is_active' => 1,
|
||||||
'created_by' => $reqData['created_by'] ?? null,
|
'created_by' => $reqData['created_by'] ?? null,
|
||||||
];
|
];
|
||||||
@ -253,6 +257,7 @@ class ClaimController extends ResourceController
|
|||||||
$allowedUpdateFields = [
|
$allowedUpdateFields = [
|
||||||
'claim_status_id',
|
'claim_status_id',
|
||||||
'insurer_id',
|
'insurer_id',
|
||||||
|
'broker_id',
|
||||||
'policy_id',
|
'policy_id',
|
||||||
'policy_no',
|
'policy_no',
|
||||||
'insured_name',
|
'insured_name',
|
||||||
@ -267,6 +272,7 @@ class ClaimController extends ResourceController
|
|||||||
'spot_surveyor_contact',
|
'spot_surveyor_contact',
|
||||||
'workshop_surveyor_name',
|
'workshop_surveyor_name',
|
||||||
'workshop_surveyor_contact',
|
'workshop_surveyor_contact',
|
||||||
|
'remark',
|
||||||
'is_active',
|
'is_active',
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -347,6 +353,7 @@ class ClaimController extends ResourceController
|
|||||||
i.short_name as insurer_short_name,
|
i.short_name as insurer_short_name,
|
||||||
pct.claim_type as claim_type_value,
|
pct.claim_type as claim_type_value,
|
||||||
pa.name as agent_name,
|
pa.name as agent_name,
|
||||||
|
pb.name as broker_name,
|
||||||
tcs.claim_status as claim_status_value,
|
tcs.claim_status as claim_status_value,
|
||||||
pp.start_date as policy_start_date,
|
pp.start_date as policy_start_date,
|
||||||
pp.end_date as policy_end_date,
|
pp.end_date as policy_end_date,
|
||||||
@ -354,6 +361,7 @@ class ClaimController extends ResourceController
|
|||||||
->join('insurers i', 'i.id = pc.insurer_id', 'left')
|
->join('insurers i', 'i.id = pc.insurer_id', 'left')
|
||||||
->join('partner_claim_type_master pct', 'pct.id = pc.claim_type', 'left')
|
->join('partner_claim_type_master pct', 'pct.id = pc.claim_type', 'left')
|
||||||
->join('partner_agent pa', 'pa.id = pc.agent_id', 'left')
|
->join('partner_agent pa', 'pa.id = pc.agent_id', 'left')
|
||||||
|
->join('partner_brokers pb', 'pb.id = pc.broker_id', 'left')
|
||||||
->join('ticket_claim_status tcs', 'tcs.id = pc.claim_status_id AND tcs.ticket_type = ' . self::CLAIM_TICKET_TYPE, 'left')
|
->join('ticket_claim_status tcs', 'tcs.id = pc.claim_status_id AND tcs.ticket_type = ' . self::CLAIM_TICKET_TYPE, 'left')
|
||||||
->join('partner_policy pp', 'pp.id = pc.policy_id', 'left')
|
->join('partner_policy pp', 'pp.id = pc.policy_id', 'left')
|
||||||
->join('vehicle v', 'v.id = pp.vehicle_id', 'left')
|
->join('vehicle v', 'v.id = pp.vehicle_id', 'left')
|
||||||
|
|||||||
@ -16,6 +16,7 @@ class ClaimModel extends Model
|
|||||||
protected $allowedFields = [
|
protected $allowedFields = [
|
||||||
'claim_status_id',
|
'claim_status_id',
|
||||||
'insurer_id',
|
'insurer_id',
|
||||||
|
'broker_id',
|
||||||
'policy_id',
|
'policy_id',
|
||||||
'policy_no',
|
'policy_no',
|
||||||
'insured_name',
|
'insured_name',
|
||||||
@ -31,6 +32,7 @@ class ClaimModel extends Model
|
|||||||
'spot_surveyor_contact',
|
'spot_surveyor_contact',
|
||||||
'workshop_surveyor_name',
|
'workshop_surveyor_name',
|
||||||
'workshop_surveyor_contact',
|
'workshop_surveyor_contact',
|
||||||
|
'remark',
|
||||||
'is_active',
|
'is_active',
|
||||||
'created_by',
|
'created_by',
|
||||||
'updated_by',
|
'updated_by',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user