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,
|
||||
email=account.email,
|
||||
wallets=[
|
||||
DirectoryWallet(
|
||||
id=w.id, name=w.name, balance_msat=w.balance_msat
|
||||
)
|
||||
DirectoryWallet(id=w.id, name=w.name, balance_msat=w.balance_msat)
|
||||
for w in wallets
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -16,8 +16,7 @@ schema.
|
|||
async def m001_initial(db):
|
||||
"""Payroll contracts — the standing "pay X this much, this often" rows."""
|
||||
|
||||
await db.execute(
|
||||
f"""
|
||||
await db.execute(f"""
|
||||
CREATE TABLE payroll.contracts (
|
||||
id TEXT PRIMARY KEY,
|
||||
employee_id TEXT NOT NULL,
|
||||
|
|
@ -37,16 +36,13 @@ async def m001_initial(db):
|
|||
created_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".
|
||||
# NOTE: the schema qualifier goes on the INDEX name, not the table —
|
||||
# SQLite attaches the extension DB as schema `payroll`, and
|
||||
# `CREATE INDEX ON schema.table` is a syntax error there.
|
||||
await db.execute(
|
||||
"CREATE INDEX payroll.idx_contracts_status ON contracts (status);"
|
||||
)
|
||||
await db.execute("CREATE INDEX payroll.idx_contracts_status ON contracts (status);")
|
||||
# Employee-facing lookups ("show me my payroll lines") filter by account.
|
||||
await db.execute(
|
||||
"CREATE INDEX payroll.idx_contracts_employee ON contracts (employee_id);"
|
||||
|
|
|
|||
|
|
@ -56,8 +56,8 @@ class Frequency(str, Enum):
|
|||
|
||||
|
||||
class ContractStatus(str, Enum):
|
||||
active = "active" # eligible for payout on every scheduler tick
|
||||
paused = "paused" # keeps its schedule position, pays nothing
|
||||
active = "active" # eligible for payout on every scheduler tick
|
||||
paused = "paused" # keeps its schedule position, pays nothing
|
||||
completed = "completed" # ran out of periods; terminal
|
||||
cancelled = "cancelled" # stopped by the operator; terminal
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ class CreateContract(BaseModel):
|
|||
total_periods: int | None = None
|
||||
|
||||
label: str = "" # display name for the line, e.g. "Alice — dev retainer"
|
||||
memo: str = "" # payment memo the employee sees; falls back to `label`
|
||||
memo: str = "" # payment memo the employee sees; falls back to `label`
|
||||
|
||||
# Periods whose payday already passed before the contract existed. Off by
|
||||
# default: creating a contract with a back-dated start is normally an
|
||||
|
|
|
|||
|
|
@ -149,9 +149,7 @@ async def api_update_contract(contract_id: str, data: UpdateContract) -> Contrac
|
|||
return await crud.update_contract(contract)
|
||||
|
||||
|
||||
@payroll_api_router.delete(
|
||||
"/api/v1/contracts/{contract_id}", status_code=HTTPStatus.OK
|
||||
)
|
||||
@payroll_api_router.delete("/api/v1/contracts/{contract_id}", status_code=HTTPStatus.OK)
|
||||
async def api_delete_contract(contract_id: str) -> None:
|
||||
"""Hard-delete a contract row.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue