···31| /user/password | Update authenticated user password | PUT (JSON) |
32| /brigade/{{id}}/members | List brigade members | GET |
33| /dashboard/stats | Fetch stats for the dashboard page | GET |
034| /occurrence/new | Register a new occurrence | POST (Form) |
35| /occurrence/resolve/{{id}} | Update an occurrence `resolved_at` field | POST / DELETE |
36
···31| /user/password | Update authenticated user password | PUT (JSON) |
32| /brigade/{{id}}/members | List brigade members | GET |
33| /dashboard/stats | Fetch stats for the dashboard page | GET |
34+| /analysis/occurrence | Fetch data for analysis about occurrences | GET |
35| /occurrence/new | Register a new occurrence | POST (Form) |
36| /occurrence/resolve/{{id}} | Update an occurrence `resolved_at` field | POST / DELETE |
37
+9
dev/app_dev.gleam
···52 |> list.sized_chunk(n_occurences / n_brigades)
5354 io.println(" Registrando ocorrências..")
055 let dummy_occurrences =
56 list.map(list.range(1, n_occurences), fn(_) {
57 let assert Ok(applicant_id) = list.first(list.sample(dummy_users, 1))
58 let assert Ok(assign) = list.first(list.sample(assigned_brigades, 1))
59 dummy.random_occurrence(conn: ctx.db, applicant_id:, assign:)
60 })
000000006162 // ALL DONE ------------------------------------------------------------------
63 let n_created_brigades_str =
···1//// This module contains the code to run the sql queries defined in
2//// `./dev/app_dev/sql`.
3-//// > 🐿️ This module was generated automatically using v4.5.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···10/// Runs the `soft_truncate_user_account` query
11/// defined in `./dev/app_dev/sql/soft_truncate_user_account.sql`.
12///
13-/// > 🐿️ This function was generated automatically using v4.5.0 of
14/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
15///
16pub fn soft_truncate_user_account(
···29/// Runs the `truncate_brigade` query
30/// defined in `./dev/app_dev/sql/truncate_brigade.sql`.
31///
32-/// > 🐿️ This function was generated automatically using v4.5.0 of
33/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
34///
35pub fn truncate_brigade(
···47/// Runs the `truncate_occurrence` query
48/// defined in `./dev/app_dev/sql/truncate_occurrence.sql`.
49///
50-/// > 🐿️ This function was generated automatically using v4.5.0 of
51/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
52///
53pub fn truncate_occurrence(
···1//// This module contains the code to run the sql queries defined in
2//// `./dev/app_dev/sql`.
3+//// > 🐿️ This module was generated automatically using v4.6.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···10/// Runs the `soft_truncate_user_account` query
11/// defined in `./dev/app_dev/sql/soft_truncate_user_account.sql`.
12///
13+/// > 🐿️ This function was generated automatically using v4.6.0 of
14/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
15///
16pub fn soft_truncate_user_account(
···29/// Runs the `truncate_brigade` query
30/// defined in `./dev/app_dev/sql/truncate_brigade.sql`.
31///
32+/// > 🐿️ This function was generated automatically using v4.6.0 of
33/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
34///
35pub fn truncate_brigade(
···47/// Runs the `truncate_occurrence` query
48/// defined in `./dev/app_dev/sql/truncate_occurrence.sql`.
49///
50+/// > 🐿️ This function was generated automatically using v4.6.0 of
51/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
52///
53pub fn truncate_occurrence(
+22
dev/dummy.gleam
···7import app/domain/occurrence/subcategory
8import app/domain/role
9import app/domain/user/sql as u_sql
010import gleam/float
11import gleam/list
12import gleam/set
···281 as "Some brigades were not assigned"
282283 created_occurrence_row.id
000000000000000000000284}
285286/// Panic on failure
···7import app/domain/occurrence/subcategory
8import app/domain/role
9import app/domain/user/sql as u_sql
10+import app/web/context
11import gleam/float
12import gleam/list
13import gleam/set
···282 as "Some brigades were not assigned"
283284 created_occurrence_row.id
285+}
286+287+pub fn update_occurrence_status(
288+ occ: uuid.Uuid,
289+ ctx: context.Context,
290+ is_active: Bool,
291+) {
292+ let updated = case is_active {
293+ False -> {
294+ let assert Ok(returned) = o_sql.reopen_occurrence(ctx.db, occ)
295+ let assert Ok(row) = list.first(returned.rows)
296+ row.id
297+ }
298+ True -> {
299+ let assert Ok(returned) = o_sql.resolve_occurrence(ctx.db, occ)
300+ let assert Ok(row) = list.first(returned.rows)
301+ row.id
302+ }
303+ }
304+305+ assert occ == updated as "Update the correct occurrence"
306}
307308/// Panic on failure
···1//// This module contains the code to run the sql queries defined in
2//// `./src/app/domain/admin/sql`.
3-//// > 🐿️ This module was generated automatically using v4.5.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···12/// A row you get from running the `admin_update_user` query
13/// defined in `./src/app/domain/admin/sql/admin_update_user.sql`.
14///
15-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
16/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
17///
18pub type AdminUpdateUserRow {
···2930/// Update an user's information as admin
31///
32-/// > 🐿️ This function was generated automatically using v4.5.0 of
33/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
34///
35pub fn admin_update_user(
···93/// A row you get from running the `count_total_users` query
94/// defined in `./src/app/domain/admin/sql/count_total_users.sql`.
95///
96-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
97/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
98///
99pub type CountTotalUsersRow {
···102103/// Count the total number of users in our system
104///
105-/// > 🐿️ This function was generated automatically using v4.5.0 of
106/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
107///
108pub fn count_total_users(
···126127/// Corresponds to the Postgres `user_role_enum` enum.
128///
129-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
130/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
131///
132pub type UserRoleEnum {
···1//// This module contains the code to run the sql queries defined in
2//// `./src/app/domain/admin/sql`.
3+//// > 🐿️ This module was generated automatically using v4.6.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···12/// A row you get from running the `admin_update_user` query
13/// defined in `./src/app/domain/admin/sql/admin_update_user.sql`.
14///
15+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
16/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
17///
18pub type AdminUpdateUserRow {
···2930/// Update an user's information as admin
31///
32+/// > 🐿️ This function was generated automatically using v4.6.0 of
33/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
34///
35pub fn admin_update_user(
···93/// A row you get from running the `count_total_users` query
94/// defined in `./src/app/domain/admin/sql/count_total_users.sql`.
95///
96+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
97/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
98///
99pub type CountTotalUsersRow {
···102103/// Count the total number of users in our system
104///
105+/// > 🐿️ This function was generated automatically using v4.6.0 of
106/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
107///
108pub fn count_total_users(
···126127/// Corresponds to the Postgres `user_role_enum` enum.
128///
129+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
130/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
131///
132pub type UserRoleEnum {
+20-20
src/app/domain/brigade/sql.gleam
···1//// This module contains the code to run the sql queries defined in
2//// `./src/app/domain/brigade/sql`.
3-//// > 🐿️ This module was generated automatically using v4.5.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···13/// A row you get from running the `assign_brigade_members` query
14/// defined in `./src/app/domain/brigade/sql/assign_brigade_members.sql`.
15///
16-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
17/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
18///
19pub type AssignBrigadeMembersRow {
···2223/// Assign a list of members to a brigade
24///
25-/// > 🐿️ This function was generated automatically using v4.5.0 of
26/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
27///
28pub fn assign_brigade_members(
···51/// A row you get from running the `delete_brigade_by_id` query
52/// defined in `./src/app/domain/brigade/sql/delete_brigade_by_id.sql`.
53///
54-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
55/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
56///
57pub type DeleteBrigadeByIdRow {
···6061/// Remove a brigade from the DataBase
62///
63-/// > 🐿️ This function was generated automatically using v4.5.0 of
64/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
65///
66pub fn delete_brigade_by_id(
···89/// A row you get from running the `insert_new_brigade` query
90/// defined in `./src/app/domain/brigade/sql/insert_new_brigade.sql`.
91///
92-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
93/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
94///
95pub type InsertNewBrigadeRow {
···9899/// Register a new brigade into the database
100///
101-/// > 🐿️ This function was generated automatically using v4.5.0 of
102/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
103///
104pub fn insert_new_brigade(
···141/// A row you get from running the `query_all_brigades` query
142/// defined in `./src/app/domain/brigade/sql/query_all_brigades.sql`.
143///
144-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
145/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
146///
147pub type QueryAllBrigadesRow {
···155156/// Find all registered brigades
157///
158-/// > 🐿️ This function was generated automatically using v4.5.0 of
159/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
160///
161pub fn query_all_brigades(
···192/// A row you get from running the `query_brigade_info` query
193/// defined in `./src/app/domain/brigade/sql/query_brigade_info.sql`.
194///
195-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
196/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
197///
198pub type QueryBrigadeInfoRow {
···206207/// Find details about a specific brigade
208///
209-/// > 🐿️ This function was generated automatically using v4.5.0 of
210/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
211///
212pub fn query_brigade_info(
···246/// A row you get from running the `query_members_id` query
247/// defined in `./src/app/domain/brigade/sql/query_members_id.sql`.
248///
249-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
250/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
251///
252pub type QueryMembersIdRow {
···255256/// Find the id of all members assigned a specific brigade
257///
258-/// > 🐿️ This function was generated automatically using v4.5.0 of
259/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
260///
261pub fn query_members_id(
···283/// A row you get from running the `query_members_info` query
284/// defined in `./src/app/domain/brigade/sql/query_members_info.sql`.
285///
286-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
287/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
288///
289pub type QueryMembersInfoRow {
···292293/// Find all members of a brigade
294///
295-/// > 🐿️ This function was generated automatically using v4.5.0 of
296/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
297///
298pub fn query_members_info(
···325/// A row you get from running the `replace_brigade_members` query
326/// defined in `./src/app/domain/brigade/sql/replace_brigade_members.sql`.
327///
328-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
329/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
330///
331pub type ReplaceBrigadeMembersRow {
···334335/// Replace all brigade members
336///
337-/// > 🐿️ This function was generated automatically using v4.5.0 of
338/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
339///
340pub fn replace_brigade_members(
···363/// A row you get from running the `update_brigade_status` query
364/// defined in `./src/app/domain/brigade/sql/update_brigade_status.sql`.
365///
366-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
367/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
368///
369pub type UpdateBrigadeStatusRow {
···372373/// Set the brigade is_active status to ON or OFF
374///
375-/// > 🐿️ This function was generated automatically using v4.5.0 of
376/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
377///
378pub fn update_brigade_status(
···409410/// Corresponds to the Postgres `user_role_enum` enum.
411///
412-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
413/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
414///
415pub type UserRoleEnum {
···1//// This module contains the code to run the sql queries defined in
2//// `./src/app/domain/brigade/sql`.
3+//// > 🐿️ This module was generated automatically using v4.6.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···13/// A row you get from running the `assign_brigade_members` query
14/// defined in `./src/app/domain/brigade/sql/assign_brigade_members.sql`.
15///
16+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
17/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
18///
19pub type AssignBrigadeMembersRow {
···2223/// Assign a list of members to a brigade
24///
25+/// > 🐿️ This function was generated automatically using v4.6.0 of
26/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
27///
28pub fn assign_brigade_members(
···51/// A row you get from running the `delete_brigade_by_id` query
52/// defined in `./src/app/domain/brigade/sql/delete_brigade_by_id.sql`.
53///
54+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
55/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
56///
57pub type DeleteBrigadeByIdRow {
···6061/// Remove a brigade from the DataBase
62///
63+/// > 🐿️ This function was generated automatically using v4.6.0 of
64/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
65///
66pub fn delete_brigade_by_id(
···89/// A row you get from running the `insert_new_brigade` query
90/// defined in `./src/app/domain/brigade/sql/insert_new_brigade.sql`.
91///
92+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
93/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
94///
95pub type InsertNewBrigadeRow {
···9899/// Register a new brigade into the database
100///
101+/// > 🐿️ This function was generated automatically using v4.6.0 of
102/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
103///
104pub fn insert_new_brigade(
···141/// A row you get from running the `query_all_brigades` query
142/// defined in `./src/app/domain/brigade/sql/query_all_brigades.sql`.
143///
144+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
145/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
146///
147pub type QueryAllBrigadesRow {
···155156/// Find all registered brigades
157///
158+/// > 🐿️ This function was generated automatically using v4.6.0 of
159/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
160///
161pub fn query_all_brigades(
···192/// A row you get from running the `query_brigade_info` query
193/// defined in `./src/app/domain/brigade/sql/query_brigade_info.sql`.
194///
195+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
196/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
197///
198pub type QueryBrigadeInfoRow {
···206207/// Find details about a specific brigade
208///
209+/// > 🐿️ This function was generated automatically using v4.6.0 of
210/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
211///
212pub fn query_brigade_info(
···246/// A row you get from running the `query_members_id` query
247/// defined in `./src/app/domain/brigade/sql/query_members_id.sql`.
248///
249+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
250/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
251///
252pub type QueryMembersIdRow {
···255256/// Find the id of all members assigned a specific brigade
257///
258+/// > 🐿️ This function was generated automatically using v4.6.0 of
259/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
260///
261pub fn query_members_id(
···283/// A row you get from running the `query_members_info` query
284/// defined in `./src/app/domain/brigade/sql/query_members_info.sql`.
285///
286+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
287/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
288///
289pub type QueryMembersInfoRow {
···292293/// Find all members of a brigade
294///
295+/// > 🐿️ This function was generated automatically using v4.6.0 of
296/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
297///
298pub fn query_members_info(
···325/// A row you get from running the `replace_brigade_members` query
326/// defined in `./src/app/domain/brigade/sql/replace_brigade_members.sql`.
327///
328+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
329/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
330///
331pub type ReplaceBrigadeMembersRow {
···334335/// Replace all brigade members
336///
337+/// > 🐿️ This function was generated automatically using v4.6.0 of
338/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
339///
340pub fn replace_brigade_members(
···363/// A row you get from running the `update_brigade_status` query
364/// defined in `./src/app/domain/brigade/sql/update_brigade_status.sql`.
365///
366+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
367/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
368///
369pub type UpdateBrigadeStatusRow {
···372373/// Set the brigade is_active status to ON or OFF
374///
375+/// > 🐿️ This function was generated automatically using v4.6.0 of
376/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
377///
378pub fn update_brigade_status(
···409410/// Corresponds to the Postgres `user_role_enum` enum.
411///
412+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
413/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
414///
415pub type UserRoleEnum {
+3-3
src/app/domain/dashboard/sql.gleam
···1//// This module contains the code to run the sql queries defined in
2//// `./src/app/domain/dashboard/sql`.
3-//// > 🐿️ This module was generated automatically using v4.5.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···10/// A row you get from running the `query_dashboard_stats` query
11/// defined in `./src/app/domain/dashboard/sql/query_dashboard_stats.sql`.
12///
13-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
14/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
15///
16pub type QueryDashboardStatsRow {
···2425/// Retrieve stats for the Dashboard page
26///
27-/// > 🐿️ This function was generated automatically using v4.5.0 of
28/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
29///
30pub fn query_dashboard_stats(
···1//// This module contains the code to run the sql queries defined in
2//// `./src/app/domain/dashboard/sql`.
3+//// > 🐿️ This module was generated automatically using v4.6.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···10/// A row you get from running the `query_dashboard_stats` query
11/// defined in `./src/app/domain/dashboard/sql/query_dashboard_stats.sql`.
12///
13+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
14/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
15///
16pub type QueryDashboardStatsRow {
···2425/// Retrieve stats for the Dashboard page
26///
27+/// > 🐿️ This function was generated automatically using v4.6.0 of
28/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
29///
30pub fn query_dashboard_stats(
···1+-- Occurrence reports
2+select
3+ o.id as occurrence_id,
4+ o.created_at as reported_timestamp,
5+ o.arrived_at as arrival_timestamp,
6+ o.resolved_at as resolved_timestamp,
7+ o.occurrence_category,
8+ o.occurrence_subcategory,
9+ o.priority,
10+ u_applicant.full_name as applicant_name,
11+ u_applicant.user_role as applicant_role,
12+ o.occurrence_location[1] as latitude,
13+ o.occurrence_location[2] as longitude
14+from
15+ public.occurrence as o
16+left join
17+ public.user_account as u_applicant
18+ on o.applicant_id = u_applicant.id
19+order by
20+ o.created_at desc;
+8-8
src/app/domain/notification/sql.gleam
···1//// This module contains the code to run the sql queries defined in
2//// `./src/app/domain/notification/sql`.
3-//// > 🐿️ This module was generated automatically using v4.5.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···11/// A row you get from running the `query_active_notifications` query
12/// defined in `./src/app/domain/notification/sql/query_active_notifications.sql`.
13///
14-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
15/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
16///
17pub type QueryActiveNotificationsRow {
···2021/// Find the active notifications from an user
22///
23-/// > 🐿️ This function was generated automatically using v4.5.0 of
24/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
25///
26pub fn query_active_notifications(
···48/// A row you get from running the `query_notification_preferences` query
49/// defined in `./src/app/domain/notification/sql/query_notification_preferences.sql`.
50///
51-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
52/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
53///
54pub type QueryNotificationPreferencesRow {
···6061/// Find the notification preferences for an user
62///
63-/// > 🐿️ This function was generated automatically using v4.5.0 of
64/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
65///
66pub fn query_notification_preferences(
···89/// A row you get from running the `update_notification_preferences` query
90/// defined in `./src/app/domain/notification/sql/update_notification_preferences.sql`.
91///
92-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
93/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
94///
95pub type UpdateNotificationPreferencesRow {
···101102/// Update user notification preference
103///
104-/// > 🐿️ This function was generated automatically using v4.5.0 of
105/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
106///
107pub fn update_notification_preferences(
···143144/// Corresponds to the Postgres `notification_type_enum` enum.
145///
146-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
147/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
148///
149pub type NotificationTypeEnum {
···1//// This module contains the code to run the sql queries defined in
2//// `./src/app/domain/notification/sql`.
3+//// > 🐿️ This module was generated automatically using v4.6.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···11/// A row you get from running the `query_active_notifications` query
12/// defined in `./src/app/domain/notification/sql/query_active_notifications.sql`.
13///
14+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
15/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
16///
17pub type QueryActiveNotificationsRow {
···2021/// Find the active notifications from an user
22///
23+/// > 🐿️ This function was generated automatically using v4.6.0 of
24/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
25///
26pub fn query_active_notifications(
···48/// A row you get from running the `query_notification_preferences` query
49/// defined in `./src/app/domain/notification/sql/query_notification_preferences.sql`.
50///
51+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
52/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
53///
54pub type QueryNotificationPreferencesRow {
···6061/// Find the notification preferences for an user
62///
63+/// > 🐿️ This function was generated automatically using v4.6.0 of
64/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
65///
66pub fn query_notification_preferences(
···89/// A row you get from running the `update_notification_preferences` query
90/// defined in `./src/app/domain/notification/sql/update_notification_preferences.sql`.
91///
92+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
93/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
94///
95pub type UpdateNotificationPreferencesRow {
···101102/// Update user notification preference
103///
104+/// > 🐿️ This function was generated automatically using v4.6.0 of
105/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
106///
107pub fn update_notification_preferences(
···143144/// Corresponds to the Postgres `notification_type_enum` enum.
145///
146+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
147/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
148///
149pub type NotificationTypeEnum {
+22-22
src/app/domain/occurrence/sql.gleam
···1//// This module contains the code to run the sql queries defined in
2//// `./src/app/domain/occurrence/sql`.
3-//// > 🐿️ This module was generated automatically using v4.5.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···13/// A row you get from running the `assign_brigades_to_occurrence` query
14/// defined in `./src/app/domain/occurrence/sql/assign_brigades_to_occurrence.sql`.
15///
16-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
17/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
18///
19pub type AssignBrigadesToOccurrenceRow {
···2223/// Assign as list of brigades as participants of a occurrence
24///
25-/// > 🐿️ This function was generated automatically using v4.5.0 of
26/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
27///
28pub fn assign_brigades_to_occurrence(
···51/// A row you get from running the `delete_occurrence_by_id` query
52/// defined in `./src/app/domain/occurrence/sql/delete_occurrence_by_id.sql`.
53///
54-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
55/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
56///
57pub type DeleteOccurrenceByIdRow {
···6061/// Remove an occurrence from the database
62///
63-/// > 🐿️ This function was generated automatically using v4.5.0 of
64/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
65///
66pub fn delete_occurrence_by_id(
···86/// A row you get from running the `insert_new_occurence` query
87/// defined in `./src/app/domain/occurrence/sql/insert_new_occurence.sql`.
88///
89-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
90/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
91///
92pub type InsertNewOccurenceRow {
···101102/// Inserts a new occurrence into the database
103///
104-/// > 🐿️ This function was generated automatically using v4.5.0 of
105/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
106///
107pub fn insert_new_occurence(
···172/// A row you get from running the `query_occurences_by_applicant` query
173/// defined in `./src/app/domain/occurrence/sql/query_occurences_by_applicant.sql`.
174///
175-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
176/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
177///
178pub type QueryOccurencesByApplicantRow {
···195/// Retrieves all occurrences associated with a user,
196/// including detailed category information and resolution status.
197///
198-/// > 🐿️ This function was generated automatically using v4.5.0 of
199/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
200///
201pub fn query_occurences_by_applicant(
···280/// A row you get from running the `query_participants` query
281/// defined in `./src/app/domain/occurrence/sql/query_participants.sql`.
282///
283-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
284/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
285///
286pub type QueryParticipantsRow {
···289290/// Find all users that participated in a occurrence
291///
292-/// > 🐿️ This function was generated automatically using v4.5.0 of
293/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
294///
295pub fn query_participants(
···318/// A row you get from running the `query_recent_occurrences` query
319/// defined in `./src/app/domain/occurrence/sql/query_recent_occurrences.sql`.
320///
321-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
322/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
323///
324pub type QueryRecentOccurrencesRow {
···335336/// Find all occurrences from the last 24 hours
337///
338-/// > 🐿️ This function was generated automatically using v4.5.0 of
339/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
340///
341pub fn query_recent_occurrences(
···389/// A row you get from running the `reopen_occurrence` query
390/// defined in `./src/app/domain/occurrence/sql/reopen_occurrence.sql`.
391///
392-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
393/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
394///
395pub type ReopenOccurrenceRow {
···402403/// Mark a occurrence as unresolved
404///
405-/// > 🐿️ This function was generated automatically using v4.5.0 of
406/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
407///
408pub fn reopen_occurrence(
···436/// A row you get from running the `replace_occurrence_brigades` query
437/// defined in `./src/app/domain/occurrence/sql/replace_occurrence_brigades.sql`.
438///
439-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
440/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
441///
442pub type ReplaceOccurrenceBrigadesRow {
···445446/// Replace all assigned brigades
447///
448-/// > 🐿️ This function was generated automatically using v4.5.0 of
449/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
450///
451pub fn replace_occurrence_brigades(
···474/// A row you get from running the `resolve_occurrence` query
475/// defined in `./src/app/domain/occurrence/sql/resolve_occurrence.sql`.
476///
477-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
478/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
479///
480pub type ResolveOccurrenceRow {
···487488/// Mark a occurrence as resolved
489///
490-/// > 🐿️ This function was generated automatically using v4.5.0 of
491/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
492///
493pub fn resolve_occurrence(
···522523/// Corresponds to the Postgres `occurrence_category_enum` enum.
524///
525-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
526/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
527///
528pub type OccurrenceCategoryEnum {
···553 |> pog.text
554}/// Corresponds to the Postgres `occurrence_priority_enum` enum.
555///
556-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
557/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
558///
559pub type OccurrencePriorityEnum {
···581 |> pog.text
582}/// Corresponds to the Postgres `occurrence_subcategory_enum` enum.
583///
584-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
585/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
586///
587pub type OccurrenceSubcategoryEnum {
···1//// This module contains the code to run the sql queries defined in
2//// `./src/app/domain/occurrence/sql`.
3+//// > 🐿️ This module was generated automatically using v4.6.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···13/// A row you get from running the `assign_brigades_to_occurrence` query
14/// defined in `./src/app/domain/occurrence/sql/assign_brigades_to_occurrence.sql`.
15///
16+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
17/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
18///
19pub type AssignBrigadesToOccurrenceRow {
···2223/// Assign as list of brigades as participants of a occurrence
24///
25+/// > 🐿️ This function was generated automatically using v4.6.0 of
26/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
27///
28pub fn assign_brigades_to_occurrence(
···51/// A row you get from running the `delete_occurrence_by_id` query
52/// defined in `./src/app/domain/occurrence/sql/delete_occurrence_by_id.sql`.
53///
54+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
55/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
56///
57pub type DeleteOccurrenceByIdRow {
···6061/// Remove an occurrence from the database
62///
63+/// > 🐿️ This function was generated automatically using v4.6.0 of
64/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
65///
66pub fn delete_occurrence_by_id(
···86/// A row you get from running the `insert_new_occurence` query
87/// defined in `./src/app/domain/occurrence/sql/insert_new_occurence.sql`.
88///
89+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
90/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
91///
92pub type InsertNewOccurenceRow {
···101102/// Inserts a new occurrence into the database
103///
104+/// > 🐿️ This function was generated automatically using v4.6.0 of
105/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
106///
107pub fn insert_new_occurence(
···172/// A row you get from running the `query_occurences_by_applicant` query
173/// defined in `./src/app/domain/occurrence/sql/query_occurences_by_applicant.sql`.
174///
175+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
176/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
177///
178pub type QueryOccurencesByApplicantRow {
···195/// Retrieves all occurrences associated with a user,
196/// including detailed category information and resolution status.
197///
198+/// > 🐿️ This function was generated automatically using v4.6.0 of
199/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
200///
201pub fn query_occurences_by_applicant(
···280/// A row you get from running the `query_participants` query
281/// defined in `./src/app/domain/occurrence/sql/query_participants.sql`.
282///
283+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
284/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
285///
286pub type QueryParticipantsRow {
···289290/// Find all users that participated in a occurrence
291///
292+/// > 🐿️ This function was generated automatically using v4.6.0 of
293/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
294///
295pub fn query_participants(
···318/// A row you get from running the `query_recent_occurrences` query
319/// defined in `./src/app/domain/occurrence/sql/query_recent_occurrences.sql`.
320///
321+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
322/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
323///
324pub type QueryRecentOccurrencesRow {
···335336/// Find all occurrences from the last 24 hours
337///
338+/// > 🐿️ This function was generated automatically using v4.6.0 of
339/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
340///
341pub fn query_recent_occurrences(
···389/// A row you get from running the `reopen_occurrence` query
390/// defined in `./src/app/domain/occurrence/sql/reopen_occurrence.sql`.
391///
392+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
393/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
394///
395pub type ReopenOccurrenceRow {
···402403/// Mark a occurrence as unresolved
404///
405+/// > 🐿️ This function was generated automatically using v4.6.0 of
406/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
407///
408pub fn reopen_occurrence(
···436/// A row you get from running the `replace_occurrence_brigades` query
437/// defined in `./src/app/domain/occurrence/sql/replace_occurrence_brigades.sql`.
438///
439+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
440/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
441///
442pub type ReplaceOccurrenceBrigadesRow {
···445446/// Replace all assigned brigades
447///
448+/// > 🐿️ This function was generated automatically using v4.6.0 of
449/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
450///
451pub fn replace_occurrence_brigades(
···474/// A row you get from running the `resolve_occurrence` query
475/// defined in `./src/app/domain/occurrence/sql/resolve_occurrence.sql`.
476///
477+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
478/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
479///
480pub type ResolveOccurrenceRow {
···487488/// Mark a occurrence as resolved
489///
490+/// > 🐿️ This function was generated automatically using v4.6.0 of
491/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
492///
493pub fn resolve_occurrence(
···522523/// Corresponds to the Postgres `occurrence_category_enum` enum.
524///
525+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
526/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
527///
528pub type OccurrenceCategoryEnum {
···553 |> pog.text
554}/// Corresponds to the Postgres `occurrence_priority_enum` enum.
555///
556+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
557/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
558///
559pub type OccurrencePriorityEnum {
···581 |> pog.text
582}/// Corresponds to the Postgres `occurrence_subcategory_enum` enum.
583///
584+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
585/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
586///
587pub type OccurrenceSubcategoryEnum {
+4-4
src/app/domain/role/sql.gleam
···1//// This module contains the code to run the sql queries defined in
2//// `./src/app/domain/role/sql`.
3-//// > 🐿️ This module was generated automatically using v4.5.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···10/// A row you get from running the `query_available_user_roles` query
11/// defined in `./src/app/domain/role/sql/query_available_user_roles.sql`.
12///
13-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
14/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
15///
16pub type QueryAvailableUserRolesRow {
···1920/// Find all available user roles
21///
22-/// > 🐿️ This function was generated automatically using v4.5.0 of
23/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
24///
25pub fn query_available_user_roles(
···4243/// Corresponds to the Postgres `user_role_enum` enum.
44///
45-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
46/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
47///
48pub type UserRoleEnum {
···1//// This module contains the code to run the sql queries defined in
2//// `./src/app/domain/role/sql`.
3+//// > 🐿️ This module was generated automatically using v4.6.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···10/// A row you get from running the `query_available_user_roles` query
11/// defined in `./src/app/domain/role/sql/query_available_user_roles.sql`.
12///
13+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
14/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
15///
16pub type QueryAvailableUserRolesRow {
···1920/// Find all available user roles
21///
22+/// > 🐿️ This function was generated automatically using v4.6.0 of
23/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
24///
25pub fn query_available_user_roles(
···4243/// Corresponds to the Postgres `user_role_enum` enum.
44///
45+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
46/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
47///
48pub type UserRoleEnum {
+31-31
src/app/domain/user/sql.gleam
···1//// This module contains the code to run the sql queries defined in
2//// `./src/app/domain/user/sql`.
3-//// > 🐿️ This module was generated automatically using v4.5.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···12/// A row you get from running the `delete_user_by_id` query
13/// defined in `./src/app/domain/user/sql/delete_user_by_id.sql`.
14///
15-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
16/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
17///
18pub type DeleteUserByIdRow {
···2122/// Remove and user from the database
23///
24-/// > 🐿️ This function was generated automatically using v4.5.0 of
25/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
26///
27pub fn delete_user_by_id(
···48/// A row you get from running the `get_complete_user_profiles` query
49/// defined in `./src/app/domain/user/sql/get_complete_user_profiles.sql`.
50///
51-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
52/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
53///
54pub type GetCompleteUserProfilesRow {
···6465/// Find all users on the database
66///
67-/// > 🐿️ This function was generated automatically using v4.5.0 of
68/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
69///
70pub fn get_complete_user_profiles(
···105/// A row you get from running the `insert_new_user` query
106/// defined in `./src/app/domain/user/sql/insert_new_user.sql`.
107///
108-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
109/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
110///
111pub type InsertNewUserRow {
···114115/// Inserts a new user into the database
116///
117-/// > 🐿️ This function was generated automatically using v4.5.0 of
118/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
119///
120pub fn insert_new_user(
···158/// A row you get from running the `query_crew_members` query
159/// defined in `./src/app/domain/user/sql/query_crew_members.sql`.
160///
161-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
162/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
163///
164pub type QueryCrewMembersRow {
···173/// Retrieves detailed information about fellow brigade members
174/// for a given user, including their names and role details.
175///
176-/// > 🐿️ This function was generated automatically using v4.5.0 of
177/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
178///
179pub fn query_crew_members(
···208/// A row you get from running the `query_login_token` query
209/// defined in `./src/app/domain/user/sql/query_login_token.sql`.
210///
211-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
212/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
213///
214pub type QueryLoginTokenRow {
···218/// Retrieves a user's ID and password hash from their registration
219/// number for authentication purposes.
220///
221-/// > 🐿️ This function was generated automatically using v4.5.0 of
222/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
223///
224pub fn query_login_token(
···250/// A row you get from running the `query_occurrences_by_participant` query
251/// defined in `./src/app/domain/user/sql/query_occurrences_by_participant.sql`.
252///
253-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
254/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
255///
256pub type QueryOccurrencesByParticipantRow {
···259260/// Find all occurrences a user participated in
261///
262-/// > 🐿️ This function was generated automatically using v4.5.0 of
263/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
264///
265pub fn query_occurrences_by_participant(
···289/// A row you get from running the `query_user_brigades` query
290/// defined in `./src/app/domain/user/sql/query_user_brigades.sql`.
291///
292-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
293/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
294///
295pub type QueryUserBrigadesRow {
···298299/// Find all brigades an user is assigned to
300///
301-/// > 🐿️ This function was generated automatically using v4.5.0 of
302/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
303///
304pub fn query_user_brigades(
···324/// A row you get from running the `query_user_id_by_registration` query
325/// defined in `./src/app/domain/user/sql/query_user_id_by_registration.sql`.
326///
327-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
328/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
329///
330pub type QueryUserIdByRegistrationRow {
···333334/// Retrieves a user's ID from their registration number.
335///
336-/// > 🐿️ This function was generated automatically using v4.5.0 of
337/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
338///
339pub fn query_user_id_by_registration(
···359/// A row you get from running the `query_user_name` query
360/// defined in `./src/app/domain/user/sql/query_user_name.sql`.
361///
362-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
363/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
364///
365pub type QueryUserNameRow {
···368369/// Retrieves a user's full name by their user ID.
370///
371-/// > 🐿️ This function was generated automatically using v4.5.0 of
372/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
373///
374pub fn query_user_name(
···394/// A row you get from running the `query_user_password` query
395/// defined in `./src/app/domain/user/sql/query_user_password.sql`.
396///
397-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
398/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
399///
400pub type QueryUserPasswordRow {
···403404/// Find the password hash from an user
405///
406-/// > 🐿️ This function was generated automatically using v4.5.0 of
407/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
408///
409pub fn query_user_password(
···429/// A row you get from running the `query_user_profile` query
430/// defined in `./src/app/domain/user/sql/query_user_profile.sql`.
431///
432-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
433/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
434///
435pub type QueryUserProfileRow {
···445446/// Find basic information about an user account
447///
448-/// > 🐿️ This function was generated automatically using v4.5.0 of
449/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
450///
451pub fn query_user_profile(
···489/// A row you get from running the `query_user_role` query
490/// defined in `./src/app/domain/user/sql/query_user_role.sql`.
491///
492-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
493/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
494///
495pub type QueryUserRoleRow {
···498499/// Find user access level
500///
501-/// > 🐿️ This function was generated automatically using v4.5.0 of
502/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
503///
504pub fn query_user_role(
···524525/// Set an new value to the password of an user
526///
527-/// > 🐿️ This function was generated automatically using v4.5.0 of
528/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
529///
530pub fn update_user_password(
···551/// A row you get from running the `update_user_profile` query
552/// defined in `./src/app/domain/user/sql/update_user_profile.sql`.
553///
554-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
555/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
556///
557pub type UpdateUserProfileRow {
···560561/// Update an authenticated user profile
562///
563-/// > 🐿️ This function was generated automatically using v4.5.0 of
564/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
565///
566pub fn update_user_profile(
···600/// A row you get from running the `update_user_status` query
601/// defined in `./src/app/domain/user/sql/update_user_status.sql`.
602///
603-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
604/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
605///
606pub type UpdateUserStatusRow {
···609610/// Update an user `is_active` field
611///
612-/// > 🐿️ This function was generated automatically using v4.5.0 of
613/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
614///
615pub fn update_user_status(
···642643/// Corresponds to the Postgres `user_role_enum` enum.
644///
645-/// > 🐿️ This type definition was generated automatically using v4.5.0 of the
646/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
647///
648pub type UserRoleEnum {
···1//// This module contains the code to run the sql queries defined in
2//// `./src/app/domain/user/sql`.
3+//// > 🐿️ This module was generated automatically using v4.6.0 of
4//// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
5////
6···12/// A row you get from running the `delete_user_by_id` query
13/// defined in `./src/app/domain/user/sql/delete_user_by_id.sql`.
14///
15+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
16/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
17///
18pub type DeleteUserByIdRow {
···2122/// Remove and user from the database
23///
24+/// > 🐿️ This function was generated automatically using v4.6.0 of
25/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
26///
27pub fn delete_user_by_id(
···48/// A row you get from running the `get_complete_user_profiles` query
49/// defined in `./src/app/domain/user/sql/get_complete_user_profiles.sql`.
50///
51+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
52/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
53///
54pub type GetCompleteUserProfilesRow {
···6465/// Find all users on the database
66///
67+/// > 🐿️ This function was generated automatically using v4.6.0 of
68/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
69///
70pub fn get_complete_user_profiles(
···105/// A row you get from running the `insert_new_user` query
106/// defined in `./src/app/domain/user/sql/insert_new_user.sql`.
107///
108+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
109/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
110///
111pub type InsertNewUserRow {
···114115/// Inserts a new user into the database
116///
117+/// > 🐿️ This function was generated automatically using v4.6.0 of
118/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
119///
120pub fn insert_new_user(
···158/// A row you get from running the `query_crew_members` query
159/// defined in `./src/app/domain/user/sql/query_crew_members.sql`.
160///
161+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
162/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
163///
164pub type QueryCrewMembersRow {
···173/// Retrieves detailed information about fellow brigade members
174/// for a given user, including their names and role details.
175///
176+/// > 🐿️ This function was generated automatically using v4.6.0 of
177/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
178///
179pub fn query_crew_members(
···208/// A row you get from running the `query_login_token` query
209/// defined in `./src/app/domain/user/sql/query_login_token.sql`.
210///
211+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
212/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
213///
214pub type QueryLoginTokenRow {
···218/// Retrieves a user's ID and password hash from their registration
219/// number for authentication purposes.
220///
221+/// > 🐿️ This function was generated automatically using v4.6.0 of
222/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
223///
224pub fn query_login_token(
···250/// A row you get from running the `query_occurrences_by_participant` query
251/// defined in `./src/app/domain/user/sql/query_occurrences_by_participant.sql`.
252///
253+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
254/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
255///
256pub type QueryOccurrencesByParticipantRow {
···259260/// Find all occurrences a user participated in
261///
262+/// > 🐿️ This function was generated automatically using v4.6.0 of
263/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
264///
265pub fn query_occurrences_by_participant(
···289/// A row you get from running the `query_user_brigades` query
290/// defined in `./src/app/domain/user/sql/query_user_brigades.sql`.
291///
292+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
293/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
294///
295pub type QueryUserBrigadesRow {
···298299/// Find all brigades an user is assigned to
300///
301+/// > 🐿️ This function was generated automatically using v4.6.0 of
302/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
303///
304pub fn query_user_brigades(
···324/// A row you get from running the `query_user_id_by_registration` query
325/// defined in `./src/app/domain/user/sql/query_user_id_by_registration.sql`.
326///
327+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
328/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
329///
330pub type QueryUserIdByRegistrationRow {
···333334/// Retrieves a user's ID from their registration number.
335///
336+/// > 🐿️ This function was generated automatically using v4.6.0 of
337/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
338///
339pub fn query_user_id_by_registration(
···359/// A row you get from running the `query_user_name` query
360/// defined in `./src/app/domain/user/sql/query_user_name.sql`.
361///
362+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
363/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
364///
365pub type QueryUserNameRow {
···368369/// Retrieves a user's full name by their user ID.
370///
371+/// > 🐿️ This function was generated automatically using v4.6.0 of
372/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
373///
374pub fn query_user_name(
···394/// A row you get from running the `query_user_password` query
395/// defined in `./src/app/domain/user/sql/query_user_password.sql`.
396///
397+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
398/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
399///
400pub type QueryUserPasswordRow {
···403404/// Find the password hash from an user
405///
406+/// > 🐿️ This function was generated automatically using v4.6.0 of
407/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
408///
409pub fn query_user_password(
···429/// A row you get from running the `query_user_profile` query
430/// defined in `./src/app/domain/user/sql/query_user_profile.sql`.
431///
432+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
433/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
434///
435pub type QueryUserProfileRow {
···445446/// Find basic information about an user account
447///
448+/// > 🐿️ This function was generated automatically using v4.6.0 of
449/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
450///
451pub fn query_user_profile(
···489/// A row you get from running the `query_user_role` query
490/// defined in `./src/app/domain/user/sql/query_user_role.sql`.
491///
492+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
493/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
494///
495pub type QueryUserRoleRow {
···498499/// Find user access level
500///
501+/// > 🐿️ This function was generated automatically using v4.6.0 of
502/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
503///
504pub fn query_user_role(
···524525/// Set an new value to the password of an user
526///
527+/// > 🐿️ This function was generated automatically using v4.6.0 of
528/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
529///
530pub fn update_user_password(
···551/// A row you get from running the `update_user_profile` query
552/// defined in `./src/app/domain/user/sql/update_user_profile.sql`.
553///
554+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
555/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
556///
557pub type UpdateUserProfileRow {
···560561/// Update an authenticated user profile
562///
563+/// > 🐿️ This function was generated automatically using v4.6.0 of
564/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
565///
566pub fn update_user_profile(
···600/// A row you get from running the `update_user_status` query
601/// defined in `./src/app/domain/user/sql/update_user_status.sql`.
602///
603+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
604/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
605///
606pub type UpdateUserStatusRow {
···609610/// Update an user `is_active` field
611///
612+/// > 🐿️ This function was generated automatically using v4.6.0 of
613/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
614///
615pub fn update_user_status(
···642643/// Corresponds to the Postgres `user_role_enum` enum.
644///
645+/// > 🐿️ This type definition was generated automatically using v4.6.0 of the
646/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
647///
648pub type UserRoleEnum {