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

error if user tries to create a place with the defined dedup property in use #212

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

freddieptf
Copy link
Collaborator

@freddieptf freddieptf commented Oct 29, 2024

Fixes #181

This adds a way to prevent a user from creating duplicate places by defining a dedup_property on a place. The dedup_property is not globally unique but it is scoped to the parent place.

@freddieptf freddieptf marked this pull request as ready for review November 5, 2024 17:43
@freddieptf freddieptf requested a review from paulpascal November 5, 2024 17:43
@freddieptf freddieptf changed the title error if user tries to create a place with an in-use name error if user tries to create a place with the defined dedup property in use Nov 5, 2024
@@ -48,6 +48,7 @@ Property | Type | Description
`contact_types.contact_properties` | Array<ConfigProperty> | Defines the attributes which are collected and set on the user's primary contact doc. See [ConfigProperty](#ConfigProperty).
`contact_types.deactivate_users_on_replace` | boolean | Controls what should happen to the defunct contact and user documents when a user is replaced. When `false`, the contact and user account will be deleted. When `true`, the contact will be unaltered and the user account will be assigned the role `deactivated`. This allows for account restoration.
`contact_types.hint` | string | Provide a brief hint or description to clarify the expected input for the property.
`contact_types.dedup_property` | string | The place's `property_name` used to prevent creation of duplicates under a certain parent.
Copy link
Member

Choose a reason for hiding this comment

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

This PR which introduced a warning system also proposed a config schema which enforced uniqueness (or "dedupes").

I still would love to get that merged some day. It was derailed by becba25 and I never did the work to update it.

This seems like a partial implementation of features within that PR. It sure would be great to use something like the same config schema so that PR can eventually make it in.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh i forgot about that, i'll have a look at both #161 and #167 today

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.

Users should not be able to create duplicate places
2 participants