Skip to content

Commit fd117b3

Browse files
authored
Merge branch 'dev' into SRS-1133-New
2 parents f2e9d7c + 985f08b commit fd117b3

File tree

18 files changed

+2796
-469
lines changed

18 files changed

+2796
-469
lines changed

.github/workflows/.pr-close.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,18 @@ jobs:
9797
package: ${{ fromJson(needs.vars.outputs.packages) }}
9898
timeout-minutes: 1
9999
steps:
100+
- name: Check if target image tag exists
101+
run: |
102+
IMAGE="ghcr.io/${{ inputs.organization }}/${{ inputs.repository }}/${{ matrix.package }}:${{ inputs.target }}"
103+
if docker manifest inspect "$IMAGE" >/dev/null 2>&1; then
104+
echo "IMAGE_EXISTS=true" >> $GITHUB_ENV
105+
else
106+
echo "IMAGE_EXISTS=false" >> $GITHUB_ENV
107+
echo "Skipping retag; not found: $IMAGE"
108+
fi
109+
100110
- uses: shrink/actions-docker-registry-tag@v4
111+
if: env.IMAGE_EXISTS == 'true'
101112
with:
102113
registry: ghcr.io
103114
repository: ${{ inputs.organization }}/${{ inputs.repository }}/${{ matrix.package }}
@@ -118,16 +129,17 @@ jobs:
118129
echo "ERROR: Tagging success!"
119130
echo "RETRY=false" >> $GITHUB_ENV
120131
fi
132+
if: env.IMAGE_EXISTS == 'true'
121133
122134
- uses: shrink/actions-docker-registry-tag@v4
123-
if: env.RETRY == 'true'
135+
if: env.IMAGE_EXISTS == 'true' && env.RETRY == 'true'
124136
with:
125137
registry: ghcr.io
126138
repository: ${{ inputs.organization }}/${{ inputs.repository }}/${{ matrix.package }}
127139
target: ${{ inputs.target }}
128140
tags: ${{ inputs.tag_promote }}
129141

130-
- if: env.RETRY == 'true'
142+
- if: env.IMAGE_EXISTS == 'true' && env.RETRY == 'true'
131143
run: |
132144
# Verify tagging after retry
133145
INSPECT="docker manifest inspect ghcr.io/${{ inputs.organization }}/${{ inputs.repository }}/${{ matrix.package }}"
@@ -138,6 +150,7 @@ jobs:
138150
exit 1
139151
fi
140152
153+
141154
# Clean up OpenShift when PR closed, no conditions
142155
cleanup:
143156
name: OpenShift
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
# Quick Start Guide
2+
3+
## Start the Application
4+
5+
```bash
6+
npm run start:dev
7+
```
8+
9+
## Access Documentation
10+
11+
| Type | URL | Purpose |
12+
|------|-----|---------|
13+
| **REST API** | http://localhost:4005/api | Swagger UI for REST endpoints |
14+
| **GraphQL API** | http://localhost:4005/graphql | GraphQL Playground for queries/mutations |
15+
16+
## Authentication
17+
18+
### Get Your JWT Token
19+
1. Login to your Keycloak instance
20+
2. Copy the JWT token from your session
21+
22+
### Use in Swagger (REST API)
23+
1. Click **"Authorize"** button (top right)
24+
2. Paste your token
25+
3. Click **"Authorize"** then **"Close"**
26+
27+
### Use in GraphQL Playground
28+
1. Click **"HTTP HEADERS"** (bottom left)
29+
2. Add:
30+
```json
31+
{
32+
"Authorization": "Bearer YOUR_TOKEN_HERE"
33+
}
34+
```
35+
36+
## Quick Examples
37+
38+
### REST: Upload Files
39+
```
40+
POST /cats/uploadFiles
41+
- files: [select files]
42+
- bucketId: "invoice-attachments"
43+
- invoiceId: 12345
44+
```
45+
46+
### REST: Send Email
47+
```
48+
POST /cats/sendEmail
49+
- file: [optional PDF]
50+
- invoiceId: 12345
51+
- to: ["email@example.com"]
52+
- subject: "Invoice"
53+
- body: "Your invoice"
54+
```
55+
56+
57+
### REST: Add User to Group
58+
```
59+
POST /users/addGroup
60+
- userId: "123e4567-e89b-12d3-a456-426614174000"
61+
```
62+
63+
### GraphQL: Get All Persons
64+
```graphql
65+
query {
66+
findAllPerson {
67+
data {
68+
id
69+
firstName
70+
lastName
71+
email
72+
}
73+
}
74+
}
75+
```
76+
77+
### GraphQL: Search Applications
78+
```graphql
79+
query {
80+
searchApplications(
81+
searchParam: ""
82+
page: 1
83+
pageSize: 10
84+
filter: ALL
85+
) {
86+
count
87+
applications {
88+
id
89+
siteAddress
90+
status
91+
}
92+
}
93+
}
94+
```
95+
96+
### GraphQL: Create Invoice
97+
```graphql
98+
mutation {
99+
createInvoice(invoice: {
100+
personId: "123"
101+
subject: "Application Fee"
102+
issuedDate: "2024-01-15T00:00:00Z"
103+
dueDate: "2024-02-15T00:00:00Z"
104+
invoiceStatus: DRAFT
105+
taxExempt: false
106+
pstExempt: false
107+
subtotalInCents: 50000
108+
gstInCents: 2500
109+
pstInCents: 3500
110+
totalInCents: 56000
111+
applicationId: 456
112+
invoiceItems: [{
113+
description: "Review Fee"
114+
quantity: 1
115+
unitPriceInCents: 50000
116+
totalInCents: 50000
117+
itemType: "SERVICE"
118+
}]
119+
}) {
120+
message
121+
success
122+
data { id }
123+
}
124+
}
125+
```
126+
127+
## Need More Help?
128+
129+
- **REST API Documentation**: See `SWAGGER_DOCUMENTATION.md` for complete REST endpoint details
130+
- **GraphQL Examples**: See `GRAPHQL_QUERIES_MUTATIONS.md` for all queries and mutations with examples
131+
132+
## Common Issues
133+
134+
### Swagger UI: "Authorize" button not working
135+
- Make sure your JWT token is valid and not expired
136+
- Token should NOT include the "Bearer " prefix when pasting
137+
- Check Keycloak is running and accessible
138+
139+
### GraphQL Playground: Authentication errors
140+
- Verify the Authorization header format: `"Authorization": "Bearer YOUR_TOKEN"`
141+
- Make sure to include "Bearer " prefix in the header value
142+
- Check the HTTP HEADERS panel is properly formatted JSON
143+
144+
### GraphQL Playground: Schema introspection failed
145+
- Ensure the application is running: `npm run start:dev`
146+
- Check `src/app.module.ts` has `playground: true` and `introspection: true`
147+
- Verify no enum or type errors in your GraphQL schema
148+
149+
### Connection refused errors
150+
- Confirm the app is running on port 4005
151+
- Check no other service is using port 4005
152+
- Verify your `.env` file has correct configuration

0 commit comments

Comments
 (0)