chore(workflow-engine): Migrate to DML (#10477)
RESOLVES FRMW-2832 RESOLVES FRMW-2833 **What** Migrate workflow engines to DML. Alos includes and update to the linkable generation which now takes into account id and primary keys to generate the linkable instead of only primary keys
This commit is contained in:
@@ -668,8 +668,8 @@ describe("joiner-config-builder", () => {
|
||||
serviceName: "myService",
|
||||
field: "car",
|
||||
entity: "Car",
|
||||
linkable: "car_number_plate",
|
||||
primaryKey: "number_plate",
|
||||
linkable: "car_id",
|
||||
primaryKey: "id",
|
||||
})
|
||||
expect(linkConfig.user.toJSON()).toEqual({
|
||||
serviceName: "myService",
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
toCamelCase,
|
||||
upperCaseFirst,
|
||||
} from "../common"
|
||||
import { DmlEntity } from "../dml"
|
||||
import { DmlEntity, IdProperty } from "../dml"
|
||||
import { toGraphQLSchema } from "../dml/helpers/create-graphql"
|
||||
import { PrimaryKeyModifier } from "../dml/properties/primary-key"
|
||||
import { BaseRelationship } from "../dml/relations/base"
|
||||
@@ -396,7 +396,10 @@ export function buildLinkConfigFromModelObjects<
|
||||
}
|
||||
|
||||
const parsedProperty = (value as PropertyType<any>).parse(property)
|
||||
if (PrimaryKeyModifier.isPrimaryKeyModifier(value)) {
|
||||
if (
|
||||
PrimaryKeyModifier.isPrimaryKeyModifier(value) ||
|
||||
IdProperty.isIdProperty(value)
|
||||
) {
|
||||
const linkableKeyName =
|
||||
parsedProperty.dataType.options?.linkable ??
|
||||
`${camelToSnakeCase(model.name).toLowerCase()}_${property}`
|
||||
|
||||
Reference in New Issue
Block a user