Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circulation: Policy configuration #124

Merged
merged 1 commit into from
Oct 18, 2018

Conversation

BadrAly
Copy link

@BadrAly BadrAly commented Oct 17, 2018

  • NEW: add circulation policy objects

Co-Authored-by: Aly Badr [email protected]
Co-Authored-by: Gianni Pante [email protected]

To test

  • get the PR branch

  • ./scripts/bootstrap

  • ./scripts/setup

  • run the tests

  • Display the list of available circulation policies (cipo), add, delete and edit

@BadrAly BadrAly force-pushed the baa-#702-circulation-policies branch from 6b52a0c to c6c1b41 Compare October 17, 2018 15:04
Copy link

@iGormilhit iGormilhit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean the number of commits that are part of this PR (should be only one, must be a rebase problem).

Some files shouldn't be part of this PR, such as:

  • all the translations files
  • the run-tests.sh file
  • maybe others... 😉

Tests run successfully. 👍

{
"$schema": "https://ils.test.rero.ch/schema/circ_policies/circ_policy-v0.0.1.json",
"name": "standard",
"description": "default standard circulation policy",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Start the description with a capital and end it with a dot.

{
"$schema": "https://ils.test.rero.ch/schema/circ_policies/circ_policy-v0.0.1.json",
"name": "short",
"description": "short circulation policy",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Start the description with a capital and end it with a dot.

{
"$schema": "https://ils.test.rero.ch/schema/circ_policies/circ_policy-v0.0.1.json",
"name": "on-site",
"description": "on-site circulation policy",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Start the description with a capital and end it with a dot.

{
"key": "name",
"validationMessage": {
"alreadyTakenMessage": "The circulation policy name is already taken"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing dot at the end of the message.

{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "CircPolicy",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not Circulation policy?

"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "CircPolicy",
"description": "JSON schema for circ_policies.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be JSON schema for circulation policies.

"properties": {
"$schema": {
"title": "Schema",
"description": "Schema to validate circ_policies records against.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change circ_policies to circulation policies.

"minLength": 9
},
"pid": {
"title": "CircPolicy ID",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change CircPolicy to Circulation policy. And check all the JSON schema with this rule.

},
"name": {
"title": "CircPolicy name",
"description": "The name of the circulation policy",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing dot at the end of the message. And check all the description messages.

},
"organisation_pid": {
"title": "Organisation ID",
"description": "The organisation_pid pid of this circulation policy",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PID of the organisation in which this circulation policy applies. Or something like it.

from ..minters import id_minter
from .providers import CircPolicyProvider

circ_policies_id_minter = partial(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

singular on policies ?

class CircPolicyIdentifier(RecordIdentifier):
"""Sequence generator for CircPolicy identifiers."""

__tablename__ = 'circ_policies_id'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

singular on policies ?

{%- block javascript %}
{{ super() }}
{% assets "rero_ils_tooltips_js" %}<script src="{{ ASSET_URL }}"></script>{% endassets %}
{%- endblock javascript %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent is 2 spaces (file)

"""Circ policy name Validate."""
response = {
'name': None,
'organisation_pid': None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this (unused)

),
cipo=dict(
pid_type='cipo',
pid_minter='circ_policies_id',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

singular on policies ?

from rero_ils.modules.circ_policies.fetchers import \
circ_policies_id_fetcher as fetcher
from rero_ils.modules.circ_policies.minters import \
circ_policies_id_minter as minter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Singular on policies ?

data = {}
# first record
rec_uuid = uuid4()
pid1 = minters.circ_policies_id_minter(rec_uuid, data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Singular on policies ?

# second record
data = {}
rec_uuid = uuid4()
pid2 = minters.circ_policies_id_minter(rec_uuid, data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Singular on policies ?

"number_renewals": {
"title": "Maximum number of renewals",
"description": "Maximum number of renewals allowed",
"type": "integer"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default value ?

@BadrAly BadrAly force-pushed the baa-#702-circulation-policies branch 6 times, most recently from 85c4e85 to 24eb0ff Compare October 18, 2018 08:57
* NEW: add circulation policy objects

Co-Authored-by: Aly Badr <[email protected]>
Co-Authored-by: Gianni Pante <[email protected]>
@BadrAly BadrAly force-pushed the baa-#702-circulation-policies branch from 24eb0ff to c59640b Compare October 18, 2018 09:00
@iGormilhit iGormilhit merged commit 937a524 into rero:master Oct 18, 2018
@BadrAly BadrAly deleted the baa-#702-circulation-policies branch January 10, 2019 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants