Hello,
I am building form driven contract generator and what i would like to accomplish is to be able to do something like this using collection2 package
Define Person schema
Schemas.person = {
type: Object,
firstName: {
type: String
},
lastName: {
type: String
},
DOB: {
type: Date
}
};
Attach person schema to employment contract
let schema = {
employer: Schemas.person,
employeee: Schemas.person
};
Schemas.employmentContract = new SimpleSchema(schema);
And then to create contract form wizard
<template name="step1">
{{> quickForm schema='Schemas.employmentContract .employer' type='method' meteormethod='processContractForm' id='step1'}}
</template>
<template name="step2">
{{> quickForm schema='Schemas.employmentContract.employee' type='method' meteormethod='processContractForm' id='step2'}}
</template>
Save the data in session and in final 2nd step to validate it against schema in processContractForm server method.
My first problem is how to achieve nesting of the Schemas.person object
Second problem is how to achieve schema chunking using quickform like Schemas.employmentContract.employee