Skip to content

Commit

Permalink
export settings V2 api
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashutosh619-sudo committed Oct 25, 2023
1 parent 5972c5c commit cfb791b
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ cache.db-journal
test_scripts/
fyle_accounting_mappings/
fyle_integrations_platform_connector/
fyle/
./fyle
20 changes: 20 additions & 0 deletions apps/fyle/migrations/0026_auto_20231025_0913.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.1.14 on 2023-10-25 09:13

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('workspaces', '0035_auto_20231019_1025'),
('fyle', '0025_auto_20230622_0516'),
]

operations = [
migrations.AlterField(
model_name='expensegroupsettings',
name='workspace',
field=models.OneToOneField(help_text='To which workspace this expense group setting belongs to', on_delete=django.db.models.deletion.PROTECT, related_name='expense_group_settings', to='workspaces.workspace'),
),
]
3 changes: 2 additions & 1 deletion apps/fyle/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ class ExpenseGroupSettings(models.Model):
ccc_export_date_type = models.CharField(max_length=100, default='current_date', help_text='CCC Export Date')
import_card_credits = models.BooleanField(help_text='Import Card Credits', default=False)
workspace = models.OneToOneField(
Workspace, on_delete=models.PROTECT, help_text='To which workspace this expense group setting belongs to'
Workspace, on_delete=models.PROTECT, help_text='To which workspace this expense group setting belongs to',
related_name = 'expense_group_settings'
)
created_at = models.DateTimeField(auto_now_add=True, help_text='Created at')
updated_at = models.DateTimeField(auto_now=True, help_text='Updated at')
Expand Down
20 changes: 20 additions & 0 deletions apps/mappings/migrations/0010_auto_20231025_0915.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.1.14 on 2023-10-25 09:15

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('workspaces', '0035_auto_20231019_1025'),
('mappings', '0009_auto_20211022_0702'),
]

operations = [
migrations.AlterField(
model_name='generalmapping',
name='workspace',
field=models.OneToOneField(help_text='Reference to Workspace model', on_delete=django.db.models.deletion.PROTECT, related_name='general_mappings', to='workspaces.workspace'),
),
]
2 changes: 1 addition & 1 deletion apps/mappings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class GeneralMapping(models.Model):
vendor_payment_account_name = models.CharField(max_length=255, help_text='VendorPayment Account name', null=True)
default_ccc_vendor_id = models.CharField(max_length=255, help_text='Default CCC Vendor ID', null=True)
default_ccc_vendor_name = models.CharField(max_length=255, help_text='Default CCC Vendor Name', null=True)
workspace = models.OneToOneField(Workspace, on_delete=models.PROTECT, help_text='Reference to Workspace model')
workspace = models.OneToOneField(Workspace, on_delete=models.PROTECT, help_text='Reference to Workspace model', related_name='general_mappings')
created_at = models.DateTimeField(auto_now_add=True, help_text='Created at datetime')
updated_at = models.DateTimeField(auto_now=True, help_text='Updated at datetime')

Expand Down
4 changes: 2 additions & 2 deletions apps/workspaces/apis/export_settings/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class Meta:
'reimbursable_expenses_object',
'corporate_credit_card_expenses_object',
'is_simplify_report_closure_enabled',
'name_in_journal_entry',
'auto_map_employees',
'employee_field_mapping'
]
Expand Down Expand Up @@ -122,7 +121,8 @@ def update(self, instance: Workspace, validated_data):
defaults={
'reimbursable_expenses_object': configurations['reimbursable_expenses_object'],
'corporate_credit_card_expenses_object': configurations['corporate_credit_card_expenses_object'],
'employee_field_mapping': configurations['employee_field_mapping']
'employee_field_mapping': configurations['employee_field_mapping'],
'auto_map_employees': configurations['auto_map_employees']
}
)

Expand Down

0 comments on commit cfb791b

Please sign in to comment.