summaryrefslogtreecommitdiff
path: root/src/services/chart/charts/classes/test-unique.ts
blob: 1eb396c2936e22d19d3f1643418c503738a5ebe2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import autobind from 'autobind-decorator';
import Chart, { DeepPartial } from '../../core';
import { SchemaType } from '../../../../misc/schema';
import { name, schema } from '../schemas/test-unique';

type TestUniqueLog = SchemaType<typeof schema>;

export default class TestUniqueChart extends Chart<TestUniqueLog> {
	constructor() {
		super(name, schema);
	}

	@autobind
	protected genNewLog(latest: TestUniqueLog): DeepPartial<TestUniqueLog> {
		return {};
	}

	@autobind
	protected async fetchActual(): Promise<DeepPartial<TestUniqueLog>> {
		return {};
	}

	@autobind
	public async uniqueIncrement(key: string) {
		await this.incIfUnique({
			foo: 1
		}, 'foos', key);
	}
}