lambda-erp 0.1.14__tar.gz → 0.1.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/PKG-INFO +1 -1
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/auth.py +27 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/frontend/src/api/client.ts +5 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/pyproject.toml +1 -1
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/.gitignore +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/LICENSE +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/README.md +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/__init__.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/attachments.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/bootstrap.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/chat.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/demo_limits.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/deps.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/errors.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/main.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/pdf.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/providers.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/routers/__init__.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/routers/accounting.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/routers/admin.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/routers/analytics.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/routers/bank_reconciliation.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/routers/documents.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/routers/masters.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/routers/reports.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/routers/setup.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/services.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/api/templates/document.html +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/docs/agents/README.md +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/frontend/README.md +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/__init__.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/accounting/__init__.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/accounting/bank_transaction.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/accounting/budget.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/accounting/chart_of_accounts.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/accounting/general_ledger.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/accounting/journal_entry.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/accounting/payment_entry.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/accounting/pos_invoice.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/accounting/purchase_invoice.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/accounting/revaluation.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/accounting/sales_invoice.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/accounting/subscription.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/buying/__init__.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/buying/purchase_order.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/controllers/__init__.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/controllers/currency.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/controllers/defaults.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/controllers/pricing_rule.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/controllers/taxes_and_totals.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/database.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/exceptions.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/hooks.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/model.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/selling/__init__.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/selling/quotation.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/selling/sales_order.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/simulation.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/stock/__init__.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/stock/delivery_note.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/stock/purchase_receipt.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/stock/stock_entry.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/stock/stock_ledger.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/lambda_erp/utils.py +0 -0
- {lambda_erp-0.1.14 → lambda_erp-0.1.16}/terraform/README.md +0 -0
|
@@ -173,6 +173,11 @@ class ChangeRoleRequest(BaseModel):
|
|
|
173
173
|
role: str
|
|
174
174
|
|
|
175
175
|
|
|
176
|
+
class ChangePasswordRequest(BaseModel):
|
|
177
|
+
current_password: str
|
|
178
|
+
new_password: str
|
|
179
|
+
|
|
180
|
+
|
|
176
181
|
# ---------------------------------------------------------------------------
|
|
177
182
|
# Dependencies
|
|
178
183
|
# ---------------------------------------------------------------------------
|
|
@@ -351,6 +356,28 @@ def me(user: dict = Depends(get_current_user)):
|
|
|
351
356
|
return {"name": user["name"], "email": user["email"], "full_name": user["full_name"], "role": user["role"]}
|
|
352
357
|
|
|
353
358
|
|
|
359
|
+
@router.post("/change-password")
|
|
360
|
+
def change_password(data: ChangePasswordRequest, user: dict = Depends(get_current_user)):
|
|
361
|
+
"""Change the signed-in user's own password (verifies the current one)."""
|
|
362
|
+
# The public_manager is a shared demo account — no real password to change.
|
|
363
|
+
if user["role"] == "public_manager":
|
|
364
|
+
raise HTTPException(status_code=403, detail="Demo accounts cannot change password")
|
|
365
|
+
|
|
366
|
+
if len(data.new_password) < 6:
|
|
367
|
+
raise HTTPException(status_code=422, detail="Password must be at least 6 characters")
|
|
368
|
+
|
|
369
|
+
db = get_db()
|
|
370
|
+
rows = db.sql('SELECT hashed_password FROM "User" WHERE name = ?', [user["name"]])
|
|
371
|
+
if not rows:
|
|
372
|
+
raise HTTPException(status_code=404, detail="User not found")
|
|
373
|
+
if not verify_password(data.current_password, rows[0]["hashed_password"]):
|
|
374
|
+
raise HTTPException(status_code=403, detail="Current password is incorrect")
|
|
375
|
+
|
|
376
|
+
db.set_value("User", user["name"],
|
|
377
|
+
{"hashed_password": hash_password(data.new_password), "modified": now()})
|
|
378
|
+
return {"ok": True}
|
|
379
|
+
|
|
380
|
+
|
|
354
381
|
@router.post("/invite")
|
|
355
382
|
def create_invite(data: InviteRequest, user: dict = Depends(require_admin)):
|
|
356
383
|
db = get_db()
|
|
@@ -366,6 +366,11 @@ export const api = {
|
|
|
366
366
|
request<any>("/auth/login", { method: "POST", body: JSON.stringify({ email, password }) }),
|
|
367
367
|
authLogout: () => request<any>("/auth/logout", { method: "POST" }),
|
|
368
368
|
authMe: () => request<any>("/auth/me"),
|
|
369
|
+
authChangePassword: (current_password: string, new_password: string) =>
|
|
370
|
+
request<any>("/auth/change-password", {
|
|
371
|
+
method: "POST",
|
|
372
|
+
body: JSON.stringify({ current_password, new_password }),
|
|
373
|
+
}),
|
|
369
374
|
authInvite: (email: string, role: string) =>
|
|
370
375
|
request<any>("/auth/invite", { method: "POST", body: JSON.stringify({ email, role }) }),
|
|
371
376
|
authListUsers: () => request<any[]>("/auth/users"),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|