@hirelink/database-prisma 1.1.6 → 1.1.9
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.
package/package.json
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
/*
|
2
|
+
Warnings:
|
3
|
+
|
4
|
+
- The `status` column on the `CandidateDocument` table would be dropped and recreated. This will lead to data loss if there is data in the column.
|
5
|
+
|
6
|
+
*/
|
7
|
+
-- CreateEnum
|
8
|
+
CREATE TYPE "CandidateDocumentStatus" AS ENUM ('pending', 'open', 'overdue', 'complete');
|
9
|
+
|
10
|
+
-- AlterTable
|
11
|
+
ALTER TABLE "CandidateDocument" DROP COLUMN "status",
|
12
|
+
ADD COLUMN "status" "CandidateDocumentStatus" NOT NULL DEFAULT 'pending';
|
package/prisma/schema.prisma
CHANGED
@@ -16,7 +16,7 @@ model User {
|
|
16
16
|
status UserStatus @default(active)
|
17
17
|
created_at DateTime? @default(now())
|
18
18
|
updated_at DateTime? @updatedAt
|
19
|
-
work_experience Work_experience?
|
19
|
+
work_experience Work_experience? @default(experience)
|
20
20
|
candidate_documents CandidateDocument[]
|
21
21
|
hirelink_ids HirelinkId[]
|
22
22
|
hr_users HrUser[]
|
@@ -112,16 +112,16 @@ model PolicyMaster {
|
|
112
112
|
}
|
113
113
|
|
114
114
|
model CandidateDocument {
|
115
|
-
doc_id String
|
115
|
+
doc_id String @id
|
116
116
|
doc_name String
|
117
117
|
doc_type String
|
118
|
-
status String
|
119
118
|
uploaded_at String
|
120
119
|
user_id String
|
121
120
|
candidate_document_type CandidateDocumentType?
|
122
|
-
|
123
|
-
|
124
|
-
|
121
|
+
status CandidateDocumentStatus @default(pending)
|
122
|
+
created_at DateTime? @default(now())
|
123
|
+
updated_at DateTime? @updatedAt
|
124
|
+
user User @relation(fields: [user_id], references: [id])
|
125
125
|
}
|
126
126
|
|
127
127
|
model Session {
|
@@ -246,3 +246,10 @@ enum NotificationStatus {
|
|
246
246
|
Unread
|
247
247
|
Read
|
248
248
|
}
|
249
|
+
|
250
|
+
enum CandidateDocumentStatus {
|
251
|
+
pending
|
252
|
+
open
|
253
|
+
overdue
|
254
|
+
complete
|
255
|
+
}
|
@@ -1,97 +0,0 @@
|
|
1
|
-
name: Notify Slack on Pull Request
|
2
|
-
|
3
|
-
on:
|
4
|
-
pull_request:
|
5
|
-
types: [opened, reopened, ready_for_review, synchronize]
|
6
|
-
# pull_request_target:
|
7
|
-
# types: [opened, reopened, ready_for_review, synchronize]
|
8
|
-
|
9
|
-
jobs:
|
10
|
-
notify-slack:
|
11
|
-
runs-on: ubuntu-latest
|
12
|
-
|
13
|
-
steps:
|
14
|
-
- name: Checkout code
|
15
|
-
uses: actions/checkout@v4
|
16
|
-
|
17
|
-
- name: Checkout main branch's team_leads.json
|
18
|
-
run: |
|
19
|
-
git fetch origin main
|
20
|
-
git checkout origin/main -- team_leads.json
|
21
|
-
|
22
|
-
- name: Extract PR Info
|
23
|
-
id: pr
|
24
|
-
run: |
|
25
|
-
echo "url=${{ github.event.pull_request.html_url }}" >> $GITHUB_OUTPUT
|
26
|
-
echo "author=${{ github.event.pull_request.user.login }}" >> $GITHUB_OUTPUT
|
27
|
-
echo "title=${{ github.event.pull_request.title }}" >> $GITHUB_OUTPUT
|
28
|
-
echo "head=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT
|
29
|
-
echo "base=${{ github.event.pull_request.base.ref }}" >> $GITHUB_OUTPUT
|
30
|
-
echo "ref=${{ github.ref }}" >> $GITHUB_OUTPUT
|
31
|
-
echo "event=${{ github.event_name }}" >> $GITHUB_OUTPUT
|
32
|
-
echo "commit=${{ github.sha }}" >> $GITHUB_OUTPUT
|
33
|
-
echo "short_commit=$(echo '${{ github.sha }}' | cut -c1-7)" >> $GITHUB_OUTPUT
|
34
|
-
echo "workflow_url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_OUTPUT
|
35
|
-
|
36
|
-
- name: Lookup Slack User IDs from team_leads.json
|
37
|
-
id: lead
|
38
|
-
env:
|
39
|
-
SLACK_BOT_PR_REVIEW_TOKEN: ${{ secrets.SLACK_BOT_PR_REVIEW_TOKEN }}
|
40
|
-
run: |
|
41
|
-
TEAM_LEAD_KEYS=("Team Lead 1" "Team Lead 2")
|
42
|
-
MENTIONS=""
|
43
|
-
if [ ! -f team_leads.json ]; then
|
44
|
-
echo "team_leads.json not found!"
|
45
|
-
exit 1
|
46
|
-
fi
|
47
|
-
for key in "${TEAM_LEAD_KEYS[@]}"; do
|
48
|
-
EMAIL=$(jq -r --arg k "$key" '.[$k]' team_leads.json)
|
49
|
-
if [ "$EMAIL" == "null" ] || [ -z "$EMAIL" ]; then
|
50
|
-
continue
|
51
|
-
fi
|
52
|
-
RESPONSE=$(curl -s -H "Authorization: Bearer $SLACK_BOT_PR_REVIEW_TOKEN" \
|
53
|
-
"https://slack.com/api/users.lookupByEmail?email=$EMAIL")
|
54
|
-
SLACK_ID=$(echo "$RESPONSE" | jq -r '.user.id // empty')
|
55
|
-
if [ -n "$SLACK_ID" ]; then
|
56
|
-
MENTIONS="$MENTIONS <@$SLACK_ID>"
|
57
|
-
fi
|
58
|
-
done
|
59
|
-
echo "lead_mentions=$MENTIONS" >> $GITHUB_OUTPUT
|
60
|
-
|
61
|
-
- name: Send Slack Notification via curl
|
62
|
-
env:
|
63
|
-
SLACK_BOT_PR_REVIEW_TOKEN: ${{ secrets.SLACK_BOT_PR_REVIEW_TOKEN }}
|
64
|
-
run: |
|
65
|
-
curl -X POST https://slack.com/api/chat.postMessage \
|
66
|
-
-H "Authorization: Bearer $SLACK_BOT_PR_REVIEW_TOKEN" \
|
67
|
-
-H "Content-type: application/json" \
|
68
|
-
--data '{
|
69
|
-
"channel": "github-pr-review-notification",
|
70
|
-
"text": "🚨 New Pull Request Notification",
|
71
|
-
"blocks": [
|
72
|
-
{
|
73
|
-
"type": "section",
|
74
|
-
"fields": [
|
75
|
-
{
|
76
|
-
"type": "mrkdwn",
|
77
|
-
"text": "*Event:*\n`${{ steps.pr.outputs.event }}`"
|
78
|
-
},
|
79
|
-
{
|
80
|
-
"type": "mrkdwn",
|
81
|
-
"text": "*Ref:*\n`${{ steps.pr.outputs.ref }}`"
|
82
|
-
},
|
83
|
-
{
|
84
|
-
"type": "mrkdwn",
|
85
|
-
"text": "*Commit:*\n<https://github.com/${{ github.repository }}/commit/${{ steps.pr.outputs.commit }}|`${{ steps.pr.outputs.short_commit }}`>"
|
86
|
-
}
|
87
|
-
]
|
88
|
-
},
|
89
|
-
{
|
90
|
-
"type": "section",
|
91
|
-
"text": {
|
92
|
-
"type": "mrkdwn",
|
93
|
-
"text": ":rotating_light: *New PR* opened by `${{ steps.pr.outputs.author }}`:\n<${{ steps.pr.outputs.url }}|${{ steps.pr.outputs.title }}>\n\n:twisted_rightwards_arrows: *Branch:* `${{ steps.pr.outputs.head }}` → `${{ steps.pr.outputs.base }}`\n:bust_in_silhouette: *Team Lead(s):* \n${{ steps.lead.outputs.lead_mentions }}"
|
94
|
-
}
|
95
|
-
}
|
96
|
-
]
|
97
|
-
}'
|
package/team_leads.json
DELETED