Browse Source

refactor(server): Switch all ids to uuid strings

Michael Bromley 7 years ago
parent
commit
b4e974f2e1
37 changed files with 64 additions and 64 deletions
  1. 1 1
      server/mock-data/mock-data-client.service.ts
  2. 1 1
      server/src/api/administrator/administrator.api.graphql
  3. 2 2
      server/src/api/customer/customer.api.graphql
  4. 1 1
      server/src/api/product-option/product-option.api.graphql
  5. 1 1
      server/src/api/product/product.api.graphql
  6. 1 1
      server/src/common/common-types.graphql
  7. 1 1
      server/src/entity/address/address.entity.ts
  8. 1 1
      server/src/entity/address/address.graphql
  9. 1 1
      server/src/entity/administrator/administrator.entity.ts
  10. 1 1
      server/src/entity/administrator/administrator.graphql
  11. 1 1
      server/src/entity/customer/customer.entity.ts
  12. 1 1
      server/src/entity/customer/customer.graphql
  13. 1 1
      server/src/entity/product-option-group/product-option-group-translation.entity.ts
  14. 1 1
      server/src/entity/product-option-group/product-option-group.dto.ts
  15. 1 1
      server/src/entity/product-option-group/product-option-group.entity.ts
  16. 4 4
      server/src/entity/product-option-group/product-option-group.graphql
  17. 1 1
      server/src/entity/product-option/product-option-translation.entity.ts
  18. 1 1
      server/src/entity/product-option/product-option.entity.ts
  19. 3 3
      server/src/entity/product-option/product-option.graphql
  20. 1 1
      server/src/entity/product-variant/product-variant-translation.entity.ts
  21. 1 1
      server/src/entity/product-variant/product-variant.entity.ts
  22. 2 2
      server/src/entity/product-variant/product-variant.graphql
  23. 1 1
      server/src/entity/product/product-translation.entity.ts
  24. 1 1
      server/src/entity/product/product.dto.ts
  25. 1 1
      server/src/entity/product/product.entity.ts
  26. 4 4
      server/src/entity/product/product.graphql
  27. 1 1
      server/src/entity/user/user.entity.ts
  28. 1 1
      server/src/entity/user/user.graphql
  29. 2 2
      server/src/locale/locale-types.ts
  30. 12 12
      server/src/locale/translate-entity.spec.ts
  31. 4 4
      server/src/locale/translation-updater.spec.ts
  32. 1 1
      server/src/service/administrator.service.ts
  33. 3 3
      server/src/service/customer.service.ts
  34. 1 1
      server/src/service/product-option-group.service.ts
  35. 1 1
      server/src/service/product-option.service.ts
  36. 1 1
      server/src/service/product.service.spec.ts
  37. 1 1
      server/src/service/product.service.ts

+ 1 - 1
server/mock-data/mock-data-client.service.ts

