@pgpm/achievements 0.16.8 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,12 @@ CREATE TABLE status_public.level_requirements (
15
15
  );
16
16
 
17
17
  COMMENT ON TABLE status_public.level_requirements IS 'Requirements to achieve a level';
18
+ COMMENT ON COLUMN status_public.level_requirements.id IS 'Unique identifier for this requirement';
19
+ COMMENT ON COLUMN status_public.level_requirements.name IS 'Requirement name (e.g. posts_created, logins); matches user_steps.name';
20
+ COMMENT ON COLUMN status_public.level_requirements.level IS 'Level this requirement belongs to (references levels.name)';
21
+ COMMENT ON COLUMN status_public.level_requirements.required_count IS 'Number of steps needed to satisfy this requirement (default 1)';
22
+ COMMENT ON COLUMN status_public.level_requirements.priority IS 'Display/evaluation order; lower numbers are checked first (default 100)';
23
+
18
24
  CREATE INDEX ON status_public.level_requirements (name, level, priority);
19
25
  GRANT SELECT ON TABLE status_public.levels TO authenticated;
20
26
 
@@ -9,6 +9,7 @@ CREATE TABLE status_public.levels (
9
9
  );
10
10
 
11
11
  COMMENT ON TABLE status_public.levels IS 'Levels for achievement';
12
+ COMMENT ON COLUMN status_public.levels.name IS 'Unique level name used as the primary key (e.g. bronze, silver, gold)';
12
13
 
13
14
  GRANT SELECT ON TABLE status_public.levels TO public;
14
15
 
@@ -14,6 +14,11 @@ CREATE TABLE status_public.user_achievements (
14
14
  );
15
15
 
16
16
  COMMENT ON TABLE status_public.user_achievements IS 'This table represents the users progress for particular level requirements, tallying the total count. This table is updated via triggers and should not be updated maually.';
17
+ COMMENT ON COLUMN status_public.user_achievements.id IS 'Unique identifier for this achievement progress record';
18
+ COMMENT ON COLUMN status_public.user_achievements.user_id IS 'User whose progress is being tracked';
19
+ COMMENT ON COLUMN status_public.user_achievements.name IS 'Name of the level requirement this progress relates to';
20
+ COMMENT ON COLUMN status_public.user_achievements.count IS 'Accumulated count toward the requirement (updated by triggers)';
21
+ COMMENT ON COLUMN status_public.user_achievements.created_at IS 'Timestamp when this progress record was first created';
17
22
 
18
23
  CREATE INDEX ON status_public.user_achievements (user_id, name);
19
24
 
@@ -13,6 +13,12 @@ CREATE TABLE status_public.user_steps (
13
13
  );
14
14
 
15
15
  COMMENT ON TABLE status_public.user_steps IS 'The user achieving a requirement for a level. Log table that has every single step ever taken.';
16
+ COMMENT ON COLUMN status_public.user_steps.id IS 'Unique identifier for this step record';
17
+ COMMENT ON COLUMN status_public.user_steps.user_id IS 'User who performed this step';
18
+ COMMENT ON COLUMN status_public.user_steps.name IS 'Name of the level requirement this step counts toward';
19
+ COMMENT ON COLUMN status_public.user_steps.count IS 'Number of units this step contributes (default 1)';
20
+ COMMENT ON COLUMN status_public.user_steps.created_at IS 'Timestamp when this step was recorded';
21
+
16
22
  CREATE INDEX ON status_public.user_steps (user_id, name);
17
23
 
18
24
  COMMIT;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpm/achievements",
3
- "version": "0.16.8",
3
+ "version": "0.18.0",
4
4
  "description": "Achievement system for tracking user progress and milestones",
5
5
  "author": "Dan Lynch <pyramation@gmail.com>",
6
6
  "contributors": [
@@ -21,11 +21,11 @@
21
21
  "test:watch": "jest --watch"
22
22
  },
23
23
  "dependencies": {
24
- "@pgpm/jwt-claims": "0.16.8",
25
- "@pgpm/verify": "0.16.0"
24
+ "@pgpm/jwt-claims": "0.18.0",
25
+ "@pgpm/verify": "0.18.0"
26
26
  },
27
27
  "devDependencies": {
28
- "pgpm": "^1.3.0"
28
+ "pgpm": "^4.2.3"
29
29
  },
