From 5f83560a4de6c3b665a4da90c099b02d4b156f1d Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Fri, 10 Jun 2022 19:13:18 +0530 Subject: [PATCH 1/3] Implemented: shipment schema for apps taking reference from moqui(#2f89b7j) --- src/types/ContactMech.ts | 51 +++++++++ src/types/Enumeration.ts | 13 +++ src/types/Geo.ts | 10 ++ src/types/Identification.ts | 11 ++ src/types/Party.ts | 51 +++++++++ src/types/Product.ts | 218 ++++++++++++++++++++++++++++++++++++ src/types/Status.ts | 6 + src/types/Uom.ts | 6 + src/types/index.ts | 19 ++++ 9 files changed, 385 insertions(+) create mode 100644 src/types/ContactMech.ts create mode 100644 src/types/Enumeration.ts create mode 100644 src/types/Geo.ts create mode 100644 src/types/Identification.ts create mode 100644 src/types/Party.ts create mode 100644 src/types/Product.ts create mode 100644 src/types/Status.ts create mode 100644 src/types/Uom.ts create mode 100644 src/types/index.ts diff --git a/src/types/ContactMech.ts b/src/types/ContactMech.ts new file mode 100644 index 0000000..5219ed7 --- /dev/null +++ b/src/types/ContactMech.ts @@ -0,0 +1,51 @@ +import { Geo } from "./index" + +export interface ContactMech { + contactMechId: string, + contactMechTypeEnumId?: string, + dataSourceId?: string, + infoString?: string, + gatewayCimId?: string, + trustLevelEnumId?: string, + validateMessage?: string, + paymentFraudEvidenceId?: string, + replacesContactMechId?: string, + telecomNumber?: { + contactMechId: string, + countryCode?: string, + areaCode?: string, + contactNumber?: string, + askForName?: string, + }, + postalAddress?: { + contactMechId: string, + toName?: string, + attnName?: string, + address1?: string, + address2?: string, + unitNumber?: string, + directions?: string, + city?: string, + cityGeoId?: string, + schoolDistrictGeoId?: string, + countyGeoId?: string, + stateProvinceGeoId?: string, + countryGeoId?: string, + postalCode?: string, + postalCodeExt?: string, + postalCodeGeoId?: string, + geoPointId?: string, + commercial?: string, + accessCode?: string, + telecomContactMechId?: string, + emailContactMechId?: string, + shipGatewayAddressId?: string, + cityGeo?: Geo, + countyGeo?: Geo, + stateProvinceGeo?: Geo, + postalCodeGeo?: Geo, + countryGeo?: Geo, + telecomContactMech?: string, + emailContactMech?: string + } +} \ No newline at end of file diff --git a/src/types/Enumeration.ts b/src/types/Enumeration.ts new file mode 100644 index 0000000..7d7976c --- /dev/null +++ b/src/types/Enumeration.ts @@ -0,0 +1,13 @@ +export interface Enumeration { + enumId: string, + enumTypeId?: string, + parentEnumId?: string, + enumCode?: string, + sequenceNum?: number, + description?: string, + optionValue?: string, + optionIndicator?: string, + relatedEnumId?: string, + relatedEnumTypeId?: string, + statusFlowId?: string, +} \ No newline at end of file diff --git a/src/types/Geo.ts b/src/types/Geo.ts new file mode 100644 index 0000000..8d359ac --- /dev/null +++ b/src/types/Geo.ts @@ -0,0 +1,10 @@ +export interface Geo { + geoId: string, + geoTypeEnumId?: string, + geoName?: string, + geoNameLocal?: string, + geoCodeAlpha2?: string, + geoCodeAlpha3?: string, + geoCodeNumeric?: string, + wellKnownText?: string, +} \ No newline at end of file diff --git a/src/types/Identification.ts b/src/types/Identification.ts new file mode 100644 index 0000000..f1266cd --- /dev/null +++ b/src/types/Identification.ts @@ -0,0 +1,11 @@ +import { Enumeration } from "./index"; + +export interface Identification { + partyId: string, + partyIdTypeEnumId: string, + idValue?: string, + issuedBy?: string, + issuedByPartyId?: string, + expireDate?: string, + type?: Enumeration +} \ No newline at end of file diff --git a/src/types/Party.ts b/src/types/Party.ts new file mode 100644 index 0000000..035fd77 --- /dev/null +++ b/src/types/Party.ts @@ -0,0 +1,51 @@ +import { ContactMech, Enumeration, Identification } from "./index" + +export interface Party { + partyId: string, + pseudoId?: string, + partyTypeEnumId?: string, + disabled?: string, + customerStatusId?: string, + ownerPartyId?: string, + externalId?: string, + dataSourceId?: string, + gatewayCimId?: string, + comments?: string, + shippingInstructions?: string, + hasDuplicates?: string, + lastDupCheckDate?: string, + mergedToPartyId?: string, + type?: Enumeration, + organization?: { + partyId: string, + organizationName?: string, + }, + person?: { + partyId: string, + firstName?: string, + middleName?: string, + lastName?: string, + }, + identifications?: Array, + contactMechs?: Array<{ + partyId: string, + contactMechId: string, + contactMechPurposeId: string, + fromDate: string, + thruDate?: string, + extension?: string, + comments?: string, + allowSolicitation?: string, + usedSince?: string, + usedUntil?: string, + verifyCode?: string, + verifyCodeDate?: string, + verifyCodeAttempts?: number, + contactMech?: ContactMech, + purpose?: { + contactMechPurposeId: string, + contactMechTypeEnumId?: string, + description?: string + } + }> +} \ No newline at end of file diff --git a/src/types/Product.ts b/src/types/Product.ts new file mode 100644 index 0000000..2dd2148 --- /dev/null +++ b/src/types/Product.ts @@ -0,0 +1,218 @@ +import { Enumeration, Geo, Party, Status, Uom } from "./index" + +export interface Product { + productId: string, + pseudoId: string, + productTypeEnumId: string, + productClassEnumId: string, + assetTypeEnumId: string, + assetClassEnumId: string, + statusId: string, + ownerPartyId: string, + productName: string, + description: string, + comments: string, + salesIntroductionDate: string, + salesDiscontinuationDate: string, + salesDiscWhenNotAvail: string, + supportDiscontinuationDate: string, + requireInventory: string, + chargeShipping: string, + signatureRequiredEnumId: string, + shippingInsuranceReqd: string, + inShippingBox: string, + defaultShipmentBoxTypeId: string, + taxable: string, + taxCode: string, + returnable: string, + amountUomId: string, + amountFixed: number, + amountRequire: string, + originGeoId: string, + type: Enumeration, + class: Enumeration, + assetType: Enumeration, + assetClass: Enumeration, + status: Status, + originGeo: Geo, + defaultBoxType: { + shipmentBoxTypeId: string, + pseudoId: string, + description: string, + dimensionUomId: string, + boxLength: number, + boxWidth: number, + boxHeight: number, + weightUomId: string, + boxWeight: number, + defaultGrossWeight: number, + capacityUomId: string, + boxCapacity: number, + gatewayBoxId: string, + lastUpdatedStamp: string + }, + amountUom: Uom, + assocs: Array, + toAssocs: Array, + contents: Array<{ + productContentId: string, + productId: string, + contentLocation: string, + productContentTypeEnumId: string, + locale: string, + productFeatureId: string, + productStoreId: string, + fromDate: string, + thruDate: string, + description: string, + sequenceNum: number, + userId: string + }>, + dimensions: Array<{ + productId: string, + dimensionTypeId: string, + value: number, + valueUomId: string, + }>, + geos: Array<{ + productId: string, + geoId: string, + productGeoPurposeEnumId: string, + description: string, + geo: Geo + }>, + identifications: Array<{ + productId: string, + productIdTypeEnumId: string, + idValue: string + }>, + parties: Array<{ + productId: string, + partyId: string, + roleTypeId: string, + fromDate: string, + thruDate: string, + sequenceNum: number, + comments: string, + otherPartyItemName: string, + otherPartyItemId: string, + party: Party, + role: { + roleTypeId: string, + parentTypeId: string, + description: string + } + }>, + prices: Array<{ + productPriceId: string, + productId: string, + productStoreId: string, + vendorPartyId: string, + customerPartyId: string, + priceTypeEnumId: string, + pricePurposeEnumId: string, + fromDate: string, + thruDate: string, + minQuantity: number, + price: number, + priceUomId: string, + termUomId: string, + taxInPrice: string, + taxAmount: number, + taxPercentage: number, + taxAuthorityId: string, + agreementId: string, + agreementItemSeqId: string, + otherPartyItemName: string, + otherPartyItemId: string, + comments: string, + quantityIncrement: number, + quantityIncluded: number, + quantityUomId: string, + preferredOrderEnumId: string, + supplierRatingTypeEnumId: string, + standardLeadTimeDays: number, + canDropShip: string + }>, + categories: Array<{ + productCategoryId: string, + productId: string, + fromDate: string, + thruDate: string, + comments: string, + sequenceNum: number, + quantity: number + }>, + features: [ + { + productId: string, + productFeatureId: string, + fromDate: string, + thruDate: string, + applTypeEnumId: string, + sequenceNum: number, + amount: number, + recurringAmount: number, + featureProductId: string, + feature: { + productFeatureId: string, + productFeatureTypeEnumId: string, + description: string, + numberSpecified: number, + numberUomId: string, + defaultAmount: number, + defaultSequenceNum: number, + abbrev: string, + idCode: string, + ownerPartyId: string, + numberPerPallet: number, + perPalletTier: number, + tiersPerPallet: number + } + } + ] +} + +export interface ProductAssoc { + productId: string, + toProductId: string, + productAssocTypeEnumId: string, + fromDate: string, + thruDate: string, + sequenceNum: number, + reason: string, + quantity: number, + scrapFactor: number, + instruction: string, + type: Enumeration, + toProduct: { + productId: string, + pseudoId: string, + productTypeEnumId: string, + productClassEnumId: string, + assetTypeEnumId: string, + assetClassEnumId: string, + statusId: string, + ownerPartyId: string, + productName: string, + description: string, + comments: string, + salesIntroductionDate: string, + salesDiscontinuationDate: string, + salesDiscWhenNotAvail: string, + supportDiscontinuationDate: string, + requireInventory: string, + chargeShipping: string, + signatureRequiredEnumId: string, + shippingInsuranceReqd: string, + inShippingBox: string, + defaultShipmentBoxTypeId: string, + taxable: string, + taxCode: string, + returnable: string, + amountUomId: string, + amountFixed: number, + amountRequire: string, + originGeoId: string + } +} \ No newline at end of file diff --git a/src/types/Status.ts b/src/types/Status.ts new file mode 100644 index 0000000..99f2d22 --- /dev/null +++ b/src/types/Status.ts @@ -0,0 +1,6 @@ +export interface Status { + statusId: string; + statusTypeId?: string; + statusCode?: string; + description?: string; +} \ No newline at end of file diff --git a/src/types/Uom.ts b/src/types/Uom.ts new file mode 100644 index 0000000..671ff5d --- /dev/null +++ b/src/types/Uom.ts @@ -0,0 +1,6 @@ +export interface Uom { + uomId: string, + uomTypeEnumId?: string, + abbreviation?: string, + description?: string +} \ No newline at end of file diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 0000000..7ce6514 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,19 @@ +import { ContactMech } from "./ContactMech"; +import { Enumeration } from "./Enumeration"; +import { Geo } from "./Geo"; +import { Identification } from "./Identification"; +import { Party } from "./Party"; +import { Product } from "./Product"; +import { Status } from "./Status"; +import { Uom } from "./Uom"; + +export { + ContactMech, + Enumeration, + Geo, + Identification, + Party, + Product, + Status, + Uom +} \ No newline at end of file From dea177ecaba2ff2676dabb65b1334f2dbf4f553c Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Mon, 13 Jun 2022 11:21:12 +0530 Subject: [PATCH 2/3] Improved: product schema to define a separate interface for ProductFeature(#2f89b7j) --- src/types/Product.ts | 59 ++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/src/types/Product.ts b/src/types/Product.ts index 2dd2148..50042ed 100644 --- a/src/types/Product.ts +++ b/src/types/Product.ts @@ -48,8 +48,7 @@ export interface Product { defaultGrossWeight: number, capacityUomId: string, boxCapacity: number, - gatewayBoxId: string, - lastUpdatedStamp: string + gatewayBoxId: string }, amountUom: Uom, assocs: Array, @@ -143,34 +142,18 @@ export interface Product { sequenceNum: number, quantity: number }>, - features: [ - { - productId: string, - productFeatureId: string, - fromDate: string, - thruDate: string, - applTypeEnumId: string, - sequenceNum: number, - amount: number, - recurringAmount: number, - featureProductId: string, - feature: { - productFeatureId: string, - productFeatureTypeEnumId: string, - description: string, - numberSpecified: number, - numberUomId: string, - defaultAmount: number, - defaultSequenceNum: number, - abbrev: string, - idCode: string, - ownerPartyId: string, - numberPerPallet: number, - perPalletTier: number, - tiersPerPallet: number - } - } - ] + features: Array<{ + productId: string, + productFeatureId: string, + fromDate: string, + thruDate: string, + applTypeEnumId: string, + sequenceNum: number, + amount: number, + recurringAmount: number, + featureProductId: string, + feature: ProductFeature + }> } export interface ProductAssoc { @@ -215,4 +198,20 @@ export interface ProductAssoc { amountRequire: string, originGeoId: string } +} + +export interface ProductFeature { + productFeatureId: string, + productFeatureTypeEnumId: string, + description: string, + numberSpecified: number, + numberUomId: string, + defaultAmount: number, + defaultSequenceNum: number, + abbrev: string, + idCode: string, + ownerPartyId: string, + numberPerPallet: number, + perPalletTier: number, + tiersPerPallet: number } \ No newline at end of file From a928749886eaa819989bc407fff6e1c096bbde1e Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Wed, 15 Jun 2022 12:10:39 +0530 Subject: [PATCH 3/3] Renamed: Identification to PartyIdentification and defined it in the party file(#2f89b7j) --- src/types/Identification.ts | 11 ----------- src/types/Party.ts | 14 ++++++++++++-- src/types/index.ts | 5 ++--- 3 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 src/types/Identification.ts diff --git a/src/types/Identification.ts b/src/types/Identification.ts deleted file mode 100644 index f1266cd..0000000 --- a/src/types/Identification.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Enumeration } from "./index"; - -export interface Identification { - partyId: string, - partyIdTypeEnumId: string, - idValue?: string, - issuedBy?: string, - issuedByPartyId?: string, - expireDate?: string, - type?: Enumeration -} \ No newline at end of file diff --git a/src/types/Party.ts b/src/types/Party.ts index 035fd77..5dafa8d 100644 --- a/src/types/Party.ts +++ b/src/types/Party.ts @@ -1,4 +1,4 @@ -import { ContactMech, Enumeration, Identification } from "./index" +import { ContactMech, Enumeration } from "./index" export interface Party { partyId: string, @@ -26,7 +26,7 @@ export interface Party { middleName?: string, lastName?: string, }, - identifications?: Array, + identifications?: Array, contactMechs?: Array<{ partyId: string, contactMechId: string, @@ -48,4 +48,14 @@ export interface Party { description?: string } }> +} + +export interface PartyIdentification { + partyId: string, + partyIdTypeEnumId: string, + idValue?: string, + issuedBy?: string, + issuedByPartyId?: string, + expireDate?: string, + type?: Enumeration } \ No newline at end of file diff --git a/src/types/index.ts b/src/types/index.ts index 7ce6514..c40b3fc 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,8 +1,7 @@ import { ContactMech } from "./ContactMech"; import { Enumeration } from "./Enumeration"; import { Geo } from "./Geo"; -import { Identification } from "./Identification"; -import { Party } from "./Party"; +import { Party, PartyIdentification } from "./Party"; import { Product } from "./Product"; import { Status } from "./Status"; import { Uom } from "./Uom"; @@ -11,8 +10,8 @@ export { ContactMech, Enumeration, Geo, - Identification, Party, + PartyIdentification, Product, Status, Uom