style: run black and ruff over the committed sources
Pure formatting — import ordering and black's line wrapping. No behaviour change. Kept out of the feature commits so their diffs stay readable. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018jy52j9GRZ6XKa1Zt21LLj
This commit is contained in:
parent
889751a41f
commit
55f3dfac91
4 changed files with 8 additions and 16 deletions
|
|
@ -44,9 +44,7 @@ async def list_directory_users(
|
||||||
username=account.username,
|
username=account.username,
|
||||||
email=account.email,
|
email=account.email,
|
||||||
wallets=[
|
wallets=[
|
||||||
DirectoryWallet(
|
DirectoryWallet(id=w.id, name=w.name, balance_msat=w.balance_msat)
|
||||||
id=w.id, name=w.name, balance_msat=w.balance_msat
|
|
||||||
)
|
|
||||||
for w in wallets
|
for w in wallets
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,7 @@ schema.
|
||||||
async def m001_initial(db):
|
async def m001_initial(db):
|
||||||
"""Payroll contracts — the standing "pay X this much, this often" rows."""
|
"""Payroll contracts — the standing "pay X this much, this often" rows."""
|
||||||
|
|
||||||
await db.execute(
|
await db.execute(f"""
|
||||||
f"""
|
|
||||||
CREATE TABLE payroll.contracts (
|
CREATE TABLE payroll.contracts (
|
||||||
id TEXT PRIMARY KEY,
|
id TEXT PRIMARY KEY,
|
||||||
employee_id TEXT NOT NULL,
|
employee_id TEXT NOT NULL,
|
||||||
|
|
@ -37,16 +36,13 @@ async def m001_initial(db):
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT {db.timestamp_now},
|
created_at TIMESTAMP NOT NULL DEFAULT {db.timestamp_now},
|
||||||
updated_at TIMESTAMP NOT NULL DEFAULT {db.timestamp_now}
|
updated_at TIMESTAMP NOT NULL DEFAULT {db.timestamp_now}
|
||||||
);
|
);
|
||||||
"""
|
""")
|
||||||
)
|
|
||||||
|
|
||||||
# The scheduler's hot path is "every contract still eligible to pay".
|
# The scheduler's hot path is "every contract still eligible to pay".
|
||||||
# NOTE: the schema qualifier goes on the INDEX name, not the table —
|
# NOTE: the schema qualifier goes on the INDEX name, not the table —
|
||||||
# SQLite attaches the extension DB as schema `payroll`, and
|
# SQLite attaches the extension DB as schema `payroll`, and
|
||||||
# `CREATE INDEX ON schema.table` is a syntax error there.
|
# `CREATE INDEX ON schema.table` is a syntax error there.
|
||||||
await db.execute(
|
await db.execute("CREATE INDEX payroll.idx_contracts_status ON contracts (status);")
|
||||||
"CREATE INDEX payroll.idx_contracts_status ON contracts (status);"
|
|
||||||
)
|
|
||||||
# Employee-facing lookups ("show me my payroll lines") filter by account.
|
# Employee-facing lookups ("show me my payroll lines") filter by account.
|
||||||
await db.execute(
|
await db.execute(
|
||||||
"CREATE INDEX payroll.idx_contracts_employee ON contracts (employee_id);"
|
"CREATE INDEX payroll.idx_contracts_employee ON contracts (employee_id);"
|
||||||
|
|
|
||||||
|
|
@ -149,9 +149,7 @@ async def api_update_contract(contract_id: str, data: UpdateContract) -> Contrac
|
||||||
return await crud.update_contract(contract)
|
return await crud.update_contract(contract)
|
||||||
|
|
||||||
|
|
||||||
@payroll_api_router.delete(
|
@payroll_api_router.delete("/api/v1/contracts/{contract_id}", status_code=HTTPStatus.OK)
|
||||||
"/api/v1/contracts/{contract_id}", status_code=HTTPStatus.OK
|
|
||||||
)
|
|
||||||
async def api_delete_contract(contract_id: str) -> None:
|
async def api_delete_contract(contract_id: str) -> None:
|
||||||
"""Hard-delete a contract row.
|
"""Hard-delete a contract row.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue