···3131| /user/password | Update authenticated user password | PUT (JSON) |
3232| /brigade/{{id}}/members | List brigade members | GET |
3333| /dashboard/stats | Fetch stats for the dashboard page | GET |
3434+| /analysis/occurrence | Fetch data for analysis about occurrences | GET |
3435| /occurrence/new | Register a new occurrence | POST (Form) |
3536| /occurrence/resolve/{{id}} | Update an occurrence `resolved_at` field | POST / DELETE |
3637
···11//// This module contains the code to run the sql queries defined in
22//// `./dev/app_dev/sql`.
33-//// > 🐿️ This module was generated automatically using v4.5.0 of
33+//// > 🐿️ This module was generated automatically using v4.6.0 of
44//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
55////
66···1010/// Runs the `soft_truncate_user_account` query
1111/// defined in `./dev/app_dev/sql/soft_truncate_user_account.sql`.
1212///
1313-/// > 🐿️ This function was generated automatically using v4.5.0 of
1313+/// > 🐿️ This function was generated automatically using v4.6.0 of
1414/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
1515///
1616pub fn soft_truncate_user_account(
···2929/// Runs the `truncate_brigade` query
3030/// defined in `./dev/app_dev/sql/truncate_brigade.sql`.
3131///
3232-/// > 🐿️ This function was generated automatically using v4.5.0 of
3232+/// > 🐿️ This function was generated automatically using v4.6.0 of
3333/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
3434///
3535pub fn truncate_brigade(
···4747/// Runs the `truncate_occurrence` query
4848/// defined in `./dev/app_dev/sql/truncate_occurrence.sql`.
4949///
5050-/// > 🐿️ This function was generated automatically using v4.5.0 of
5050+/// > 🐿️ This function was generated automatically using v4.6.0 of
5151/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5252///
5353pub fn truncate_occurrence(
+22
dev/dummy.gleam
···77import app/domain/occurrence/subcategory
88import app/domain/role
99import app/domain/user/sql as u_sql
1010+import app/web/context
1011import gleam/float
1112import gleam/list
1213import gleam/set
···281282 as "Some brigades were not assigned"
282283283284 created_occurrence_row.id
285285+}
286286+287287+pub fn update_occurrence_status(
288288+ occ: uuid.Uuid,
289289+ ctx: context.Context,
290290+ is_active: Bool,
291291+) {
292292+ let updated = case is_active {
293293+ False -> {
294294+ let assert Ok(returned) = o_sql.reopen_occurrence(ctx.db, occ)
295295+ let assert Ok(row) = list.first(returned.rows)
296296+ row.id
297297+ }
298298+ True -> {
299299+ let assert Ok(returned) = o_sql.resolve_occurrence(ctx.db, occ)
300300+ let assert Ok(row) = list.first(returned.rows)
301301+ row.id
302302+ }
303303+ }
304304+305305+ assert occ == updated as "Update the correct occurrence"
284306}
285307286308/// Panic on failure
···11//// This module contains the code to run the sql queries defined in
22//// `./src/app/domain/admin/sql`.
33-//// > 🐿️ This module was generated automatically using v4.5.0 of
33+//// > 🐿️ This module was generated automatically using v4.6.0 of
44//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
55////
66···1212/// A row you get from running the `admin_update_user` query
1313/// defined in `./src/app/domain/admin/sql/admin_update_user.sql`.
1414///
1515-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
1515+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
1616/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
1717///
1818pub type AdminUpdateUserRow {
···29293030/// Update an user's information as admin
3131///
3232-/// > 🐿️ This function was generated automatically using v4.5.0 of
3232+/// > 🐿️ This function was generated automatically using v4.6.0 of
3333/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
3434///
3535pub fn admin_update_user(
···9393/// A row you get from running the `count_total_users` query
9494/// defined in `./src/app/domain/admin/sql/count_total_users.sql`.
9595///
9696-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
9696+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
9797/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
9898///
9999pub type CountTotalUsersRow {
···102102103103/// Count the total number of users in our system
104104///
105105-/// > 🐿️ This function was generated automatically using v4.5.0 of
105105+/// > 🐿️ This function was generated automatically using v4.6.0 of
106106/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
107107///
108108pub fn count_total_users(
···126126127127/// Corresponds to the Postgres `user_role_enum` enum.
128128///
129129-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
129129+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
130130/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
131131///
132132pub type UserRoleEnum {
+20-20
src/app/domain/brigade/sql.gleam
···11//// This module contains the code to run the sql queries defined in
22//// `./src/app/domain/brigade/sql`.
33-//// > 🐿️ This module was generated automatically using v4.5.0 of
33+//// > 🐿️ This module was generated automatically using v4.6.0 of
44//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
55////
66···1313/// A row you get from running the `assign_brigade_members` query
1414/// defined in `./src/app/domain/brigade/sql/assign_brigade_members.sql`.
1515///
1616-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
1616+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
1717/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
1818///
1919pub type AssignBrigadeMembersRow {
···22222323/// Assign a list of members to a brigade
2424///
2525-/// > 🐿️ This function was generated automatically using v4.5.0 of
2525+/// > 🐿️ This function was generated automatically using v4.6.0 of
2626/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
2727///
2828pub fn assign_brigade_members(
···5151/// A row you get from running the `delete_brigade_by_id` query
5252/// defined in `./src/app/domain/brigade/sql/delete_brigade_by_id.sql`.
5353///
5454-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
5454+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
5555/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
5656///
5757pub type DeleteBrigadeByIdRow {
···60606161/// Remove a brigade from the DataBase
6262///
6363-/// > 🐿️ This function was generated automatically using v4.5.0 of
6363+/// > 🐿️ This function was generated automatically using v4.6.0 of
6464/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
6565///
6666pub fn delete_brigade_by_id(
···8989/// A row you get from running the `insert_new_brigade` query
9090/// defined in `./src/app/domain/brigade/sql/insert_new_brigade.sql`.
9191///
9292-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
9292+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
9393/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
9494///
9595pub type InsertNewBrigadeRow {
···98989999/// Register a new brigade into the database
100100///
101101-/// > 🐿️ This function was generated automatically using v4.5.0 of
101101+/// > 🐿️ This function was generated automatically using v4.6.0 of
102102/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
103103///
104104pub fn insert_new_brigade(
···141141/// A row you get from running the `query_all_brigades` query
142142/// defined in `./src/app/domain/brigade/sql/query_all_brigades.sql`.
143143///
144144-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
144144+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
145145/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
146146///
147147pub type QueryAllBrigadesRow {
···155155156156/// Find all registered brigades
157157///
158158-/// > 🐿️ This function was generated automatically using v4.5.0 of
158158+/// > 🐿️ This function was generated automatically using v4.6.0 of
159159/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
160160///
161161pub fn query_all_brigades(
···192192/// A row you get from running the `query_brigade_info` query
193193/// defined in `./src/app/domain/brigade/sql/query_brigade_info.sql`.
194194///
195195-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
195195+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
196196/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
197197///
198198pub type QueryBrigadeInfoRow {
···206206207207/// Find details about a specific brigade
208208///
209209-/// > 🐿️ This function was generated automatically using v4.5.0 of
209209+/// > 🐿️ This function was generated automatically using v4.6.0 of
210210/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
211211///
212212pub fn query_brigade_info(
···246246/// A row you get from running the `query_members_id` query
247247/// defined in `./src/app/domain/brigade/sql/query_members_id.sql`.
248248///
249249-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
249249+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
250250/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
251251///
252252pub type QueryMembersIdRow {
···255255256256/// Find the id of all members assigned a specific brigade
257257///
258258-/// > 🐿️ This function was generated automatically using v4.5.0 of
258258+/// > 🐿️ This function was generated automatically using v4.6.0 of
259259/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
260260///
261261pub fn query_members_id(
···283283/// A row you get from running the `query_members_info` query
284284/// defined in `./src/app/domain/brigade/sql/query_members_info.sql`.
285285///
286286-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
286286+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
287287/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
288288///
289289pub type QueryMembersInfoRow {
···292292293293/// Find all members of a brigade
294294///
295295-/// > 🐿️ This function was generated automatically using v4.5.0 of
295295+/// > 🐿️ This function was generated automatically using v4.6.0 of
296296/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
297297///
298298pub fn query_members_info(
···325325/// A row you get from running the `replace_brigade_members` query
326326/// defined in `./src/app/domain/brigade/sql/replace_brigade_members.sql`.
327327///
328328-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
328328+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
329329/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
330330///
331331pub type ReplaceBrigadeMembersRow {
···334334335335/// Replace all brigade members
336336///
337337-/// > 🐿️ This function was generated automatically using v4.5.0 of
337337+/// > 🐿️ This function was generated automatically using v4.6.0 of
338338/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
339339///
340340pub fn replace_brigade_members(
···363363/// A row you get from running the `update_brigade_status` query
364364/// defined in `./src/app/domain/brigade/sql/update_brigade_status.sql`.
365365///
366366-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
366366+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
367367/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
368368///
369369pub type UpdateBrigadeStatusRow {
···372372373373/// Set the brigade is_active status to ON or OFF
374374///
375375-/// > 🐿️ This function was generated automatically using v4.5.0 of
375375+/// > 🐿️ This function was generated automatically using v4.6.0 of
376376/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
377377///
378378pub fn update_brigade_status(
···409409410410/// Corresponds to the Postgres `user_role_enum` enum.
411411///
412412-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
412412+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
413413/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
414414///
415415pub type UserRoleEnum {
+3-3
src/app/domain/dashboard/sql.gleam
···11//// This module contains the code to run the sql queries defined in
22//// `./src/app/domain/dashboard/sql`.
33-//// > 🐿️ This module was generated automatically using v4.5.0 of
33+//// > 🐿️ This module was generated automatically using v4.6.0 of
44//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
55////
66···1010/// A row you get from running the `query_dashboard_stats` query
1111/// defined in `./src/app/domain/dashboard/sql/query_dashboard_stats.sql`.
1212///
1313-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
1313+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
1414/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
1515///
1616pub type QueryDashboardStatsRow {
···24242525/// Retrieve stats for the Dashboard page
2626///
2727-/// > 🐿️ This function was generated automatically using v4.5.0 of
2727+/// > 🐿️ This function was generated automatically using v4.6.0 of
2828/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
2929///
3030pub fn query_dashboard_stats(
···11+-- Occurrence reports
22+select
33+ o.id as occurrence_id,
44+ o.created_at as reported_timestamp,
55+ o.arrived_at as arrival_timestamp,
66+ o.resolved_at as resolved_timestamp,
77+ o.occurrence_category,
88+ o.occurrence_subcategory,
99+ o.priority,
1010+ u_applicant.full_name as applicant_name,
1111+ u_applicant.user_role as applicant_role,
1212+ o.occurrence_location[1] as latitude,
1313+ o.occurrence_location[2] as longitude
1414+from
1515+ public.occurrence as o
1616+left join
1717+ public.user_account as u_applicant
1818+ on o.applicant_id = u_applicant.id
1919+order by
2020+ o.created_at desc;
+8-8
src/app/domain/notification/sql.gleam
···11//// This module contains the code to run the sql queries defined in
22//// `./src/app/domain/notification/sql`.
33-//// > 🐿️ This module was generated automatically using v4.5.0 of
33+//// > 🐿️ This module was generated automatically using v4.6.0 of
44//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
55////
66···1111/// A row you get from running the `query_active_notifications` query
1212/// defined in `./src/app/domain/notification/sql/query_active_notifications.sql`.
1313///
1414-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
1414+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
1515/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
1616///
1717pub type QueryActiveNotificationsRow {
···20202121/// Find the active notifications from an user
2222///
2323-/// > 🐿️ This function was generated automatically using v4.5.0 of
2323+/// > 🐿️ This function was generated automatically using v4.6.0 of
2424/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
2525///
2626pub fn query_active_notifications(
···4848/// A row you get from running the `query_notification_preferences` query
4949/// defined in `./src/app/domain/notification/sql/query_notification_preferences.sql`.
5050///
5151-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
5151+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
5252/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
5353///
5454pub type QueryNotificationPreferencesRow {
···60606161/// Find the notification preferences for an user
6262///
6363-/// > 🐿️ This function was generated automatically using v4.5.0 of
6363+/// > 🐿️ This function was generated automatically using v4.6.0 of
6464/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
6565///
6666pub fn query_notification_preferences(
···8989/// A row you get from running the `update_notification_preferences` query
9090/// defined in `./src/app/domain/notification/sql/update_notification_preferences.sql`.
9191///
9292-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
9292+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
9393/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
9494///
9595pub type UpdateNotificationPreferencesRow {
···101101102102/// Update user notification preference
103103///
104104-/// > 🐿️ This function was generated automatically using v4.5.0 of
104104+/// > 🐿️ This function was generated automatically using v4.6.0 of
105105/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
106106///
107107pub fn update_notification_preferences(
···143143144144/// Corresponds to the Postgres `notification_type_enum` enum.
145145///
146146-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
146146+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
147147/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
148148///
149149pub type NotificationTypeEnum {
+22-22
src/app/domain/occurrence/sql.gleam
···11//// This module contains the code to run the sql queries defined in
22//// `./src/app/domain/occurrence/sql`.
33-//// > 🐿️ This module was generated automatically using v4.5.0 of
33+//// > 🐿️ This module was generated automatically using v4.6.0 of
44//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
55////
66···1313/// A row you get from running the `assign_brigades_to_occurrence` query
1414/// defined in `./src/app/domain/occurrence/sql/assign_brigades_to_occurrence.sql`.
1515///
1616-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
1616+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
1717/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
1818///
1919pub type AssignBrigadesToOccurrenceRow {
···22222323/// Assign as list of brigades as participants of a occurrence
2424///
2525-/// > 🐿️ This function was generated automatically using v4.5.0 of
2525+/// > 🐿️ This function was generated automatically using v4.6.0 of
2626/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
2727///
2828pub fn assign_brigades_to_occurrence(
···5151/// A row you get from running the `delete_occurrence_by_id` query
5252/// defined in `./src/app/domain/occurrence/sql/delete_occurrence_by_id.sql`.
5353///
5454-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
5454+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
5555/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
5656///
5757pub type DeleteOccurrenceByIdRow {
···60606161/// Remove an occurrence from the database
6262///
6363-/// > 🐿️ This function was generated automatically using v4.5.0 of
6363+/// > 🐿️ This function was generated automatically using v4.6.0 of
6464/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
6565///
6666pub fn delete_occurrence_by_id(
···8686/// A row you get from running the `insert_new_occurence` query
8787/// defined in `./src/app/domain/occurrence/sql/insert_new_occurence.sql`.
8888///
8989-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
8989+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
9090/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
9191///
9292pub type InsertNewOccurenceRow {
···101101102102/// Inserts a new occurrence into the database
103103///
104104-/// > 🐿️ This function was generated automatically using v4.5.0 of
104104+/// > 🐿️ This function was generated automatically using v4.6.0 of
105105/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
106106///
107107pub fn insert_new_occurence(
···172172/// A row you get from running the `query_occurences_by_applicant` query
173173/// defined in `./src/app/domain/occurrence/sql/query_occurences_by_applicant.sql`.
174174///
175175-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
175175+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
176176/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
177177///
178178pub type QueryOccurencesByApplicantRow {
···195195/// Retrieves all occurrences associated with a user,
196196/// including detailed category information and resolution status.
197197///
198198-/// > 🐿️ This function was generated automatically using v4.5.0 of
198198+/// > 🐿️ This function was generated automatically using v4.6.0 of
199199/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
200200///
201201pub fn query_occurences_by_applicant(
···280280/// A row you get from running the `query_participants` query
281281/// defined in `./src/app/domain/occurrence/sql/query_participants.sql`.
282282///
283283-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
283283+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
284284/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
285285///
286286pub type QueryParticipantsRow {
···289289290290/// Find all users that participated in a occurrence
291291///
292292-/// > 🐿️ This function was generated automatically using v4.5.0 of
292292+/// > 🐿️ This function was generated automatically using v4.6.0 of
293293/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
294294///
295295pub fn query_participants(
···318318/// A row you get from running the `query_recent_occurrences` query
319319/// defined in `./src/app/domain/occurrence/sql/query_recent_occurrences.sql`.
320320///
321321-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
321321+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
322322/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
323323///
324324pub type QueryRecentOccurrencesRow {
···335335336336/// Find all occurrences from the last 24 hours
337337///
338338-/// > 🐿️ This function was generated automatically using v4.5.0 of
338338+/// > 🐿️ This function was generated automatically using v4.6.0 of
339339/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
340340///
341341pub fn query_recent_occurrences(
···389389/// A row you get from running the `reopen_occurrence` query
390390/// defined in `./src/app/domain/occurrence/sql/reopen_occurrence.sql`.
391391///
392392-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
392392+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
393393/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
394394///
395395pub type ReopenOccurrenceRow {
···402402403403/// Mark a occurrence as unresolved
404404///
405405-/// > 🐿️ This function was generated automatically using v4.5.0 of
405405+/// > 🐿️ This function was generated automatically using v4.6.0 of
406406/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
407407///
408408pub fn reopen_occurrence(
···436436/// A row you get from running the `replace_occurrence_brigades` query
437437/// defined in `./src/app/domain/occurrence/sql/replace_occurrence_brigades.sql`.
438438///
439439-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
439439+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
440440/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
441441///
442442pub type ReplaceOccurrenceBrigadesRow {
···445445446446/// Replace all assigned brigades
447447///
448448-/// > 🐿️ This function was generated automatically using v4.5.0 of
448448+/// > 🐿️ This function was generated automatically using v4.6.0 of
449449/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
450450///
451451pub fn replace_occurrence_brigades(
···474474/// A row you get from running the `resolve_occurrence` query
475475/// defined in `./src/app/domain/occurrence/sql/resolve_occurrence.sql`.
476476///
477477-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
477477+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
478478/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
479479///
480480pub type ResolveOccurrenceRow {
···487487488488/// Mark a occurrence as resolved
489489///
490490-/// > 🐿️ This function was generated automatically using v4.5.0 of
490490+/// > 🐿️ This function was generated automatically using v4.6.0 of
491491/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
492492///
493493pub fn resolve_occurrence(
···522522523523/// Corresponds to the Postgres `occurrence_category_enum` enum.
524524///
525525-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
525525+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
526526/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
527527///
528528pub type OccurrenceCategoryEnum {
···553553 |> pog.text
554554}/// Corresponds to the Postgres `occurrence_priority_enum` enum.
555555///
556556-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
556556+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
557557/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
558558///
559559pub type OccurrencePriorityEnum {
···581581 |> pog.text
582582}/// Corresponds to the Postgres `occurrence_subcategory_enum` enum.
583583///
584584-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
584584+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
585585/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
586586///
587587pub type OccurrenceSubcategoryEnum {
+4-4
src/app/domain/role/sql.gleam
···11//// This module contains the code to run the sql queries defined in
22//// `./src/app/domain/role/sql`.
33-//// > 🐿️ This module was generated automatically using v4.5.0 of
33+//// > 🐿️ This module was generated automatically using v4.6.0 of
44//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
55////
66···1010/// A row you get from running the `query_available_user_roles` query
1111/// defined in `./src/app/domain/role/sql/query_available_user_roles.sql`.
1212///
1313-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
1313+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
1414/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
1515///
1616pub type QueryAvailableUserRolesRow {
···19192020/// Find all available user roles
2121///
2222-/// > 🐿️ This function was generated automatically using v4.5.0 of
2222+/// > 🐿️ This function was generated automatically using v4.6.0 of
2323/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
2424///
2525pub fn query_available_user_roles(
···42424343/// Corresponds to the Postgres `user_role_enum` enum.
4444///
4545-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
4545+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
4646/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
4747///
4848pub type UserRoleEnum {
+31-31
src/app/domain/user/sql.gleam
···11//// This module contains the code to run the sql queries defined in
22//// `./src/app/domain/user/sql`.
33-//// > 🐿️ This module was generated automatically using v4.5.0 of
33+//// > 🐿️ This module was generated automatically using v4.6.0 of
44//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
55////
66···1212/// A row you get from running the `delete_user_by_id` query
1313/// defined in `./src/app/domain/user/sql/delete_user_by_id.sql`.
1414///
1515-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
1515+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
1616/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
1717///
1818pub type DeleteUserByIdRow {
···21212222/// Remove and user from the database
2323///
2424-/// > 🐿️ This function was generated automatically using v4.5.0 of
2424+/// > 🐿️ This function was generated automatically using v4.6.0 of
2525/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
2626///
2727pub fn delete_user_by_id(
···4848/// A row you get from running the `get_complete_user_profiles` query
4949/// defined in `./src/app/domain/user/sql/get_complete_user_profiles.sql`.
5050///
5151-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
5151+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
5252/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
5353///
5454pub type GetCompleteUserProfilesRow {
···64646565/// Find all users on the database
6666///
6767-/// > 🐿️ This function was generated automatically using v4.5.0 of
6767+/// > 🐿️ This function was generated automatically using v4.6.0 of
6868/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
6969///
7070pub fn get_complete_user_profiles(
···105105/// A row you get from running the `insert_new_user` query
106106/// defined in `./src/app/domain/user/sql/insert_new_user.sql`.
107107///
108108-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
108108+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
109109/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
110110///
111111pub type InsertNewUserRow {
···114114115115/// Inserts a new user into the database
116116///
117117-/// > 🐿️ This function was generated automatically using v4.5.0 of
117117+/// > 🐿️ This function was generated automatically using v4.6.0 of
118118/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
119119///
120120pub fn insert_new_user(
···158158/// A row you get from running the `query_crew_members` query
159159/// defined in `./src/app/domain/user/sql/query_crew_members.sql`.
160160///
161161-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
161161+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
162162/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
163163///
164164pub type QueryCrewMembersRow {
···173173/// Retrieves detailed information about fellow brigade members
174174/// for a given user, including their names and role details.
175175///
176176-/// > 🐿️ This function was generated automatically using v4.5.0 of
176176+/// > 🐿️ This function was generated automatically using v4.6.0 of
177177/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
178178///
179179pub fn query_crew_members(
···208208/// A row you get from running the `query_login_token` query
209209/// defined in `./src/app/domain/user/sql/query_login_token.sql`.
210210///
211211-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
211211+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
212212/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
213213///
214214pub type QueryLoginTokenRow {
···218218/// Retrieves a user's ID and password hash from their registration
219219/// number for authentication purposes.
220220///
221221-/// > 🐿️ This function was generated automatically using v4.5.0 of
221221+/// > 🐿️ This function was generated automatically using v4.6.0 of
222222/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
223223///
224224pub fn query_login_token(
···250250/// A row you get from running the `query_occurrences_by_participant` query
251251/// defined in `./src/app/domain/user/sql/query_occurrences_by_participant.sql`.
252252///
253253-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
253253+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
254254/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
255255///
256256pub type QueryOccurrencesByParticipantRow {
···259259260260/// Find all occurrences a user participated in
261261///
262262-/// > 🐿️ This function was generated automatically using v4.5.0 of
262262+/// > 🐿️ This function was generated automatically using v4.6.0 of
263263/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
264264///
265265pub fn query_occurrences_by_participant(
···289289/// A row you get from running the `query_user_brigades` query
290290/// defined in `./src/app/domain/user/sql/query_user_brigades.sql`.
291291///
292292-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
292292+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
293293/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
294294///
295295pub type QueryUserBrigadesRow {
···298298299299/// Find all brigades an user is assigned to
300300///
301301-/// > 🐿️ This function was generated automatically using v4.5.0 of
301301+/// > 🐿️ This function was generated automatically using v4.6.0 of
302302/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
303303///
304304pub fn query_user_brigades(
···324324/// A row you get from running the `query_user_id_by_registration` query
325325/// defined in `./src/app/domain/user/sql/query_user_id_by_registration.sql`.
326326///
327327-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
327327+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
328328/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
329329///
330330pub type QueryUserIdByRegistrationRow {
···333333334334/// Retrieves a user's ID from their registration number.
335335///
336336-/// > 🐿️ This function was generated automatically using v4.5.0 of
336336+/// > 🐿️ This function was generated automatically using v4.6.0 of
337337/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
338338///
339339pub fn query_user_id_by_registration(
···359359/// A row you get from running the `query_user_name` query
360360/// defined in `./src/app/domain/user/sql/query_user_name.sql`.
361361///
362362-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
362362+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
363363/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
364364///
365365pub type QueryUserNameRow {
···368368369369/// Retrieves a user's full name by their user ID.
370370///
371371-/// > 🐿️ This function was generated automatically using v4.5.0 of
371371+/// > 🐿️ This function was generated automatically using v4.6.0 of
372372/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
373373///
374374pub fn query_user_name(
···394394/// A row you get from running the `query_user_password` query
395395/// defined in `./src/app/domain/user/sql/query_user_password.sql`.
396396///
397397-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
397397+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
398398/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
399399///
400400pub type QueryUserPasswordRow {
···403403404404/// Find the password hash from an user
405405///
406406-/// > 🐿️ This function was generated automatically using v4.5.0 of
406406+/// > 🐿️ This function was generated automatically using v4.6.0 of
407407/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
408408///
409409pub fn query_user_password(
···429429/// A row you get from running the `query_user_profile` query
430430/// defined in `./src/app/domain/user/sql/query_user_profile.sql`.
431431///
432432-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
432432+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
433433/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
434434///
435435pub type QueryUserProfileRow {
···445445446446/// Find basic information about an user account
447447///
448448-/// > 🐿️ This function was generated automatically using v4.5.0 of
448448+/// > 🐿️ This function was generated automatically using v4.6.0 of
449449/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
450450///
451451pub fn query_user_profile(
···489489/// A row you get from running the `query_user_role` query
490490/// defined in `./src/app/domain/user/sql/query_user_role.sql`.
491491///
492492-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
492492+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
493493/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
494494///
495495pub type QueryUserRoleRow {
···498498499499/// Find user access level
500500///
501501-/// > 🐿️ This function was generated automatically using v4.5.0 of
501501+/// > 🐿️ This function was generated automatically using v4.6.0 of
502502/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
503503///
504504pub fn query_user_role(
···524524525525/// Set an new value to the password of an user
526526///
527527-/// > 🐿️ This function was generated automatically using v4.5.0 of
527527+/// > 🐿️ This function was generated automatically using v4.6.0 of
528528/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
529529///
530530pub fn update_user_password(
···551551/// A row you get from running the `update_user_profile` query
552552/// defined in `./src/app/domain/user/sql/update_user_profile.sql`.
553553///
554554-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
554554+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
555555/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
556556///
557557pub type UpdateUserProfileRow {
···560560561561/// Update an authenticated user profile
562562///
563563-/// > 🐿️ This function was generated automatically using v4.5.0 of
563563+/// > 🐿️ This function was generated automatically using v4.6.0 of
564564/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
565565///
566566pub fn update_user_profile(
···600600/// A row you get from running the `update_user_status` query
601601/// defined in `./src/app/domain/user/sql/update_user_status.sql`.
602602///
603603-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
603603+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
604604/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
605605///
606606pub type UpdateUserStatusRow {
···609609610610/// Update an user `is_active` field
611611///
612612-/// > 🐿️ This function was generated automatically using v4.5.0 of
612612+/// > 🐿️ This function was generated automatically using v4.6.0 of
613613/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
614614///
615615pub fn update_user_status(
···642642643643/// Corresponds to the Postgres `user_role_enum` enum.
644644///
645645-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
645645+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
646646/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
647647///
648648pub type UserRoleEnum {