@@ -97,7 +97,7 @@ export class MockDataClientService {
             );
             );
 
 
             if (customer) {
             if (customer) {
-                const query2 = `mutation($customerId: Int!, $input: CreateAddressInput) {
+                const query2 = `mutation($customerId: String!, $input: CreateAddressInput) {
                                 createCustomerAddress(customerId: $customerId, input: $input) {
                                 createCustomerAddress(customerId: $customerId, input: $input) {
                                     id
                                     id
                                     streetLine1
                                     streetLine1

+ 1 - 1
server/src/api/administrator/administrator.api.graphql

@@ -1,6 +1,6 @@
 type Query {
 type Query {
   administrators: [Administrator]
   administrators: [Administrator]
-  administrator(id: Int!): Administrator
+  administrator(id: String!): Administrator
 }
 }
 
 
 type Mutation {
 type Mutation {

+ 2 - 2
server/src/api/customer/customer.api.graphql

@@ -1,13 +1,13 @@
 type Query {
 type Query {
   customers(take: Int, skip: Int): CustomerList
   customers(take: Int, skip: Int): CustomerList
-  customer(id: Int!): Customer
+  customer(id: String!): Customer
 }
 }
 
 
 type Mutation {
 type Mutation {
   "Create a new Customer. If a password is provided, a new User will also be created an linked to the Customer."
   "Create a new Customer. If a password is provided, a new User will also be created an linked to the Customer."
   createCustomer(input: CreateCustomerInput!, password: String): Customer
   createCustomer(input: CreateCustomerInput!, password: String): Customer
   "Create a new Address and associate it with the Customer specified by customerId"
   "Create a new Address and associate it with the Customer specified by customerId"
-  createCustomerAddress(customerId: Int, input: CreateAddressInput): Address
+  createCustomerAddress(customerId: String, input: CreateAddressInput): Address
 }
 }
 
 
 type CustomerList implements PaginatedList {
 type CustomerList implements PaginatedList {

+ 1 - 1
server/src/api/product-option/product-option.api.graphql

@@ -1,6 +1,6 @@
 type Query {
 type Query {
     productOptionGroups(languageCode: LanguageCode): [ProductOptionGroup]
     productOptionGroups(languageCode: LanguageCode): [ProductOptionGroup]
-    productOptionGroup(id: Int!, languageCode: LanguageCode): ProductOptionGroup
+    productOptionGroup(id: String!, languageCode: LanguageCode): ProductOptionGroup
 }
 }
 
 
 type Mutation {
 type Mutation {

+ 1 - 1
server/src/api/product/product.api.graphql

@@ -1,6 +1,6 @@
 type Query {
 type Query {
     products(languageCode: LanguageCode, take: Int, skip: Int): ProductList
     products(languageCode: LanguageCode, take: Int, skip: Int): ProductList
-    product(id: Int!, languageCode: LanguageCode): Product
+    product(id: String!, languageCode: LanguageCode): Product
 }
 }
 
 
 type Mutation {
 type Mutation {

+ 1 - 1
server/src/common/common-types.graphql

@@ -4,5 +4,5 @@ interface PaginatedList {
 }
 }
 
 
 interface Node {
 interface Node {
-    id: Int!
+    id: String!
 }
 }

+ 1 - 1
server/src/entity/address/address.entity.ts

@@ -10,7 +10,7 @@ export class Address {
         }
         }
     }
     }
 
 
-    @PrimaryGeneratedColumn() id: number;
+    @PrimaryGeneratedColumn('uuid') id: string;
 
 
     @ManyToOne(type => Customer, customer => customer.addresses)
     @ManyToOne(type => Customer, customer => customer.addresses)
     customer: Customer;
     customer: Customer;

+ 1 - 1
server/src/entity/address/address.graphql

@@ -1,5 +1,5 @@
 type Address implements Node {
 type Address implements Node {
-  id: Int!
+  id: String!
   fullName: String
   fullName: String
   company: String
   company: String
   streetLine1: String
   streetLine1: String

+ 1 - 1
server/src/entity/administrator/administrator.entity.ts

@@ -18,7 +18,7 @@ export class Administrator {
         }
         }
     }
     }
 
 
-    @PrimaryGeneratedColumn() id: number;
+    @PrimaryGeneratedColumn('uuid') id: string;
 
 
     @Column() firstName: string;
     @Column() firstName: string;
 
 

+ 1 - 1
server/src/entity/administrator/administrator.graphql

@@ -1,5 +1,5 @@
 type Administrator implements Node {
 type Administrator implements Node {
-    id: Int!
+    id: String!
     firstName: String
     firstName: String
     lastName: String
     lastName: String
     emailAddress: String
     emailAddress: String

+ 1 - 1
server/src/entity/customer/customer.entity.ts

@@ -20,7 +20,7 @@ export class Customer {
         }
         }
     }
     }
 
 
-    @PrimaryGeneratedColumn() id: number;
+    @PrimaryGeneratedColumn('uuid') id: string;
 
 
     @Column() firstName: string;
     @Column() firstName: string;
 
 

+ 1 - 1
server/src/entity/customer/customer.graphql

@@ -1,5 +1,5 @@
 type Customer implements Node {
 type Customer implements Node {
-  id: Int!
+  id: String!
   firstName: String
   firstName: String
   lastName: String
   lastName: String
   phoneNumber: String
   phoneNumber: String

+ 1 - 1
server/src/entity/product-option-group/product-option-group-translation.entity.ts

@@ -12,7 +12,7 @@ export class ProductOptionGroupTranslation implements Translation<ProductOptionG
         }
         }
     }
     }
 
 
-    @PrimaryGeneratedColumn() id: number;
+    @PrimaryGeneratedColumn('uuid') id: string;
 
 
     @Column() languageCode: LanguageCode;
     @Column() languageCode: LanguageCode;
 
 

+ 1 - 1
server/src/entity/product-option-group/product-option-group.dto.ts

@@ -8,6 +8,6 @@ export interface CreateProductOptionGroupDto extends TranslatedInput<ProductOpti
 }
 }
 
 
 export interface UpdateProductOptionGroupDto extends TranslatedInput<ProductOptionGroup> {
 export interface UpdateProductOptionGroupDto extends TranslatedInput<ProductOptionGroup> {
-    id: number;
+    id: string;
     code: string;
     code: string;
 }
 }

+ 1 - 1
server/src/entity/product-option-group/product-option-group.entity.ts

@@ -12,7 +12,7 @@ export class ProductOptionGroup implements Translatable {
         }
         }
     }
     }
 
 
