Skip to content

Commit 169445a

Browse files
authored
Merge pull request #50 from WildCodeSchool/dev
deploy to staging
2 parents 9daf4da + 50b9c27 commit 169445a

File tree

100 files changed

+5527
-2121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+5527
-2121
lines changed

.env.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ INTERNAL_SECRET_KEY=cle_code_secret_interne
1818
FRONTEND_PORT=NUMERO_DE_PORT_DU_FRONTEND
1919
SERVEUR_URL=http://localhost:GATEWAY_PORT/api || https://URL_DU_SERVEUR/api
2020
SERVEUR_URL_DOCKER=http://backend:SERVEUR_PORT_DOCKER/graphql || https://URL_DU_SERVEUR/graphql
21-
SERVICE_MESSAGE_URL=http://localhost:3000/service/message
21+
SERVICE_MESSAGE_URL=http://localhost:3000
2222

2323
# variable gateway
2424
GATEWAY_PORT=NUMERO_DE_PORT_DU_GATEWAY
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: check-biome
2+
3+
on: push
4+
5+
jobs:
6+
check-biome:
7+
name: check-biome
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Récupère le code du dépôt
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Node
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 22.20.0
18+
cache: "npm"
19+
20+
- name: Installe les dépendances
21+
run: npm install
22+
23+
- name: Exécute biome
24+
run: npm run husky-lint
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Test le build des services
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
branches-ignore:
7+
- main
8+
9+
jobs:
10+
build-and-push-projects:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
# pouvoir voir tout les builds qui échouent pas juste le premier
14+
fail-fast: false
15+
matrix:
16+
include:
17+
- nom_service: frontend
18+
- nom_service: backend
19+
- nom_service: gateway
20+
- nom_service: message-service
21+
- nom_service: picture-service
22+
steps:
23+
- name: Récupérer le code source
24+
uses: actions/checkout@v4
25+
26+
- name: setup Docker Buildx (pour du cache)
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Build l'image Docker
30+
uses: docker/build-push-action@v4
31+
with:
32+
context: ./${{ matrix.nom_service }}
33+
file: ./${{ matrix.nom_service }}/Dockerfile.staging
34+
push: false
35+
load: false
36+
cache-from: type=gha
37+
cache-to: type=gha,mode=max
38+

.husky/pre-commit

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
npm run husky-lint
2-
3-
# si le paramètre bypass-bin est pas actif
4-
if [ "$bypass_bin" != "1" ]; then
5-
# Bloquer toute modification du dossier bin/
6-
if git diff --cached --name-only | grep -q "^bin/"; then
7-
echo ""
8-
echo "🚫 Vous n'avez pas le droit de modifier le contenu du dossier \"bin/\""
9-
echo "Ce fichier est sensible donc vous devez étre sûr de ce que vous faites."
10-
echo ""
11-
exit 1
12-
fi
1+
npm run husky-lint
2+
3+
# si le paramètre bypass-bin est pas actif
4+
# bypass_bin=1 git commit
5+
if [ "$bypass_bin" != "1" ]; then
6+
# Bloquer toute modification du dossier bin/
7+
if git diff --cached --name-only | grep -q "^bin/"; then
8+
echo ""
9+
echo "🚫 Vous n'avez pas le droit de modifier le contenu du dossier \"bin/\""
10+
echo "Ce fichier est sensible donc vous devez étre sûr de ce que vous faites."
11+
echo ""
12+
exit 1
13+
fi
1314
fi

backend/src/entities/Group.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class Group extends BaseEntity {
4545
@Field()
4646
event_type: string;
4747

48-
@Column()
48+
@Column({ default: 0 })
4949
@Field()
5050
piggy_bank: number;
5151

backend/src/entities/GroupMember.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,27 @@ export class GroupMember extends BaseEntity {
3939
@Field()
4040
isGroupAdmin: boolean;
4141

42-
@Column({ nullable: true })
43-
@Field({ nullable: true })
44-
firstName?: string;
45-
46-
@Column({ nullable: true })
47-
@Field({ nullable: true })
48-
lastName?: string;
49-
50-
@Column({ nullable: true })
51-
@Field({ nullable: true })
52-
email?: string;
42+
@Column({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" })
43+
@Field()
44+
lastTempstampVu: Date;
5345

46+
@Field(() => User)
5447
@ManyToOne(
5548
() => User,
5649
(user) => user.groupMember,
50+
{
51+
onDelete: "CASCADE",
52+
},
5753
)
5854
@JoinColumn({ name: "userId" })
5955
user: User;
6056

6157
@ManyToOne(
6258
() => Group,
6359
(group) => group.groupMember,
60+
{
61+
onDelete: "CASCADE",
62+
},
6463
)
6564
@JoinColumn({ name: "groupId" })
6665
group: Group;

backend/src/entities/Message.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ export class Message extends BaseEntity {
5151
@ManyToOne(
5252
() => Group,
5353
(group) => group.messages,
54+
{
55+
onDelete: "CASCADE",
56+
},
5457
)
5558
@Field(() => Group)
5659
group: Group;

0 commit comments

Comments
 (0)