<!-- 
RSS generated by JIRA (1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d) at Thu Feb 08 23:17:13 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>FOLIO Jira</title>
    <link>https://folio-org.atlassian.net</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>1001.0.0-SNAPSHOT</version>
        <build-number>100246</build-number>
        <build-date>07-02-2024</build-date>
    </build-info>

<item>
            <title>[FOLIO-1965] API design for deletion prevention</title>
                <link>https://folio-org.atlassian.net/browse/FOLIO-1965</link>
                <project id="10290" key="FOLIO">FOLIO</project>
                    <description>&lt;p&gt;In order to support the following user experience during deletion, with usage checks implemented in the backend&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;click delete&lt;/li&gt;
	&lt;li&gt;present modal to disallow if in use&lt;/li&gt;
	&lt;li&gt;otherwise present confirmation modal&lt;/li&gt;
	&lt;li&gt;attempt to delete if confirmed&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;At the moment, the checks for usage tend to be performed by the UI.&lt;/p&gt;

&lt;p&gt;We need to decide:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;What is the API for checking that a record is in-use or not (e.g. endpoint structure, responses etc)?&lt;/li&gt;
	&lt;li&gt;How do we provide a client meaningful response to explain why a delete fails?&lt;/li&gt;
	&lt;li&gt;How do we check for usage (especially when usage could be in other modules / contexts)?&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;b&gt;Assumptions&lt;/b&gt;&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Usage checks for in use will be performed during DELETE endpoint execution, as well as the mechanism we decide upon to check before issuing the delete.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;b&gt;Context&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Some conversation around this topic has already happened on 
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;CIRC-179&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/CIRC-179&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;in-use loan policies may be deleted&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10300?size=medium&quot; /&gt;
            CIRC-179
        &lt;/a&gt;
                                                    &lt;span class=&quot;aui-lozenge aui-lozenge-subtle aui-lozenge-success jira-macro-single-issue-export-pdf&quot;&gt;Closed&lt;/span&gt;
            &lt;/span&gt;
, 
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;CIRCSTORE-121&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/CIRCSTORE-121&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;[SPIKE] Investigate how to prohibit deleting patron notice policy that is currently in use&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium&quot; /&gt;
            CIRCSTORE-121
        &lt;/a&gt;
                                                    &lt;span class=&quot;aui-lozenge aui-lozenge-subtle aui-lozenge-success jira-macro-single-issue-export-pdf&quot;&gt;Closed&lt;/span&gt;
            &lt;/span&gt;
 and 
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;UICIRC-185&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/UICIRC-185&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;Not allow user to delete patron notice template if currently in use&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10309?size=medium&quot; /&gt;
            UICIRC-185
        &lt;/a&gt;
                                                    &lt;span class=&quot;aui-lozenge aui-lozenge-subtle aui-lozenge-success jira-macro-single-issue-export-pdf&quot;&gt;Closed&lt;/span&gt;
            &lt;/span&gt;
&lt;/p&gt;</description>
                <environment></environment>
        <key id="81197">FOLIO-1965</key>
            <summary>API design for deletion prevention</summary>
                <type id="10003" iconUrl="https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium">Task</type>
                                            <priority id="10001" iconUrl="https://dev.folio.org/assets/jira-priority/jira-p2.svg">P2</priority>
                        <status id="6" iconUrl="https://folio-org.atlassian.net/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Won&apos;t Do</resolution>
                                                        <assignee accountid="-1">Unassigned</assignee>
                                                                <reporter accountid="63e2a2771b13d42998e4e706">Marc Johnson</reporter>
                                    <labels>
                            <label>potential-decision</label>
                            <label>tech-debt</label>
                    </labels>
                <created>Fri, 12 Apr 2019 14:10:02 +0000</created>
                <updated>Wed, 25 Jan 2023 14:39:52 +0000</updated>
                            <resolved>Wed, 25 Jan 2023 14:39:52 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>7</watches>
                                                                <comments>
                                                            <comment id="193994" author="63e2a2771b13d42998e4e706" created="Fri, 12 Apr 2019 15:20:41 +0000"  >&lt;p&gt;It seems the most urgent aspect of this is to decide on an API design for how a client can determine if a record can be deleted.&lt;/p&gt;

&lt;p&gt;I did some quick searching and it appears that this isn&apos;t a common pattern in API design, so there appears to be limited guidance available (or I&apos;m not searching for it well).&lt;/p&gt;

