mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-03-19 07:54:08 +01: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)
|
||||
|
||||
|
||||
class TransactionInternalMapping(ColumnMapping):
|
||||
class TransactionInternalNoteMapping(ColumnMapping):
|
||||
target: Literal["internal_note"] = Field(
|
||||
..., description="Transaction field to map to"
|
||||
)
|
||||
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):
|
||||
target: Literal["category_name"] = Field(
|
||||
..., description="Category field to map to"
|
||||
@@ -314,7 +321,8 @@ class ImportProfileSchema(BaseModel):
|
||||
| TransactionTagsMapping
|
||||
| TransactionEntitiesMapping
|
||||
| TransactionCategoryMapping
|
||||
| TransactionInternalMapping
|
||||
| TransactionInternalNoteMapping
|
||||
| TransactionInternalIDMapping
|
||||
| CategoryNameMapping
|
||||
| CategoryMuteMapping
|
||||
| CategoryActiveMapping
|
||||
@@ -358,7 +366,8 @@ class ImportProfileSchema(BaseModel):
|
||||
TransactionTagsMapping,
|
||||
TransactionEntitiesMapping,
|
||||
TransactionCategoryMapping,
|
||||
TransactionInternalMapping,
|
||||
TransactionInternalNoteMapping,
|
||||
TransactionInternalIDMapping,
|
||||
),
|
||||
"accounts": (
|
||||
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"),
|
||||
)
|
||||
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(
|
||||
default=False, verbose_name=_("Deleted"), db_index=True
|
||||
|
||||
Reference in New Issue
Block a user