Files
FrozenFriendsYume/packages/backend/built/services/chart/charts/test-grouped.js
T
2026-07-26 18:25:37 +09:00

27 lines
629 B
JavaScript

import Chart from "../core.js";
import { name, schema } from "./entities/test-grouped.js";
/**
* For testing
*/ export default class TestGroupedChart extends Chart {
total = {};
constructor(){
super(name, schema, true);
}
async tickMajor(group) {
return {
"foo.total": this.total[group]
};
}
async tickMinor() {
return {};
}
async increment(group) {
if (this.total[group] == null) this.total[group] = 0;
this.total[group]++;
await this.commit({
"foo.total": 1,
"foo.inc": 1
}, group);
}
}