-    @PrimaryGeneratedColumn() id: number;
+    @PrimaryGeneratedColumn('uuid') id: string;
 
 
     name: LocaleString;
     name: LocaleString;
 
 

+ 4 - 4
server/src/entity/product-option-group/product-option-group.graphql

@@ -1,5 +1,5 @@
 type ProductOptionGroup implements Node {
 type ProductOptionGroup implements Node {
-    id: Int!
+    id: String!
     languageCode: LanguageCode
     languageCode: LanguageCode
     code: String
     code: String
     name: String
     name: String
@@ -8,13 +8,13 @@ type ProductOptionGroup implements Node {
 }
 }
 
 
 type ProductOptionGroupTranslation {
 type ProductOptionGroupTranslation {
-    id: Int!
+    id: String!
     languageCode: LanguageCode!
     languageCode: LanguageCode!
     name: String!
     name: String!
 }
 }
 
 
 input ProductOptionGroupTranslationInput {
 input ProductOptionGroupTranslationInput {
-    id: Int
+    id: String
     languageCode: LanguageCode!
     languageCode: LanguageCode!
     name: String!
     name: String!
 }
 }
@@ -26,7 +26,7 @@ input CreateProductOptionGroupInput {
 }
 }
 
 
 input UpdateProductOptionGroupInput {
 input UpdateProductOptionGroupInput {
-    id: Int!
+    id: String!
     code: String!
     code: String!
     translations: [ProductOptionGroupTranslationInput]!
     translations: [ProductOptionGroupTranslationInput]!
 }
 }

+ 1 - 1
server/src/entity/product-option/product-option-translation.entity.ts

@@ -12,7 +12,7 @@ export class ProductOptionTranslation implements Translation<ProductOption> {
         }
         }
     }
     }
 
 
-    @PrimaryGeneratedColumn() id: number;
+    @PrimaryGeneratedColumn('uuid') id: string;
 
 
     @Column() languageCode: LanguageCode;
     @Column() languageCode: LanguageCode;
 
 

+ 1 - 1
server/src/entity/product-option/product-option.entity.ts

@@ -20,7 +20,7 @@ export class ProductOption implements Translatable {
         }
         }
     }
     }
 
 
-    @PrimaryGeneratedColumn() id: number;
+    @PrimaryGeneratedColumn('uuid') id: string;
 
 
     name: LocaleString;
     name: LocaleString;
 
 

+ 3 - 3
server/src/entity/product-option/product-option.graphql

@@ -1,5 +1,5 @@
 type ProductOption implements Node {
 type ProductOption implements Node {
-    id: Int!
+    id: String!
     languageCode: LanguageCode
     languageCode: LanguageCode
     code: String
     code: String
     name: String
     name: String
@@ -7,13 +7,13 @@ type ProductOption implements Node {
 }
 }
 
 
 type ProductOptionTranslation {
 type ProductOptionTranslation {
-    id: Int!
+    id: String!
     languageCode: LanguageCode!
     languageCode: LanguageCode!
     name: String!
     name: String!
 }
 }
 
 
 input ProductOptionTranslationInput {
 input ProductOptionTranslationInput {
-    id: Int
+    id: String
     languageCode: LanguageCode!
     languageCode: LanguageCode!
     name: String!
     name: String!
 }
 }

+ 1 - 1
server/src/entity/product-variant/product-variant-translation.entity.ts

@@ -12,7 +12,7 @@ export class ProductVariantTranslation implements Translation<ProductVariant> {
         }
         }
     }
     }
 
 
