@hasna/contacts 0.6.28 → 0.6.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/crm.d.ts.map +1 -1
- package/dist/cli/index.js +46 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crm.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/crm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAezC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"crm.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/crm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAezC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAm+B1D"}
|
package/dist/cli/index.js
CHANGED
|
@@ -20689,11 +20689,49 @@ ${apps.length} application(s) need follow-up:
|
|
|
20689
20689
|
console.log();
|
|
20690
20690
|
});
|
|
20691
20691
|
program2.command("seed").description("Seed demo contacts, companies, and relationships").option("--demo", "Seed demo data (professional services example)").option("--clear", "Clear existing demo data first").action(async (opts) => {
|
|
20692
|
+
const store = getStore();
|
|
20693
|
+
if (opts.clear) {
|
|
20694
|
+
const demoCompanyNames = [
|
|
20695
|
+
"KPMG Romania",
|
|
20696
|
+
"Escalon Services",
|
|
20697
|
+
"Revision Legal PLLC",
|
|
20698
|
+
"RAW Financial",
|
|
20699
|
+
"Silicon Valley Bank",
|
|
20700
|
+
"Hasna, Inc.",
|
|
20701
|
+
"Beep Media International LLC",
|
|
20702
|
+
"Hasna Global SRL"
|
|
20703
|
+
];
|
|
20704
|
+
const demoContactEmails = [
|
|
20705
|
+
"alinaturlea@kpmg.com",
|
|
20706
|
+
"lsipos@kpmg.com",
|
|
20707
|
+
"elizabeth.robles@escalon.services",
|
|
20708
|
+
"drew@revisionlegal.com",
|
|
20709
|
+
"DYang@svb.com"
|
|
20710
|
+
];
|
|
20711
|
+
let removedCompanies = 0;
|
|
20712
|
+
let removedContacts = 0;
|
|
20713
|
+
const { companies } = await store.listCompanies({ limit: 500 });
|
|
20714
|
+
for (const c of companies) {
|
|
20715
|
+
if (demoCompanyNames.includes(c.name)) {
|
|
20716
|
+
await store.deleteCompany(c.id);
|
|
20717
|
+
removedCompanies++;
|
|
20718
|
+
}
|
|
20719
|
+
}
|
|
20720
|
+
for (const email of demoContactEmails) {
|
|
20721
|
+
const contact = await store.getContactByEmail(email);
|
|
20722
|
+
if (contact) {
|
|
20723
|
+
await store.deleteContact(contact.id);
|
|
20724
|
+
removedContacts++;
|
|
20725
|
+
}
|
|
20726
|
+
}
|
|
20727
|
+
console.log(chalk3.green(`\u2713 Cleared demo data: ${removedCompanies} companies, ${removedContacts} contacts`));
|
|
20728
|
+
if (!opts.demo)
|
|
20729
|
+
return;
|
|
20730
|
+
}
|
|
20692
20731
|
if (!opts.demo) {
|
|
20693
|
-
console.log("Use --demo flag to seed demo data");
|
|
20732
|
+
console.log("Use --demo flag to seed demo data (add --clear to remove previously seeded demo data)");
|
|
20694
20733
|
return;
|
|
20695
20734
|
}
|
|
20696
|
-
const store = getStore();
|
|
20697
20735
|
console.log(chalk3.cyan("Seeding demo contacts..."));
|
|
20698
20736
|
const kpmg = await store.createCompany({ name: "KPMG Romania", industry: "Accounting", description: "Romanian accounting, tax, and payroll firm" });
|
|
20699
20737
|
const escalon = await store.createCompany({ name: "Escalon Services", industry: "Tax & Finance", description: "US tax preparation for multi-entity businesses", domain: "escalon.services" });
|
|
@@ -20877,7 +20915,7 @@ No deals found.
|
|
|
20877
20915
|
${deals.length} deal(s)
|
|
20878
20916
|
`));
|
|
20879
20917
|
});
|
|
20880
|
-
dealsCmd.command("add").description("Add a new deal").option("--title <title>", "Deal title (required)").option("--stage <stage>", "Stage:
|
|
20918
|
+
dealsCmd.command("add").description("Add a new deal").option("--title <title>", "Deal title (required)").option("--stage <stage>", "Stage: lead|qualified|proposal|negotiation|won|lost|cancelled", "lead").option("--value <usd>", "Value in USD").option("--contact <id>", "Contact ID").option("--company <id>", "Company ID").option("--close-date <date>", "Expected close date (YYYY-MM-DD)").option("--notes <text>", "Notes").action(async (opts) => {
|
|
20881
20919
|
const store = getStore();
|
|
20882
20920
|
let title = opts.title;
|
|
20883
20921
|
if (!title) {
|
|
@@ -20887,6 +20925,11 @@ ${deals.length} deal(s)
|
|
|
20887
20925
|
process.exit(1);
|
|
20888
20926
|
}
|
|
20889
20927
|
}
|
|
20928
|
+
const validStages = ["lead", "qualified", "proposal", "negotiation", "won", "lost", "cancelled"];
|
|
20929
|
+
if (opts.stage && !validStages.includes(opts.stage)) {
|
|
20930
|
+
console.error(chalk3.red(`Invalid stage '${opts.stage}'. Valid stages: ${validStages.join(", ")}`));
|
|
20931
|
+
process.exit(1);
|
|
20932
|
+
}
|
|
20890
20933
|
const deal = await store.createDeal({
|
|
20891
20934
|
title,
|
|
20892
20935
|
stage: opts.stage,
|