Cannot reuse auction_code after soft delete of CivilProspect
When a CivilBondProspect is soft deleted (archived = true), creating a new record with the same auction_code fails due to unique constraint "pk_civilbondprospect".
Full Error message: could not execute statement [ERROR: duplicate key value violates unique constraint "pk_civilbondprospect" Detail: Key (auction_code)=(DO2023/19-1127) already exists.] [insert into civil_bond_prospect (allocation_strategy,archived,auction_date,percentage,currency_clause,investor_type,isin,maturity_due_date,maturity_due_in_years,name,nominal_value,nominal_value_currency,start,"end",offered_amount,offered_amount_currency,offered_amount_total,offered_amount_total_currency,payed_amount,payed_amount_currency,payment_missmatch_amount,payment_missmatch_amount_currency,status,tender_type,total_allocated_amount,total_allocated_amount_currency,total_paid_number_of_bonds,total_return_amount,total_return_amount_currency,auction_code) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)]; SQL [insert into civil_bond_prospect (allocation_strategy,archived,auction_date,percentage,currency_clause,investor_type,isin,maturity_due_date,maturity_due_in_years,name,nominal_value,nominal_value_currency,start,"end",offered_amount,offered_amount_currency,offered_amount_total,offered_amount_total_currency,payed_amount,payed_amount_currency,payment_missmatch_amount,payment_missmatch_amount_currency,status,tender_type,total_allocated_amount,total_allocated_amount_currency,total_paid_number_of_bonds,total_return_amount,total_return_amount_currency,auction_code) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)]; constraint [pk_civilbondprospect]
Question: Is auction_code expected to remain globally unique for archived posts as well, and if current behavior is intended should error message be handled better?
@bojana.marojevikj please advise on the intended behavior.