@chatarmin/os 1.21.0 → 1.23.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/companies/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EACV,eAAe,EAkBhB,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/companies/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EACV,eAAe,EAkBhB,MAAM,YAAY,CAAA;AAsCnB,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAA;AAC/D,KAAK,OAAO,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAA;AAE7E,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,OAAO,GACZ,eAAe,CAgJjB"}
|
package/dist/companies/client.js
CHANGED
|
@@ -27,5 +27,7 @@ export function createCompaniesClient(client, call) {
|
|
|
27
27
|
linkStripeCustomer: (input) => call('companies.linkStripeCustomer', () => client.companies.linkStripeCustomerForStaff.mutate(input)),
|
|
28
28
|
onboardingPlan: (input) => call('companies.onboardingPlan', () => client.companies.getOnboardingPlanForStaff.query(input)),
|
|
29
29
|
approveOnboardingPlan: (input) => call('companies.approveOnboardingPlan', () => client.companies.approveOnboardingPlanForStaff.mutate(input)),
|
|
30
|
+
createOnboardingPlanPrice: (input) => call('companies.createOnboardingPlanPrice', () => client.companies.createOnboardingPlanPriceForStaff.mutate(input)),
|
|
31
|
+
answerOnboardingPlanQuestion: (input) => call('companies.answerOnboardingPlanQuestion', () => client.companies.answerOnboardingPlanQuestionForStaff.mutate(input)),
|
|
30
32
|
};
|
|
31
33
|
}
|
|
@@ -21,6 +21,20 @@ export interface OnboardingPlanItem {
|
|
|
21
21
|
export interface OnboardingPlanOpenQuestion {
|
|
22
22
|
code: string;
|
|
23
23
|
message: string;
|
|
24
|
+
/** `USAGE_PRICE_MISSING`: the price OS can create (`createOnboardingPlanPrice`). */
|
|
25
|
+
price?: {
|
|
26
|
+
featureCode: string;
|
|
27
|
+
productCode: string;
|
|
28
|
+
amountCents: number;
|
|
29
|
+
perUnits: number;
|
|
30
|
+
currency: string | null;
|
|
31
|
+
};
|
|
32
|
+
/** `USAGE_PRICE_UNCLEAR`: the usage price that is 0 (`zero`) or empty (`missing`) in the deal. */
|
|
33
|
+
usage?: {
|
|
34
|
+
featureCode: string;
|
|
35
|
+
productCode: string;
|
|
36
|
+
state: 'zero' | 'missing';
|
|
37
|
+
};
|
|
24
38
|
}
|
|
25
39
|
export interface OnboardingPlan {
|
|
26
40
|
id: string;
|
|
@@ -33,8 +47,17 @@ export interface OnboardingPlan {
|
|
|
33
47
|
} | null;
|
|
34
48
|
products: string[];
|
|
35
49
|
items: OnboardingPlanItem[];
|
|
36
|
-
/** `yyyy-MM-dd
|
|
50
|
+
/** Billing start `yyyy-MM-dd` (`startDateOverride` when set); null when unknown (then an open question). */
|
|
37
51
|
startDate: string | null;
|
|
52
|
+
/**
|
|
53
|
+
* The billing start staff chose (`answerOnboardingPlanQuestion`), kept in OS only: the CRM keeps
|
|
54
|
+
* the contract date. `at` is ISO.
|
|
55
|
+
*/
|
|
56
|
+
startDateOverride: {
|
|
57
|
+
date: string;
|
|
58
|
+
byUserId: string | null;
|
|
59
|
+
at: string;
|
|
60
|
+
} | null;
|
|
38
61
|
/** Any open question blocks approval; fix the deal in the CRM and the plan rebuilds. */
|
|
39
62
|
openQuestions: OnboardingPlanOpenQuestion[];
|
|
40
63
|
/** Approve exactly this revision. */
|
|
@@ -69,6 +92,40 @@ export interface ApproveOnboardingPlanResult {
|
|
|
69
92
|
/** True when the payment-method invite went out; false in shadow mode. */
|
|
70
93
|
sent: boolean;
|
|
71
94
|
}
|
|
95
|
+
export interface CreateOnboardingPlanPriceInput {
|
|
96
|
+
planId: string;
|
|
97
|
+
/** The revision that was reviewed; 409 when the plan changed since. */
|
|
98
|
+
revision: string;
|
|
99
|
+
/** The `USAGE_PRICE_MISSING` question's `price.featureCode` and `price.productCode`. */
|
|
100
|
+
featureCode: string;
|
|
101
|
+
productCode: string;
|
|
102
|
+
/** Login email of the OS member who confirmed (403 otherwise). */
|
|
103
|
+
actorEmail: string;
|
|
104
|
+
}
|
|
105
|
+
export interface CreateOnboardingPlanPriceResult {
|
|
106
|
+
price: {
|
|
107
|
+
catalogPriceId: string;
|
|
108
|
+
created: boolean;
|
|
109
|
+
catalogProductName: string;
|
|
110
|
+
};
|
|
111
|
+
/** The rebuilt plan (the question is gone). */
|
|
112
|
+
plan: OnboardingPlan | null;
|
|
113
|
+
}
|
|
114
|
+
export interface AnswerOnboardingPlanQuestionInput {
|
|
115
|
+
planId: string;
|
|
116
|
+
/** The revision that was reviewed; 409 when the plan changed since. */
|
|
117
|
+
revision: string;
|
|
118
|
+
/** The open start-date question answered. */
|
|
119
|
+
code: 'START_DATE_PAST' | 'START_DATE_MISSING';
|
|
120
|
+
/** Billing start `yyyy-MM-dd`, today or later in the organization's time zone (422 otherwise). */
|
|
121
|
+
startDate: string;
|
|
122
|
+
/** Login email of the OS member who chose the date (403 otherwise). */
|
|
123
|
+
actorEmail: string;
|
|
124
|
+
}
|
|
125
|
+
export interface AnswerOnboardingPlanQuestionResult {
|
|
126
|
+
/** The rebuilt plan (its `startDate` is the chosen date, the question is gone). */
|
|
127
|
+
plan: OnboardingPlan | null;
|
|
128
|
+
}
|
|
72
129
|
export interface CompaniesOnboardingPlanClient {
|
|
73
130
|
/** The client's billing plan from its won deal (newest), or null. */
|
|
74
131
|
onboardingPlan: (input: OnboardingPlanInput) => Promise<OnboardingPlanResult>;
|
|
@@ -77,5 +134,18 @@ export interface CompaniesOnboardingPlanClient {
|
|
|
77
134
|
* 422 = open questions. Recorded for `actorEmail`.
|
|
78
135
|
*/
|
|
79
136
|
approveOnboardingPlan: (input: ApproveOnboardingPlanInput) => Promise<ApproveOnboardingPlanResult>;
|
|
137
|
+
/**
|
|
138
|
+
* Creates the usage price a draft plan's `USAGE_PRICE_MISSING` question asks for, as a copy of
|
|
139
|
+
* the feature's default price (same product and meter); the plan rebuilds. Ask staff first.
|
|
140
|
+
* 404 = no such question, 409 = changed or not a draft, 422 = cannot be copied (create it in OS).
|
|
141
|
+
*/
|
|
142
|
+
createOnboardingPlanPrice: (input: CreateOnboardingPlanPriceInput) => Promise<CreateOnboardingPlanPriceResult>;
|
|
143
|
+
/**
|
|
144
|
+
* Answers a draft plan's `START_DATE_PAST` / `START_DATE_MISSING` question with the date billing
|
|
145
|
+
* should start. Stored in OS only (the CRM keeps the contract date) and kept when the plan
|
|
146
|
+
* rebuilds; the plan rebuilds now. Ask staff first. 404 = plan or open question not found,
|
|
147
|
+
* 403 = non-member, 409 = changed or not a draft, 422 = date in the past. Audited.
|
|
148
|
+
*/
|
|
149
|
+
answerOnboardingPlanQuestion: (input: AnswerOnboardingPlanQuestionInput) => Promise<AnswerOnboardingPlanQuestionResult>;
|
|
80
150
|
}
|
|
81
151
|
//# sourceMappingURL=onboarding-plan-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding-plan-types.d.ts","sourceRoot":"","sources":["../../src/companies/onboarding-plan-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAE9D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