Skip to content

Define interfaces for Account and Backup#728

Open
ramasat wants to merge 8 commits intodevelopfrom
topic/CPESP-9044
Open

Define interfaces for Account and Backup#728
ramasat wants to merge 8 commits intodevelopfrom
topic/CPESP-9044

Conversation

@ramasat
Copy link
Contributor

@ramasat ramasat commented Feb 9, 2026

Reason for change: Defining Interface for new Plugins.
Test Procedure: Compile the interface repo and make sure document is getting generated.
Risks: Low
version: Major
Signed-off-by: Ramasamy Thalavay Pillai Ramasamy_ThalavayPillai@comcast.com

@ramasat ramasat requested a review from a team as a code owner February 9, 2026 15:43
Copilot AI review requested due to automatic review settings February 9, 2026 15:43
@github-actions
Copy link

github-actions bot commented Feb 9, 2026

Documentation Auto-Generated

Documentation has been automatically generated for the changed plugins and committed to this PR branch.

The generated documentation files have been added to the PR for review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new Thunder Exchange interfaces for Account and Backup plugins and publishes generated API reference docs for them.

Changes:

  • Introduced IAccount interface and generated docs/apis/Account.md.
  • Introduced IBackupManager / IBackupProvider interfaces and generated docs/apis/Backup.md.
  • Linked the new API docs into docs/_sidebar.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
docs/apis/Backup.md Adds generated JSON-RPC documentation for Backup plugin methods.
docs/apis/Account.md Adds generated JSON-RPC documentation for Account plugin methods.
docs/_sidebar.md Adds navigation links for the new Account and Backup API docs.
apis/Backup/IBackup.h Defines the Exchange interfaces for system backup/restore plus per-plugin backup/restore provider.
apis/Account/IAccount.h Defines the Exchange interface for account-level operations.

Comment on lines 73 to 76
// @param scenario: Scenario for which the backup to happen
virtual Core::hresult Restore(const Scenario scenario) const = 0;

};
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two issues in this block: (1) Restore's @param scenario description says 'backup' but should say 'restore'. (2) There's trailing whitespace after }; on line 76. Update the comment text and remove the trailing space to keep generated docs and formatting clean.

Suggested change
// @param scenario: Scenario for which the backup to happen
virtual Core::hresult Restore(const Scenario scenario) const = 0;
};
// @param scenario: Scenario for which the restore to happen
virtual Core::hresult Restore(const Scenario scenario) const = 0;
};

Copilot uses AI. Check for mistakes.
| Name | Type | Description |
| :-------- | :-------- | :-------- |
| params | object | |
| params.scenario | string | Scenario for which the backup to happen |
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both restore and restoreSettings parameter descriptions incorrectly say 'backup'. These should describe the restore operation (e.g., 'Scenario for which the restore is to happen') to avoid confusion and mismatched generated docs.

Copilot uses AI. Check for mistakes.
| Name | Type | Description |
| :-------- | :-------- | :-------- |
| params | object | |
| params.scenario | string | Scenario for which the backup to happen |
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both restore and restoreSettings parameter descriptions incorrectly say 'backup'. These should describe the restore operation (e.g., 'Scenario for which the restore is to happen') to avoid confusion and mismatched generated docs.

Suggested change
| params.scenario | string | Scenario for which the backup to happen |
| params.scenario | string | Scenario for which the restore is to happen |

Copilot uses AI. Check for mistakes.
| Name | Type | Description |
| :-------- | :-------- | :-------- |
| result | object | |
| result.resetTime | integer | Time in UTC. Returns 0, if time is not available. |
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IAccount uses uint64_t for resetTime, but the generated docs describe it only as integer (often interpreted as 32-bit). Update the documentation/type mapping to explicitly indicate a 64-bit integer (or document the unit/range) so API consumers don't truncate large epoch values.

Suggested change
| result.resetTime | integer | Time in UTC. Returns 0, if time is not available. |
| result.resetTime | integer (64-bit) | 64-bit unsigned integer representing epoch time in UTC (may exceed 32-bit range). Returns 0, if time is not available. |

