Class ArtGallery.Address Extends (%SerialObject, %Populate, %XML.Adaptor, %ZEN.DataModel.Adaptor)
{

/* define attributes */
/// The street address
Property street As %String(MAXLEN = 80, POPSPEC = "Street()");

/// The city name
Property city As %String(MAXLEN = 40, POPSPEC = "City()");

/// The 2-letter state abbreviation
Property state As %String(MAXLEN = 2, POPSPEC = "USState()");

/// The 5-digit US Zone Improvement Plan code
Property zip As %String(MAXLEN = 5, POPSPEC = "USZip()");

}



Class ArtGallery.Telephone Extends (%SerialObject, %Populate, %XML.Adaptor, %ZEN.DataModel.Adaptor)
{

/* define attributes */
/// The area code
Property areaCode As %String(MAXLEN = 3);

/// The 7-digit phone number
Property phoneNumber As %String(MAXLEN = 8);

}


Class ArtGallery.Person [ Abstract ]
{

/* define attributes */
/// The person's ID
Property pid As %SmallInt;

/// The person's name
Property name As %Name(MAXLEN = 40);

/// The person's address
Property address As Address;

/// The person's telephone number
Property phone As Telephone;

}



/// A person who creates a work of art
Class ArtGallery.Artist Extends (Person, %Persistent, %XML.Adaptor, %ZEN.DataModel.Adaptor)
{

/// Date artist was interviwed
Property interviewDate As %Date;

/// Employee who interviewed the artist
Property interviewerName As %Name(MAXLEN = 40);

/// Total of the artist's sales last year
Property salesLastYear As %Currency;

/// Total of the artist's sales to date this year
Property salesThisYear As %Currency;

/// The artist's social security number
Property socialSecurityNumber As %String(MAXLEN = 9);

/// The artistic medium the artist usually uses.
Property usualMedium As %String(MAXLEN = 25);

/// The style the artist usually uses.
Property usualStyle As %String(MAXLEN = 25);

/// The artistic medium the artist usually uses.
Property usualType As %String(MAXLEN = 25);

/// The relationship from Artist to Artwork
Relationship Creates As ArtGallery.Artwork [ Cardinality = many, Inverse = CreatedBy ];

}


Class ArtGallery.Artwork Extends (%Persistent, %XML.Adaptor, %ZEN.DataModel.Adaptor)
{

/// Unique ID of the work of art
Property artworkID As %String(MAXLEN = 8);

/// The title of the work of art
Property workTitle As %String(MAXLEN = 80);

/// The asking price of the work of art
Property askingPrice As %Currency;

/// The date the work of art was first listed for sale by the gallery
Property dateListed As %Date;

/// The last date the work of art was included in a show by the gallery
Property dateShown As %Date;

/// The medium used for the work of art
Property workMedium As %String;

/// The dimensions of the work of art
Property workSize As %String;

/// The style used for the work of art
Property workStyle As %String;

/// The type of the work of art
Property workType As %String;

/// The year the work of art was completed
Property yearCompleted As %String;

Index artworkIDIndex On artworkID;

Relationship CreatedBy As ArtGallery.Artist [ Cardinality = one, Inverse = Creates ];

Index CreatedByIndex On CreatedBy;

}
