Skip to content

Commit

Permalink
comments resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
ruuushhh committed Oct 26, 2023
1 parent 9eafe9f commit 4537d71
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
12 changes: 9 additions & 3 deletions apps/accounting_exports/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,32 @@
StringNotNullField,
StringNullField,
CustomJsonField,
CustomDateTimeField
CustomDateTimeField,
StringOptionsField
)
from apps.workspaces.models import BaseForeignWorkspaceModel
from apps.fyle.models import Expense

TYPE_CHOICES = (
('FETCH_EXPENSES', 'FETCH_EXPENSES'),
('INVOICES', 'INVOICES'),
('DIRECT_COST', 'DIRECT_COST')
)

class AccountingExport(BaseForeignWorkspaceModel):
"""
Table to store accounting exports
"""
id = models.AutoField(primary_key=True)
type = StringNotNullField(max_length=50, help_text='Task type (FETCH_EXPENSES / INVOICES / DIRECT_COST)')
type = StringOptionsField(choices=TYPE_CHOICES, help_text='Task type')
fund_source = StringNotNullField(help_text='Expense fund source')
mapping_errors = ArrayField(help_text='Mapping errors', base_field=models.CharField(max_length=255), blank=True, null=True)
expenses = models.ManyToManyField(Expense, help_text="Expenses under this Expense Group")
task_id = StringNullField(help_text='Fyle Jobs task reference')
description = CustomJsonField(help_text='Description')
status = StringNotNullField(help_text='Task Status')
detail = CustomJsonField(help_text='Task Response')
sage_intacct_errors = CustomJsonField(help_text='Sage Intacct Errors')
sage_300_errors = CustomJsonField(help_text='Sage 300 Errors')
exported_at = CustomDateTimeField(help_text='time of export')

class Meta:
Expand Down
1 change: 0 additions & 1 deletion apps/sage300/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class Invoice(BaseModel):
accounting_export = models.OneToOneField(AccountingExport, on_delete=models.PROTECT, help_text='Reference to AccountingExport model')
vendor_id = StringNotNullField(help_text='Vendor ID')
code = StringNotNullField(max_length=15, help_text="unique key for each document")
discount_amount = FloatNullField(help_text='Discount amount')

class Meta:
db_table = 'invoice'
Expand Down
4 changes: 2 additions & 2 deletions tests/test_fyle/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"description":[],
"status":"IN_PROGRESS",
"detail":[],
"sage_intacct_errors":[],
"sage_300_errors":[],
"exported_at":"None",
"workspace":1,
"expenses":[]
Expand All @@ -91,7 +91,7 @@
"description":[],
"status":"IN_PROGRESS",
"detail":[],
"sage_intacct_errors":[],
"sage_300_errors":[],
"exported_at":"None",
"workspace":1,
"expenses":[]
Expand Down

0 comments on commit 4537d71

Please sign in to comment.