feat: add admin settings system and improve customer/pricing endpoints
Add centralized admin settings (company info, social links, quick calls, sidebar visibility toggles, theme, logo upload) with singleton pattern and full CRUD API. Add active/dedicated customer count endpoints for dashboard stats. Fix automatic assignment route to use PUT instead of GET. Refactor oil price endpoint to use schema serialization with null safety. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -52,14 +52,10 @@ def get_oil_price_today():
|
||||
.query(Pricing_Oil_Oil)
|
||||
.order_by(Pricing_Oil_Oil.date.desc())
|
||||
.first())
|
||||
return success_response({
|
||||
'price_from_supplier': get_price_query.price_from_supplier,
|
||||
'price_for_customer': get_price_query.price_for_customer,
|
||||
'price_for_employee': get_price_query.price_for_employee,
|
||||
'price_same_day': get_price_query.price_same_day,
|
||||
'price_prime': get_price_query.price_prime,
|
||||
'price_emergency': get_price_query.price_emergency,
|
||||
})
|
||||
if get_price_query:
|
||||
delivery_schema = Pricing_Oil_Oil_schema(many=False)
|
||||
return success_response(delivery_schema.dump(get_price_query))
|
||||
return error_response("No pricing data found", 404)
|
||||
|
||||
|
||||
@info.route("/price/oil/table", methods=["GET"])
|
||||
|
||||
Reference in New Issue
Block a user