-    @PrimaryGeneratedColumn() id: number;
+    @PrimaryGeneratedColumn('uuid') id: string;
 
 
     @Column() languageCode: LanguageCode;
     @Column() languageCode: LanguageCode;
 
 

+ 1 - 1
server/src/entity/product-variant/product-variant.entity.ts

@@ -23,7 +23,7 @@ export class ProductVariant implements Translatable {
         }
         }
     }
     }
 
 
-    @PrimaryGeneratedColumn() id: number;
+    @PrimaryGeneratedColumn('uuid') id: string;
 
 
     name: LocaleString;
     name: LocaleString;
 
 

+ 2 - 2
server/src/entity/product-variant/product-variant.graphql

@@ -1,5 +1,5 @@
 type ProductVariant implements Node {
 type ProductVariant implements Node {
-    id: Int!
+    id: String!
     sku: String
     sku: String
     name: String
     name: String
     image: String
     image: String
@@ -9,7 +9,7 @@ type ProductVariant implements Node {
 }
 }
 
 
 type ProductVariantTranslation {
 type ProductVariantTranslation {
-    id: Int!
+    id: String!
     languageCode: LanguageCode!
     languageCode: LanguageCode!
     name: String!
     name: String!
 }
 }

+ 1 - 1
server/src/entity/product/product-translation.entity.ts

@@ -12,7 +12,7 @@ export class ProductTranslation implements Translation<Product> {
         }
         }
     }
     }
 
 
-    @PrimaryGeneratedColumn() id: number;
+    @PrimaryGeneratedColumn('uuid') id: string;
 
 
     @Column() languageCode: LanguageCode;
     @Column() languageCode: LanguageCode;
 
 

+ 1 - 1
server/src/entity/product/product.dto.ts

@@ -9,7 +9,7 @@ export interface CreateProductDto extends TranslatedInput<Product> {
 }
 }
 
 
 export interface UpdateProductDto extends TranslatedInput<Product> {
 export interface UpdateProductDto extends TranslatedInput<Product> {
-    id: number;
+    id: string;
     image?: string;
     image?: string;
     optionGroupCodes?: [string];
     optionGroupCodes?: [string];
 }
 }

+ 1 - 1
server/src/entity/product/product.entity.ts

@@ -22,7 +22,7 @@ export class Product implements Translatable {
         }
         }
     }
     }
 
 
-    @PrimaryGeneratedColumn() id: number;
+    @PrimaryGeneratedColumn('uuid') id: string;
 
 
     name: LocaleString;
     name: LocaleString;
 
 

+ 4 - 4
server/src/entity/product/product.graphql

