Skip to content

Conversation

@GOLDER303
Copy link
Contributor

@GOLDER303 GOLDER303 commented Sep 20, 2025

Important

Refactor codebase to use UUIDs for primary keys across models, controllers, services, and validators, ensuring consistency and future-proofing.

  • Behavior:
    • Refactor to use uuid instead of id for primary keys across models like Admin, Event, Attribute, Block, Email, Form, Participant, and Permission.
    • Update controllers to handle uuid in routes and queries, e.g., admins_controller.ts, events_controller.ts, participants_controller.ts.
    • Modify services to work with uuid, e.g., admin_service.ts, attribute_service.ts, participant_service.ts.
    • Adjust validators to validate uuid fields, e.g., admin.ts, attribute.ts, participants.ts.
  • Models:
    • Add uuid generation using randomUUID() in beforeCreate hooks for models.
    • Update relationships to use uuid in pivot tables, e.g., AdminsPermissions, ParticipantsAttributes.
  • Misc:
    • Implement PrismaNamingStrategy for consistent naming conventions.
    • Update routes.ts to reflect uuid usage in route parameters.
    • Adjust tests to validate uuid changes, e.g., auth/me.spec.ts.

This description was created by Ellipsis for 4e7038a. You can customize this summary. It will automatically update as commits are pushed.

dawidlinek and others added 30 commits March 2, 2025 23:27
the current dockerfile was using the `npm i` command instead of
`npm ci`, which allowed it to automatically & silently update
dependencies.
this allowed for issues, where it could update a dependency to one that
would break the build (but only if it was a minor/patch update, i.e. the
dependency devs made a mistake)
coincidentally, `adonis-autoswagger` devs appear to have just made that
exact mistake, adding a new required field on a public type in a minor
update.
this commit fixes this issue by using `npm ci` instead.

addtionally, there was no `.dockerignore` file, which combined with the
`ADD . .` command just before the build in the `Dockerfile` caused the
build to actually use the dependencies installed in the local repo,
outside of the container image build environment, by copying the local
`node_modules` directory into the build env.
this made the bug explained earlier not reproducible locally, if your
local repo had dependencies already installed.
reproducing the bug required the cleanup of the repo by running
`git reset --hard` and `git clean -fdx`.
this commit fixes this issue by adding a `.dockerignore` which mostly
mirrors the directories specified `.gitignore`, including the
`node_modules` directory.
await organizer
.related("permissions")
.attach({ [permissionId]: { event_id: eventId } });
.attach({ [permissionId]: { event_id: eventUuid } });
Copy link
Contributor

Choose a reason for hiding this comment

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

Use consistent pivot key when attaching permissions; use eventUuid (as in addOrganizer) instead of event_id for updateOrganizerPermissions.

Suggested change
.attach({ [permissionId]: { event_id: eventUuid } });
.attach({ [permissionId]: { eventUuid } });

@GOLDER303 GOLDER303 force-pushed the main branch 3 times, most recently from 6ec9ba7 to b271cd4 Compare November 10, 2025 21:08
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Nov 21, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

@ibtyog
Copy link
Member

ibtyog commented Nov 21, 2025

uwaga na mergowanie, bo mi część "postępów" wywaliło

@Solvro Solvro deleted a comment from ellipsis-dev bot Nov 22, 2025
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Nov 22, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Nov 22, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Nov 22, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

@ibtyog
Copy link
Member

ibtyog commented Nov 22, 2025

@pb3dpb3d @GOLDER303

Wypisuję to co nie działa
Eventownik zmiany

Organizers
Store - brakuje tworzenia uuid, dla AdminsPermissions (Pivot), trzeba podobno coś w migracji pogrzebać
Update - ten sam case chyba,

Forms
Store - to samo, ale dla FormDefinitions
Update - to samo

Events (cały kontroler do obejrzenia)
Index - do sprawdzenia, coś mi nie śmiga (zwraca 200 co prawda ale pustą listę, chyba że ja coś źle robie, jest też taka opcja)
Post - Zmergowane zmiany z V2, których nie ma w V3 (weryfikacja sypie, trzeba migrację machnąć i guess)

Events Import/Export
Do sprawdzenia całość

Emails
Do sprawdzenia send/duplicate (może nawet działa, po prostu skipnąłem bo fajnie by to było sprawdzić czy faktycznie wysyła a nie tylko 200 daje)

Admins
Do fixa jest updateValidator, bo każe podać maila (nie jest w cale taki optional), ale innego niż masz bo unique sprawdza czy po prostu coś jest i ma gdzieś czy to ty, gdzieś to już naprawiałem porównując id, pewnie trzeba w meta do validatora podać user id

Blocks (Całe)
Głownie problem przez outdated model (dokładnie to zagmatwane zmiany relacji rootblocków i guess), raczej po tym będzie śmigać

Auth
Coś mi się ten auth wysypał, ostatnio działał (tj. Przed mergem maina) jak dobrze pamiętam choć mogę się mylić

Public Participants (całe)

Przy okazji testów fajnie by było sprawdzić jeszcze czy gdzieś nie zostały, np. W responsie/validatorze requestu id zamiast uuid (napewno zostały IMO jakieś zagnieżdżone).

W pewnym sensie przekazuję to już wam, ale dlatego że nie do końca już łapie te błędy tutaj.
Moje uwagi:

  • Uwaga na mergowanie z maina, może wysypać coś co jest poprawione,
  • Sprawdzić wysyłanie maili,
  • fajnie jakby front albo ktoś od nas to też testnął czy nie ma gdzieś jakiegoś false 200 (co jedyne co robi to zwraca 200)

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.

10 participants