Add workshops CMS API with schedule, registrations, and public storefront routes.
Includes SQL migrations, Prisma models, dashboard CRUD, registration status workflow, and website OpenAPI updates for workshop listing and signup. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
9d56ec7396
commit
c7d5204b49
@@ -128,7 +128,7 @@ export class InstructionsService {
|
||||
}
|
||||
|
||||
const authorId = dto.authorId ? BigInt(dto.authorId) : actor.id;
|
||||
await this.assertAuthorBelongsToBusiness(businessId, authorId);
|
||||
await this.assertAuthorBelongsToBusiness(businessId, authorId, actor);
|
||||
|
||||
if (dto.categoryId) {
|
||||
await this.assertCategoryBelongsToBusiness(
|
||||
@@ -248,7 +248,7 @@ export class InstructionsService {
|
||||
authorId = null;
|
||||
} else {
|
||||
authorId = BigInt(dto.authorId);
|
||||
await this.assertAuthorBelongsToBusiness(businessId, authorId);
|
||||
await this.assertAuthorBelongsToBusiness(businessId, authorId, actor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -785,7 +785,12 @@ export class InstructionsService {
|
||||
private async assertAuthorBelongsToBusiness(
|
||||
businessId: bigint,
|
||||
authorId: bigint,
|
||||
actor: AuthUser,
|
||||
) {
|
||||
if (await this.permissions.isSuperAdmin(actor.id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const member = await this.prisma.businessUser.findFirst({
|
||||
where: { businessId, userId: authorId },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user