Add seeds and move to uuid (#80)
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
export interface Company {
|
||||
id: number;
|
||||
id: string;
|
||||
name: string;
|
||||
domain: string;
|
||||
domain_name: string;
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ import { mapGqlPerson, mapPerson } from './person.interface';
|
||||
describe('mapPerson', () => {
|
||||
it('should map person', () => {
|
||||
const person = mapPerson({
|
||||
id: 1,
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
|
||||
firstname: 'John',
|
||||
lastname: 'Doe',
|
||||
email: '',
|
||||
@ -12,9 +12,9 @@ describe('mapPerson', () => {
|
||||
created_at: '',
|
||||
company: {
|
||||
__typename: '',
|
||||
id: 1,
|
||||
company_name: '',
|
||||
company_domain: '',
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
|
||||
name: '',
|
||||
domain_name: '',
|
||||
},
|
||||
__typename: '',
|
||||
});
|
||||
@ -23,19 +23,19 @@ describe('mapPerson', () => {
|
||||
|
||||
it('should map person back', () => {
|
||||
const person = mapGqlPerson({
|
||||
id: 1,
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
|
||||
fullName: 'John Doe',
|
||||
email: '',
|
||||
phone: '',
|
||||
city: '',
|
||||
company: {
|
||||
id: 1,
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
|
||||
name: '',
|
||||
domain: '',
|
||||
domain_name: '',
|
||||
},
|
||||
creationDate: new Date(),
|
||||
pipe: {
|
||||
id: 3,
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6c',
|
||||
name: '',
|
||||
icon: '',
|
||||
},
|
||||
|
||||
@ -2,7 +2,7 @@ import { Company } from './company.interface';
|
||||
import { Pipe } from './pipe.interface';
|
||||
|
||||
export type Person = {
|
||||
id: number;
|
||||
id: string;
|
||||
fullName: string;
|
||||
picture?: string;
|
||||
email: string;
|
||||
@ -18,14 +18,14 @@ export type GraphqlQueryPerson = {
|
||||
city: string;
|
||||
company: {
|
||||
__typename: string;
|
||||
id: number;
|
||||
company_name: string;
|
||||
company_domain: string;
|
||||
id: string;
|
||||
name: string;
|
||||
domain_name: string;
|
||||
};
|
||||
created_at: string;
|
||||
email: string;
|
||||
firstname: string;
|
||||
id: number;
|
||||
id: string;
|
||||
lastname: string;
|
||||
phone: string;
|
||||
__typename: string;
|
||||
@ -33,11 +33,11 @@ export type GraphqlQueryPerson = {
|
||||
|
||||
export type GraphqlMutationPerson = {
|
||||
city: string;
|
||||
company_id?: number;
|
||||
company_id?: string;
|
||||
created_at: string;
|
||||
email: string;
|
||||
firstname: string;
|
||||
id: number;
|
||||
id: string;
|
||||
lastname: string;
|
||||
phone: string;
|
||||
__typename: string;
|
||||
@ -46,12 +46,16 @@ export type GraphqlMutationPerson = {
|
||||
export const mapPerson = (person: GraphqlQueryPerson): Person => ({
|
||||
fullName: `${person.firstname} ${person.lastname}`,
|
||||
creationDate: new Date(person.created_at),
|
||||
pipe: { name: 'coucou', id: 1, icon: '💰' },
|
||||
pipe: {
|
||||
name: 'coucou',
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
|
||||
icon: '💰',
|
||||
},
|
||||
...person,
|
||||
company: {
|
||||
id: person.company.id,
|
||||
name: person.company.company_name,
|
||||
domain: person.company.company_domain,
|
||||
name: person.company.name,
|
||||
domain_name: person.company.domain_name,
|
||||
},
|
||||
countryCode: 'FR',
|
||||
});
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
export interface Pipe {
|
||||
id: number;
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
export interface User {
|
||||
id: number;
|
||||
id: string;
|
||||
email: string;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
export interface Workspace {
|
||||
id: number;
|
||||
id: string;
|
||||
name: string;
|
||||
logo: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user