Class: ErpIntegration::Fulfil::Resources::CustomerShipment

Inherits:
ApiResource
  • Object
show all
Defined in:
lib/erp_integration/fulfil/resources/customer_shipment.rb

Constant Summary

Constants included from PaginationMethods

PaginationMethods::DEFAULT_LIMIT, PaginationMethods::DEFAULT_OFFSET, PaginationMethods::MAX_LIMIT

Instance Attribute Summary

Attributes inherited from ApiResource

#resource_klass

Attributes included from QueryMethods

#or_clauses, #selected_fields, #where_clauses

Attributes included from PaginationMethods

#limit_value, #offset_value, #page_number

Instance Method Summary collapse

Methods inherited from ApiResource

#all, api_keys_pool, api_keys_pool=, client, config, #count, #each, #find_each, #initialize, model_name, model_name=

Methods included from QueryMethods

#or, #or!, #select, #select!, #where, #where!, #where_domain, #where_ilike, #where_in, #where_less_or_equal_to, #where_less_than, #where_like, #where_more_or_equal_to, #where_more_than, #where_not, #where_not_in

Methods included from Persistence

#create, #destroy, #update

Methods included from PaginationMethods

#limit, #limit!, #offset, #offset!, #page, #page!

Methods included from FinderMethods

#find, #find_by, #find_by!

Methods included from Context

#context?, #with_context

Constructor Details

This class inherits a constructor from ErpIntegration::Fulfil::ApiResource

Instance Method Details

#bulk_update(options) ⇒ Object

Bulk update CustomerShipments in Fulfil

[

[ customer_shipment_id ],
{ "planned_date": 2024-05-04 },
...

]

Parameters:

  • options (Array)


48
49
50
# File 'lib/erp_integration/fulfil/resources/customer_shipment.rb', line 48

def bulk_update(options)
  client.put('model/stock.shipment.out/write', options)
end

#change_warehouse(id, options) ⇒ Object

Change the warehouse of a CustomerShipment in Fulfil

Parameters:

  • id (Integer, String)

    The ID of the Customer Shipment



14
15
16
# File 'lib/erp_integration/fulfil/resources/customer_shipment.rb', line 14

def change_warehouse(id, options)
  client.put("model/stock.shipment.out/#{id}/change_warehouse", options)
end

#mark_as_done!(id) ⇒ Object

Mark a CustomerShipment as done in Fulfil

Parameters:

  • id (Integer, String)

    The ID of the Customer Shipment



36
37
38
# File 'lib/erp_integration/fulfil/resources/customer_shipment.rb', line 36

def mark_as_done!(id)
  client.put("model/stock.shipment.out/#{id}/done")
end

#mark_as_packed!(id) ⇒ Object

Mark a CustomerShipment as packed in Fulfil

Parameters:

  • id (Integer, String)

    The ID of the Customer Shipment



29
30
31
# File 'lib/erp_integration/fulfil/resources/customer_shipment.rb', line 29

def mark_as_packed!(id)
  client.put("model/stock.shipment.out/#{id}/pack")
end

#split(id, options) ⇒ Object

Split a CustomerShipment in Fulfil

Parameters:

  • id (Integer, String)

    The ID of the Customer Shipment

  • options (Hash)

    The attributes needed for the split.



22
23
24
# File 'lib/erp_integration/fulfil/resources/customer_shipment.rb', line 22

def split(id, options)
  client.put("model/stock.shipment.out/#{id}/split", options)
end