Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(entity-archival): add package for entity level archival #2137

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

yeshamavani
Copy link
Contributor

gh-1778

Description

Added a new package for entity level archival

  • Provides a repository mixin to export data to external system and delete the data
  • A service function that asynchronously imports the data from external system and provides the json data
  • A default implementation for S3 as external system to archive data.

Fixes #1778

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Intermediate change (work in progress)

Checklist:

  • Performed a self-review of my own code
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Any dependent changes have been merged and published in downstream modules

@yeshamavani yeshamavani requested a review from a team as a code owner July 26, 2024 10:57
Copy link

sonarcloud bot commented Jul 26, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
0.3% Duplication on New Code

See analysis details on SonarCloud

private options: ArchivalComponentOptions = DEFAULT_ARCHIVAL_OPTIONS,
) {
this.providers = {};
this.application.component(CoreComponent);
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we have this dependency ?


## Overview

`@sourceloop/entity-archival` package is a powerful LoopBack 4 extension designed to seamlessly
Copy link
Contributor

Choose a reason for hiding this comment

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

after reading this, I feel this should be part of soft delete package

name: 'filter_inquired',
type: 'object',
})
filterInquired: Object;
Copy link
Contributor

Choose a reason for hiding this comment

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

just keep name as filter

strict: false,
},
})
export class JobDetails extends CoreEntity<JobDetails> {
Copy link
Contributor

Choose a reason for hiding this comment

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

retrieval_jobs

import {GetJobDetailsFn, JobResponse, JobStatus} from '../types';

@injectable({scope: BindingScope.TRANSIENT})
export class GetJobDetailsProvider implements Provider<GetJobDetailsFn> {
Copy link
Contributor

Choose a reason for hiding this comment

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

RetrieveArchivedDataProvider

import {ProcessImportedData} from '../types';

@injectable({scope: BindingScope.TRANSIENT})
export class ProcessImportedDataProvider
Copy link
Contributor

Choose a reason for hiding this comment

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

ProcessRetrievedDataProvider

* return the json data to user
*/

async import(jobId: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Entire flow for retrieval should be in this service file

data.push(...fileContent);
}

const dsName = 'db';
Copy link
Contributor

Choose a reason for hiding this comment

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

refactor this code. ensure connection is closed gracefully

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.

Entity level Archival
2 participants