Files
delphi-database-v2/data-import/fvarlkup_dcd3cdea-c8c4-4bbc-b0f3-1c814b961fb8.csv
HotSwapp 63809d46fb Fix PHONE.csv import duplicate constraint error
- Implement upsert logic in import_phone() function
- Check for existing (id, phone) combinations before insert
- Track duplicates within CSV to skip gracefully
- Update existing records instead of failing on duplicates
- Add detailed statistics: inserted, updated, skipped counts
- Align with upsert pattern used in other import functions
- Add documentation in docs/PHONE_IMPORT_FIX.md

Fixes: UNIQUE constraint failed: phone.id, phone.phone error
when re-importing or uploading CSV with duplicate entries
2025-10-12 21:45:30 -05:00

84 lines
3.9 KiB
CSV

Identifier,Query,Response
BEQ_1,"1st Bequest (relationship , full name)?",
BEQ_2,2nd Bequest?,
BEQ_3,3rd Bequest?,
BEQ_S,Special Bequest?,
BRANCH_OF_SERVICE,Military member's branch of service?,
CASE_CODE,Case code assigned by the Court?,40101
CASE_NUMBER,Case number assigned by the Court?,
CH_#,Number of children from this marriage (two)?,
CH_AGE1,Age of first child (5)?,
CH_DOB1,Birthdate of first child (##/##/##)?,
CH_NAME1,Full name of first child?,
CH_RESIDE,Children reside with (Petitioner/Respondent/Both)?,
C_GUARD_1,"Children's first guardian? (relationship, name)",
C_GUARD_2,Children's second guardian?,
C_GUARD_3,Children's third guardian?,
C_GUARD_4,Children's fourth guardian?,
DB_PLAN_NAME,Name of the defined benefit plan?,
DB_VALUATION_DATE,Date used to value DB plan (##/##/##)?,
DC_PLAN_NAME,Name of the defined contribution plan?,
DC_VALUATION_DATE,Date used to value DC plan (##/##/##)?,
DIED_ON,Date subject died (##/##/##)?,
DOLLARS_OF,"Month, year of purchasing power (June, 1999)?",
EIN,Employer identification number?,
FRINGE_PERCENTAGE,Fringe benefit percentage applied to loss?,
FUTURE_EC_LOSS,"Dollars of future earning capacity loss (633,210)?",
FUTURE_FRINGE_LOSS,"Dollar value of future fringe loss (82,554)?",
FUTURE_SERVICE_LOSS,"Dollar value of future service loss (82,554)?",
FUTURE_WAGE_LOSS,"Dollar value of future wage loss (633,210)?",
INJURED_ON,Date of injury (MM/DD/YY)?,
IS_PREGNANT,"Wife is (pregnant, not pregnant)?",
JUDGMENT_DATE,Date of Judgment (##/##/##)?,
MARRIAGE_#,"Marriage is (first, second, etc.)?",
MARRIED_CS,City and state of marriage?,
MARRIED_ON,Date of marriage (##/##/##)?,
MONTHS_WHILE_MARRIED,Months of military service while married?,
PAST_EC_LOSS,"Dollars of past earning capacity loss (45,332)?",
PAST_FRINGE_LOSS,"Dollar value of past fringe loss (16,985)?",
PAST_SERVICE_LOSS,"Dollar value of past service loss (16,985)?",
PAST_WAGE_LOSS,"Dollar value of past wage loss (45,332)?",
PAY_HOUR_#,Hourly rate for services (###.##)?,
PAY_HOUR_TEXT,Hourly rate for services (One Hundred)?,
PAY_MON_#,Minimum monthly payment (###.##)?,
PAY_MON_TEXT,Minimum monthly payment (Fifty)?,
PAY_RET_#,Retainer that is required (###.##)?,
PAY_RET_TEXT,Retainer that is required (Three Hundred)?,
PERCENT_AWARDED,Percent of defined benefit to Alternate Payee?,50.00% (Fifty Percent)
PLAN#,Plan number?,
PLAN_NAME,Full name of the retirement plan?,
POINTS_WHILE_MARRIED,Points accumulated by Reservist while married?,
P_GUARD_1,"1st Personal Guardian? (relationship, full name)",
P_GUARD_2,2nd Personal Guardian?,
P_GUARD_3,3rd Personal Guardian?,
P_GUARD_4,4th Personal Guardian?,
P_REP_1,"1st Personal Rep.? (relationship, full name)",
P_REP_2,2nd Personal Rep.?,
P_REP_3,3rd Personal Rep.?,
P_REP_4,4th Personal Rep.?,
SECTION,Pertinent section of state statutes?,767.255
SEPARATED_ON,Date of separation (##/##/##)?,
SERVICE_WAGE_RATE,Hourly rate used to value lost services (10.00)?,
SUE_FOR_#,Amount suing for (###.##)?,
SUE_FOR_TEXT,Amount suing for (One Thousand Thirty Two)?,
SUE_FOR_YEAR,Suing for services provided in year (####)?,
SUMMONS_FILED,Date summons was filed (##/##/##)?,
SUMMONS_SERVED,Date summons was served (##/##/##)?,
TAX_YEAR,Tax year (####)?,
TOTAL_EC_LOSS,"Dollar value of earning capacity loss (875,244)?",
TOTAL_LOSS,"Dollar value of all losses (875,244)?",
TRIAL_DATE,Date of trial (##/##/##)?,
TRUSTEE_1,"1st Trustee? (relationship, full name)",
TRUSTEE_2,2nd Trustee?,
TRUSTEE_3,3rd Trustee?,
TRUSTEE_4,4th Trustee?,
VEN_CITY,County of venue?,Milwaukee
VEN_CNTY,City of venue?,Milwaukee
VEN_ST,State of venue?,Wisconsin
^ALTP,"Alternate Payee is (1 = client, 2 = other party)?",
^HUS,"Husband is (1 = client, 2 = other party)?",
^PART,"Participant is (1 = client, 2 = other party)?",
^PET,"Petitioner is (1 = client, 2 = other party)?",
^RES,"Respondent is (1 = client, 2 = other party)?",
^WIF,"Wife is (1 = client, 2 = other party)?",