Skip to content

Commit 534bdd3

Browse files
authored
Merge branch 'dev' into #156-move-rooms-to-the-past-room-list-and-change-settlestatus-automatically-when-the-participant-is-one
2 parents e0c6415 + e541fc0 commit 534bdd3

Some content is hidden

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

60 files changed

+1885
-910
lines changed

.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ CORS_WHITELIST=[CORS 정책에서 허용하는 도메인의 목록(e.g. ["http:/
1616
GOOGLE_APPLICATION_CREDENTIALS=[GOOGLE_APPLICATION_CREDENTIALS JSON]
1717
TEST_ACCOUNTS=[스팍스SSO로 로그인시 무조건 테스트로 로그인이 가능한 허용 아이디 목록]
1818
SLACK_REPORT_WEBHOOK_URL=[Slack 웹훅 URL들이 담긴 JSON]
19+
NAVER_MAP_API_ID=[네이버 지도 API ID]
20+
NAVER_MAP_API_KEY=[네이버 지도 API KEY]
1921

2022
# optional environment variables for taxiSampleGenerator
2123
SAMPLE_NUM_OF_ROOMS=[방의 개수]

app.js

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ app.use("/chats", require("./src/routes/chats"));
6969
app.use("/locations", require("./src/routes/locations"));
7070
app.use("/reports", require("./src/routes/reports"));
7171
app.use("/notifications", require("./src/routes/notifications"));
72+
app.use("/fare", require("./src/routes/fare"));
7273

7374
// [Middleware] 전역 에러 핸들러. 에러 핸들러는 router들보다 아래에 등록되어야 합니다.
7475
app.use(require("./src/middlewares/errorHandler"));
@@ -85,3 +86,6 @@ app.set("io", startSocketServer(serverHttp));
8586

8687
// [Schedule] 스케줄러 시작
8788
require("./src/schedules")(app);
89+
90+
// [Module] 택시 예상 비용 db 초기화
91+
require("./src/modules/fare").initializeDatabase();

loadenv.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,20 @@ module.exports = {
4343
slackWebhookUrl: {
4444
report: process.env.SLACK_REPORT_WEBHOOK_URL || "", // optional
4545
},
46-
eventConfig: process.env.EVENT_CONFIG && JSON.parse(process.env.EVENT_CONFIG), // optional
46+
eventConfig: (process.env.EVENT_CONFIG &&
47+
JSON.parse(process.env.EVENT_CONFIG)) || {
48+
mode: "2024fall",
49+
credit: {
50+
name: "송편코인",
51+
initialAmount: 0,
52+
},
53+
period: {
54+
startAt: new Date("2024-09-07T00:00:00+09:00"),
55+
endAt: new Date("2024-09-24T00:00:00+09:00"),
56+
},
57+
}, // optional
58+
naverMap: {
59+
apiId: process.env.NAVER_MAP_API_ID, // optional
60+
apiKey: process.env.NAVER_MAP_API_KEY, //optional
61+
},
4762
};

pnpm-lock.yaml

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Issue #449-1을 해결하기 위한 DB 마이그레이션 스크립트입니다.
2+
// chat type 중 settlement와 payment를 서로 교체합니다.
3+
// https://github.com/sparcs-kaist/taxi-back/issues/449
4+
5+
const { MongoClient } = require("mongodb");
6+
const { mongo: mongoUrl } = require("../loadenv");
7+
8+
const client = new MongoClient(mongoUrl);
9+
const db = client.db("taxi");
10+
const chats = db.collection("chats");
11+
12+
async function run() {
13+
try {
14+
for await (const doc of chats.find()) {
15+
if (doc.type === "settlement" || doc.type === "payment") {
16+
await chats.findOneAndUpdate(
17+
{ _id: doc._id },
18+
{
19+
$set: {
20+
type: doc.type === "settlement" ? "payment" : "settlement",
21+
},
22+
}
23+
);
24+
}
25+
}
26+
} catch (err) {
27+
console.log(err);
28+
} finally {
29+
await client.close();
30+
}
31+
}
32+
run().then(() => {
33+
console.log("Done!");
34+
});

src/lottery/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ lotteryRouter.use(require("../middlewares/originValidator"));
2828

2929
// [Router] APIs
3030
lotteryRouter.use("/globalState", require("./routes/globalState"));
31-
lotteryRouter.use("/invite", require("./routes/invite"));
31+
lotteryRouter.use("/invites", require("./routes/invites"));
3232
lotteryRouter.use("/transactions", require("./routes/transactions"));
3333
lotteryRouter.use("/items", require("./routes/items"));
34-
lotteryRouter.use("/publicNotice", require("./routes/publicNotice"));
34+
// lotteryRouter.use("/publicNotice", require("./routes/publicNotice"));
3535
lotteryRouter.use("/quests", require("./routes/quests"));
3636

3737
// [AdminJS] AdminJS에 표시할 Resource 생성

0 commit comments

Comments
 (0)