&lt;p&gt;I imagine most systems either do client based checks or refuse deletion after confirmation.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5ee89462f7aa140abd82d11d&quot; class=&quot;user-hover&quot; rel=&quot;5ee89462f7aa140abd82d11d&quot; data-account-id=&quot;5ee89462f7aa140abd82d11d&quot; accountid=&quot;5ee89462f7aa140abd82d11d&quot; rel=&quot;noreferrer&quot;&gt;Julian Ladisch&lt;/a&gt; has proposed adding a nested endpoint to records named &lt;tt&gt;/deletable&lt;/tt&gt; for example &lt;tt&gt;/loan-policy-storage/loan-policies/&lt;span class=&quot;error&quot;&gt;&amp;#91;loanPolicyId&amp;#93;&lt;/span&gt;/deletable&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;What are people&apos;s thoughts about this idea? &lt;/p&gt;

&lt;p&gt;Are there any viable alternatives (e.g. a property or properties within the record)?&lt;/p&gt;</comment>
                                                            <comment id="193997" author="557058:09292aa8-9d37-482b-b244-17349bbbf497" created="Tue, 16 Apr 2019 09:15:42 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=63e2a2771b13d42998e4e706&quot; class=&quot;user-hover&quot; rel=&quot;63e2a2771b13d42998e4e706&quot; data-account-id=&quot;63e2a2771b13d42998e4e706&quot; accountid=&quot;63e2a2771b13d42998e4e706&quot; rel=&quot;noreferrer&quot;&gt;Marc Johnson&lt;/a&gt; From my experience API usually checks delete availability for the item at the time of DELETE api request, and in case of deny sends error response with some additional data that could be helpful on UI to show a valuable message for end user.&lt;br/&gt;
In case you call a separate endpoint to check delete availability - it doesn&apos;t guarantee that item will be still available to delete on the time of actual DELETE response.&lt;br/&gt;
So it might be a good idea to define error codes and structure for &lt;em&gt;bad&lt;/em&gt; responses, 
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;FOLIO-671&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/FOLIO-671&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;Respond with descriptive information in consistent JSON on bad requests and server errors&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium&quot; /&gt;
            FOLIO-671
        &lt;/a&gt;
                                                    &lt;span class=&quot;aui-lozenge aui-lozenge-subtle aui-lozenge-success jira-macro-single-issue-export-pdf&quot;&gt;Closed&lt;/span&gt;
            &lt;/span&gt;
, 
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;FOLIO-1716&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/FOLIO-1716&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;Uniquely identify backend API validation errors&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium&quot; /&gt;
            FOLIO-1716
        &lt;/a&gt;
                                                    &lt;span class=&quot;aui-lozenge aui-lozenge-subtle aui-lozenge-success jira-macro-single-issue-export-pdf&quot;&gt;Closed&lt;/span&gt;
            &lt;/span&gt;
, so all API clients can consume them with proper UX.&lt;/p&gt;</comment>
                                                            <comment id="194001" author="63e2a2771b13d42998e4e706" created="Tue, 16 Apr 2019 11:29:05 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A09292aa8-9d37-482b-b244-17349bbbf497&quot; class=&quot;user-hover&quot; rel=&quot;557058:09292aa8-9d37-482b-b244-17349bbbf497&quot; data-account-id=&quot;557058:09292aa8-9d37-482b-b244-17349bbbf497&quot; accountid=&quot;557058:09292aa8-9d37-482b-b244-17349bbbf497&quot; rel=&quot;noreferrer&quot;&gt;Aliaksei Chumakou&lt;/a&gt; Thanks for your comments&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;From my experience API usually checks delete availability for the item at the time of DELETE api request, and in case of deny sends error response with some additional data that could be helpful on UI to show a valuable message for end user.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;That fits with my experience. There is an assumption in the above, that any checks performed prior to deletion are also performed during deletion. I will try to make that more explicit.&lt;/p&gt;

&lt;p&gt;At the moment, the &lt;a href=&quot;https://github.com/folio-org/raml/blob/69f6074f5f48fd58e379e9ae76c892aa68c115ea/rtypes/item-collection.raml#L41&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;standard resource types&lt;/a&gt; allow DELETE to respond with 400 with a plain text body.&lt;/p&gt;

&lt;p&gt;Reviewing whether that is sufficient is likely part of this decision. And I agree, those two issues are related to this topic.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;In case you call a separate endpoint to check delete availability - it doesn&apos;t guarantee that item will be still available to delete on the time of actual DELETE response.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Indeed, it does not, the deletion itself could still fail as the circumstances have changed since the pre-check.&lt;/p&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="76703">MODTEMPENG-15</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="80912">FOLIO-1716</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="58664">UICIRC-184</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="58662">UICIRC-185</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="47471">CIRC-179</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="29758">CIRCSTORE-121</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="80227">FOLIO-671</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummarycf">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10057" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Development Team</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10144"><![CDATA[Core: Platform]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10019" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|hzzmjj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10020" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10024" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>[CHART] Date of First Response</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 16 Apr 2019 09:15:42 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10025" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>[CHART] Time in Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>