feat(accounting): add invoice preparation workflow
This commit is contained in:
parent
ffffb68898
commit
46eeaa1f2e
17 changed files with 519 additions and 44 deletions
|
|
@ -0,0 +1,53 @@
|
|||
"""add accounting export status
|
||||
|
||||
Revision ID: d2e3f4a5b6c7
|
||||
Revises: c9d4e5f6a7b8
|
||||
Create Date: 2026-07-05 17:20:00.000000
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision: str = "d2e3f4a5b6c7"
|
||||
down_revision: Union[str, Sequence[str], None] = "c9d4e5f6a7b8"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column("lexware_sync_records", sa.Column("export_status", sa.String(length=40), server_default="prepared", nullable=False))
|
||||
op.add_column("lexware_sync_records", sa.Column("accounting_note", sa.Text(), nullable=True))
|
||||
op.add_column("lexware_sync_records", sa.Column("transferred_at", sa.DateTime(timezone=True), nullable=True))
|
||||
op.add_column("lexware_sync_records", sa.Column("transferred_by_user_id", sa.Integer(), nullable=True))
|
||||
op.create_index(op.f("ix_lexware_sync_records_export_status"), "lexware_sync_records", ["export_status"], unique=False)
|
||||
op.create_index(op.f("ix_lexware_sync_records_transferred_by_user_id"), "lexware_sync_records", ["transferred_by_user_id"], unique=False)
|
||||
|
||||
op.add_column("repair_estimates", sa.Column("accounting_export_status", sa.String(length=40), nullable=True))
|
||||
op.add_column("repair_estimates", sa.Column("accounting_note", sa.Text(), nullable=True))
|
||||
op.add_column("repair_estimates", sa.Column("accounting_transferred_at", sa.DateTime(timezone=True), nullable=True))
|
||||
op.add_column("repair_estimates", sa.Column("accounting_transferred_by_user_id", sa.Integer(), nullable=True))
|
||||
op.create_foreign_key(
|
||||
"fk_repair_estimates_accounting_transferred_by_user_id",
|
||||
"repair_estimates",
|
||||
"users",
|
||||
["accounting_transferred_by_user_id"],
|
||||
["id"],
|
||||
ondelete="SET NULL",
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_constraint("fk_repair_estimates_accounting_transferred_by_user_id", "repair_estimates", type_="foreignkey")
|
||||
op.drop_column("repair_estimates", "accounting_transferred_by_user_id")
|
||||
op.drop_column("repair_estimates", "accounting_transferred_at")
|
||||
op.drop_column("repair_estimates", "accounting_note")
|
||||
op.drop_column("repair_estimates", "accounting_export_status")
|
||||
op.drop_index(op.f("ix_lexware_sync_records_transferred_by_user_id"), table_name="lexware_sync_records")
|
||||
op.drop_index(op.f("ix_lexware_sync_records_export_status"), table_name="lexware_sync_records")
|
||||
op.drop_column("lexware_sync_records", "transferred_by_user_id")
|
||||
op.drop_column("lexware_sync_records", "transferred_at")
|
||||
op.drop_column("lexware_sync_records", "accounting_note")
|
||||
op.drop_column("lexware_sync_records", "export_status")
|
||||
Loading…
Add table
Add a link
Reference in a new issue