# Problem domain Each pet is assigned a unique tag, which identifies pet owner. Valid owner has an address, which may later change. One owner may possess several pets. Pet store application supports creating tag identifiers. Owner information may be given, when a tag is created, or it may be updated later on a tag. # Solution domain ## Features - I can generate new tag for an owner - I can associate owner with an existing tag - I can update owner address on a existing tag - I can assign an existig tag to a pet ## Data model ### Data types * Pet * id : String * name : String * tag : String * Tag * tag : String * owner : Owner * Owner * name: String * address: Address * Address * city: String * street: String ### Data base * pets: Pet * tags: Tag ## Design ### Application services * /tags(post) * Features * I can generate tags * I can update owner address on tag * I can associate owner with a tag * Design * Create unique 'tag` identifier * Insert into `tags` * If address given: update address on existing tags * /tags(put) * Features * I can update owner address on tag * I can associate owner with a tag * Design * Update `tags` * Update address on existing tags * /pets(post): * Features * I can associate owner with a pet * Design * Create new entry in `pets` * Generate unique identifier ### Infrastructure services * /id/pet(get): ### Correctness * Unique pet id * Unique tag id * Reference integrity of pet tags for all pets there exists a unique valid tag entry * Owner address coherence: address on all tags with the same ower are equal ### Traces * tag-post (O1,A1): * * tag-pos( T1 ) * : pos * * * * Post pet1, tag1 * Post pet2, tag1 ==> ERROR * Post tag1, owner1, address1 * Post pet1, tag1 * Post tag2, owner1, address2 --> * Post pet1, tag1 * Post pet2, tag1 ==> ERROR * Put tag