need4deed-sdk 0.0.125 → 0.0.127

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.
@@ -3,7 +3,7 @@ import { ApiComment } from "./comment";
3
3
  import { OptionById } from "./common";
4
4
  import { ApiLanguage } from "./language";
5
5
  import { OptionItem } from "./option";
6
- import { ApiPersonGet } from "./person";
6
+ import { ApiPersonGet, ApiPersonPatch } from "./person";
7
7
  export declare enum AgentType {
8
8
  AE = "AE",
9
9
  GU1 = "GU1",
@@ -70,7 +70,10 @@ export interface AgentDetails {
70
70
  export interface ApiRepresentativeGet extends ApiPersonGet {
71
71
  role: AgentRoleType;
72
72
  }
73
- export type ApiRepresentativePatch = VoidableProps<ApiRepresentativeGet>;
73
+ export type ApiRepresentativePatch = ApiPersonPatch & {
74
+ role?: AgentRoleType;
75
+ agentId?: number;
76
+ };
74
77
  interface AgentGetList {
75
78
  id: number;
76
79
  title: string;
@@ -108,7 +108,41 @@ export interface OpportunityLegacyFormDataProps {
108
108
  language: `${Lang}`;
109
109
  }
110
110
  export type OpportunityLegacyFormData = VoidableUndefined<OpportunityLegacyFormDataProps>;
111
- export type OpportunityFormDataWithAgentSubmitter = VoidableUndefined<Omit<OpportunityLegacyFormDataProps, "rac_email" | "rac_full_name" | "rac_phone" | "rac_address" | "rac_plz">>;
111
+ /**
112
+ * Body for `POST /opportunity` — the dashboard's typed create-opportunity
113
+ * form. Unlike `OpportunityLegacyFormData` (free-text/ISO-code strings from
114
+ * the public form, resolved by title lookup), activities/skills/languages/
115
+ * districts here are numeric option ids from `GET /option/*`, resolved by id.
116
+ * Deliberately not derived from `OpportunityLegacyFormDataProps`: the two
117
+ * shapes look similar but mean different things, and overloading one type for
118
+ * both invites exactly the id-vs-title mismatch this type exists to prevent.
119
+ */
120
+ export interface OpportunityCreateFormDataProps {
121
+ title: string;
122
+ agent_id?: number;
123
+ submitted_by_id?: number;
124
+ opportunity_type: OpportunityLegacyType;
125
+ accomp_address?: string;
126
+ accomp_postcode?: string;
127
+ accomp_datetime?: string;
128
+ accomp_name?: string;
129
+ accomp_phone?: string;
130
+ accomp_information?: string;
131
+ accomp_translation?: `${TranslatedIntoType}`;
132
+ districtIds?: number[];
133
+ languageIds: number[];
134
+ activityIds: number[];
135
+ skillIds: number[];
136
+ timeslots?: [number, string][];
137
+ onetime_date_time?: string;
138
+ volunteers_number: number;
139
+ vo_information?: string;
140
+ category: string;
141
+ category_id: OptionId;
142
+ last_edited_time_notion?: string;
143
+ language: `${Lang}`;
144
+ }
145
+ export type OpportunityFormDataWithAgentSubmitter = VoidableUndefined<OpportunityCreateFormDataProps>;
112
146
  export interface ApiOpportunityAgent {
113
147
  id: number;
114
148
  type: AgentType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "need4deed-sdk",
3
- "version": "0.0.125",
3
+ "version": "0.0.127",
4
4
  "description": "Need4Deed.org SDK",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",