Skip to content

Commit

Permalink
Merge branch 'master' into feat/update-mapping-types
Browse files Browse the repository at this point in the history
* master:
  Hardcoded connected product uuids
  Change hardcoded ids to uuids

# Conflicts:
#	src/services/mapping/reseller/ExpediaGetMappingService.ts
#	src/services/mapping/reseller/GetYourGuideGetMappingService.ts
#	src/services/mapping/reseller/ViatorGetMappingService.ts
  • Loading branch information
Faboslav committed Jan 17, 2024
2 parents 766200c + 851e44d commit 45d6a9e
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 46 deletions.
80 changes: 42 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/generators/ProductWithAvailabilityModelGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class ProductWithAvailabilityModelGenerator {
productWithAvailabilityModels.push(
this.generateProduct({
productData: {
id: "1",
id: "9cbd7f33-6b53-45c4-a44b-730605f68753",
internalName: "PPU - OH",
availabilityType: AvailabilityType.OPENING_HOURS,
options: [
Expand Down Expand Up @@ -91,7 +91,7 @@ export class ProductWithAvailabilityModelGenerator {
}),
this.generateProduct({
productData: {
id: "2",
id: "b5c0ab15-6575-4ca4-a39d-a8c7995ccbda",
internalName: "PPB - OH",
availabilityType: AvailabilityType.OPENING_HOURS,
options: [
Expand Down Expand Up @@ -123,7 +123,7 @@ export class ProductWithAvailabilityModelGenerator {
}),
this.generateProduct({
productData: {
id: "3",
id: "bb9eb918-fcb5-4947-9fce-86586bbea111",
internalName: "PPU - ST",
availabilityType: AvailabilityType.START_TIME,
options: [
Expand Down Expand Up @@ -166,7 +166,7 @@ export class ProductWithAvailabilityModelGenerator {
}),
this.generateProduct({
productData: {
id: "4",
id: "0a8f2ef2-7469-4ef0-99fa-a67132ab0bce",
internalName: "PPB - ST",
availabilityType: AvailabilityType.START_TIME,
options: [
Expand Down
10 changes: 8 additions & 2 deletions src/services/mapping/reseller/ExpediaGetMappingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ export class ExpediaMappingModel extends MappingModel {
export class ExpediaGetMappingService
implements SpecificResellerGetMappingService<ExpediaMappingModel>
{
private readonly connectedProductUuids = [
"9cbd7f33-6b53-45c4-a44b-730605f68753",
"b5c0ab15-6575-4ca4-a39d-a8c7995ccbda",
"bb9eb918-fcb5-4947-9fce-86586bbea111",
"0a8f2ef2-7469-4ef0-99fa-a67132ab0bce",
];

public async getMapping(productModels: ProductModel[]): Promise<ExpediaMappingModel[]> {
const mappingModels: ExpediaMappingModel[] = [];

Expand All @@ -46,7 +53,6 @@ export class ExpediaGetMappingService
].join("_");

const title = `${productModel.internalName} | ${availabilityLocalStartTime}, ${optionModel.internalName} | ${unitModel.internalName}`;
const random = new Prando(resellerReference);

const mappingModel = new ExpediaMappingModel({
id: DataGenerator.generateUUID(),
Expand All @@ -60,7 +66,7 @@ export class ExpediaGetMappingService
productId: productModel.id,
optionId: optionModel.id,
unitId: unitModel.id,
connected: random.nextBoolean(),
connected: this.connectedProductUuids.includes(productModel.id),
expediaTourTime: availabilityLocalStartTime,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ export class GetYourGuideMappingModel extends MappingModel {
export class GetYourGuideGetMappingService
implements SpecificResellerGetMappingService<GetYourGuideMappingModel>
{
private readonly connectedProductUuids = [
"9cbd7f33-6b53-45c4-a44b-730605f68753",
"b5c0ab15-6575-4ca4-a39d-a8c7995ccbda",
"bb9eb918-fcb5-4947-9fce-86586bbea111",
"0a8f2ef2-7469-4ef0-99fa-a67132ab0bce",
];

public async getMapping(productModels: ProductModel[]): Promise<GetYourGuideMappingModel[]> {
return productModels
.map((productModel) =>
Expand All @@ -50,7 +57,7 @@ export class GetYourGuideGetMappingService
productId: productModel.id,
optionId: optionModel.id,
unitId: unitModel.id,
connected: random.nextBoolean(),
connected: this.connectedProductUuids.includes(productModel.id),
gygPriceOverApi: random.nextBoolean(),
});
}),
Expand Down
9 changes: 8 additions & 1 deletion src/services/mapping/reseller/ViatorGetMappingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ export class ViatorMappingModel extends MappingModel {
export class ViatorGetMappingService
implements SpecificResellerGetMappingService<ViatorMappingModel>
{
private readonly connectedProductUuids = [
"9cbd7f33-6b53-45c4-a44b-730605f68753",
"b5c0ab15-6575-4ca4-a39d-a8c7995ccbda",
"bb9eb918-fcb5-4947-9fce-86586bbea111",
"0a8f2ef2-7469-4ef0-99fa-a67132ab0bce",
];

public async getMapping(productModels: ProductModel[]): Promise<ViatorMappingModel[]> {
return productModels
.map((productModel) =>
Expand All @@ -49,7 +56,7 @@ export class ViatorGetMappingService
productId: productModel.id,
optionId: optionModel.id,
unitId: null,
connected: random.nextBoolean(),
connected: this.connectedProductUuids.includes(productModel.id),
viatorRecurringPriceSync: random.nextBoolean(),
});
}),
Expand Down

0 comments on commit 45d6a9e

Please sign in to comment.