mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-25 01:58:54 +02:00
feat(transactions): add internal_id field to transactions
This commit is contained in:
@@ -167,13 +167,20 @@ class TransactionCategoryMapping(ColumnMapping):
|
|||||||
coerce_to: Literal["str|int"] = Field("str|int", frozen=True)
|
coerce_to: Literal["str|int"] = Field("str|int", frozen=True)
|
||||||
|
|
||||||
|
|
||||||
class TransactionInternalMapping(ColumnMapping):
|
class TransactionInternalNoteMapping(ColumnMapping):
|
||||||
target: Literal["internal_note"] = Field(
|
target: Literal["internal_note"] = Field(
|
||||||
..., description="Transaction field to map to"
|
..., description="Transaction field to map to"
|
||||||
)
|
)
|
||||||
coerce_to: Literal["str"] = Field("str", frozen=True)
|
coerce_to: Literal["str"] = Field("str", frozen=True)
|
||||||
|
|
||||||
|
|
||||||
|
class TransactionInternalIDMapping(ColumnMapping):
|
||||||
|
target: Literal["internal_id"] = Field(
|
||||||
|
..., description="Transaction field to map to"
|
||||||
|
)
|
||||||
|
coerce_to: Literal["str"] = Field("str", frozen=True)
|
||||||
|
|
||||||
|
|
||||||
class CategoryNameMapping(ColumnMapping):
|
class CategoryNameMapping(ColumnMapping):
|
||||||
target: Literal["category_name"] = Field(
|
target: Literal["category_name"] = Field(
|
||||||
..., description="Category field to map to"
|
..., description="Category field to map to"
|
||||||
@@ -314,7 +321,8 @@ class ImportProfileSchema(BaseModel):
|
|||||||
| TransactionTagsMapping
|
| TransactionTagsMapping
|
||||||
| TransactionEntitiesMapping
|
| TransactionEntitiesMapping
|
||||||
| TransactionCategoryMapping
|
| TransactionCategoryMapping
|
||||||
| TransactionInternalMapping
|
| TransactionInternalNoteMapping
|
||||||
|
| TransactionInternalIDMapping
|
||||||
| CategoryNameMapping
|
| CategoryNameMapping
|
||||||
| CategoryMuteMapping
|
| CategoryMuteMapping
|
||||||
| CategoryActiveMapping
|
| CategoryActiveMapping
|
||||||
@@ -358,7 +366,8 @@ class ImportProfileSchema(BaseModel):
|
|||||||
TransactionTagsMapping,
|
TransactionTagsMapping,
|
||||||
TransactionEntitiesMapping,
|
TransactionEntitiesMapping,
|
||||||
TransactionCategoryMapping,
|
TransactionCategoryMapping,
|
||||||
TransactionInternalMapping,
|
TransactionInternalNoteMapping,
|
||||||
|
TransactionInternalIDMapping,
|
||||||
),
|
),
|
||||||
"accounts": (
|
"accounts": (
|
||||||
AccountNameMapping,
|
AccountNameMapping,
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Generated by Django 5.1.5 on 2025-01-21 01:56
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("transactions", "0032_transaction_created_at_transaction_updated_at"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="transaction",
|
||||||
|
name="internal_id",
|
||||||
|
field=models.TextField(
|
||||||
|
blank=True, null=True, unique=True, verbose_name="Internal ID"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -190,6 +190,9 @@ class Transaction(models.Model):
|
|||||||
verbose_name=_("Recurring Transaction"),
|
verbose_name=_("Recurring Transaction"),
|
||||||
)
|
)
|
||||||
internal_note = models.TextField(blank=True, verbose_name=_("Internal Note"))
|
internal_note = models.TextField(blank=True, verbose_name=_("Internal Note"))
|
||||||
|
internal_id = models.TextField(
|
||||||
|
blank=True, null=True, unique=True, verbose_name=_("Internal ID")
|
||||||
|
)
|
||||||
|
|
||||||
deleted = models.BooleanField(
|
deleted = models.BooleanField(
|
||||||
default=False, verbose_name=_("Deleted"), db_index=True
|
default=False, verbose_name=_("Deleted"), db_index=True
|
||||||
|
|||||||
Reference in New Issue
Block a user