4558 lines
88 KiB
JavaScript
4558 lines
88 KiB
JavaScript
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const db = require('../models');
|
|
const Users = db.users;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const TaxProfiles = db.tax_profiles;
|
|
|
|
const Settings = db.settings;
|
|
|
|
const HouseholdMembers = db.household_members;
|
|
|
|
const Employers = db.employers;
|
|
|
|
const IncomeEntries = db.income_entries;
|
|
|
|
const DeductionEntries = db.deduction_entries;
|
|
|
|
const Receipts = db.receipts;
|
|
|
|
const WizardCheckpoints = db.wizard_checkpoints;
|
|
|
|
const AuditEvents = db.audit_events;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const TaxProfilesData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tax_year": 2024,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"federal_state": "SH",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"assessment_type": "einzel",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"profile_title": "ESt 2024 Max Mustermann",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"disclaimer_acknowledged_text": "Keine Steuerberatung, nur Organisation",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"disclaimer_acknowledged": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"last_reviewed_at": new Date('2026-01-15T10:20:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tax_year": 2023,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"federal_state": "SL",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"assessment_type": "zusammen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"profile_title": "ESt 2023 Familie Musterfrau",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"disclaimer_acknowledged_text": "Keine Steuerberatung, nur Organisation",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"disclaimer_acknowledged": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"last_reviewed_at": new Date('2025-12-20T18:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tax_year": 2024,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"federal_state": "NI",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"assessment_type": "einzel",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"profile_title": "ESt 2024 Thomas Becker",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"disclaimer_acknowledged_text": "Keine Steuerberatung, nur Organisation",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"disclaimer_acknowledged": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"last_reviewed_at": new Date('2026-02-01T09:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tax_year": 2022,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"federal_state": "HH",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"assessment_type": "zusammen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"profile_title": "ESt 2022 Julia Schneider",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"disclaimer_acknowledged_text": "Keine Steuerberatung, nur Organisation",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"disclaimer_acknowledged": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"last_reviewed_at": new Date('2025-11-05T12:30:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const SettingsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"km_rate_eur": 0.3,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"homeoffice_rate_eur": 6,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"meal_allowance_rate_eur": 14,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"store_receipt_files_as_base64": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Standardpauschalen, Dateien nur als Metadaten",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"km_rate_eur": 0.3,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"homeoffice_rate_eur": 6,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"meal_allowance_rate_eur": 14,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"store_receipt_files_as_base64": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Gemeinsame Veranlagung, Belege zentral sammeln",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"km_rate_eur": 0.3,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"homeoffice_rate_eur": 6,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"meal_allowance_rate_eur": 14,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"store_receipt_files_as_base64": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Testprofil, Base64 Speicherung aktiv",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"km_rate_eur": 0.3,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"homeoffice_rate_eur": 5,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"meal_allowance_rate_eur": 14,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"store_receipt_files_as_base64": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Homeoffice Satz abweichend gesetzt",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const HouseholdMembersData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"full_name": "Max Mustermann",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"birth_date": new Date('1988-05-12T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"role_in_household": "other",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"occupation": "Softwareentwickler",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tax_class": "V",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"commute_distance_km": 18.5,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"workdays_per_year": 210,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"homeoffice_days": 60,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"full_name": "Lisa Mustermann",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"birth_date": new Date('1990-09-03T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"role_in_household": "person",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"occupation": "Projektmanagerin",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tax_class": "II",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"commute_distance_km": 12,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"workdays_per_year": 200,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"homeoffice_days": 40,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"full_name": "Mia Mustermann",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"birth_date": new Date('2018-02-21T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"role_in_household": "other",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"occupation": "Schuelerin",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tax_class": "II",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"commute_distance_km": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"workdays_per_year": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"homeoffice_days": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"full_name": "Erika Musterfrau",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"birth_date": new Date('1987-11-10T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"role_in_household": "other",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"occupation": "Lehrerin",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tax_class": "VI",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"commute_distance_km": 9.2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"workdays_per_year": 195,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"homeoffice_days": 15,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const EmployersData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employer_name": "MusterTech GmbH",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employer_city": "Muenchen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employer_identifier": "DE-MTG-001",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employment_start": new Date('2023-01-01T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employment_end": new Date('2026-12-31T00:00:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employer_name": "Planwerk AG",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employer_city": "Muenchen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employer_identifier": "DE-PWA-014",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employment_start": new Date('2022-06-01T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employment_end": new Date('2026-12-31T00:00:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employer_name": "Stadt Schule Koeln",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employer_city": "Koeln",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employer_identifier": "DE-SSK-777",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employment_start": new Date('2019-08-01T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employment_end": new Date('2026-12-31T00:00:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employer_name": "FinanzData Solutions",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employer_city": "Berlin",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employer_identifier": "DE-FDS-112",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employment_start": new Date('2021-04-15T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"employment_end": new Date('2026-12-31T00:00:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const IncomeEntriesData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"income_type": "sonstiges",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"gross_amount_eur": 72000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"wage_tax_eur": 12500,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"solidarity_tax_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"church_tax_eur": 950,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"health_insurance_eur": 4200,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"pension_insurance_eur": 6700,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"unemployment_insurance_eur": 900,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"long_term_care_insurance_eur": 1100,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"statement_date": new Date('2025-02-28T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Lohnsteuerbescheinigung Arbeitgeber 1",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"income_type": "lohn",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"gross_amount_eur": 64000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"wage_tax_eur": 11000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"solidarity_tax_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"church_tax_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"health_insurance_eur": 3900,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"pension_insurance_eur": 6000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"unemployment_insurance_eur": 820,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"long_term_care_insurance_eur": 980,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"statement_date": new Date('2025-02-28T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Keine Kirchensteuer",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"income_type": "lohn",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"gross_amount_eur": 52000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"wage_tax_eur": 8200,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"solidarity_tax_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"church_tax_eur": 640,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"health_insurance_eur": 3500,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"pension_insurance_eur": 5200,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"unemployment_insurance_eur": 700,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"long_term_care_insurance_eur": 860,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"statement_date": new Date('2024-02-29T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Lohnsteuerbescheinigung 2023",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"income_type": "lohn",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"gross_amount_eur": 88000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"wage_tax_eur": 17800,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"solidarity_tax_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"church_tax_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"health_insurance_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"pension_insurance_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"unemployment_insurance_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"long_term_care_insurance_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"statement_date": new Date('2025-02-28T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Privat versichert, Sozialabgaben nicht erfasst",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const DeductionEntriesData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"scope": "person",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"main_category": "haushaltsnahe_dienstleistungen_handwerker",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sub_category": "reinigung",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"entry_date": new Date('2024-12-31T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"title": "Pendlerpauschale 2024",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"amount_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"work_costs_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"material_costs_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"payment_method": "ueberweisung",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"quantity": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"unit_rate_eur": 0.3,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"distance_km": 18.5,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"days_count": 210,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"provider_name": "",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"period_start": new Date('2024-01-01T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"period_end": new Date('2024-12-31T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_checklist_item": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_paid_in_cash": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Berechnung ueber Rechner, Betrag wird aus Parametern ermittelt",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"scope": "household",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"main_category": "aussergewoehnliche_belastungen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sub_category": "krankheitskosten",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"entry_date": new Date('2024-12-31T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"title": "Homeoffice Pauschale 2024",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"amount_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"work_costs_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"material_costs_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"payment_method": "ueberweisung",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"quantity": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"unit_rate_eur": 6,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"distance_km": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"days_count": 40,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"provider_name": "",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"period_start": new Date('2024-01-01T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"period_end": new Date('2024-12-31T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_checklist_item": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_paid_in_cash": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "HO Tage aus Personendaten",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"scope": "person",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"main_category": "aussergewoehnliche_belastungen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sub_category": "homeoffice",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"entry_date": new Date('2024-03-18T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"title": "Ergonomische Tastatur",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"amount_eur": 129.99,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"work_costs_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"material_costs_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"payment_method": "sonstiges",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"quantity": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"unit_rate_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"distance_km": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"days_count": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"provider_name": "OfficeStore Online",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"period_start": new Date('2024-03-18T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"period_end": new Date('2024-03-18T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_checklist_item": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_paid_in_cash": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Arbeitsmittel fuer Homeoffice",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"scope": "household",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"main_category": "haushaltsnahe_dienstleistungen_handwerker",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sub_category": "pflegekosten",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"entry_date": new Date('2023-06-10T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"title": "Spende an Hilfswerk",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"amount_eur": 150,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"work_costs_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"material_costs_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"payment_method": "sonstiges",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"quantity": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"unit_rate_eur": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"distance_km": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"days_count": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"provider_name": "Deutsches Hilfswerk eV",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"period_start": new Date('2023-06-10T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"period_end": new Date('2023-06-10T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_checklist_item": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_paid_in_cash": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Zuwendungsbestaetigung vorhanden",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const ReceiptsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"scope": "person",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"receipt_category": "einkommen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"receipt_date": new Date('2024-01-15T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"title": "Tankbeleg Januar",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"amount_eur": 72.4,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"merchant": "Tankstelle Zentrum",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"document_number": "TB-2024-01-15",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"file_type": "other",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"metadata_only": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"file_base64": "",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Nur Metadaten gespeichert",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "zugeordnet",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"scope": "household",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"receipt_category": "einkommen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"receipt_date": new Date('2024-03-18T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"title": "Rechnung Tastatur",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"amount_eur": 129.99,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"merchant": "OfficeStore Online",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"document_number": "OS-88421",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"file_type": "jpg",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"metadata_only": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"file_base64": "",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "PDF liegt extern im Cloudspeicher",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "zugeordnet",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"scope": "household",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"receipt_category": "haushaltsnahe_dienstleistungen_handwerker",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"receipt_date": new Date('2023-06-12T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"title": "Spendenquittung Juni",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"amount_eur": 150,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"merchant": "Deutsches Hilfswerk eV",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"document_number": "SP-2023-0612",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"file_type": "none",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"metadata_only": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"file_base64": "",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Zuwendungsbestaetigung als PDF",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "geprueft",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"scope": "person",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"receipt_category": "aussergewoehnliche_belastungen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"receipt_date": new Date('2024-09-02T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"title": "Rechnung Heizungswartung",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"amount_eur": 320,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"merchant": "Haustechnik Nord",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"document_number": "HTN-2024-0902",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"file_type": "pdf",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"metadata_only": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"file_base64": "",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Arbeitskosten und Material getrennt",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "zugeordnet",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const WizardCheckpointsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"step": "haushalt_personen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"checkpoint_key": "year_state_assessment_set",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"checkpoint_title": "Steuerjahr und Bundesland gesetzt",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_done": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"completed_at": new Date('2026-01-10T08:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"hint": "Bitte Veranlagungsart pruefen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sort_order": 10,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"step": "sonderausgaben",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"checkpoint_key": "at_least_one_person",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"checkpoint_title": "Mindestens eine Person angelegt",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_done": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"completed_at": new Date('2026-01-10T08:10:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"hint": "Geburtsdatum je Person eintragen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sort_order": 20,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"step": "sonderausgaben",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"checkpoint_key": "income_entered",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"checkpoint_title": "Einkommen je Person erfasst",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_done": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"completed_at": new Date('2026-01-12T17:45:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"hint": "Sozialabgaben optional ergaenzen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sort_order": 30,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"step": "belege_zuordnung",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"checkpoint_key": "commute_or_homeoffice",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"checkpoint_title": "Fahrtkosten oder Homeoffice eingetragen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_done": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"completed_at": new Date('2026-01-13T19:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"hint": "Arbeitsmittel pruefen",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sort_order": 40,
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const AuditEventsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"event_at": new Date('2026-01-10T08:05:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"event_type": "reset",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"summary": "Pauschalen geprueft",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"details": "Kilometerpauschale 0.30, Homeoffice 6.00",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"event_at": new Date('2026-01-12T18:10:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"event_type": "export_json",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"summary": "JSON Export erstellt",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"details": "Export fuer ESt 2024 Max Mustermann",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"event_at": new Date('2025-12-20T18:05:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"event_type": "export_json",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"summary": "Daten importiert und zusammengefuehrt",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"details": "Import aus taxwizard_2023 Datei, Merge ausgewaehlt",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"event_at": new Date('2026-01-28T20:15:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"event_type": "import_merge",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"summary": "CSV Export erstellt",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"details": "Eintraege ohne Dateien exportiert",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateTaxProfileWithUser() {
|
|
|
|
const relatedUser0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const TaxProfile0 = await TaxProfiles.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (TaxProfile0?.setUser)
|
|
{
|
|
await
|
|
TaxProfile0.
|
|
setUser(relatedUser0);
|
|
}
|
|
|
|
const relatedUser1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const TaxProfile1 = await TaxProfiles.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (TaxProfile1?.setUser)
|
|
{
|
|
await
|
|
TaxProfile1.
|
|
setUser(relatedUser1);
|
|
}
|
|
|
|
const relatedUser2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const TaxProfile2 = await TaxProfiles.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (TaxProfile2?.setUser)
|
|
{
|
|
await
|
|
TaxProfile2.
|
|
setUser(relatedUser2);
|
|
}
|
|
|
|
const relatedUser3 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const TaxProfile3 = await TaxProfiles.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (TaxProfile3?.setUser)
|
|
{
|
|
await
|
|
TaxProfile3.
|
|
setUser(relatedUser3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateSettingWithTax_profile() {
|
|
|
|
const relatedTax_profile0 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const Setting0 = await Settings.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Setting0?.setTax_profile)
|
|
{
|
|
await
|
|
Setting0.
|
|
setTax_profile(relatedTax_profile0);
|
|
}
|
|
|
|
const relatedTax_profile1 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const Setting1 = await Settings.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Setting1?.setTax_profile)
|
|
{
|
|
await
|
|
Setting1.
|
|
setTax_profile(relatedTax_profile1);
|
|
}
|
|
|
|
const relatedTax_profile2 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const Setting2 = await Settings.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Setting2?.setTax_profile)
|
|
{
|
|
await
|
|
Setting2.
|
|
setTax_profile(relatedTax_profile2);
|
|
}
|
|
|
|
const relatedTax_profile3 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const Setting3 = await Settings.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (Setting3?.setTax_profile)
|
|
{
|
|
await
|
|
Setting3.
|
|
setTax_profile(relatedTax_profile3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateHouseholdMemberWithTax_profile() {
|
|
|
|
const relatedTax_profile0 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const HouseholdMember0 = await HouseholdMembers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (HouseholdMember0?.setTax_profile)
|
|
{
|
|
await
|
|
HouseholdMember0.
|
|
setTax_profile(relatedTax_profile0);
|
|
}
|
|
|
|
const relatedTax_profile1 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const HouseholdMember1 = await HouseholdMembers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (HouseholdMember1?.setTax_profile)
|
|
{
|
|
await
|
|
HouseholdMember1.
|
|
setTax_profile(relatedTax_profile1);
|
|
}
|
|
|
|
const relatedTax_profile2 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const HouseholdMember2 = await HouseholdMembers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (HouseholdMember2?.setTax_profile)
|
|
{
|
|
await
|
|
HouseholdMember2.
|
|
setTax_profile(relatedTax_profile2);
|
|
}
|
|
|
|
const relatedTax_profile3 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const HouseholdMember3 = await HouseholdMembers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (HouseholdMember3?.setTax_profile)
|
|
{
|
|
await
|
|
HouseholdMember3.
|
|
setTax_profile(relatedTax_profile3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateEmployerWithTax_profile() {
|
|
|
|
const relatedTax_profile0 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const Employer0 = await Employers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Employer0?.setTax_profile)
|
|
{
|
|
await
|
|
Employer0.
|
|
setTax_profile(relatedTax_profile0);
|
|
}
|
|
|
|
const relatedTax_profile1 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const Employer1 = await Employers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Employer1?.setTax_profile)
|
|
{
|
|
await
|
|
Employer1.
|
|
setTax_profile(relatedTax_profile1);
|
|
}
|
|
|
|
const relatedTax_profile2 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const Employer2 = await Employers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Employer2?.setTax_profile)
|
|
{
|
|
await
|
|
Employer2.
|
|
setTax_profile(relatedTax_profile2);
|
|
}
|
|
|
|
const relatedTax_profile3 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const Employer3 = await Employers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (Employer3?.setTax_profile)
|
|
{
|
|
await
|
|
Employer3.
|
|
setTax_profile(relatedTax_profile3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateEmployerWithHousehold_member() {
|
|
|
|
const relatedHousehold_member0 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const Employer0 = await Employers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Employer0?.setHousehold_member)
|
|
{
|
|
await
|
|
Employer0.
|
|
setHousehold_member(relatedHousehold_member0);
|
|
}
|
|
|
|
const relatedHousehold_member1 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const Employer1 = await Employers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Employer1?.setHousehold_member)
|
|
{
|
|
await
|
|
Employer1.
|
|
setHousehold_member(relatedHousehold_member1);
|
|
}
|
|
|
|
const relatedHousehold_member2 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const Employer2 = await Employers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Employer2?.setHousehold_member)
|
|
{
|
|
await
|
|
Employer2.
|
|
setHousehold_member(relatedHousehold_member2);
|
|
}
|
|
|
|
const relatedHousehold_member3 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const Employer3 = await Employers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (Employer3?.setHousehold_member)
|
|
{
|
|
await
|
|
Employer3.
|
|
setHousehold_member(relatedHousehold_member3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateIncomeEntryWithTax_profile() {
|
|
|
|
const relatedTax_profile0 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const IncomeEntry0 = await IncomeEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (IncomeEntry0?.setTax_profile)
|
|
{
|
|
await
|
|
IncomeEntry0.
|
|
setTax_profile(relatedTax_profile0);
|
|
}
|
|
|
|
const relatedTax_profile1 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const IncomeEntry1 = await IncomeEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (IncomeEntry1?.setTax_profile)
|
|
{
|
|
await
|
|
IncomeEntry1.
|
|
setTax_profile(relatedTax_profile1);
|
|
}
|
|
|
|
const relatedTax_profile2 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const IncomeEntry2 = await IncomeEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (IncomeEntry2?.setTax_profile)
|
|
{
|
|
await
|
|
IncomeEntry2.
|
|
setTax_profile(relatedTax_profile2);
|
|
}
|
|
|
|
const relatedTax_profile3 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const IncomeEntry3 = await IncomeEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (IncomeEntry3?.setTax_profile)
|
|
{
|
|
await
|
|
IncomeEntry3.
|
|
setTax_profile(relatedTax_profile3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateIncomeEntryWithHousehold_member() {
|
|
|
|
const relatedHousehold_member0 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const IncomeEntry0 = await IncomeEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (IncomeEntry0?.setHousehold_member)
|
|
{
|
|
await
|
|
IncomeEntry0.
|
|
setHousehold_member(relatedHousehold_member0);
|
|
}
|
|
|
|
const relatedHousehold_member1 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const IncomeEntry1 = await IncomeEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (IncomeEntry1?.setHousehold_member)
|
|
{
|
|
await
|
|
IncomeEntry1.
|
|
setHousehold_member(relatedHousehold_member1);
|
|
}
|
|
|
|
const relatedHousehold_member2 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const IncomeEntry2 = await IncomeEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (IncomeEntry2?.setHousehold_member)
|
|
{
|
|
await
|
|
IncomeEntry2.
|
|
setHousehold_member(relatedHousehold_member2);
|
|
}
|
|
|
|
const relatedHousehold_member3 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const IncomeEntry3 = await IncomeEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (IncomeEntry3?.setHousehold_member)
|
|
{
|
|
await
|
|
IncomeEntry3.
|
|
setHousehold_member(relatedHousehold_member3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateIncomeEntryWithEmployer() {
|
|
|
|
const relatedEmployer0 = await Employers.findOne({
|
|
offset: Math.floor(Math.random() * (await Employers.count())),
|
|
});
|
|
const IncomeEntry0 = await IncomeEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (IncomeEntry0?.setEmployer)
|
|
{
|
|
await
|
|
IncomeEntry0.
|
|
setEmployer(relatedEmployer0);
|
|
}
|
|
|
|
const relatedEmployer1 = await Employers.findOne({
|
|
offset: Math.floor(Math.random() * (await Employers.count())),
|
|
});
|
|
const IncomeEntry1 = await IncomeEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (IncomeEntry1?.setEmployer)
|
|
{
|
|
await
|
|
IncomeEntry1.
|
|
setEmployer(relatedEmployer1);
|
|
}
|
|
|
|
const relatedEmployer2 = await Employers.findOne({
|
|
offset: Math.floor(Math.random() * (await Employers.count())),
|
|
});
|
|
const IncomeEntry2 = await IncomeEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (IncomeEntry2?.setEmployer)
|
|
{
|
|
await
|
|
IncomeEntry2.
|
|
setEmployer(relatedEmployer2);
|
|
}
|
|
|
|
const relatedEmployer3 = await Employers.findOne({
|
|
offset: Math.floor(Math.random() * (await Employers.count())),
|
|
});
|
|
const IncomeEntry3 = await IncomeEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (IncomeEntry3?.setEmployer)
|
|
{
|
|
await
|
|
IncomeEntry3.
|
|
setEmployer(relatedEmployer3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateDeductionEntryWithTax_profile() {
|
|
|
|
const relatedTax_profile0 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const DeductionEntry0 = await DeductionEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (DeductionEntry0?.setTax_profile)
|
|
{
|
|
await
|
|
DeductionEntry0.
|
|
setTax_profile(relatedTax_profile0);
|
|
}
|
|
|
|
const relatedTax_profile1 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const DeductionEntry1 = await DeductionEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (DeductionEntry1?.setTax_profile)
|
|
{
|
|
await
|
|
DeductionEntry1.
|
|
setTax_profile(relatedTax_profile1);
|
|
}
|
|
|
|
const relatedTax_profile2 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const DeductionEntry2 = await DeductionEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (DeductionEntry2?.setTax_profile)
|
|
{
|
|
await
|
|
DeductionEntry2.
|
|
setTax_profile(relatedTax_profile2);
|
|
}
|
|
|
|
const relatedTax_profile3 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const DeductionEntry3 = await DeductionEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (DeductionEntry3?.setTax_profile)
|
|
{
|
|
await
|
|
DeductionEntry3.
|
|
setTax_profile(relatedTax_profile3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateDeductionEntryWithHousehold_member() {
|
|
|
|
const relatedHousehold_member0 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const DeductionEntry0 = await DeductionEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (DeductionEntry0?.setHousehold_member)
|
|
{
|
|
await
|
|
DeductionEntry0.
|
|
setHousehold_member(relatedHousehold_member0);
|
|
}
|
|
|
|
const relatedHousehold_member1 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const DeductionEntry1 = await DeductionEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (DeductionEntry1?.setHousehold_member)
|
|
{
|
|
await
|
|
DeductionEntry1.
|
|
setHousehold_member(relatedHousehold_member1);
|
|
}
|
|
|
|
const relatedHousehold_member2 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const DeductionEntry2 = await DeductionEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (DeductionEntry2?.setHousehold_member)
|
|
{
|
|
await
|
|
DeductionEntry2.
|
|
setHousehold_member(relatedHousehold_member2);
|
|
}
|
|
|
|
const relatedHousehold_member3 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const DeductionEntry3 = await DeductionEntries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (DeductionEntry3?.setHousehold_member)
|
|
{
|
|
await
|
|
DeductionEntry3.
|
|
setHousehold_member(relatedHousehold_member3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateReceiptWithTax_profile() {
|
|
|
|
const relatedTax_profile0 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const Receipt0 = await Receipts.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Receipt0?.setTax_profile)
|
|
{
|
|
await
|
|
Receipt0.
|
|
setTax_profile(relatedTax_profile0);
|
|
}
|
|
|
|
const relatedTax_profile1 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const Receipt1 = await Receipts.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Receipt1?.setTax_profile)
|
|
{
|
|
await
|
|
Receipt1.
|
|
setTax_profile(relatedTax_profile1);
|
|
}
|
|
|
|
const relatedTax_profile2 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const Receipt2 = await Receipts.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Receipt2?.setTax_profile)
|
|
{
|
|
await
|
|
Receipt2.
|
|
setTax_profile(relatedTax_profile2);
|
|
}
|
|
|
|
const relatedTax_profile3 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const Receipt3 = await Receipts.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (Receipt3?.setTax_profile)
|
|
{
|
|
await
|
|
Receipt3.
|
|
setTax_profile(relatedTax_profile3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateReceiptWithHousehold_member() {
|
|
|
|
const relatedHousehold_member0 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const Receipt0 = await Receipts.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Receipt0?.setHousehold_member)
|
|
{
|
|
await
|
|
Receipt0.
|
|
setHousehold_member(relatedHousehold_member0);
|
|
}
|
|
|
|
const relatedHousehold_member1 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const Receipt1 = await Receipts.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Receipt1?.setHousehold_member)
|
|
{
|
|
await
|
|
Receipt1.
|
|
setHousehold_member(relatedHousehold_member1);
|
|
}
|
|
|
|
const relatedHousehold_member2 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const Receipt2 = await Receipts.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Receipt2?.setHousehold_member)
|
|
{
|
|
await
|
|
Receipt2.
|
|
setHousehold_member(relatedHousehold_member2);
|
|
}
|
|
|
|
const relatedHousehold_member3 = await HouseholdMembers.findOne({
|
|
offset: Math.floor(Math.random() * (await HouseholdMembers.count())),
|
|
});
|
|
const Receipt3 = await Receipts.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (Receipt3?.setHousehold_member)
|
|
{
|
|
await
|
|
Receipt3.
|
|
setHousehold_member(relatedHousehold_member3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateWizardCheckpointWithTax_profile() {
|
|
|
|
const relatedTax_profile0 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const WizardCheckpoint0 = await WizardCheckpoints.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (WizardCheckpoint0?.setTax_profile)
|
|
{
|
|
await
|
|
WizardCheckpoint0.
|
|
setTax_profile(relatedTax_profile0);
|
|
}
|
|
|
|
const relatedTax_profile1 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const WizardCheckpoint1 = await WizardCheckpoints.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (WizardCheckpoint1?.setTax_profile)
|
|
{
|
|
await
|
|
WizardCheckpoint1.
|
|
setTax_profile(relatedTax_profile1);
|
|
}
|
|
|
|
const relatedTax_profile2 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const WizardCheckpoint2 = await WizardCheckpoints.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (WizardCheckpoint2?.setTax_profile)
|
|
{
|
|
await
|
|
WizardCheckpoint2.
|
|
setTax_profile(relatedTax_profile2);
|
|
}
|
|
|
|
const relatedTax_profile3 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const WizardCheckpoint3 = await WizardCheckpoints.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (WizardCheckpoint3?.setTax_profile)
|
|
{
|
|
await
|
|
WizardCheckpoint3.
|
|
setTax_profile(relatedTax_profile3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateAuditEventWithTax_profile() {
|
|
|
|
const relatedTax_profile0 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const AuditEvent0 = await AuditEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (AuditEvent0?.setTax_profile)
|
|
{
|
|
await
|
|
AuditEvent0.
|
|
setTax_profile(relatedTax_profile0);
|
|
}
|
|
|
|
const relatedTax_profile1 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const AuditEvent1 = await AuditEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (AuditEvent1?.setTax_profile)
|
|
{
|
|
await
|
|
AuditEvent1.
|
|
setTax_profile(relatedTax_profile1);
|
|
}
|
|
|
|
const relatedTax_profile2 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const AuditEvent2 = await AuditEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (AuditEvent2?.setTax_profile)
|
|
{
|
|
await
|
|
AuditEvent2.
|
|
setTax_profile(relatedTax_profile2);
|
|
}
|
|
|
|
const relatedTax_profile3 = await TaxProfiles.findOne({
|
|
offset: Math.floor(Math.random() * (await TaxProfiles.count())),
|
|
});
|
|
const AuditEvent3 = await AuditEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (AuditEvent3?.setTax_profile)
|
|
{
|
|
await
|
|
AuditEvent3.
|
|
setTax_profile(relatedTax_profile3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateAuditEventWithUser() {
|
|
|
|
const relatedUser0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const AuditEvent0 = await AuditEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (AuditEvent0?.setUser)
|
|
{
|
|
await
|
|
AuditEvent0.
|
|
setUser(relatedUser0);
|
|
}
|
|
|
|
const relatedUser1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const AuditEvent1 = await AuditEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (AuditEvent1?.setUser)
|
|
{
|
|
await
|
|
AuditEvent1.
|
|
setUser(relatedUser1);
|
|
}
|
|
|
|
const relatedUser2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const AuditEvent2 = await AuditEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (AuditEvent2?.setUser)
|
|
{
|
|
await
|
|
AuditEvent2.
|
|
setUser(relatedUser2);
|
|
}
|
|
|
|
const relatedUser3 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const AuditEvent3 = await AuditEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (AuditEvent3?.setUser)
|
|
{
|
|
await
|
|
AuditEvent3.
|
|
setUser(relatedUser3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
up: async (queryInterface, Sequelize) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await TaxProfiles.bulkCreate(TaxProfilesData);
|
|
|
|
|
|
|
|
|
|
await Settings.bulkCreate(SettingsData);
|
|
|
|
|
|
|
|
|
|
await HouseholdMembers.bulkCreate(HouseholdMembersData);
|
|
|
|
|
|
|
|
|
|
await Employers.bulkCreate(EmployersData);
|
|
|
|
|
|
|
|
|
|
await IncomeEntries.bulkCreate(IncomeEntriesData);
|
|
|
|
|
|
|
|
|
|
await DeductionEntries.bulkCreate(DeductionEntriesData);
|
|
|
|
|
|
|
|
|
|
await Receipts.bulkCreate(ReceiptsData);
|
|
|
|
|
|
|
|
|
|
await WizardCheckpoints.bulkCreate(WizardCheckpointsData);
|
|
|
|
|
|
|
|
|
|
await AuditEvents.bulkCreate(AuditEventsData);
|
|
|
|
|
|
await Promise.all([
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateTaxProfileWithUser(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateSettingWithTax_profile(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateHouseholdMemberWithTax_profile(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateEmployerWithTax_profile(),
|
|
|
|
|
|
|
|
|
|
await associateEmployerWithHousehold_member(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateIncomeEntryWithTax_profile(),
|
|
|
|
|
|
|
|
|
|
await associateIncomeEntryWithHousehold_member(),
|
|
|
|
|
|
|
|
|
|
await associateIncomeEntryWithEmployer(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateDeductionEntryWithTax_profile(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateDeductionEntryWithHousehold_member(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateReceiptWithTax_profile(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateReceiptWithHousehold_member(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateWizardCheckpointWithTax_profile(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateAuditEventWithTax_profile(),
|
|
|
|
|
|
|
|
|
|
await associateAuditEventWithUser(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]);
|
|
|
|
},
|
|
|
|
down: async (queryInterface, Sequelize) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await queryInterface.bulkDelete('tax_profiles', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('settings', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('household_members', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('employers', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('income_entries', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('deduction_entries', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('receipts', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('wizard_checkpoints', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('audit_events', null, {});
|
|
|
|
|
|
},
|
|
}; |