mmday-firebase/firestore.indexes.json
윤정민 cf5f10af64 Add season-end settlement and tierPoints reset
- config/season 문서(id/startDate/endDate)로 시즌 경계 정의 — 문서가 없으면 시즌제 비활성(기존 동작 유지)
- endDate 다음 날 dailyArchive에서 maybeSettleSeason 1회 실행: 랭킹 대상 전원의 최종 성적(tierPoints·티어·동점 동일 rank)을 users/{uid}/seasonHistory/{seasonId}에 아카이브 후 tierPoints 0 리셋·rankSnapshot 제거
- 유저별 아카이브+리셋을 같은 배치로 묶고 settledAt 마커는 전원 완료 후 기록 — 부분 실패 재실행 시 기정산 유저 점수를 collectionGroup으로 되읽어 순위 보존(멱등)
- 스트릭은 시즌과 무관하게 유지(이월 이득은 streakBonus 상한이 제한)
- seasonHistory 본인 읽기 전용 rules와 seasonId collectionGroup 인덱스 추가, 정산 시나리오 테스트 신규 작성
2026-07-23 14:46:22 +09:00

146 lines
3.8 KiB
JSON

{
// Example (Standard Edition):
//
// "indexes": [
// {
// "collectionGroup": "widgets",
// "queryScope": "COLLECTION",
// "fields": [
// { "fieldPath": "foo", "arrayConfig": "CONTAINS" },
// { "fieldPath": "bar", "mode": "DESCENDING" }
// ]
// },
//
// "fieldOverrides": [
// {
// "collectionGroup": "widgets",
// "fieldPath": "baz",
// "indexes": [
// { "order": "ASCENDING", "queryScope": "COLLECTION" }
// ]
// },
// ]
// ]
//
// Example (Enterprise Edition):
//
// "indexes": [
// {
// "collectionGroup": "reviews",
// "queryScope": "COLLECTION_GROUP",
// "apiScope": "MONGODB_COMPATIBLE_API",
// "density": "DENSE",
// "multikey": false,
// "fields": [
// { "fieldPath": "baz", "mode": "ASCENDING" }
// ]
// },
// {
// "collectionGroup": "items",
// "queryScope": "COLLECTION_GROUP",
// "apiScope": "MONGODB_COMPATIBLE_API",
// "density": "SPARSE_ANY",
// "multikey": true,
// "fields": [
// { "fieldPath": "baz", "mode": "ASCENDING" }
// ]
// },
// ]
"indexes": [
{
"collectionGroup": "users",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "favoriteTeamCode", "order": "ASCENDING" },
{ "fieldPath": "tierPoints", "order": "DESCENDING" }
]
},
{
"collectionGroup": "users",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "active", "order": "ASCENDING" },
{ "fieldPath": "tierPoints", "order": "DESCENDING" }
]
},
{
"collectionGroup": "users",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "active", "order": "ASCENDING" },
{ "fieldPath": "tierPoints", "order": "ASCENDING" }
]
},
{
"collectionGroup": "users",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "favoriteTeamCode", "order": "ASCENDING" },
{ "fieldPath": "active", "order": "ASCENDING" },
{ "fieldPath": "tierPoints", "order": "DESCENDING" }
]
},
{
"collectionGroup": "users",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "favoriteTeamCode", "order": "ASCENDING" },
{ "fieldPath": "active", "order": "ASCENDING" },
{ "fieldPath": "tierPoints", "order": "ASCENDING" }
]
},
{
"collectionGroup": "users",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "active", "order": "ASCENDING" },
{ "fieldPath": "deactivatedAt", "order": "ASCENDING" }
]
},
{
"collectionGroup": "users",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "favoriteTeamCode", "order": "ASCENDING" },
{ "fieldPath": "tierPoints", "order": "ASCENDING" },
{ "fieldPath": "__name__", "order": "ASCENDING" }
]
},
{
"collectionGroup": "orders",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "uid", "order": "ASCENDING" },
{ "fieldPath": "createdAt", "order": "DESCENDING" }
]
},
{
"collectionGroup": "orders",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "status", "order": "ASCENDING" },
{ "fieldPath": "createdAt", "order": "DESCENDING" }
]
}
],
"fieldOverrides": [
{
"collectionGroup": "seasonHistory",
"fieldPath": "seasonId",
"indexes": [
{ "order": "ASCENDING", "queryScope": "COLLECTION_GROUP" }
]
},
{
"collectionGroup": "products",
"fieldPath": "mainImages",
"indexes": []
},
{
"collectionGroup": "products",
"fieldPath": "detailImages",
"indexes": []
}
]
}