Skip to content

Feat/assos creation & claim - #133

Open
tuturd wants to merge 16 commits into
devfrom
feat/asso-creation
Open

tuturd wants to merge 16 commits into
devfrom
feat/asso-creation

Conversation

@tuturd

@tuturd tuturd commented Oct 12, 2026

Copy link
Copy Markdown
Member

No description provided.

@tuturd
tuturd marked this pull request as draft October 12, 2026 22:41
Comment thread src/assos/assos.service.ts Fixed
@tuturd
tuturd requested a review from AlbanSdl October 12, 2026 23:31
Comment thread prisma/models/asso.prisma Resolved
Comment thread prisma/models/asso.prisma Resolved
Comment thread src/assos/assos.controller.ts Resolved
Comment thread src/assos/assos.controller.ts Resolved
Comment thread src/assos/assos.service.ts Resolved
Comment thread src/assos/assos.service.ts Resolved
Comment thread src/assos/assos.service.ts Resolved
Comment thread src/assos/assos.service.ts Resolved
Comment thread src/assos/assos.service.ts Resolved
@tuturd tuturd added the P3 label Oct 19, 2026
@AlbanSdl
AlbanSdl marked this pull request as ready for review October 24, 2026 16:21
@tuturd tuturd self-assigned this Oct 24, 2026
@ApiProperty()
assoEmail: string;

@ApiProperty({ enum: ['CREATE', 'CLAIM'], nullable: true })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pk pas utiliser AssoAccessAction ici ?

Comment thread prisma/models/asso.prisma
createdAt DateTime @default(now())
userId String
assoEmail String @db.VarChar(100)
action String? @db.VarChar(10)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est soit CREATE soit CLAIM, right ?

Comment on lines +297 to +302
this.mailService.send(
email,
'Validation d’accès association',
undefined,
{ action, email },
`Pour valider votre demande, utilisez ce lien : ${link}`,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En théorie, ce serait plus logique de mettre cette fonction dans le service (pareil en dessous)

endAt: { gte: new Date() },
OR: [
{ role: { isPresident: true } },
{ permissions: { some: { id: { in: ['manage_infos', 'manage_members', 'manage_roles', 'weekly'] } } } },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je mettrais peut être uniquement seulement la permission qui permet de changer les perms et les rôles des gens (je sais plus ce que c'est, probablement manage_members, puisque sinon on est locked out) mais en tout cas pas les weekly, ni manage_infos

Comment thread src/auth/auth.service.ts
Comment on lines +50 to +52
private isAllowedCasUserType(type?: UserType): boolean {
return type === UserType.STUDENT || type === UserType.TEACHER || type === UserType.EMPLOYEE;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Déplace ça au dessus de la tsdoc de la fonction du dessous

Comment thread test/e2e/assos/access.e2e-spec.ts Outdated
import { MailService } from '../../../src/mail/mail.service';

function tokenFromValidationEmail(mailService: MailService): string {
const calls = (mailService.send as jest.Mock).mock.calls;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quand t'auras rebase, faudra remplacer jest par vitest (et modifier les imports btw)

Comment thread test/declarations.ts Outdated
Comment on lines +45 to +52
type FakeUeWithOfs = FakeUe & { ueofs: FakeUeof[] };
type FakeAssoMembers = {
role: FakeAssoMembershipRole;
users: {
user: FakeUser;
permissions: FakeAssoMembershipPermission[];
}[];
}[];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En théorie, ces types vont dans fakedb.ts (sauf exceptions, mais tu me diras si c'est le cas)

Comment thread test/declarations.ts Outdated
import ApplicationResDto from '../src/auth/application/dto/res/application-res.dto';
import PermissionsResDto from '../src/auth/permissions/dto/res/permissions.dto';

type JsonLikeVariant<T> = Partial<{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T'as besoin de le mettre aussi dans le .ts ?

Comment thread .env.dist
MEDIA_DETACHED_LIFESPAN=1

CAS_URL=https://cas.utt.fr/cas
CAS_URL=https://auth.utt.fr/cas

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Même modif à faire dans .env.test.dist vu qu'elle est aussi set là bas

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'avoue j'ai pas encore review ce fichier mais j'envoie quand même, le reste des commentaires entre temps

@TeddyRoncin

Copy link
Copy Markdown
Member

@tuturd pour info, en fixant les tests qui failaient à cause du merge, j'ai changé pour faire en sorte que par défaut un utilisateur est de type OTHER (sur /vdev/auth/signup, j'ai ajouté un paramètre userType dans le body)
J'ai aussi viré le if (!this.isAllowedCasUserType(type)) dans AuthService::signUp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants