<div dir="ltr">I&#39;m working on a Catalyst application which mainly uses Catalyst::Controller::DBIC:API::REST to provide CRUD (Create, Read, Update, Delete) access to a MySQL database.<div><br></div><div>A feature the customer requires is that database records are non-destructive, in order to provide an additional level of security (the application is financial, so it&#39;s important that users cannot remove records from the actual database). The number of records which will be in the final system is relatively low, in the thousands, so the presence of defunct records will not slow down database operations).</div>
<div><br></div><div>To implement this I have added a flag, &quot;defunct&quot; to all database tables, and I now need to overload the delete and update methods as follows:</div><div><br></div><div>delete -&gt; set defunct to true</div>
<div><br></div><div>update -&gt; delete (see above) existing record, write updated record to the database.</div><div><br></div><div>What I can&#39;t work out at the moment is where in the inheritance hierarchy of classes are the methods I should overload. It doesn&#39;t look as though Catalyst::DBIC::API is the correct place, since there seem to be a number of similar but related methods to perform deletion and updating. The individual record methods as far as I can see are implemented at the bottom level of Moose, but I&#39;m not sufficiently comfortable with Moose internals to work out exactly what to overload. I&#39;m continuing with research on the matter, but thsi must be a behaviour which has been done before, and any advice or pointers to online documentation or tutorials would be very handy.</div>
<div><br></div><div>Thanks in advance for any help, I will summarize results to the list if need be.</div><div><br></div><div>Andy Holyer, Brighton, UK.</div><div><br></div><div><br></div></div>