Logo: Relish

  1. Sign in

Project: My-project

Create person

As a user
I want to create a person
So that I can later use this person in managements and/or tenancies

Background
Given
that a realm is active
Scenarios
Create a simple person

Here we are simply creating a person without having its contacts, addresses, ownerships or any contact points.

Given
a "Create Person" job version "1" is invoked with the following uic:
targets attributes
<ns>;Person;<person_id>;0 <person_id>;given_name;Emma
<person_id>;family_name;Ward
When
the request to "Create Person" is received
Then
a new "Person" will be created with:
attribute value
given_name Emma
family_name Ward
domain_obj_state active
And
the "Person" will have the following objects attached:
object_type
Addresses
Contacts
ContactPoints
Ownerships
Create a person with an address

This scenario creates a person with an address. Even if the address already exists in the system,
we would still need to create one i.e. duplicate data.

Given
a "Create Person" job version "1" is invoked with the following uic:
targets attributes
<ns>;Person;<person_id>;0 <person_id>;given_name;Emma
<person_id>;family_name;Ward
<ns>;Address;<address_id>;0 <address_id>;type;residential
<address_id>;country;Australia
<address_id>;locality;Sydney
<address_id>;region;NSW
<address_id>;postcode;2000
<address_id>;street_address;46 Pitt St
<address_id>;google_map_link;http://goo.gl/maps/1AhUA
When
the request to "Create Person" is received
Then
'the objects as per -create a simple person- scenario will be created'
And
an :address will be created under "Addresses"
Create a person with contact

A contact could be of type mobile, email, fax, etc. Please see spec for a full list.

Given
a "Create Person" job version "1" is invoked with the following uic:
targets attributes
<ns>;Person;<person_id>;0 <person_id>;given_name;Emma
<person_id>;family_name;Ward
<ns>;Contact;<email_contact_id>;0 <email_contact_id>;type;email
<email_contact_id>;value;[email protected]
<email_contact_id>;preferred;true
When
the request to "Create Person" is received
Then
'the objects as per -create a simple person- scenario will be created'
And
a :contact will be created under "Contacts"
Create a person who owns a property that already exists

If a property already exists, then this context will not create a new property.
It will simply references the property id via an Asset object.

Given
a "Create Person" job version "1" is invoked with the following uic:
targets attributes
<ns>;Person;<person_id>;0 <person_id>;given_name;Emma
<person_id>;family_name;Ward
<ns>;Asset;<property_asset_id>;0 <property_asset_id>;type;Property
<property_asset_id>;domain_obj_label;whatever is being displayed
<property_asset_id>;reference_id;633b1030-d873-11e2-a28f-0800200c9a66
And
the "Property" with id "633b1030-d873-11e2-a28f-0800200c9a66" is a :property_owned that already exists
When
the request to "Create Person" is received
Then
'the objects as per -create a simple person- scenario will be created'
And
a :property_asset will be created under "Ownerships"
Create a person who owns a property that does not already exist

If a property already exists, then this context will not create a new property.
It will simply references the property id via an Asset object.

Given
a "Create Person" job version "1" is invoked with the following uic:
targets attributes
<ns>;Person;<person_id>;0 <person_id>;given_name;Emma
<person_id>;family_name;Ward
<ns>;Asset;<property_asset_id>;0 <property_asset_id>;type;Property
<property_asset_id>;domain_obj_label;whatever is being displayed
<property_asset_id>;reference_id;633b1030-d873-11e2-a28f-0800200c9a66
And
'the property with id 633b1030-d873-11e2-a28f-0800200c9a66 does not exist'
When
the request to "Create Person" is received
Then
'the objects as per -create a simple person- scenario will be created'
And
a :property_asset will be created under "Ownerships"
And
a :property_owned will be created under "Properties"
Create a person who has a contact point of another person that already exists

For example, Emma Ward wants to delegate all repair calls to another person.

Given
a "Create Person" job version "1" is invoked with the following uic:
targets attributes
<ns>;Person;<person_id>;0 <person_id>;given_name;Emma
<person_id>;family_name;Ward
<ns>;ContactVia;<contact_point_id>;0 <contact_point_id>;reference_id;foreign_key_to_person_or_org
<contact_point_id>;type;Person
<contact_point_id>;purpose;Repair
And
the "Person" with id "foreign_key_to_person_or_org" is a :person_as_a_contact_point that already exists
When
the request to "Create Person" is received
Then
'the objects as per -create a simple person- scenario will be created'
And
a :contact_via_another_person will be created under "ContactPoints"
Create a person who has a contact point of a person that does not yet exist

For example, Emma Ward wants to delegate all repair calls to another person.

Given
a "Create Person" job version "1" is invoked with the following uic:
targets attributes
<ns>;Person;<person_id>;0 <person_id>;given_name;Emma
<person_id>;family_name;Ward
<ns>;ContactVia;<contact_point_id>;0 <contact_point_id>;reference_id;foreign_key_to_person_or_org
<contact_point_id>;type;Person
<contact_point_id>;purpose;Repair
And
'the person with id foreign_key_to_person_or_org does not yet exist'
When
the request to "Create Person" is received
Then
'the objects as per -create a simple person- scenario will be created'
And
a :contact_via_another_person will be created under "ContactPoints"
And
a :person_as_a_contact_point will be created under "People"
Create a person who is a contact point of an organisation or a person that already exists

Here, Emma Ward is the contact point of ABC organisation for any repair related tasks.
If Emma ward was the contact point of another person, then the type of the ContactFor will be Person.

Given
a "Create Person" job version "1" is invoked with the following uic:
targets attributes
<ns>;Person;<person_id>;0 <person_id>;given_name;Emma
<person_id>;family_name;Ward
<ns>;ContactFor;<contact_point_id>;0 <contact_point_id>;reference_id;abc_organisation_foreign_key
<contact_point_id>;type;Organisation
<contact_point_id>;purpose;Repair
And
the "Organisation" with id "abc_organisation_foreign_key" is an :organisation_who_has_a_contact_point that already exists
When
the request to "Create Person" is received
Then
'the objects as per -create a simple person- scenario will be created'
And
a :contact_for_abc_organisation will be created under "ContactPoints"
Create a person who is a contact point of an organisation or a person that does not exist

Here, Emma Ward is the contact point of another Person.
Note, the type of ContactFor is a Person.

Given
a "Create Person" job version "1" is invoked with the following uic:
targets attributes
<ns>;Person;<person_id>;0 <person_id>;given_name;Emma
<person_id>;family_name;Ward
<ns>;ContactFor;<contact_point_id>;0 <contact_point_id>;reference_id;foreign_key_to_person_or_org
<contact_point_id>;type;Person
<contact_point_id>;purpose;Repair
And
'the Person with id another_person_foreign_key does not exist'
When
the request to "Create Person" is received
Then
'the objects as per -create a simple person- scenario will be created'
And
a :contact_for_another_person will be created under "ContactPoints"
And
a :person_as_a_contact_point will be created under "People"

Last published over 4 years ago by nbeagley.