[offers][chore] remove profileName and discussion from editprofile

pull/405/head
Stuart Long Chay Boon 2 years ago
parent 18d2a10708
commit 6a665bc976

@ -192,7 +192,7 @@ function Test() {
}); });
}; };
const profileId = 'cl9efyn9p004ww3u42mjgl1vn'; // Remember to change this filed after testing deleting const profileId = 'cl9i68fv60000tthj8t3zkox0'; // Remember to change this filed after testing deleting
const data = trpc.useQuery( const data = trpc.useQuery(
[ [
`offers.profile.listOne`, `offers.profile.listOne`,
@ -241,10 +241,10 @@ function Test() {
background: { background: {
educations: [ educations: [
{ {
backgroundId: 'cl96stky6002fw32g6vj4meyr', backgroundId: 'cl9i68fv60001tthj23g9tuv4',
endDate: new Date('2018-09-30T07:58:54.000Z'), endDate: new Date('2018-09-30T07:58:54.000Z'),
field: 'Computer Science', field: 'Computer Science',
id: 'cl96stky6002gw32gey2ffawd', id: 'cl9i68fv60002tthjq4eux7kn',
school: 'National University of Singapore', school: 'National University of Singapore',
startDate: new Date('2014-09-30T07:58:54.000Z'), startDate: new Date('2014-09-30T07:58:54.000Z'),
type: 'Bachelors', type: 'Bachelors',
@ -252,20 +252,20 @@ function Test() {
], ],
experiences: [ experiences: [
{ {
backgroundId: 'cl96stky6002fw32g6vj4meyr', backgroundId: 'cl9i68fv60001tthj23g9tuv4',
company: { company: {
createdAt: new Date('2022-10-12T16:19:05.196Z'), createdAt: new Date('2022-10-12T16:19:05.196Z'),
description: description:
'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.', 'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.',
id: 'cl95u79f000007im531ysjg79', id: 'cl9h0bqug0003txxwgkac0x40',
logoUrl: 'https://logo.clearbit.com/meta.com', logoUrl: 'https://logo.clearbit.com/meta.com',
name: 'Meta', name: 'Meta',
slug: 'meta', slug: 'meta',
updatedAt: new Date('2022-10-12T16:19:05.196Z'), updatedAt: new Date('2022-10-12T16:19:05.196Z'),
}, },
companyId: 'cl9h0bqu50000txxwkhmshhxz', companyId: 'cl9h0bqug0003txxwgkac0x40',
durationInMonths: 24, durationInMonths: 24,
id: 'cl96stky6002iw32gpt6t87s2', id: 'cl9i68fvc0004tthjo5jbr0yg',
jobType: 'FULLTIME', jobType: 'FULLTIME',
level: 'Junior', level: 'Junior',
monthlySalary: null, monthlySalary: null,
@ -274,57 +274,57 @@ function Test() {
title: 'Software Engineer', title: 'Software Engineer',
totalCompensation: { totalCompensation: {
currency: 'SGD', currency: 'SGD',
id: 'cl96stky6002jw32g73svfacr', id: 'cl9i68fvc0005tthj7r1rhvb1',
value: 104100, value: 100,
}, },
totalCompensationId: 'cl96stky6002jw32g73svfacr', totalCompensationId: 'cl9i68fvc0005tthj7r1rhvb1',
}, },
], ],
id: 'cl96stky6002fw32g6vj4meyr', id: 'cl9i68fv60001tthj23g9tuv4',
offersProfileId: 'cl96stky5002ew32gx2kale2x', offersProfileId: 'cl9i68fv60000tthj8t3zkox0',
specificYoes: [ specificYoes: [
{ {
backgroundId: 'cl96stky6002fw32g6vj4meyr', backgroundId: 'cl9i68fv60001tthj23g9tuv4',
domain: 'Backend', domain: 'Backend',
id: 'cl96t7890004tw32g5in3px5j', id: 'cl9i68fvc0008tthjlxslzfo4',
yoe: 2, yoe: 2,
}, },
{ {
backgroundId: 'cl96stky6002fw32g6vj4meyr', backgroundId: 'cl9i68fv60001tthj23g9tuv4',
domain: 'Backend', domain: 'Backend',
id: 'cl96tb87x004xw32gnu17jbzv', id: 'cl9i68fvc0009tthjwol3285l',
yoe: 2, yoe: 2,
}, },
{ {
backgroundId: 'cl96stky6002fw32g6vj4meyr', // BackgroundId: 'cl9i68fv60001tthj23g9tuv4',
domain: 'Backend', domain: 'Backend',
id: 'cl976t39z00007iygt3np3cgo', // Id: 'cl976t39z00007iygt3np3cgo',
yoe: 2, yoe: 2,
}, },
{ {
backgroundId: 'cl96stky6002fw32g6vj4meyr', // BackgroundId: 'cl96stky6002fw32g6vj4meyr',
domain: 'Front End', domain: 'Front End',
id: 'cl96stky7002mw32gn4jc7uml', // Id: 'cl96stky7002mw32gn4jc7uml',
yoe: 2, yoe: 2,
}, },
{ {
backgroundId: 'cl96stky6002fw32g6vj4meyr', // BackgroundId: 'cl96stky6002fw32g6vj4meyr',
domain: 'Full Stack', domain: 'Full Stack',
id: 'cl96stky7002nw32gpprghtxr', // Id: 'cl96stky7002nw32gpprghtxr',
yoe: 2, yoe: 2,
}, },
{ {
backgroundId: 'cl96stky6002fw32g6vj4meyr', // BackgroundId: 'cl96stky6002fw32g6vj4meyr',
domain: 'Backend', domain: 'Backend',
id: 'cl976we5h000p7iygiomdo9fh', // Id: 'cl976we5h000p7iygiomdo9fh',
yoe: 2, yoe: 2,
}, },
], ],
totalYoe: 6, totalYoe: 6,
}, },
createdAt: '2022-10-13T08:28:13.518Z', createdAt: '2022-10-13T08:28:13.518Z',
discussion: [], // Discussion: [],
id: 'cl96stky5002ew32gx2kale2x', id: 'cl9i68fv60000tthj8t3zkox0',
isEditable: true, isEditable: true,
offers: [ offers: [
{ {
@ -333,14 +333,14 @@ function Test() {
createdAt: new Date('2022-10-12T16:19:05.196Z'), createdAt: new Date('2022-10-12T16:19:05.196Z'),
description: description:
'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.', 'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.',
id: 'cl95u79f000007im531ysjg79', id: 'cl9h0bqug0003txxwgkac0x40',
logoUrl: 'https://logo.clearbit.com/meta.com', logoUrl: 'https://logo.clearbit.com/meta.com',
name: 'Meta', name: 'Meta',
slug: 'meta', slug: 'meta',
updatedAt: new Date('2022-10-12T16:19:05.196Z'), updatedAt: new Date('2022-10-12T16:19:05.196Z'),
}, },
companyId: 'cl9h0bqu50000txxwkhmshhxz', companyId: 'cl9h0bqug0003txxwgkac0x40',
id: 'cl976t4de00047iygl0zbce11', id: 'cl9i68fve000ntthj5h9yvqnh',
jobType: 'FULLTIME', jobType: 'FULLTIME',
location: 'Singapore, Singapore', location: 'Singapore, Singapore',
monthYearReceived: new Date('2022-09-30T07:58:54.000Z'), monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
@ -348,37 +348,37 @@ function Test() {
offersFullTime: { offersFullTime: {
baseSalary: { baseSalary: {
currency: 'SGD', currency: 'SGD',
id: 'cl976t4de00067iyg3pjir7k9', id: 'cl9i68fve000ptthjn55hpoe4',
value: 1999999999, value: 1999999999,
}, },
baseSalaryId: 'cl976t4de00067iyg3pjir7k9', baseSalaryId: 'cl9i68fve000ptthjn55hpoe4',
bonus: { bonus: {
currency: 'SGD', currency: 'SGD',
id: 'cl976t4de00087iygcnlmh8aw', id: 'cl9i68fve000rtthjqo2ktljt',
value: 1410065407, value: 1410065407,
}, },
bonusId: 'cl976t4de00087iygcnlmh8aw', bonusId: 'cl9i68fve000rtthjqo2ktljt',
id: 'cl976t4de00057iygq3ktce3v', id: 'cl9i68fve000otthjqk0g01k0',
level: 'EXPERT', level: 'EXPERT',
specialization: 'FRONTEND', specialization: 'FRONTEND',
stocks: { stocks: {
currency: 'SGD', currency: 'SGD',
id: 'cl976t4df000a7iygkrsgr1xh', id: 'cl9i68fvf000ttthjt2ode0cc',
value: -558038585, value: -558038585,
}, },
stocksId: 'cl976t4df000a7iygkrsgr1xh', stocksId: 'cl9i68fvf000ttthjt2ode0cc',
title: 'Software Engineer', title: 'Software Engineer',
totalCompensation: { totalCompensation: {
currency: 'SGD', currency: 'SGD',
id: 'cl976t4df000c7iyg73ryf5uw', id: 'cl9i68fvf000vtthjg90s48nj',
value: 55555555, value: 55555555,
}, },
totalCompensationId: 'cl976t4df000c7iyg73ryf5uw', totalCompensationId: 'cl9i68fvf000vtthjg90s48nj',
}, },
offersFullTimeId: 'cl976t4de00057iygq3ktce3v', offersFullTimeId: 'cl9i68fve000otthjqk0g01k0',
offersIntern: null, offersIntern: null,
offersInternId: null, offersInternId: null,
profileId: 'cl96stky5002ew32gx2kale2x', profileId: 'cl9i68fv60000tthj8t3zkox0',
}, },
{ {
comments: '', comments: '',
@ -386,14 +386,14 @@ function Test() {
createdAt: new Date('2022-10-12T16:19:05.196Z'), createdAt: new Date('2022-10-12T16:19:05.196Z'),
description: description:
'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.', 'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.',
id: 'cl95u79f000007im531ysjg79', id: 'cl9h0bqug0003txxwgkac0x40',
logoUrl: 'https://logo.clearbit.com/meta.com', logoUrl: 'https://logo.clearbit.com/meta.com',
name: 'Meta', name: 'Meta',
slug: 'meta', slug: 'meta',
updatedAt: new Date('2022-10-12T16:19:05.196Z'), updatedAt: new Date('2022-10-12T16:19:05.196Z'),
}, },
companyId: 'cl9h0bqu50000txxwkhmshhxz', companyId: 'cl9h0bqug0003txxwgkac0x40',
id: 'cl96stky80031w32gau9mu1gs', id: 'cl9i68fvf000ytthj0ltsqt1d',
jobType: 'FULLTIME', jobType: 'FULLTIME',
location: 'Singapore, Singapore', location: 'Singapore, Singapore',
monthYearReceived: new Date('2022-09-30T07:58:54.000Z'), monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
@ -401,200 +401,200 @@ function Test() {
offersFullTime: { offersFullTime: {
baseSalary: { baseSalary: {
currency: 'SGD', currency: 'SGD',
id: 'cl96stky80033w32gxw5goc4z', id: 'cl9i68fvf0010tthj0iym6woh',
value: 84000, value: 84000,
}, },
baseSalaryId: 'cl96stky80033w32gxw5goc4z', baseSalaryId: 'cl9i68fvf0010tthj0iym6woh',
bonus: { bonus: {
currency: 'SGD', currency: 'SGD',
id: 'cl96stky80035w32gajjwdo1p', id: 'cl9i68fvf0012tthjioltnspk',
value: 123456789, value: 123456789,
}, },
bonusId: 'cl96stky80035w32gajjwdo1p', bonusId: 'cl9i68fvf0012tthjioltnspk',
id: 'cl96stky80032w32gep9ovgj3', id: 'cl9i68fvf000ztthjcovbiehc',
level: 'Junior', level: 'Junior',
specialization: 'Front End', specialization: 'Front End',
stocks: { stocks: {
currency: 'SGD', currency: 'SGD',
id: 'cl96stky90037w32gu04t6ybh', id: 'cl9i68fvf0014tthjz2gff3hs',
value: 100, value: 100,
}, },
stocksId: 'cl96stky90037w32gu04t6ybh', stocksId: 'cl9i68fvf0014tthjz2gff3hs',
title: 'Software Engineer', title: 'Software Engineer',
totalCompensation: { totalCompensation: {
currency: 'SGD', currency: 'SGD',
id: 'cl96stky90039w32glbpktd0o', id: 'cl9i68fvf0016tthjrtb7iuvj',
value: 104100, value: 104100,
}, },
totalCompensationId: 'cl96stky90039w32glbpktd0o', totalCompensationId: 'cl9i68fvf0016tthjrtb7iuvj',
},
offersFullTimeId: 'cl96stky80032w32gep9ovgj3',
offersIntern: null,
offersInternId: null,
profileId: 'cl96stky5002ew32gx2kale2x',
},
{
comments: '',
company: {
createdAt: new Date('2022-10-12T16:19:05.196Z'),
description:
'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.',
id: 'cl95u79f000007im531ysjg79',
logoUrl: 'https://logo.clearbit.com/meta.com',
name: 'Meta',
slug: 'meta',
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
},
companyId: 'cl9h0bqu50000txxwkhmshhxz',
id: 'cl96stky9003bw32gc3l955vr',
jobType: 'FULLTIME',
location: 'Singapore, Singapore',
monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
negotiationStrategy: 'LOst out having multiple offers',
offersFullTime: {
baseSalary: {
currency: 'SGD',
id: 'cl96stky9003dw32gcvqbijlo',
value: 1,
},
baseSalaryId: 'cl96stky9003dw32gcvqbijlo',
bonus: {
currency: 'SGD',
id: 'cl96stky9003fw32goc3zqxwr',
value: 0,
},
bonusId: 'cl96stky9003fw32goc3zqxwr',
id: 'cl96stky9003cw32g5v10izfu',
level: 'Senior',
specialization: 'Front End',
stocks: {
currency: 'SGD',
id: 'cl96stky9003hw32g1lbbkqqr',
value: 999999,
},
stocksId: 'cl96stky9003hw32g1lbbkqqr',
title: 'Software Engineer DOG',
totalCompensation: {
currency: 'SGD',
id: 'cl96stky9003jw32gzumcoi7v',
value: 999999,
},
totalCompensationId: 'cl96stky9003jw32gzumcoi7v',
}, },
offersFullTimeId: 'cl96stky9003cw32g5v10izfu', offersFullTimeId: 'cl9i68fvf000ztthjcovbiehc',
offersIntern: null, offersIntern: null,
offersInternId: null, offersInternId: null,
profileId: 'cl96stky5002ew32gx2kale2x', profileId: 'cl9i68fv60000tthj8t3zkox0',
},
{
comments: 'this IS SO COOL',
company: {
createdAt: new Date('2022-10-12T16:19:05.196Z'),
description:
'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.',
id: 'cl95u79f000007im531ysjg79',
logoUrl: 'https://logo.clearbit.com/meta.com',
name: 'Meta',
slug: 'meta',
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
},
companyId: 'cl9h0bqu50000txxwkhmshhxz',
id: 'cl976wf28000t7iyga4noyz7s',
jobType: 'FULLTIME',
location: 'Singapore, Singapore',
monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
negotiationStrategy: 'Charmed the guy with my face',
offersFullTime: {
baseSalary: {
currency: 'SGD',
id: 'cl976wf28000v7iygmk1b7qaq',
value: 1999999999,
},
baseSalaryId: 'cl976wf28000v7iygmk1b7qaq',
bonus: {
currency: 'SGD',
id: 'cl976wf28000x7iyg63w7kcli',
value: 1410065407,
},
bonusId: 'cl976wf28000x7iyg63w7kcli',
id: 'cl976wf28000u7iyg6euei8e9',
level: 'EXPERT',
specialization: 'FRONTEND',
stocks: {
currency: 'SGD',
id: 'cl976wf28000z7iyg9ivun6ap',
value: 111222333,
},
stocksId: 'cl976wf28000z7iyg9ivun6ap',
title: 'Software Engineer',
totalCompensation: {
currency: 'SGD',
id: 'cl976wf2800117iygmzsc0xit',
value: 55555555,
},
totalCompensationId: 'cl976wf2800117iygmzsc0xit',
},
offersFullTimeId: 'cl976wf28000u7iyg6euei8e9',
offersIntern: null,
offersInternId: null,
profileId: 'cl96stky5002ew32gx2kale2x',
},
{
comments: 'this rocks',
company: {
createdAt: new Date('2022-10-12T16:19:05.196Z'),
description:
'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.',
id: 'cl95u79f000007im531ysjg79',
logoUrl: 'https://logo.clearbit.com/meta.com',
name: 'Meta',
slug: 'meta',
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
},
companyId: 'cl9h0bqu50000txxwkhmshhxz',
id: 'cl96tbb3o0051w32gjrpaiiit',
jobType: 'FULLTIME',
location: 'Singapore, Singapore',
monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
negotiationStrategy: 'Charmed the guy with my face',
offersFullTime: {
baseSalary: {
currency: 'SGD',
id: 'cl96tbb3o0053w32gz11paaxu',
value: 1999999999,
},
baseSalaryId: 'cl96tbb3o0053w32gz11paaxu',
bonus: {
currency: 'SGD',
id: 'cl96tbb3o0055w32gpyqgz5hx',
value: 1410065407,
},
bonusId: 'cl96tbb3o0055w32gpyqgz5hx',
id: 'cl96tbb3o0052w32guguajzin',
level: 'EXPERT',
specialization: 'FRONTEND',
stocks: {
currency: 'SGD',
id: 'cl96tbb3o0057w32gu4nyxguf',
value: 500,
},
stocksId: 'cl96tbb3o0057w32gu4nyxguf',
title: 'Software Engineer',
totalCompensation: {
currency: 'SGD',
id: 'cl96tbb3o0059w32gm3iy1zk4',
value: 55555555,
},
totalCompensationId: 'cl96tbb3o0059w32gm3iy1zk4',
},
offersFullTimeId: 'cl96tbb3o0052w32guguajzin',
offersIntern: null,
offersInternId: null,
profileId: 'cl96stky5002ew32gx2kale2x',
}, },
// {
// comments: '',
// company: {
// createdAt: new Date('2022-10-12T16:19:05.196Z'),
// description:
// 'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.',
// id: 'cl9h0bqug0003txxwgkac0x40',
// logoUrl: 'https://logo.clearbit.com/meta.com',
// name: 'Meta',
// slug: 'meta',
// updatedAt: new Date('2022-10-12T16:19:05.196Z'),
// },
// companyId: 'cl9h0bqug0003txxwgkac0x40',
// id: 'cl96stky9003bw32gc3l955vr',
// jobType: 'FULLTIME',
// location: 'Singapore, Singapore',
// monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
// negotiationStrategy: 'LOst out having multiple offers',
// offersFullTime: {
// baseSalary: {
// currency: 'SGD',
// id: 'cl96stky9003dw32gcvqbijlo',
// value: 1,
// },
// baseSalaryId: 'cl96stky9003dw32gcvqbijlo',
// bonus: {
// currency: 'SGD',
// id: 'cl96stky9003fw32goc3zqxwr',
// value: 0,
// },
// bonusId: 'cl96stky9003fw32goc3zqxwr',
// id: 'cl96stky9003cw32g5v10izfu',
// level: 'Senior',
// specialization: 'Front End',
// stocks: {
// currency: 'SGD',
// id: 'cl96stky9003hw32g1lbbkqqr',
// value: 999999,
// },
// stocksId: 'cl96stky9003hw32g1lbbkqqr',
// title: 'Software Engineer DOG',
// totalCompensation: {
// currency: 'SGD',
// id: 'cl96stky9003jw32gzumcoi7v',
// value: 999999,
// },
// totalCompensationId: 'cl96stky9003jw32gzumcoi7v',
// },
// offersFullTimeId: 'cl96stky9003cw32g5v10izfu',
// offersIntern: null,
// offersInternId: null,
// profileId: 'cl96stky5002ew32gx2kale2x',
// },
// {
// comments: 'this IS SO COOL',
// company: {
// createdAt: new Date('2022-10-12T16:19:05.196Z'),
// description:
// 'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.',
// id: 'cl9h0bqug0003txxwgkac0x40',
// logoUrl: 'https://logo.clearbit.com/meta.com',
// name: 'Meta',
// slug: 'meta',
// updatedAt: new Date('2022-10-12T16:19:05.196Z'),
// },
// companyId: 'cl9h0bqug0003txxwgkac0x40',
// id: 'cl976wf28000t7iyga4noyz7s',
// jobType: 'FULLTIME',
// location: 'Singapore, Singapore',
// monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
// negotiationStrategy: 'Charmed the guy with my face',
// offersFullTime: {
// baseSalary: {
// currency: 'SGD',
// id: 'cl976wf28000v7iygmk1b7qaq',
// value: 1999999999,
// },
// baseSalaryId: 'cl976wf28000v7iygmk1b7qaq',
// bonus: {
// currency: 'SGD',
// id: 'cl976wf28000x7iyg63w7kcli',
// value: 1410065407,
// },
// bonusId: 'cl976wf28000x7iyg63w7kcli',
// id: 'cl976wf28000u7iyg6euei8e9',
// level: 'EXPERT',
// specialization: 'FRONTEND',
// stocks: {
// currency: 'SGD',
// id: 'cl976wf28000z7iyg9ivun6ap',
// value: 111222333,
// },
// stocksId: 'cl976wf28000z7iyg9ivun6ap',
// title: 'Software Engineer',
// totalCompensation: {
// currency: 'SGD',
// id: 'cl976wf2800117iygmzsc0xit',
// value: 55555555,
// },
// totalCompensationId: 'cl976wf2800117iygmzsc0xit',
// },
// offersFullTimeId: 'cl976wf28000u7iyg6euei8e9',
// offersIntern: null,
// offersInternId: null,
// profileId: 'cl96stky5002ew32gx2kale2x',
// },
// {
// comments: 'this rocks',
// company: {
// createdAt: new Date('2022-10-12T16:19:05.196Z'),
// description:
// 'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.',
// id: 'cl9h0bqug0003txxwgkac0x40',
// logoUrl: 'https://logo.clearbit.com/meta.com',
// name: 'Meta',
// slug: 'meta',
// updatedAt: new Date('2022-10-12T16:19:05.196Z'),
// },
// companyId: 'cl9h0bqug0003txxwgkac0x40',
// id: 'cl96tbb3o0051w32gjrpaiiit',
// jobType: 'FULLTIME',
// location: 'Singapore, Singapore',
// monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
// negotiationStrategy: 'Charmed the guy with my face',
// offersFullTime: {
// baseSalary: {
// currency: 'SGD',
// id: 'cl96tbb3o0053w32gz11paaxu',
// value: 1999999999,
// },
// baseSalaryId: 'cl96tbb3o0053w32gz11paaxu',
// bonus: {
// currency: 'SGD',
// id: 'cl96tbb3o0055w32gpyqgz5hx',
// value: 1410065407,
// },
// bonusId: 'cl96tbb3o0055w32gpyqgz5hx',
// id: 'cl96tbb3o0052w32guguajzin',
// level: 'EXPERT',
// specialization: 'FRONTEND',
// stocks: {
// currency: 'SGD',
// id: 'cl96tbb3o0057w32gu4nyxguf',
// value: 500,
// },
// stocksId: 'cl96tbb3o0057w32gu4nyxguf',
// title: 'Software Engineer',
// totalCompensation: {
// currency: 'SGD',
// id: 'cl96tbb3o0059w32gm3iy1zk4',
// value: 55555555,
// },
// totalCompensationId: 'cl96tbb3o0059w32gm3iy1zk4',
// },
// offersFullTimeId: 'cl96tbb3o0052w32guguajzin',
// offersIntern: null,
// offersInternId: null,
// profileId: 'cl96stky5002ew32gx2kale2x',
// },
], ],
profileName: 'ailing bryann stuart ziqing', // ProfileName: 'ailing bryann stuart ziqing',
token: 'afca11e436d21bde24543718fa957c6c625335439dc504f24ee35eae7b5ef1ba', token: 'd3509cb890f0bae0a785afdd6c1c074a140706ab1d155ed338ec22dcca5c92f1',
userId: null, userId: null,
}); });
}; };

@ -94,14 +94,14 @@ const education = z.object({
type: z.string().nullish(), type: z.string().nullish(),
}); });
const reply = z.object({ // Const reply = z.object({
createdAt: z.date().nullish(), // createdAt: z.date().nullish(),
id: z.string().optional(), // id: z.string().optional(),
messages: z.string().nullish(), // messages: z.string().nullish(),
profileId: z.string().nullish(), // profileId: z.string().nullish(),
replyingToId: z.string().nullish(), // replyingToId: z.string().nullish(),
userId: z.string().nullish(), // userId: z.string().nullish(),
}); // });
export const offersProfileRouter = createRouter() export const offersProfileRouter = createRouter()
.query('listOne', { .query('listOne', {
@ -535,11 +535,11 @@ export const offersProfileRouter = createRouter()
totalYoe: z.number(), totalYoe: z.number(),
}), }),
createdAt: z.string().optional(), createdAt: z.string().optional(),
discussion: z.array(reply), // Discussion: z.array(reply),
id: z.string(), id: z.string(),
isEditable: z.boolean().nullish(), isEditable: z.boolean().nullish(),
offers: z.array(offer), offers: z.array(offer),
profileName: z.string(), profileName: z.string().optional(),
token: z.string(), token: z.string(),
userId: z.string().nullish(), userId: z.string().nullish(),
}), }),
@ -552,14 +552,16 @@ export const offersProfileRouter = createRouter()
const profileEditToken = profileToUpdate?.editToken; const profileEditToken = profileToUpdate?.editToken;
if (profileEditToken === input.token) { if (profileEditToken === input.token) {
await ctx.prisma.offersProfile.update({ if (input.profileName) {
data: { await ctx.prisma.offersProfile.update({
profileName: input.profileName, data: {
}, profileName: input.profileName,
where: { },
id: input.id, where: {
}, id: input.id,
}); },
});
}
await ctx.prisma.offersBackground.update({ await ctx.prisma.offersBackground.update({
data: { data: {
@ -572,6 +574,7 @@ export const offersProfileRouter = createRouter()
for (const edu of input.background.educations) { for (const edu of input.background.educations) {
if (edu.id) { if (edu.id) {
// Update existing education
await ctx.prisma.offersEducation.update({ await ctx.prisma.offersEducation.update({
data: { data: {
endDate: edu.endDate, endDate: edu.endDate,
@ -585,6 +588,7 @@ export const offersProfileRouter = createRouter()
}, },
}); });
} else { } else {
// Create new education
await ctx.prisma.offersBackground.update({ await ctx.prisma.offersBackground.update({
data: { data: {
educations: { educations: {
@ -606,6 +610,7 @@ export const offersProfileRouter = createRouter()
for (const exp of input.background.experiences) { for (const exp of input.background.experiences) {
if (exp.id) { if (exp.id) {
// Update existing experience
await ctx.prisma.offersExperience.update({ await ctx.prisma.offersExperience.update({
data: { data: {
companyId: exp.companyId, companyId: exp.companyId,
@ -642,6 +647,7 @@ export const offersProfileRouter = createRouter()
}); });
} }
} else if (!exp.id) { } else if (!exp.id) {
// Create new experience
if ( if (
exp.jobType === 'FULLTIME' && exp.jobType === 'FULLTIME' &&
exp.totalCompensation?.currency !== undefined && exp.totalCompensation?.currency !== undefined &&
@ -760,6 +766,7 @@ export const offersProfileRouter = createRouter()
for (const yoe of input.background.specificYoes) { for (const yoe of input.background.specificYoes) {
if (yoe.id) { if (yoe.id) {
// Update existing yoe
await ctx.prisma.offersSpecificYoe.update({ await ctx.prisma.offersSpecificYoe.update({
data: { data: {
...yoe, ...yoe,
@ -769,6 +776,7 @@ export const offersProfileRouter = createRouter()
}, },
}); });
} else { } else {
// Create new yoe
await ctx.prisma.offersBackground.update({ await ctx.prisma.offersBackground.update({
data: { data: {
specificYoes: { specificYoes: {
@ -787,6 +795,7 @@ export const offersProfileRouter = createRouter()
for (const offerToUpdate of input.offers) { for (const offerToUpdate of input.offers) {
if (offerToUpdate.id) { if (offerToUpdate.id) {
// Update existing offer
await ctx.prisma.offersOffer.update({ await ctx.prisma.offersOffer.update({
data: { data: {
comments: offerToUpdate.comments, comments: offerToUpdate.comments,
@ -894,6 +903,7 @@ export const offersProfileRouter = createRouter()
}); });
} }
} else { } else {
// Create new offer
if ( if (
offerToUpdate.jobType === 'INTERN' && offerToUpdate.jobType === 'INTERN' &&
offerToUpdate.offersIntern && offerToUpdate.offersIntern &&

Loading…
Cancel
Save