Copilot uses AI. Check for mistakes.
| Name | Type | Description |
| :-------- | :-------- | :-------- |
| params | object | |
| params.resetTime | integer | Time in UTC. Returns 0, if time is not available. |
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IAccount uses uint64_t for resetTime, but the generated docs describe it only as integer (often interpreted as 32-bit). Update the documentation/type mapping to explicitly indicate a 64-bit integer (or document the unit/range) so API consumers don't truncate large epoch values.

Suggested change
| params.resetTime | integer | Time in UTC. Returns 0, if time is not available. |
| params.resetTime | integer (int64) | Time in UTC as a 64-bit Unix epoch value (seconds since 1970-01-01T00:00:00Z). Returns 0 if time is not available. |

Copilot uses AI. Check for mistakes.
// @text getLastCheckoutResetTime
// @brief Gets the last reset time for Hotel Checkout.
// @param resetTime: Time in UTC. Returns 0, if time is not available.
virtual Core::hresult GetLastCheckoutResetTime(uint64_t& resetTime /* @out */) = 0;
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetLastCheckoutResetTime appears to be a read-only accessor but is not marked const, unlike SetLastCheckoutResetTime. Consider making it const for const-correctness and to make the interface easier to implement with immutable state.

Suggested change
virtual Core::hresult GetLastCheckoutResetTime(uint64_t& resetTime /* @out */) = 0;
virtual Core::hresult GetLastCheckoutResetTime(uint64_t& resetTime /* @out */) const = 0;

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings February 9, 2026 16:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

anand-ky
anand-ky previously approved these changes Feb 9, 2026
Copy link
Contributor

@anand-ky anand-ky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test review for checking if "Require conversation resolution before merging" works

@github-actions
Copy link

Documentation Auto-Generated

Documentation has been automatically generated for the changed plugins and committed to this PR branch.

The generated documentation files have been added to the PR for review.

Copilot AI review requested due to automatic review settings February 12, 2026 10:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

@github-actions
Copy link

Documentation Auto-Generated

Documentation has been automatically generated for the changed plugins and committed to this PR branch.

The generated documentation files have been added to the PR for review.

Copilot AI review requested due to automatic review settings February 12, 2026 13:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

virtual ~IBackupManager() = default;

enum Scenario : uint8_t {
HOSPITALITY_RESET /* @text HOSPITALITY_RESET */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would just call it HOSPITALITY and strip the RESET


virtual ~IBackupManager() = default;

enum Scenario : uint8_t {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Context a better name ?
Would also add a GENERIC entry as the first entry in the enum. Allowing for usage that does not require a context.

// @brief Backup settings across the system
// @param scenario: Scenario for which the backup to happen
// @retval Core::ERROR_NONE Successfully backed up the settings
virtual Core::hresult BackupSettings(const Scenario scenario) = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a string to allow naming the backup. Enabling several backups of the same type.
E.g. A backup for english or french speeking hotel guests


virtual ~IBackupProvider() = default;

enum Scenario : uint8_t {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed here, as we maintain in BackupManager

// @brief Backup settings that belong to this component.
// @param scenario: Scenario for which the backup to happen
// @retval Core::ERROR_NONE Successfully backed up
virtual Core::hresult Backup(const Scenario scenario) = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a name string as suggested on the manager.
on both Backup and Restore

// @brief Backup settings across the system
// @param scenario: Scenario for which the backup to happen
// @retval Core::ERROR_NONE Successfully backed up the settings
virtual Core::hresult BackupSettings(const Scenario scenario) = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would Backup and Restore be better names also on the Manager

// @param scenario: Scenario for which the backup to happen
// @retval Core::ERROR_NONE Successfully backed up the settings
virtual Core::hresult BackupSettings(const Scenario scenario) = 0;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the intro of a name on the backups.
It would be good to have an iterator to list available backups.

enum { ID = ID_BACKUP_MANAGER };

virtual ~IBackupManager() = default;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think we need a delete method. to remove a named backup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants