export class MembershipModel extends SchemaClass({
userId: S.string,
accepted: S.boolean,
invitedById: S.string,
joinedAt: pipe(S.number, S.optional).withDefault(() => Date.now()),
activeAt: pipe(S.number, S.optional).withDefault(() => 0),
}) {}
const foo = new MembershipModel({
userId: "foo",
accepted: true,
invitedById: "bar",
})
export class MembershipModel extends SchemaClass({
userId: S.string,
accepted: S.boolean,
invitedById: S.string,
joinedAt: pipe(S.number, S.optional).withDefault(() => Date.now()),
activeAt: pipe(S.number, S.optional).withDefault(() => 0),
}) {}
const foo = new MembershipModel({
userId: "foo",
accepted: true,
invitedById: "bar",
})