crpt
This commit is contained in:
		@@ -221,3 +221,16 @@ def update_assembly_state():
 | 
			
		||||
    except Exception as e:
 | 
			
		||||
        print('Error while updating')
 | 
			
		||||
        return jsonify(ok=False)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@assembly_blueprint.get('/needCrpt')
 | 
			
		||||
def need_crpt():
 | 
			
		||||
    order_product_id = request.args.get('orderProductId')
 | 
			
		||||
    return sipro.api.orders.need_crpt(order_product_id)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@assembly_blueprint.post('/attachCrpt')
 | 
			
		||||
def attach_crpt():
 | 
			
		||||
    order_product_id = request.json.get('orderProductId')
 | 
			
		||||
    crpt = request.json.get('crpt')
 | 
			
		||||
    return sipro.api.orders.attach_crpt(order_product_id, crpt)
 | 
			
		||||
 
 | 
			
		||||
@@ -40,3 +40,16 @@ def get_orders_from_barcode(params: dict):
 | 
			
		||||
    method = f'{router}/getByProductId'
 | 
			
		||||
    response = client.method('GET', method, params=params)
 | 
			
		||||
    return response
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def need_crpt(order_product_id):
 | 
			
		||||
    method = f'{router}/needCrpt?orderProductId={order_product_id}'
 | 
			
		||||
    response = client.method('GET', method)
 | 
			
		||||
    return response
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def attach_crpt(order_product_id, crpt):
 | 
			
		||||
    method = f'{router}/attachCrpt'
 | 
			
		||||
    data = {'orderProductId': order_product_id, 'crpt': crpt}
 | 
			
		||||
    response = client.method('POST', method, data=data)
 | 
			
		||||
    return response
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user