-
Notifications
You must be signed in to change notification settings - Fork 2
/
ocpi.chargingprofiles.v221.ts
64 lines (50 loc) · 1.43 KB
/
ocpi.chargingprofiles.v221.ts
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { z } from "zod";
const ChargingProfileResponseType = z.enum([
"ACCEPTED",
"NOT_SUPPORTED",
"REJECTED",
"TOO_OFTEN",
"UNKNOWN_SESSION"
]);
const ChargingRateUnit = z.enum([
"W",
"A"
]);
const ChargingProfilePeriod = z.object({
start_period: z.number().int().nonnegative(),
limit: z.number().multipleOf(0.1).nonnegative(),
});
export const ChargingProfile = z.object({
start_date_time: z.date().nullish(),
duration: z.number().int().nonnegative().nullish(),
charging_rate_unit: ChargingRateUnit,
min_charging_rate: z.number().multipleOf(0.1).nonnegative().nullish(),
charging_profile_period: z.array(ChargingProfilePeriod).nullish()
});
const ChargingProfileResultType = z.enum([
"ACCEPTED",
"REJECTED",
"UNKNOWN"
]);
export const ActiveChargingProfile = z.object({
start_date_time: z.date(),
charging_profile: ChargingProfile
});
export const SetChargingProfile = z.object({
charging_profile: ChargingProfile,
response_url: z.string().url(),
});
export const ChargingProfileResponse = z.object({
result: ChargingProfileResponseType,
timeout: z.number().int().nonnegative(),
});
export const ActiveChargingProfileResult = z.object({
result: ChargingProfileResultType,
profile: ActiveChargingProfile.nullish(),
});
export const ChargingProfileResult = z.object({
result: ChargingProfileResultType,
});
export const ClearProfileResult = z.object({
result: ChargingProfileResultType,
});