30
30
  "repository": {
31
31
  "type": "git",
@@ -35,5 +35,5 @@
35
35
  "bugs": {
36
36
  "url": "https://github.com/constructive-io/pgpm-modules/issues"
37
37
  },
38
- "gitHead": "a0718b6712d797acacfd51fbcdad8a6d577d8bbc"
38
+ "gitHead": "8144027c7fab4956bcdebd736d04c0d4f57344bc"
39
39
  }
@@ -22,6 +22,11 @@ CREATE TABLE status_public.user_steps (
22
22
  );
23
23
 
24
24
  COMMENT ON TABLE status_public.user_steps IS 'The user achieving a requirement for a level. Log table that has every single step ever taken.';
25
+ COMMENT ON COLUMN status_public.user_steps.id IS 'Unique identifier for this step record';
26
+ COMMENT ON COLUMN status_public.user_steps.user_id IS 'User who performed this step';
27
+ COMMENT ON COLUMN status_public.user_steps.name IS 'Name of the level requirement this step counts toward';
28
+ COMMENT ON COLUMN status_public.user_steps.count IS 'Number of units this step contributes (default 1)';
29
+ COMMENT ON COLUMN status_public.user_steps.created_at IS 'Timestamp when this step was recorded';
25
30
 
26
31
  CREATE INDEX ON status_public.user_steps (user_id, name);
27
32
 
@@ -124,6 +129,11 @@ CREATE TABLE status_public.user_achievements (
124
129
  );
125
130
 
126
131
  COMMENT ON TABLE status_public.user_achievements IS 'This table represents the users progress for particular level requirements, tallying the total count. This table is updated via triggers and should not be updated maually.';
132
+ COMMENT ON COLUMN status_public.user_achievements.id IS 'Unique identifier for this achievement progress record';
133
+ COMMENT ON COLUMN status_public.user_achievements.user_id IS 'User whose progress is being tracked';
134
+ COMMENT ON COLUMN status_public.user_achievements.name IS 'Name of the level requirement this progress relates to';
135
+ COMMENT ON COLUMN status_public.user_achievements.count IS 'Accumulated count toward the requirement (updated by triggers)';
136
+ COMMENT ON COLUMN status_public.user_achievements.created_at IS 'Timestamp when this progress record was first created';
127
137
 
128
138
  CREATE INDEX ON status_public.user_achievements (user_id, name);
129
139
 
@@ -145,6 +155,7 @@ CREATE TABLE status_public.levels (
145
155
  );
146
156
 
147
157
  COMMENT ON TABLE status_public.levels IS 'Levels for achievement';
158
+ COMMENT ON COLUMN status_public.levels.name IS 'Unique level name used as the primary key (e.g. bronze, silver, gold)';
148
159
 
149
160
  GRANT SELECT ON status_public.levels TO PUBLIC;
150
161
 
@@ -158,6 +169,11 @@ CREATE TABLE status_public.level_requirements (
158
169
  );
159
170
 
160
171
  COMMENT ON TABLE status_public.level_requirements IS 'Requirements to achieve a level';
172
+ COMMENT ON COLUMN status_public.level_requirements.id IS 'Unique identifier for this requirement';
173
+ COMMENT ON COLUMN status_public.level_requirements.name IS 'Requirement name (e.g. posts_created, logins); matches user_steps.name';
174
+ COMMENT ON COLUMN status_public.level_requirements.level IS 'Level this requirement belongs to (references levels.name)';
175
+ COMMENT ON COLUMN status_public.level_requirements.required_count IS 'Number of steps needed to satisfy this requirement (default 1)';
176
+ COMMENT ON COLUMN status_public.level_requirements.priority IS 'Display/evaluation order; lower numbers are checked first (default 100)';
161
177
 
162
178
  CREATE INDEX ON status_public.level_requirements (name, level, priority);
163
179
 
@@ -261,4 +277,4 @@ CREATE TRIGGER update_achievements_tg
261
277
  AFTER INSERT
262
278
  ON status_public.user_steps
263
279
  FOR EACH ROW
264
- EXECUTE PROCEDURE status_private.tg_update_achievements_tg();
280
+ EXECUTE PROCEDURE status_private.tg_update_achievements_tg();