-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 91: Implement StatusNotification
Signed-off-by: Zihe Cheng <lydiazcheng@users.noreply.github.com>
- Loading branch information
1 parent
b0b6a51
commit baed9d0
Showing
12 changed files
with
204 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright Contributors to the CitrineOS Project | ||
// | ||
// SPDX-License-Identifier: Apache 2.0 | ||
|
||
import { OCPP1_6_Namespace, OCPP1_6 } from '@citrineos/base'; | ||
import { Column, DataType, Model, Table } from 'sequelize-typescript'; | ||
|
||
@Table | ||
export class Connector extends Model { | ||
static readonly MODEL_NAME: string = OCPP1_6_Namespace.Connector; | ||
|
||
@Column({ | ||
unique: 'stationId_connectorId', | ||
allowNull: false, | ||
type: DataType.STRING, | ||
}) | ||
declare stationId: string; | ||
|
||
@Column({ | ||
unique: 'stationId_connectorId', | ||
allowNull: false, | ||
type: DataType.INTEGER, | ||
}) | ||
declare connectorId: number; | ||
|
||
@Column(DataType.ENUM(...Object.values(OCPP1_6.StatusNotificationRequestStatus))) | ||
declare status: OCPP1_6.StatusNotificationRequestStatus; | ||
|
||
@Column(DataType.ENUM(...Object.values(OCPP1_6.StatusNotificationRequestErrorCode))) | ||
declare errorCode: OCPP1_6.StatusNotificationRequestErrorCode; | ||
|
||
@Column({ | ||
type: DataType.DATE, | ||
get() { | ||
return this.getDataValue('timestamp').toISOString(); | ||
}, | ||
}) | ||
declare timestamp: string; | ||
|
||
@Column(DataType.STRING) | ||
declare info?: string | null; | ||
|
||
@Column(DataType.STRING) | ||
declare vendorId?: string | null; | ||
|
||
@Column(DataType.STRING) | ||
declare vendorErrorCode?: string | null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.