I am attempting to execute the following ontology as code:
import { defineSharedPropertyType, defineInterface, defineObject, defineLink, defineCreateObjectAction, defineModifyObjectAction, defineDeleteObjectAction } from "@osdk/maker";
// Shared Property Types (deduped across interface-attached tables)
const hashIdProperty = defineSharedPropertyType({
apiName: "hash_id",
displayName: "Hash Id",
type: "string",
});
const startDateProperty = defineSharedPropertyType({
apiName: "start_date",
displayName: "Start Date",
type: "date",
});
const endDateProperty = defineSharedPropertyType({
apiName: "end_date",
displayName: "End Date",
type: "date",
});
const descriptionProperty = defineSharedPropertyType({
apiName: "description",
displayName: "Description",
type: {
type: "string",
isLongText: true,
supportsEfficientLeadingWildcard: true,
supportsExactMatching: false,
},
});
const amountProperty = defineSharedPropertyType({
apiName: "amount",
displayName: "Amount",
type: "integer",
});
const rawRowProperty = defineSharedPropertyType({
apiName: "raw_row",
displayName: "Raw Row",
type: {
type: "string",
isLongText: true,
supportsEfficientLeadingWildcard: true,
supportsExactMatching: false,
},
});
const workpaperHashProperty = defineSharedPropertyType({
apiName: "workpaper_hash",
displayName: "Workpaper Hash",
type: "string",
});
const fileIdProperty = defineSharedPropertyType({
apiName: "file_id",
displayName: "File Id",
type: "string",
});
const customerIdProperty = defineSharedPropertyType({
apiName: "customer_id",
displayName: "Customer Id",
type: "string",
});
const systemOfRecordIdProperty = defineSharedPropertyType({
apiName: "system_of_record_id",
displayName: "System Of Record Id",
type: "string",
});
const batchIdProperty = defineSharedPropertyType({
apiName: "batch_id",
displayName: "Batch Id",
type: "string",
});
const ingestedDateProperty = defineSharedPropertyType({
apiName: "ingested_date",
displayName: "Ingested Date",
type: "date",
});
const idProperty = defineSharedPropertyType({
apiName: "id",
displayName: "Id",
type: "string",
});
const fsliIdProperty = defineSharedPropertyType({
apiName: "fsli_id",
displayName: "Fsli Id",
type: "string",
});
const mainAccountIdProperty = defineSharedPropertyType({
apiName: "main_account_id",
displayName: "Main Account Id",
type: "string",
});
const subAccountIdProperty = defineSharedPropertyType({
apiName: "sub_account_id",
displayName: "Sub Account Id",
type: "string",
});
const fsliNameProperty = defineSharedPropertyType({
apiName: "fsli_name",
displayName: "Fsli Name",
type: "string",
});
const mainAccountNameProperty = defineSharedPropertyType({
apiName: "main_account_name",
displayName: "Main Account Name",
type: "string",
});
const subAccountNameProperty = defineSharedPropertyType({
apiName: "sub_account_name",
displayName: "Sub Account Name",
type: "string",
});
const typeProperty = defineSharedPropertyType({
apiName: "type",
displayName: "Type",
type: "string",
});
const chartOfAccountIdProperty = defineSharedPropertyType({
apiName: "chart_of_account_id",
displayName: "Chart Of Account Id",
type: "string",
});
const iWorkpaperInterface = defineInterface({
apiName: "IWorkpaper",
displayName: "Workpaper",
properties: {
"hash_id": hashIdProperty,
"start_date": startDateProperty,
"end_date": endDateProperty,
"description": descriptionProperty,
"amount": amountProperty,
"raw_row": rawRowProperty,
"workpaper_hash": workpaperHashProperty,
"file_id": fileIdProperty,
"customer_id": customerIdProperty,
"system_of_record_id": systemOfRecordIdProperty,
"batch_id": batchIdProperty,
"ingested_date": ingestedDateProperty,
},
});
const workpapersExtractedObject = defineObject({
apiName: "workpapers-extracted",
displayName: "Workpapers Extracted",
pluralDisplayName: "Workpapers Extracteds",
titlePropertyApiName: "hash_id",
primaryKeyPropertyApiName: "hash_id",
properties: {
"hash_id": { displayName: "Hash Id", type: "string" },
"start_date": { displayName: "Start Date", type: "date" },
"end_date": { displayName: "End Date", type: "date" },
"description": { displayName: "Description", type: { type: "string", isLongText: true, supportsEfficientLeadingWildcard: true, supportsExactMatching: false } },
"amount": { displayName: "Amount", type: "integer" },
"raw_row": { displayName: "Raw Row", type: { type: "string", isLongText: true, supportsEfficientLeadingWildcard: true, supportsExactMatching: false } },
"workpaper_hash": { displayName: "Workpaper Hash", type: "string" },
"file_id": { displayName: "File Id", type: "string" },
"customer_id": { displayName: "Customer Id", type: "string" },
"system_of_record_id": { displayName: "System Of Record Id", type: "string" },
"batch_id": { displayName: "Batch Id", type: "string" },
"ingested_date": { displayName: "Ingested Date", type: "date" },
},
implementsInterfaces: [{
implements: iWorkpaperInterface, propertyMapping: [
{ interfaceProperty: "hash_id", mapsTo: "hash_id" },
{ interfaceProperty: "start_date", mapsTo: "start_date" },
{ interfaceProperty: "end_date", mapsTo: "end_date" },
{ interfaceProperty: "description", mapsTo: "description" },
{ interfaceProperty: "amount", mapsTo: "amount" },
{ interfaceProperty: "raw_row", mapsTo: "raw_row" },
{ interfaceProperty: "workpaper_hash", mapsTo: "workpaper_hash" },
{ interfaceProperty: "file_id", mapsTo: "file_id" },
{ interfaceProperty: "customer_id", mapsTo: "customer_id" },
{ interfaceProperty: "system_of_record_id", mapsTo: "system_of_record_id" },
{ interfaceProperty: "batch_id", mapsTo: "batch_id" },
{ interfaceProperty: "ingested_date", mapsTo: "ingested_date" },
]
}],
});
But I keep getting errors this this related to the interface properties not being implemented by workpapers-extracted (it does this for all proprs, I just limited it to one):
Error: Invariant failed:
Ontology Definition Error: Interface spt com.palantirfoundry.<STACK>.<MAVEN_ID>.ontology-as-code-test-store.ontology-as-code-test.hash_id not implemented by workpapers-extracted object definition
What am I doing wring here?