diff --git a/bun.lockb b/bun.lockb index 9c1a4534..82b14330 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 3177fc1d..c027bfbf 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { "name": "cafeore-2024", - "private": true, - "type": "module", - "workspaces": ["pos", "mobile", "common"], - "scripts": { - "sync": "bun install --frozen-lockfile" - }, "devDependencies": { "@biomejs/biome": "1.9.3", "typescript": "^5.6.3" }, - "trustedDependencies": ["@biomejs/biome", "workerd"] + "private": true, + "scripts": { + "sync": "bun install --frozen-lockfile" + }, + "trustedDependencies": ["@biomejs/biome", "workerd"], + "type": "module", + "workspaces": ["pos", "mobile", "common"] } diff --git a/scripts/download-master-state.ts b/scripts/download-master-state.ts new file mode 100644 index 00000000..96f401c2 --- /dev/null +++ b/scripts/download-master-state.ts @@ -0,0 +1,24 @@ +import fs from "node:fs"; +import { masterRepository } from "common/repositories/global"; +import dayjs from "dayjs"; +import timezone from "dayjs/plugin/timezone"; +import utc from "dayjs/plugin/utc"; + +dayjs.extend(utc); +dayjs.extend(timezone); + +const masterStateEntity = await masterRepository.get(); +const orderStats = masterStateEntity?.orderStats ?? []; + +const getJST = (date: Date) => dayjs(date).tz("Asia/Tokyo"); + +const sohosaiData = orderStats.filter(({ createdAt }) => + getJST(createdAt).isAfter(dayjs("2024-11-03 10:00").tz()), +); + +console.log( + getJST(sohosaiData[0].createdAt), + getJST(sohosaiData[sohosaiData.length - 1].createdAt), +); + +fs.writeFileSync("order_stops.json", JSON.stringify(sohosaiData, null, 2)); diff --git a/scripts/download-firestore.ts b/scripts/download-orders.ts similarity index 100% rename from scripts/download-firestore.ts rename to scripts/download-orders.ts