MCPcopy Create free account
hub / github.com/code100x/cms / seedPurchases

Function seedPurchases

prisma/seed.ts:227–257  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

225}
226
227async function seedPurchases() {
228 try {
229 await db.userPurchases.create({
230 data: {
231 userId: '1',
232 courseId: 1,
233 },
234 });
235 await db.userPurchases.create({
236 data: {
237 userId: '2',
238 courseId: 1,
239 },
240 });
241 await db.userPurchases.create({
242 data: {
243 userId: '1',
244 courseId: 2,
245 },
246 });
247 await db.userPurchases.create({
248 data: {
249 userId: '2',
250 courseId: 2,
251 },
252 });
253 } catch (error) {
254 console.error('Error while seeding purchases');
255 throw error;
256 }
257}
258
259export async function addClassesFromAugustToMay() {
260 const startDate = new Date('2024-08-01T00:00:00+05:30');

Callers 1

seedDatabaseFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected