How can I assign values to typeorm entities and insert them into the database?
import { PricingPatternElement } from file
const Element:PricingPatternElement = {
displayOrder: 10,
elementName: "test",
createdAt : getCurrentDate(),
createdBy: "test"
}
After setting the above values for PricingPatternElement
, I encountered the following error:
Type '{ displayOrder: number; elementName: string; createdAt: Date; createdBy: string; }' is missing several properties such as 'pricingPatternElementId', 'minPrice', 'maxPrice', 'priceInterval', and 15 others.
The error states that 15 members have not been set, however, I specified these fields as nullable
.
My objective is to only set the values for the required 5 columns
based on the entity definitions.
Code snippet of the entity definitions...
How can I assign values without having to set nullable columns? Thank you.