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

Feature/cb2 10594 - add upsert functionality for (tech-record's) ADR-Details attributes #79

Open
wants to merge 47 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5c0c30e
rectifying data type mismatches, add un-defined Enums and attributes,…
Jan 26, 2024
96b894e
add AdrCertificateDetails interface and parsing function
Jan 26, 2024
722ebfd
adding guidanceNotes Enum
Jan 26, 2024
f373b0a
adding m145 attribute as per documentation change
Jan 29, 2024
e8eb827
feat: adr details added, test resource for technoical record added, u…
Feb 1, 2024
a5488b4
style: rearrange enums
Feb 2, 2024
e456415
fix: replace ! with ? for optional attributes
Feb 2, 2024
c9025ce
fix: memosApplyEnum value updated
Feb 2, 2024
43ed027
fix: 2 new attributes added to adrDetails, as per documentation
Feb 2, 2024
d15b265
feat: tab le definition
Feb 2, 2024
d3404d9
fix: enum updated
Feb 2, 2024
dcfac2a
feat: adr tables added to the tech record list of tables
Feb 8, 2024
6feb0fc
feat: new function added for partial upsert based on condition attribute
Feb 8, 2024
2a0a721
feat: some adr table detail updated
Feb 8, 2024
59ba45a
feat: upsert fun ctionality added for adr-details attributes in tech …
Feb 8, 2024
c31cf13
feat: adr parts added to tech record integration test
Feb 8, 2024
01fdc81
feat: docker's mysql image updated to version 8 - consistent with rec…
Feb 8, 2024
957c9b4
feat: adr attribute values updated
Feb 8, 2024
f0e39d5
feat: test updated as adr attribute values updated in json file
Feb 8, 2024
01f08d9
fix: changes reverted back to original
Feb 8, 2024
37f2490
fix: changes reverted back to original
meys-bjss Feb 8, 2024
deff3e3
fix: changes reverted back to original
meys-bjss Feb 8, 2024
847fd26
feat: cleaning and bringing in adr pass certificate
Feb 9, 2024
e00b564
feat: cleaning and bringing in adr pass certificate
Feb 9, 2024
7803cc3
feat: cleaning and bringing in adr pass certificate
Feb 9, 2024
11d4cb3
fix: removed async keyword to avoid error when running the test
Feb 9, 2024
a4efb62
fix: bringing in to be able to run integration tests on my mac and be…
Feb 9, 2024
c604751
fix: bringing in to be able to run integration tests on my mac and be…
Feb 9, 2024
cdf0c3f
Merge branch 'feature/CB2-10594' of https://github.com/dvsa/cvs-tsk-u…
Feb 9, 2024
d433a3c
fix: bringing in to be able to run integration tests on my mac and be…
Feb 9, 2024
7c9f140
fix: updating adr pass certificate function
Feb 12, 2024
cbf62ab
fix: updating adr pass certificate field name
Feb 12, 2024
9a1ca1c
fix: updating adr pass certificate var name
Feb 12, 2024
0514dc3
feat: adding integration tests for additional test scenarios
Feb 12, 2024
f833b02
feat: adding adr pass certificate attribute
Feb 12, 2024
64f8c63
feat: adding adr pass certificate attribute test to unit test
Feb 12, 2024
fb74bdc
fix: syntax fixed
Feb 12, 2024
577351f
Feature/cb2 10594 (#80)
DanielFry-bjss Feb 12, 2024
7e85d06
fix: updating for tank statement attributes, add conditions for missi…
Feb 13, 2024
0c6845c
fix: updating for tank statement attributes
Feb 13, 2024
485fa8f
fix: updating for tank statement attributes
Feb 13, 2024
cd24248
fix: updating for tank statement attributes
Feb 13, 2024
f4bbfbd
fix: updating for tank statement attributes
Feb 13, 2024
17ef513
Merge branch 'feature/CB2-10564' into feature/CB2-10594
meys-bjss Feb 13, 2024
914302e
Feature/cb2 10594 (#81)
DanielFry-bjss Feb 13, 2024
99cb11b
fix: updating parse adr details function for missing optional attributes
Feb 15, 2024
dd204ee
Merge branch 'feature/CB2-10564' into feature/CB2-10594
DanielFry-bjss Feb 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ For the full field-to-column mapping, see `tech-record-document-conversion.ts`.
* `microfilm`
* `plate`
* `axle`
* `adr_details`
* `adr_memos_apply`
* `adr_permitted_dangerous_goods`
* `adr_productListUnNo`
* `adr_additional_examiner_notes`
* `adr_additional_notes_number`


## Test Result conversion
For the full field-to-column mapping, see `test-result-record-conversion.ts`.
Expand Down
45 changes: 45 additions & 0 deletions src/models/adr-certificate-details.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { DynamoDbImage } from "../services/dynamodb-images";
import { Maybe } from "./optionals";

// define Enums
export type AdrPassCertificateTypeEnum = "PASS" | "REPLACEMENT";

export type AdrPassCertificateDetails = AdrPassCertificateDetailsItems[];

export interface AdrPassCertificateDetailsItems {
createdByName?: string;
certificateType?: AdrPassCertificateTypeEnum;
generatedTimestamp?: string;
certificateId?: string;
}

export const parseAdrCertificateDetails = (
adrPassCertificateDetailsImage?: DynamoDbImage
): Maybe<AdrPassCertificateDetails> => {
if (!adrPassCertificateDetailsImage) {
return undefined;
}

const adrPassCertificateDetails: AdrPassCertificateDetails = [];

for (const key of adrPassCertificateDetailsImage.getKeys()) {
const adrPassCertificateDetailsItemImage = adrPassCertificateDetailsImage.getMap(
key
)!;
adrPassCertificateDetails.push({
createdByName: adrPassCertificateDetailsItemImage.getString(
"createdByName"
),
certificateType: adrPassCertificateDetailsItemImage.getString(
"certificateType"
) as AdrPassCertificateTypeEnum,
generatedTimestamp: adrPassCertificateDetailsItemImage.getDate(
"generatedTimestamp"
),
certificateId: adrPassCertificateDetailsItemImage.getString(
"certificateId"
),
});
}
return adrPassCertificateDetails;
};
Loading
Loading