mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-31 10:24:25 +00:00
Orders APIs WIP
This commit is contained in:
@@ -23,30 +23,14 @@ class OrderStepsResource extends JsonResource
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'order_id' => $this->order_id,
|
||||
'appointee_id' => $this->appointee_id,
|
||||
'reference' => $this->reference,
|
||||
'type' => (int) $this->type,
|
||||
'business_type' => (int) $this->business_type,
|
||||
'status' => (int) $this->status,
|
||||
'contact' => new ContactResource ($this->when($this->has('contacts'), $this->contacts->first())),
|
||||
'address' => new AddressResource($this->when($this->has('addresses'), $this->addresses->where('billing', true)->first())),
|
||||
// 'employee' => new UserResource($this->employees->first()),
|
||||
// 'identification' => new DocumentResource($this->documents->whereIn('document_type', DocumentType::IDENTIFICATION_DOCUMENTS)->first()),
|
||||
// 'bookings' => BookingResource::collection($this->whenLoaded('bookings', $this->bookings()->orderBy('id', 'DESC')->get(), [])),
|
||||
// 'personal_banks' => BankResource::collection($this->banks->where('type', BankAccountType::PERSONAL)),
|
||||
// 'recipient_banks' => [
|
||||
// 'accounts' => BankResource::collection($this->banks->where('type', BankAccountType::EXTERNAL)),
|
||||
// 'default' => new BankResource($this->banks->where('type', BankAccountType::EXTERNAL)->where('default', true)->first())
|
||||
// ],
|
||||
// 'segments' => SegmentResource::collection($this->segments),
|
||||
// 'services' => (new FetchesCompanyServices())->getServices($this->servicesConfigurations()),
|
||||
// 'currencies' => $this->when($this->business_type === BusinessType::CURRENCY_VENDOR, function(){
|
||||
// $segment = SegmentConstant::where('reference', SegmentConstants::SUPPLIER_CURRENCIES)->where('detail->id', $this->id)->first();
|
||||
// return $segment ? CurrencyResource::collection(Currency::whereIn('id', $segment->detail->currencies)->get()) : [];
|
||||
// })
|
||||
|
||||
|
||||
'primary' => (int) $this->primary,
|
||||
'sequence' => (double) $this->sequence,
|
||||
'status' =>(int) $this->status,
|
||||
'contract_status' =>(int) $this->contract_status,
|
||||
'complete_date' => $this->complete_date,
|
||||
];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user