@@ -1,5 +1,5 @@
 type Product implements Node {
 type Product implements Node {
-    id: Int!
+    id: String!
     languageCode: LanguageCode
     languageCode: LanguageCode
     name: String
     name: String
     slug: String
     slug: String
@@ -11,7 +11,7 @@ type Product implements Node {
 }
 }
 
 
 type ProductTranslation {
 type ProductTranslation {
-    id: Int!
+    id: String!
     languageCode: LanguageCode!
     languageCode: LanguageCode!
     name: String!
     name: String!
     slug: String!
     slug: String!
@@ -19,7 +19,7 @@ type ProductTranslation {
 }
 }
 
 
 input ProductTranslationInput {
 input ProductTranslationInput {
-    id: Int
+    id: String
     languageCode: LanguageCode!
     languageCode: LanguageCode!
     name: String!
     name: String!
     slug: String
     slug: String
@@ -34,7 +34,7 @@ input CreateProductInput {
 }
 }
 
 
 input UpdateProductInput {
 input UpdateProductInput {
-    id: Int!
+    id: String!
     image: String
     image: String
     translations: [ProductTranslationInput]!
     translations: [ProductTranslationInput]!
     optionGroupCodes: [String]
     optionGroupCodes: [String]

+ 1 - 1
server/src/entity/user/user.entity.ts

@@ -4,7 +4,7 @@ import { Address } from '../address/address.entity';
 
 
 @Entity('user')
 @Entity('user')
 export class User {
 export class User {
-    @PrimaryGeneratedColumn() id: number;
+    @PrimaryGeneratedColumn('uuid') id: string;
 
 
     @Column({ unique: true })
     @Column({ unique: true })
     identifier: string;
     identifier: string;

+ 1 - 1
server/src/entity/user/user.graphql

@@ -1,5 +1,5 @@
 type User implements Node {
 type User implements Node {
-    id: Int!
+    id: String!
     identifier: String
     identifier: String
     passwordHash: String
     passwordHash: String
     roles: [String]
     roles: [String]

+ 2 - 2
server/src/locale/locale-types.ts

@@ -23,7 +23,7 @@ export interface Translatable { translations: Array<Translation<any>>; }
 export type Translation<T> =
 export type Translation<T> =
     // Translation must include the languageCode and a reference to the base Translatable entity it is associated with
     // Translation must include the languageCode and a reference to the base Translatable entity it is associated with
     {
     {
-        id: number;
+        id: string;
         languageCode: LanguageCode;
         languageCode: LanguageCode;
         base: T;
         base: T;
     } &
     } &
@@ -33,7 +33,7 @@ export type Translation<T> =
 /**
 /**
  * This is the type of a translation object when provided as input to a create or update operation.
  * This is the type of a translation object when provided as input to a create or update operation.
  */
  */
-export type TranslationInput<T> = { [K in TranslatableKeys<T>]: string } & { id?: number; languageCode: LanguageCode };
+export type TranslationInput<T> = { [K in TranslatableKeys<T>]: string } & { id?: string; languageCode: LanguageCode };
 
 
 /**
 /**
  * This interface defines the shape of a DTO used to create / update an entity which has one or more LocaleString
  * This interface defines the shape of a DTO used to create / update an entity which has one or more LocaleString

+ 12 - 12
server/src/locale/translate-entity.spec.ts

@@ -23,7 +23,7 @@ describe('translateEntity()', () => {
 
 
     beforeEach(() => {
     beforeEach(() => {
         productTranslationEN = new ProductTranslation({
         productTranslationEN = new ProductTranslation({
-            id: 2,
+            id: '2',
             languageCode: LanguageCode.EN,
             languageCode: LanguageCode.EN,
             name: PRODUCT_NAME_EN,
             name: PRODUCT_NAME_EN,
             slug: '',
             slug: '',
@@ -32,7 +32,7 @@ describe('translateEntity()', () => {
         productTranslationEN.base = { id: 1 } as any;
         productTranslationEN.base = { id: 1 } as any;
 
 
         productTranslationDE = new ProductTranslation({
         productTranslationDE = new ProductTranslation({
-            id: 3,
+            id: '3',
             languageCode: LanguageCode.DE,
             languageCode: LanguageCode.DE,
             name: PRODUCT_NAME_DE,
             name: PRODUCT_NAME_DE,
             slug: '',
             slug: '',
@@ -41,7 +41,7 @@ describe('translateEntity()', () => {
         productTranslationDE.base = { id: 1 } as any;
         productTranslationDE.base = { id: 1 } as any;
 
 
         product = new Product();
         product = new Product();
-        product.id = 1;
+        product.id = '1';
         product.translations = [productTranslationEN, productTranslationDE];
         product.translations = [productTranslationEN, productTranslationDE];
     });
     });
 
 
@@ -54,7 +54,7 @@ describe('translateEntity()', () => {
     it('should not overwrite translatable id with translation id', () => {
     it('should not overwrite translatable id with translation id', () => {
         const result = translateEntity(product, LanguageCode.EN);
         const result = translateEntity(product, LanguageCode.EN);
 
 
-        expect(result).toHaveProperty('id', 1);
+        expect(result).toHaveProperty('id', '1');
     });
     });
 
 
     it('should note transfer the base from the selected translation', () => {
     it('should note transfer the base from the selected translation', () => {
@@ -93,7 +93,7 @@ describe('translateDeep()', () => {
     }
     }
 
 
     class TestProductEntity implements Translatable {
     class TestProductEntity implements Translatable {
-        id: number;
+        id: string;
         singleTestVariant: TestVariantEntity;
         singleTestVariant: TestVariantEntity;
         singleRealVariant: ProductVariant;
         singleRealVariant: ProductVariant;
         translations: Array<Translation<TestProduct>>;
         translations: Array<Translation<TestProduct>>;
@@ -104,7 +104,7 @@ describe('translateDeep()', () => {
     }
     }
 
 
     class TestVariantEntity implements Translatable {
     class TestVariantEntity implements Translatable {
-        id: number;
+        id: string;
         singleOption: ProductOption;
         singleOption: ProductOption;
         translations: Array<Translation<TestVariant>>;
         translations: Array<Translation<TestVariant>>;
     }
     }
@@ -120,31 +120,31 @@ describe('translateDeep()', () => {
 
 
     beforeEach(() => {
     beforeEach(() => {
         productTranslation = new ProductTranslation();
         productTranslation = new ProductTranslation();
-        productTranslation.id = 2;
+        productTranslation.id = '2';
         productTranslation.languageCode = LANGUAGE_CODE;
         productTranslation.languageCode = LANGUAGE_CODE;
         productTranslation.name = PRODUCT_NAME_EN;
         productTranslation.name = PRODUCT_NAME_EN;
 
 
         productOptionTranslation = new ProductOptionTranslation();
         productOptionTranslation = new ProductOptionTranslation();
-        productOptionTranslation.id = 31;
+        productOptionTranslation.id = '31';
         productOptionTranslation.languageCode = LANGUAGE_CODE;
         productOptionTranslation.languageCode = LANGUAGE_CODE;
         productOptionTranslation.name = OPTION_NAME_EN;
         productOptionTranslation.name = OPTION_NAME_EN;
 
 
         productOption = new ProductOption();
         productOption = new ProductOption();
-        productOption.id = 3;
+        productOption.id = '3';
         productOption.translations = [productOptionTranslation];
         productOption.translations = [productOptionTranslation];
 
 
         productVariantTranslation = new ProductVariantTranslation();
         productVariantTranslation = new ProductVariantTranslation();
-        productVariantTranslation.id = 41;
+        productVariantTranslation.id = '41';
         productVariantTranslation.languageCode = LANGUAGE_CODE;
         productVariantTranslation.languageCode = LANGUAGE_CODE;
         productVariantTranslation.name = VARIANT_NAME_EN;
         productVariantTranslation.name = VARIANT_NAME_EN;
 
 
         productVariant = new ProductVariant();
         productVariant = new ProductVariant();
-        productVariant.id = 3;
+        productVariant.id = '3';
         productVariant.translations = [productVariantTranslation];
         productVariant.translations = [productVariantTranslation];
         productVariant.options = [productOption];
         productVariant.options = [productOption];
 
 
         product = new Product();
         product = new Product();
-        product.id = 1;
+        product.id = '1';
         product.translations = [productTranslation];
         product.translations = [productTranslation];
         product.variants = [productVariant];
         product.variants = [productVariant];
 
 

+ 4 - 4
server/src/locale/translation-updater.spec.ts

@@ -9,20 +9,20 @@ describe('TranslationUpdater', () => {
     describe('diff()', () => {
     describe('diff()', () => {
         const existing: ProductTranslation[] = [
         const existing: ProductTranslation[] = [
             {
             {
-                id: 10,
+                id: '10',
                 languageCode: LanguageCode.EN,
                 languageCode: LanguageCode.EN,
                 name: '',
                 name: '',
                 slug: '',
                 slug: '',
                 description: '',
                 description: '',
-                base: 1 as any,
+                base: '1' as any,
             },
             },
             {
             {
-                id: 11,
+                id: '11',
                 languageCode: LanguageCode.DE,
                 languageCode: LanguageCode.DE,
                 name: '',
                 name: '',
                 slug: '',
                 slug: '',
                 description: '',
                 description: '',
-                base: 1 as any,
+                base: '1' as any,
             },
             },
         ];
         ];
 
 

+ 1 - 1
server/src/service/administrator.service.ts

@@ -15,7 +15,7 @@ export class AdministratorService {
         return this.connection.manager.find(Administrator);
         return this.connection.manager.find(Administrator);
     }
     }
 
 
-    findOne(administratorId: number): Promise<Administrator | undefined> {
+    findOne(administratorId: string): Promise<Administrator | undefined> {
         return this.connection.manager.findOne(Administrator, administratorId);
         return this.connection.manager.findOne(Administrator, administratorId);
     }
     }
 
 

+ 3 - 3
server/src/service/customer.service.ts

@@ -24,11 +24,11 @@ export class CustomerService {
             .then(([items, totalItems]) => ({ items, totalItems }));
             .then(([items, totalItems]) => ({ items, totalItems }));
     }
     }
 
 
-    findOne(userId: number): Promise<Customer | undefined> {
+    findOne(userId: string): Promise<Customer | undefined> {
         return this.connection.manager.findOne(Customer, userId);
         return this.connection.manager.findOne(Customer, userId);
     }
     }
 
 
-    findAddressesByCustomerId(customerId: number): Promise<Address[]> {
+    findAddressesByCustomerId(customerId: string): Promise<Address[]> {
         return this.connection
         return this.connection
             .getRepository(Address)
             .getRepository(Address)
             .createQueryBuilder('address')
             .createQueryBuilder('address')
@@ -51,7 +51,7 @@ export class CustomerService {
         return this.connection.getRepository(Customer).save(customer);
         return this.connection.getRepository(Customer).save(customer);
     }
     }
 
 
-    async createAddress(customerId: number, createAddressDto: CreateAddressDto): Promise<Address> {
+    async createAddress(customerId: string, createAddressDto: CreateAddressDto): Promise<Address> {
         const customer = await this.connection.manager.findOne(Customer, customerId, { relations: ['addresses'] });
         const customer = await this.connection.manager.findOne(Customer, customerId, { relations: ['addresses'] });
 
 
         if (!customer) {
         if (!customer) {

+ 1 - 1
server/src/service/product-option-group.service.ts

@@ -27,7 +27,7 @@ export class ProductOptionGroupService {
             .then(groups => groups.map(group => translateDeep(group, lang, ['options'])));
             .then(groups => groups.map(group => translateDeep(group, lang, ['options'])));
     }
     }
 
 
-    findOne(id: number, lang: LanguageCode): Promise<ProductOptionGroup | undefined> {
+    findOne(id: string, lang: LanguageCode): Promise<ProductOptionGroup | undefined> {
         return this.connection.manager
         return this.connection.manager
             .findOne(ProductOptionGroup, id, {
             .findOne(ProductOptionGroup, id, {
                 relations: ['options'],
                 relations: ['options'],

+ 1 - 1
server/src/service/product-option.service.ts

@@ -21,7 +21,7 @@ export class ProductOptionService {
             .then(groups => groups.map(group => translateDeep(group, lang)));
             .then(groups => groups.map(group => translateDeep(group, lang)));
     }
     }
 
 
-    findOne(id: number, lang: LanguageCode): Promise<ProductOption | undefined> {
+    findOne(id: string, lang: LanguageCode): Promise<ProductOption | undefined> {
         return this.connection.manager
         return this.connection.manager
             .findOne(ProductOption, id, {
             .findOne(ProductOption, id, {
                 relations: ['group'],
                 relations: ['group'],

+ 1 - 1
server/src/service/product.service.spec.ts

@@ -113,7 +113,7 @@ describe('ProductService', () => {
             translationUpdater.applyDiff.mockReturnValue(Promise.resolve(productFromApplyDiffCall));
             translationUpdater.applyDiff.mockReturnValue(Promise.resolve(productFromApplyDiffCall));
 
 
             const dto: UpdateProductDto = {
             const dto: UpdateProductDto = {
-                id: 1,
+                id: '1',
                 image: 'some-image',
                 image: 'some-image',
                 translations: [],
                 translations: [],
             };
             };

+ 1 - 1
server/src/service/product.service.ts

@@ -39,7 +39,7 @@ export class ProductService {
             });
             });
     }
     }
 
 
-    findOne(productId: number, lang: LanguageCode): Promise<Product | undefined> {
+    findOne(productId: string, lang: LanguageCode): Promise<Product | undefined> {
         const relations = ['variants', 'optionGroups', 'variants.options'];
         const relations = ['variants', 'optionGroups', 'variants.options'];
 
 
         return this.connection.manager
         return this.connection.manager