Skip to content

Commit

Permalink
Add ProductCategoryIdent, ProductStoreDataDocument, and ProductIdenti…
Browse files Browse the repository at this point in the history
…ficationType URL Slug (#92)

* Add ProductOtherIdentification relationship to Product, Add ProductIdentificationType URL Slug, Add ProductStoreDataDocument and relationships, Add ProductCategoryIdent and relationships

* Rename typeEnumIds from Slug to UrlSlug for clarity, Add deprecation warning to ProductStore's dataDocumentId field descriptions, rename storeDataDocumentTypeEnumId to storeDocumentTypeEnumId, Rename ProductStoreDataDocument Enum descriptions, rename productCategoryIdentTypeEnumId to identTypeEnumId

* Rename storeDocumentTypeEnumId to typeEnumId
  • Loading branch information
acetousk committed Jul 13, 2022
1 parent f7f25c4 commit d5d4c48
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 7 deletions.
35 changes: 32 additions & 3 deletions entity/ProductDefinitionEntities.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This software is in the public domain under CC0 1.0 Universal plus a
This software is in the public domain under CC0 1.0 Universal plus a
Grant of Patent License.
To the extent possible under law, the author(s) have dedicated all
Expand Down Expand Up @@ -102,6 +102,8 @@ along with this software (see the LICENSE.md file). If not, see
<key-map field-name="productId"/></relationship>
<relationship type="many" related="mantle.product.ProductIdentification" short-alias="identifications">
<key-map field-name="productId"/></relationship>
<relationship type="many" related="mantle.product.ProductOtherIdentification" short-alias="otherIdentifications">
<key-map field-name="productId"/></relationship>
<relationship type="many" related="mantle.product.ProductParty" short-alias="parties">
<key-map field-name="productId"/></relationship>
<relationship type="many" related="mantle.product.ProductPrice" short-alias="prices">
Expand Down Expand Up @@ -175,6 +177,7 @@ along with this software (see the LICENSE.md file). If not, see
<detail relationship="dimensions"/>
<detail relationship="geos"><detail relationship="geo"/></detail>
<detail relationship="identifications"><detail relationship="type"/></detail>
<detail relationship="otherIdentifications"><detail relationship="type"/></detail>
<detail relationship="parties"><detail relationship="party" use-master="basic"/><detail relationship="role"/></detail>
<detail relationship="prices">
<detail relationship="type"/>
Expand Down Expand Up @@ -471,6 +474,7 @@ along with this software (see the LICENSE.md file). If not, see
<moqui.basic.Enumeration description="EAN" enumId="PidtEan" enumTypeId="ProductIdentificationType"/>
<moqui.basic.Enumeration description="GTIN" enumId="PidtGtin" enumTypeId="ProductIdentificationType"/>
<moqui.basic.Enumeration description="Library of Congress" enumId="PidtLoc" enumTypeId="ProductIdentificationType"/>
<!-- see https://en.wikipedia.org/wiki/Clean_URL#Slug -->
<moqui.basic.Enumeration description="URL Slug" enumId="PidtUrlSlug" enumTypeId="ProductIdentificationType"/>
<!-- see https://en.wikipedia.org/wiki/Harmonized_Tariff_Schedule_of_the_United_States and https://hts.usitc.gov/ -->
<moqui.basic.Enumeration description="HTS (Tariff)" enumId="PidtHts" enumTypeId="ProductIdentificationType"/>
Expand Down Expand Up @@ -740,6 +744,8 @@ along with this software (see the LICENSE.md file). If not, see
<key-map field-name="productCategoryId"/></relationship>
<relationship type="many" related="mantle.product.category.ProductCategoryParty" short-alias="parties">
<key-map field-name="productCategoryId"/></relationship>
<relationship type="many" related="mantle.product.category.ProductCategoryIdent" short-alias="identifications">
<key-map field-name="productCategoryId"/></relationship>
<relationship type="many" related="mantle.product.category.ProductCategoryMember" short-alias="products">
<key-map field-name="productCategoryId"/></relationship>
<relationship type="many" related="mantle.product.category.ProductCategoryRollup" short-alias="parents">
Expand All @@ -748,6 +754,8 @@ along with this software (see the LICENSE.md file). If not, see
<key-map field-name="productCategoryId" related="parentProductCategoryId"/></relationship>
<relationship type="many" related="mantle.product.feature.ProductCategoryFeatGrpAppl" short-alias="featureGroups">
<key-map field-name="productCategoryId"/></relationship>
<relationship type="many" related="mantle.product.store.ProductStoreCategory" short-alias="storeCategories">
<key-map field-name="productCategoryId"/></relationship>

<index name="CATEGORY_ID_PSEUDO" unique="true"><index-field name="pseudoId"/><index-field name="ownerPartyId"/></index>
<seed-data>
Expand Down Expand Up @@ -791,7 +799,7 @@ along with this software (see the LICENSE.md file). If not, see
<field name="sequenceNum" type="number-integer"/>
<field name="userId" type="id" default="ec.user.userId"/>
<relationship type="one" related="mantle.product.category.ProductCategory"/>
<relationship type="one" title="ProductCategoryContentType" related="moqui.basic.Enumeration">
<relationship type="one" title="ProductCategoryContentType" related="moqui.basic.Enumeration" short-alias="type">
<key-map field-name="categoryContentTypeEnumId"/></relationship>
<relationship type="one" related="mantle.product.store.ProductStore" short-alias="store"/>
<index name="PRDCAT_CNT_CTTP"><index-field name="productCategoryId"/><index-field name="categoryContentTypeEnumId"/></index>
Expand Down Expand Up @@ -819,6 +827,27 @@ along with this software (see the LICENSE.md file). If not, see
<relationship type="one" related="mantle.party.Party" short-alias="party"/>
<relationship type="one" related="mantle.party.RoleType" short-alias="role"/>
</entity>
<entity entity-name="ProductCategoryIdent" package="mantle.product.category">
<description>Based on mantle.product.ProductOtherIdentification to be a one ProductCategory to many ProductCategoryIdent.</description>
<field name="productCategoryIdentId" type="id" is-pk="true"/>
<field name="productCategoryId" type="id"/>
<field name="identTypeEnumId" type="id"/>
<field name="productStoreId" type="id"/>
<field name="marketSegmentId" type="id"/>
<field name="idValue" type="text-medium"/>
<relationship type="one" title="ProductCategoryIdentType" related="moqui.basic.Enumeration" short-alias="type">
<key-map field-name="identTypeEnumId"/></relationship>
<relationship type="one" related="mantle.product.category.ProductCategory" short-alias="productCategory"/>
<relationship type="one" related="mantle.product.store.ProductStore" short-alias="productStore"/>
<relationship type="one" related="mantle.marketing.segment.MarketSegment" short-alias="marketSegment"/>
<index name="PRODUCT_CAT_STR_ID_VAL" unique="false"><index-field name="idValue"/></index>
<seed-data>
<!-- Product Category Ident Type -->
<moqui.basic.EnumerationType description="Product Category Ident Type" enumTypeId="ProductCategoryIdentType"/>
<!-- see https://en.wikipedia.org/wiki/Clean_URL#Slug -->
<moqui.basic.Enumeration description="URL Slug" enumId="PcitUrlSlug" enumTypeId="ProductCategoryIdentType"/>
</seed-data>
</entity>

<entity entity-name="ProductCategoryMember" package="mantle.product.category">
<field name="productCategoryId" type="id" is-pk="true"/>
Expand Down Expand Up @@ -1179,7 +1208,7 @@ along with this software (see the LICENSE.md file). If not, see
<field name="applTypeEnumId" type="id"/>
<relationship type="one" related="mantle.product.category.ProductCategory" short-alias="category"/>
<relationship type="one" related="mantle.product.feature.ProductFeatureGroup" short-alias="group"/>
<relationship type="one" title="ProductFeatureApplType" related="moqui.basic.Enumeration">
<relationship type="one" title="ProductFeatureApplType" related="moqui.basic.Enumeration" short-alias="type">
<key-map field-name="applTypeEnumId"/></relationship>
</entity>
<entity entity-name="ProductFeatureGroup" package="mantle.product.feature" short-alias="featureGroups">
Expand Down
37 changes: 33 additions & 4 deletions entity/ProductStoreEntities.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This software is in the public domain under CC0 1.0 Universal plus a
This software is in the public domain under CC0 1.0 Universal plus a
Grant of Patent License.
To the extent possible under law, the author(s) have dedicated all
Expand Down Expand Up @@ -46,9 +46,10 @@ along with this software (see the LICENSE.md file). If not, see
<field name="storeDomain" type="text-short"><description>Store domain for use in emails</description></field>
<field name="profileUrlPath" type="text-medium"><description>Path to profile page for use in emails</description></field>
<field name="wikiSpaceId" type="id"><description>For a WikiSpace mounted as content, superceded by ProductStoreWikiSpace with spaceTypeEnumId=PstFull</description></field>
<field name="contentDataDocumentId" type="id"><description>The dataDocumentId to use for search of content pages in wikiSpaceId</description></field>
<field name="blogDataDocumentId" type="id"><description>The dataDocumentId to use for search of blog entries</description></field>
<field name="productDataDocumentId" type="id"><description>The dataDocumentId to use for product search</description></field>
<!-- TODO: Warning dataDocumentId fields are to be deprecated in favor of the ProductStoreDataDocument entity -->
<field name="contentDataDocumentId" type="id"><description>Warning: this field to be deprecated in favor of a ProductStoreDataDocument entity with a typeEnumId of PsdtContent. The dataDocumentId to use for search of content pages in wikiSpaceId</description></field>
<field name="blogDataDocumentId" type="id"><description>Warning: this field to be deprecated in favor a ProductStoreDataDocument entity with a typeEnumId of PsdtBlog. The dataDocumentId to use for search of blog entries</description></field>
<field name="productDataDocumentId" type="id"><description>Warning: this field to be deprecated in favor of a ProductStoreDataDocument entity with a typeEnumId of PsdtProduct. The dataDocumentId to use for product search</description></field>

<field name="defaultLocale" type="text-short"/>
<field name="defaultCurrencyUomId" type="id"/>
Expand All @@ -75,6 +76,8 @@ along with this software (see the LICENSE.md file). If not, see
<key-map field-name="returnPostalContactMechId"/></relationship>

<relationship type="one" related="moqui.resource.wiki.WikiSpace" short-alias="wikiSpace"/>
<relationship type="many" related="mantle.product.store.ProductStoreDataDocument" short-alias="storeDataDocuments">
<key-map field-name="productStoreId"/></relationship>
<relationship type="one" title="Content" related="moqui.entity.document.DataDocument" short-alias="contentDataDocument">
<key-map field-name="contentDataDocumentId"/></relationship>
<relationship type="one" title="Blog" related="moqui.entity.document.DataDocument" short-alias="blogDataDocument">
Expand Down Expand Up @@ -520,6 +523,32 @@ along with this software (see the LICENSE.md file). If not, see
</seed-data>
</entity>

<extend-entity entity-name="DataDocument" package="moqui.entity.document">
<relationship type="many" related="mantle.product.store.ProductStoreDataDocument" short-alias="storeDataDocuments">
<key-map field-name="dataDocumentId"/></relationship>
</extend-entity>
<entity entity-name="ProductStoreDataDocument" package="mantle.product.store">
<description>Relationship between the ProductStore and DataDocument Entities meant to replace ProductStore.productDataDocumentId fields and the like. See: https://forum.moqui.org/t/productstore-datadocument-options/303.</description>
<field name="productStoreId" type="id" is-pk="true"/>
<field name="typeEnumId" type="id" is-pk="true"/>
<field name="dataDocumentId" type="id"/>

<!-- TODO: Are these many relationships? -->
<relationship type="one" related="mantle.product.store.ProductStore" short-alias="store"/>
<relationship type="one" related="moqui.entity.document.DataDocument" short-alias="dataDocument"/>
<relationship type="one" title="StoreDataDocumentType" related="moqui.basic.Enumeration" short-alias="type">
<key-map field-name="typeEnumId"/></relationship>

<seed-data>
<moqui.basic.EnumerationType description="Product Store Data Document Type" enumTypeId="ProductStoreDataDocumentType"/>
<moqui.basic.Enumeration description="Product Search" enumId="PsdtProduct" enumTypeId="ProductStoreDataDocumentType"/>
<moqui.basic.Enumeration description="Category Search" enumId="PsdtCategory" enumTypeId="ProductStoreDataDocumentType"/>
<moqui.basic.Enumeration description="Blog Search" enumId="PsdtBlog" enumTypeId="ProductStoreDataDocumentType"/>
<!-- TODO: What type of Content was the ProductStore.contentDataDocumentId for? -->
<moqui.basic.Enumeration description="Content Search" enumId="PsdtContent" enumTypeId="ProductStoreDataDocumentType"/>
</seed-data>
</entity>

<entity entity-name="ProductStoreGroup" package="mantle.product.store">
<field name="productStoreGroupId" type="id" is-pk="true"/>
<field name="storeGroupTypeEnumId" type="id"/>
Expand Down

0 comments on commit d5d4c48

Please sign in to comment.