Skip to content

Commit

Permalink
feat(circulation): automatic renewals
Browse files Browse the repository at this point in the history
* Depends on rero/rero-ils#3691.
* Adds the info for auto_extends in the circulation log.
* Adds new notification type so that it can be displayed in the
library editor.
* Fixes the notification type `claim_issue` being wrongly displayed in
the library editor.

Co-Authored-by: Pascal Repond <[email protected]>
  • Loading branch information
PascalRepond committed Jul 8, 2024
1 parent 4660395 commit 95e2274
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
7 changes: 5 additions & 2 deletions projects/admin/src/app/classes/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export enum NotificationType {
RECALL = 'recall',
REQUEST = 'request',
TRANSIT_NOTICE = 'transit_notice',
ACQUISITION_ORDER = 'acquisition_order'
ACQUISITION_ORDER = 'acquisition_order',
CLAIM_ISSUE = 'claim_issue',
AUTO_EXTEND = 'auto_extend'
}

export class Notification {
Expand All @@ -39,7 +41,8 @@ export class Notification {
NotificationType.AVAILABILITY,
NotificationType.DUE_SOON,
NotificationType.OVERDUE,
NotificationType.RECALL
NotificationType.RECALL,
NotificationType.AUTO_EXTEND
],
library: [
NotificationType.AT_DESK,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@
</dd>

<!-- Operator -->
<dt class="col-4 label-title font-weight-bold fa-icon-operator"translate>Operator</dt>
<dd class="col-8">{{ record.metadata.user_name }}</dd>
<dt class="col-4 label-title font-weight-bold fa-icon-operator" translate>Operator</dt>
<dd class="col-8">
{{ record.metadata.user_name }}
@if (record.metadata.loan.auto_extend) {
({{ 'automatic renewal' | translate }})
}
</dd>
</dl>
</admin-circulation-log>
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,17 @@ export class LibraryFormService {
this.rolloverAccountTransferOptions = libSchema.schema.properties.rollover_settings.properties.
account_transfer.enum;

// DEV NOTES :: Why remove `acquisition_order`
// DEV NOTES :: Why remove `acquisition_order` an `claim_issue`
// `this.notificationTypes` is used to build the notification setting form ;
// but we need to remove `acquisition_order` from this list because the email
// but we need to remove `acquisition_order` and `claim_issue` from this list because the email
// used to send this kind of notification is selected by manager when it confirms
// and order. Then the email used is either :
// - related vendor email
// - library acquisition setting email
// - library (serial) acquisition setting email
// - custom email
this.notificationTypes = notifSchema.schema.properties.notification_type.enum
.filter(type => type != NotificationType.ACQUISITION_ORDER);
.filter(type => type != NotificationType.ACQUISITION_ORDER)
.filter(type => type != NotificationType.CLAIM_ISSUE);

this.build();
this.buildEvent.next(true);
Expand Down
1 change: 1 addition & 0 deletions projects/admin/src/manual_translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ _('at_desk');
_('booking');
_('request');
_('claim_issue');
_('auto_extend');
// - loan state
_('CREATED');
_('PENDING');
Expand Down

0 comments on commit 95e2274

Please sign in to comment.