ad2app-lib 1.47.0 → 1.50.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.
@@ -0,0 +1,479 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.UpdateSettlementFormDto = exports.CreateAgencyMilestoneDto = exports.ConfirmMaterialUploadDto = exports.PrepareMaterialUploadDto = exports.MATERIAL_CONTENT_TYPE = exports.MATERIAL_IMAGE_TYPES = exports.MATERIAL_MAX_BYTES = exports.JoinCampaignDto = exports.CampaignMaterialActDto = exports.CampaignOfferActDto = exports.SendCampaignOfferDto = exports.InviteCampaignCreatorDto = exports.UpdateAgencyCampaignDto = exports.CreateAgencyCampaignDto = exports.AGENCY_CAMPAIGN_CODES = exports.AGENCY_CAMPAIGN_EVENT_KINDS = exports.AGENCY_MILESTONE_MEDIA_RULES = exports.AGENCY_MILESTONE_OFFER_RULES = exports.AGENCY_MILESTONE_KINDS = exports.AGENCY_CAMPAIGN_STEPS = exports.AGENCY_MATERIAL_ACTIONS = exports.AGENCY_OFFER_ACTIONS = exports.AGENCY_OFFER_STATUSES = exports.AGENCY_CAMPAIGN_MEMBER_STATES = exports.AGENCY_CAMPAIGN_KINDS = exports.SETTLEMENT_FORMS = exports.isCampaignPlacement = exports.CAMPAIGN_PLATFORMS = exports.CAMPAIGN_PLACEMENTS = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const I_Media_1 = require("./I_Media");
15
+ const I_Offer_1 = require("./I_Offer");
16
+ const agency_1 = require("./agency");
17
+ const agency_pots_1 = require("./agency-pots");
18
+ /**
19
+ * The campaign loop (spec 175 US7) — an organization runs a campaign with the
20
+ * creators on its roster or in the directory.
21
+ *
22
+ * Two steps, never one (Jan, 2026-09-28):
23
+ *
24
+ * 1. MEMBERSHIP — the agency invites a creator; the creator joins or
25
+ * declines. Joining answers any access request folded into the
26
+ * invitation. No money is named here.
27
+ * 2. OFFER — once joined, the agency sends a rate. It is countered, accepted,
28
+ * confirmed or rejected; a creator who leaves withdraws it.
29
+ *
30
+ * The server owns every transition. Each view carries `availableActions`, and
31
+ * a screen renders exactly those acts — it never derives them from a status,
32
+ * so the two can never disagree.
33
+ *
34
+ * See specs/speckit/175-agency-roster/contracts/agency-api.md → US7.
35
+ */
36
+ // ── The ONE placements list (FR-025) ────────────────────────────────────────
37
+ /**
38
+ * What a deliverable may be, per platform. A named list in one place, so a
39
+ * "placement" can never be free text that drifts per campaign.
40
+ */
41
+ exports.CAMPAIGN_PLACEMENTS = {
42
+ instagram: ['reel', 'post', 'carousel', 'stories', 'collab_post'],
43
+ tiktok: ['video', 'repost', 'duet', 'stories'],
44
+ youtube: ['video', 'short', 'integration', 'community_post'],
45
+ facebook: ['post', 'reel', 'stories'],
46
+ linkedin: ['post', 'article'],
47
+ };
48
+ exports.CAMPAIGN_PLATFORMS = Object.keys(exports.CAMPAIGN_PLACEMENTS);
49
+ const isCampaignPlacement = (platform, placement) => Object.prototype.hasOwnProperty.call(exports.CAMPAIGN_PLACEMENTS, platform) &&
50
+ exports.CAMPAIGN_PLACEMENTS[platform].includes(placement);
51
+ exports.isCampaignPlacement = isCampaignPlacement;
52
+ // ── The settlement form (FR-027) ─────────────────────────────────────────────
53
+ /** The creator's own setting. The agency reads it and can never set it. */
54
+ exports.SETTLEMENT_FORMS = ['invoice', 'contract', 'barter'];
55
+ // ── States ───────────────────────────────────────────────────────────────────
56
+ /**
57
+ * An offer campaign negotiates one price per creator (US7); a pot campaign pays
58
+ * from one pot on each creator's own terms (US9). Chosen at creation, fixed once
59
+ * the first creator is invited (FR-030).
60
+ */
61
+ exports.AGENCY_CAMPAIGN_KINDS = ['offer', 'pot'];
62
+ exports.AGENCY_CAMPAIGN_MEMBER_STATES = ['invited', 'joined', 'declined', 'left', 'removed'];
63
+ /** The offer statuses the agency loop writes. `draft`, `deleted` and `alternativeSuggested` are legacy-only. */
64
+ exports.AGENCY_OFFER_STATUSES = [
65
+ I_Offer_1.I_OfferStatus.SENT,
66
+ I_Offer_1.I_OfferStatus.INFLUENCER_NEGOTIATED,
67
+ I_Offer_1.I_OfferStatus.AGENCY_NEGOTIATED,
68
+ I_Offer_1.I_OfferStatus.ACCEPTED,
69
+ I_Offer_1.I_OfferStatus.CONFIRMED,
70
+ I_Offer_1.I_OfferStatus.REJECTED,
71
+ I_Offer_1.I_OfferStatus.WITHDRAWN,
72
+ ];
73
+ /**
74
+ * Every act on an offer, by either side. Which of them a given caller may take
75
+ * right now is the server's `availableActions`, never a client guess.
76
+ *
77
+ * agency: counter · confirm · reject
78
+ * creator: accept · counter · reject
79
+ */
80
+ exports.AGENCY_OFFER_ACTIONS = ['accept', 'counter', 'confirm', 'reject'];
81
+ /** The agency's acts on the latest material; the creator's only act is to upload. */
82
+ exports.AGENCY_MATERIAL_ACTIONS = ['approve', 'request_changes', 'reject'];
83
+ /**
84
+ * The board's columns, in order (FR-024). A creator stands in exactly one.
85
+ * `declined`, `left`, `removed` and `rejected` are OFF the board: those rows
86
+ * stay in the list with their date (US7 scenario 9), never in a column.
87
+ */
88
+ exports.AGENCY_CAMPAIGN_STEPS = [
89
+ 'invited',
90
+ 'joined',
91
+ 'offer_sent',
92
+ 'negotiating',
93
+ 'confirmed',
94
+ 'material_in',
95
+ 'approved',
96
+ 'published',
97
+ ];
98
+ exports.AGENCY_MILESTONE_KINDS = ['draft_due', 'live_by', 'custom'];
99
+ /** A milestone may wait on one rule: every ACTIVE offer at a status, or every active creator's latest material at a stage. */
100
+ exports.AGENCY_MILESTONE_OFFER_RULES = [I_Offer_1.I_OfferStatus.CONFIRMED];
101
+ exports.AGENCY_MILESTONE_MEDIA_RULES = [I_Media_1.I_MediaStage.UPLOADED, I_Media_1.I_MediaStage.ACCEPTED];
102
+ exports.AGENCY_CAMPAIGN_EVENT_KINDS = [
103
+ 'invited',
104
+ 'joined',
105
+ 'declined',
106
+ 'left',
107
+ 'removed',
108
+ 'offer_sent',
109
+ 'offer_countered',
110
+ 'offer_accepted',
111
+ 'offer_confirmed',
112
+ 'offer_rejected',
113
+ 'offer_withdrawn',
114
+ 'material_uploaded',
115
+ 'material_approved',
116
+ 'material_changes_asked',
117
+ 'material_rejected',
118
+ 'published',
119
+ 'milestone_confirmed',
120
+ // US9: the pot. Every money act carries its amount (FR-021, FR-033).
121
+ 'pot_applied',
122
+ 'pot_application_withdrawn',
123
+ 'pot_accepted',
124
+ 'pot_declined',
125
+ 'pot_released',
126
+ 'pot_refilled',
127
+ 'pot_moved',
128
+ 'pot_deadline_moved',
129
+ 'pot_publish_time_set',
130
+ 'pot_publish_time_confirmed',
131
+ /** Zernio refused the post at scheduling; `note` carries its reason. */
132
+ 'pot_publish_refused',
133
+ 'pot_published',
134
+ 'pot_counted',
135
+ 'pot_frozen',
136
+ 'pot_bonus_held',
137
+ 'pot_bonus_approved',
138
+ 'pot_bonus_capped',
139
+ 'pot_bonus_message',
140
+ 'pot_kept',
141
+ 'pot_broken',
142
+ 'pot_removal_decided',
143
+ 'caption_edited',
144
+ 'file_uploaded',
145
+ 'file_removed',
146
+ ];
147
+ /** Refusal codes the frontend owes its own copy for. */
148
+ exports.AGENCY_CAMPAIGN_CODES = {
149
+ /** The transition is not open at this state, or not for this side. */
150
+ TRANSITION_REFUSED: 'agency-campaign-transition-refused',
151
+ /** A campaign sent to a creator must carry its brief text (FR-025). */
152
+ BRIEF_REQUIRED: 'agency-campaign-brief-required',
153
+ /** A deliverable on a platform the creator has not connected (FR-025). */
154
+ PLATFORM_NOT_CONNECTED: 'agency-campaign-platform-not-connected',
155
+ /** The creator is already on this campaign. */
156
+ ALREADY_MEMBER: 'agency-campaign-already-member',
157
+ /** The upload was confirmed but no stored file exists at its path (FR-029). */
158
+ MATERIAL_NOT_STORED: 'agency-campaign-material-not-stored',
159
+ /** A demo creator cannot be invited or mailed (spec 179). */
160
+ DEMO_CREATOR: 'agency-campaign-demo-creator',
161
+ };
162
+ // ── Bodies ───────────────────────────────────────────────────────────────────
163
+ //
164
+ // Flat on purpose: nested bodies need class-transformer's `@Type`, and a
165
+ // linked lib carries its own copy whose metadata the backend's ValidationPipe
166
+ // never reads. `deliverables` is an array of plain objects checked item by
167
+ // item in the service against CAMPAIGN_PLACEMENTS — the pair is the rule.
168
+ /** The brief's fields, shared by create and update. All optional on the wire. The pot's fields ride along (US9). */
169
+ class AgencyCampaignBriefFields extends agency_pots_1.PotFields {
170
+ assignBrief(data) {
171
+ this.assignPot(data);
172
+ this.text = data?.text;
173
+ this.deliverables = data?.deliverables;
174
+ this.draftDueAt = data?.draftDueAt;
175
+ this.liveByAt = data?.liveByAt;
176
+ this.licenceMonths = data?.licenceMonths;
177
+ this.paidPromoMonths = data?.paidPromoMonths;
178
+ this.revisionRounds = data?.revisionRounds;
179
+ }
180
+ }
181
+ __decorate([
182
+ (0, class_validator_1.IsOptional)(),
183
+ (0, class_validator_1.IsString)(),
184
+ (0, class_validator_1.MaxLength)(10000),
185
+ __metadata("design:type", String)
186
+ ], AgencyCampaignBriefFields.prototype, "text", void 0);
187
+ __decorate([
188
+ (0, class_validator_1.IsOptional)(),
189
+ (0, class_validator_1.IsArray)(),
190
+ (0, class_validator_1.ArrayMaxSize)(30),
191
+ __metadata("design:type", Array)
192
+ ], AgencyCampaignBriefFields.prototype, "deliverables", void 0);
193
+ __decorate([
194
+ (0, class_validator_1.IsOptional)(),
195
+ (0, class_validator_1.IsDateString)(),
196
+ __metadata("design:type", String)
197
+ ], AgencyCampaignBriefFields.prototype, "draftDueAt", void 0);
198
+ __decorate([
199
+ (0, class_validator_1.IsOptional)(),
200
+ (0, class_validator_1.IsDateString)(),
201
+ __metadata("design:type", String)
202
+ ], AgencyCampaignBriefFields.prototype, "liveByAt", void 0);
203
+ __decorate([
204
+ (0, class_validator_1.IsOptional)(),
205
+ (0, class_validator_1.IsInt)(),
206
+ (0, class_validator_1.Min)(0),
207
+ (0, class_validator_1.Max)(120),
208
+ __metadata("design:type", Number)
209
+ ], AgencyCampaignBriefFields.prototype, "licenceMonths", void 0);
210
+ __decorate([
211
+ (0, class_validator_1.IsOptional)(),
212
+ (0, class_validator_1.IsInt)(),
213
+ (0, class_validator_1.Min)(0),
214
+ (0, class_validator_1.Max)(120),
215
+ __metadata("design:type", Number)
216
+ ], AgencyCampaignBriefFields.prototype, "paidPromoMonths", void 0);
217
+ __decorate([
218
+ (0, class_validator_1.IsOptional)(),
219
+ (0, class_validator_1.IsInt)(),
220
+ (0, class_validator_1.Min)(0),
221
+ (0, class_validator_1.Max)(20),
222
+ __metadata("design:type", Number)
223
+ ], AgencyCampaignBriefFields.prototype, "revisionRounds", void 0);
224
+ class CreateAgencyCampaignDto extends AgencyCampaignBriefFields {
225
+ constructor(data) {
226
+ super();
227
+ this.name = data?.name ?? '';
228
+ this.kind = data?.kind;
229
+ this.assignBrief(data);
230
+ }
231
+ }
232
+ exports.CreateAgencyCampaignDto = CreateAgencyCampaignDto;
233
+ __decorate([
234
+ (0, class_validator_1.IsString)(),
235
+ (0, class_validator_1.IsNotEmpty)(),
236
+ (0, class_validator_1.MaxLength)(128),
237
+ __metadata("design:type", String)
238
+ ], CreateAgencyCampaignDto.prototype, "name", void 0);
239
+ __decorate([
240
+ (0, class_validator_1.IsOptional)(),
241
+ (0, class_validator_1.IsIn)(exports.AGENCY_CAMPAIGN_KINDS),
242
+ __metadata("design:type", String)
243
+ ], CreateAgencyCampaignDto.prototype, "kind", void 0);
244
+ class UpdateAgencyCampaignDto extends AgencyCampaignBriefFields {
245
+ constructor(data) {
246
+ super();
247
+ this.name = data?.name;
248
+ this.isDraft = data?.isDraft;
249
+ this.kind = data?.kind;
250
+ this.assignBrief(data);
251
+ }
252
+ }
253
+ exports.UpdateAgencyCampaignDto = UpdateAgencyCampaignDto;
254
+ __decorate([
255
+ (0, class_validator_1.IsOptional)(),
256
+ (0, class_validator_1.IsString)(),
257
+ (0, class_validator_1.IsNotEmpty)(),
258
+ (0, class_validator_1.MaxLength)(128),
259
+ __metadata("design:type", String)
260
+ ], UpdateAgencyCampaignDto.prototype, "name", void 0);
261
+ __decorate([
262
+ (0, class_validator_1.IsOptional)(),
263
+ (0, class_validator_1.IsBoolean)(),
264
+ __metadata("design:type", Boolean)
265
+ ], UpdateAgencyCampaignDto.prototype, "isDraft", void 0);
266
+ __decorate([
267
+ (0, class_validator_1.IsOptional)(),
268
+ (0, class_validator_1.IsIn)(exports.AGENCY_CAMPAIGN_KINDS),
269
+ __metadata("design:type", String)
270
+ ], UpdateAgencyCampaignDto.prototype, "kind", void 0);
271
+ class InviteCampaignCreatorDto {
272
+ constructor(data) {
273
+ this.creatorUserId = data?.creatorUserId ?? '';
274
+ this.creatorBrief = data?.creatorBrief;
275
+ this.scopes = data?.scopes;
276
+ }
277
+ }
278
+ exports.InviteCampaignCreatorDto = InviteCampaignCreatorDto;
279
+ __decorate([
280
+ (0, class_validator_1.IsString)(),
281
+ (0, class_validator_1.Matches)(/^[A-Za-z0-9-]{1,128}$/),
282
+ __metadata("design:type", String)
283
+ ], InviteCampaignCreatorDto.prototype, "creatorUserId", void 0);
284
+ __decorate([
285
+ (0, class_validator_1.IsOptional)(),
286
+ (0, class_validator_1.IsString)(),
287
+ (0, class_validator_1.MaxLength)(5000),
288
+ __metadata("design:type", String)
289
+ ], InviteCampaignCreatorDto.prototype, "creatorBrief", void 0);
290
+ __decorate([
291
+ (0, class_validator_1.IsOptional)(),
292
+ (0, class_validator_1.IsArray)(),
293
+ (0, class_validator_1.IsIn)(agency_1.AGENCY_GRANT_SCOPES, { each: true }),
294
+ __metadata("design:type", Array)
295
+ ], InviteCampaignCreatorDto.prototype, "scopes", void 0);
296
+ class SendCampaignOfferDto {
297
+ constructor(data) {
298
+ this.priceMinor = data?.priceMinor ?? 0;
299
+ this.currency = data?.currency ?? 'PLN';
300
+ }
301
+ }
302
+ exports.SendCampaignOfferDto = SendCampaignOfferDto;
303
+ __decorate([
304
+ (0, class_validator_1.IsInt)(),
305
+ (0, class_validator_1.Min)(0),
306
+ (0, class_validator_1.Max)(1000000000),
307
+ __metadata("design:type", Number)
308
+ ], SendCampaignOfferDto.prototype, "priceMinor", void 0);
309
+ __decorate([
310
+ (0, class_validator_1.IsString)(),
311
+ (0, class_validator_1.Matches)(/^[A-Z]{3}$/),
312
+ __metadata("design:type", String)
313
+ ], SendCampaignOfferDto.prototype, "currency", void 0);
314
+ /** One act on an offer. `counter` needs `priceMinor`; any act may carry a note. */
315
+ class CampaignOfferActDto {
316
+ constructor(data) {
317
+ this.action = data?.action ?? 'accept';
318
+ this.priceMinor = data?.priceMinor;
319
+ this.note = data?.note;
320
+ }
321
+ }
322
+ exports.CampaignOfferActDto = CampaignOfferActDto;
323
+ __decorate([
324
+ (0, class_validator_1.IsIn)(exports.AGENCY_OFFER_ACTIONS),
325
+ __metadata("design:type", String)
326
+ ], CampaignOfferActDto.prototype, "action", void 0);
327
+ __decorate([
328
+ (0, class_validator_1.IsOptional)(),
329
+ (0, class_validator_1.IsInt)(),
330
+ (0, class_validator_1.Min)(0),
331
+ (0, class_validator_1.Max)(1000000000),
332
+ __metadata("design:type", Number)
333
+ ], CampaignOfferActDto.prototype, "priceMinor", void 0);
334
+ __decorate([
335
+ (0, class_validator_1.IsOptional)(),
336
+ (0, class_validator_1.IsString)(),
337
+ (0, class_validator_1.MaxLength)(2000),
338
+ __metadata("design:type", String)
339
+ ], CampaignOfferActDto.prototype, "note", void 0);
340
+ /** One agency act on a material. `request_changes` requires the note. */
341
+ class CampaignMaterialActDto {
342
+ constructor(data) {
343
+ this.action = data?.action ?? 'approve';
344
+ this.note = data?.note;
345
+ }
346
+ }
347
+ exports.CampaignMaterialActDto = CampaignMaterialActDto;
348
+ __decorate([
349
+ (0, class_validator_1.IsIn)(exports.AGENCY_MATERIAL_ACTIONS),
350
+ __metadata("design:type", String)
351
+ ], CampaignMaterialActDto.prototype, "action", void 0);
352
+ __decorate([
353
+ (0, class_validator_1.IsOptional)(),
354
+ (0, class_validator_1.IsString)(),
355
+ (0, class_validator_1.MaxLength)(2000),
356
+ __metadata("design:type", String)
357
+ ], CampaignMaterialActDto.prototype, "note", void 0);
358
+ class JoinCampaignDto {
359
+ constructor(data) {
360
+ this.scopes = data?.scopes;
361
+ }
362
+ }
363
+ exports.JoinCampaignDto = JoinCampaignDto;
364
+ __decorate([
365
+ (0, class_validator_1.IsOptional)(),
366
+ (0, class_validator_1.IsArray)(),
367
+ (0, class_validator_1.IsIn)(agency_1.AGENCY_GRANT_SCOPES, { each: true }),
368
+ __metadata("design:type", Array)
369
+ ], JoinCampaignDto.prototype, "scopes", void 0);
370
+ /** Material files: images and video only, at most 2 GB. */
371
+ exports.MATERIAL_MAX_BYTES = 2 * 1024 * 1024 * 1024;
372
+ /**
373
+ * The photo formats a material may be. Raster only: no SVG or HTML, because a
374
+ * material is opened in the browser. Shared so the upload picker, the
375
+ * creator's own check and the API refuse exactly the same files.
376
+ */
377
+ exports.MATERIAL_IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/gif', 'image/webp', 'image/heic', 'image/heif', 'image/avif'];
378
+ /** A material's content type: one of MATERIAL_IMAGE_TYPES, or any video. */
379
+ exports.MATERIAL_CONTENT_TYPE = new RegExp(`^(${exports.MATERIAL_IMAGE_TYPES.map((type) => type.replace(/[/+.]/g, (c) => `\\${c}`)).join('|')}|video\\/[A-Za-z0-9.+-]+)$`);
380
+ class PrepareMaterialUploadDto {
381
+ constructor(data) {
382
+ this.fileName = data?.fileName ?? '';
383
+ this.contentType = data?.contentType ?? '';
384
+ this.sizeBytes = data?.sizeBytes ?? 0;
385
+ }
386
+ }
387
+ exports.PrepareMaterialUploadDto = PrepareMaterialUploadDto;
388
+ __decorate([
389
+ (0, class_validator_1.IsString)(),
390
+ (0, class_validator_1.IsNotEmpty)(),
391
+ (0, class_validator_1.MaxLength)(255),
392
+ __metadata("design:type", String)
393
+ ], PrepareMaterialUploadDto.prototype, "fileName", void 0);
394
+ __decorate([
395
+ (0, class_validator_1.IsString)()
396
+ /** Raster images and video (MATERIAL_CONTENT_TYPE). */
397
+ ,
398
+ (0, class_validator_1.Matches)(exports.MATERIAL_CONTENT_TYPE),
399
+ __metadata("design:type", String)
400
+ ], PrepareMaterialUploadDto.prototype, "contentType", void 0);
401
+ __decorate([
402
+ (0, class_validator_1.IsInt)(),
403
+ (0, class_validator_1.Min)(1),
404
+ (0, class_validator_1.Max)(exports.MATERIAL_MAX_BYTES),
405
+ __metadata("design:type", Number)
406
+ ], PrepareMaterialUploadDto.prototype, "sizeBytes", void 0);
407
+ class ConfirmMaterialUploadDto {
408
+ constructor(data) {
409
+ this.uploadId = data?.uploadId ?? '';
410
+ this.caption = data?.caption;
411
+ }
412
+ }
413
+ exports.ConfirmMaterialUploadDto = ConfirmMaterialUploadDto;
414
+ __decorate([
415
+ (0, class_validator_1.IsString)(),
416
+ (0, class_validator_1.IsNotEmpty)(),
417
+ (0, class_validator_1.MaxLength)(512),
418
+ __metadata("design:type", String)
419
+ ], ConfirmMaterialUploadDto.prototype, "uploadId", void 0);
420
+ __decorate([
421
+ (0, class_validator_1.IsOptional)(),
422
+ (0, class_validator_1.IsString)(),
423
+ (0, class_validator_1.MaxLength)(2200),
424
+ __metadata("design:type", String)
425
+ ], ConfirmMaterialUploadDto.prototype, "caption", void 0);
426
+ class CreateAgencyMilestoneDto {
427
+ constructor(data) {
428
+ this.kind = data?.kind ?? 'custom';
429
+ this.label = data?.label;
430
+ this.dueAt = data?.dueAt;
431
+ this.creatorUserId = data?.creatorUserId;
432
+ this.offerRule = data?.offerRule;
433
+ this.mediaRule = data?.mediaRule;
434
+ }
435
+ }
436
+ exports.CreateAgencyMilestoneDto = CreateAgencyMilestoneDto;
437
+ __decorate([
438
+ (0, class_validator_1.IsIn)(exports.AGENCY_MILESTONE_KINDS),
439
+ __metadata("design:type", String)
440
+ ], CreateAgencyMilestoneDto.prototype, "kind", void 0);
441
+ __decorate([
442
+ (0, class_validator_1.IsOptional)(),
443
+ (0, class_validator_1.IsString)(),
444
+ (0, class_validator_1.MaxLength)(256),
445
+ __metadata("design:type", String)
446
+ ], CreateAgencyMilestoneDto.prototype, "label", void 0);
447
+ __decorate([
448
+ (0, class_validator_1.IsOptional)(),
449
+ (0, class_validator_1.IsDateString)(),
450
+ __metadata("design:type", String)
451
+ ], CreateAgencyMilestoneDto.prototype, "dueAt", void 0);
452
+ __decorate([
453
+ (0, class_validator_1.IsOptional)(),
454
+ (0, class_validator_1.IsString)(),
455
+ (0, class_validator_1.Matches)(/^[A-Za-z0-9-]{1,128}$/),
456
+ __metadata("design:type", String)
457
+ ], CreateAgencyMilestoneDto.prototype, "creatorUserId", void 0);
458
+ __decorate([
459
+ (0, class_validator_1.IsOptional)(),
460
+ (0, class_validator_1.IsIn)(exports.AGENCY_MILESTONE_OFFER_RULES),
461
+ __metadata("design:type", Object)
462
+ ], CreateAgencyMilestoneDto.prototype, "offerRule", void 0);
463
+ __decorate([
464
+ (0, class_validator_1.IsOptional)(),
465
+ (0, class_validator_1.IsIn)(exports.AGENCY_MILESTONE_MEDIA_RULES),
466
+ __metadata("design:type", Object)
467
+ ], CreateAgencyMilestoneDto.prototype, "mediaRule", void 0);
468
+ /** `PATCH /users/me/settlement-form` — the creator's own setting (FR-027). */
469
+ class UpdateSettlementFormDto {
470
+ constructor(data) {
471
+ this.settlementForm = data?.settlementForm ?? null;
472
+ }
473
+ }
474
+ exports.UpdateSettlementFormDto = UpdateSettlementFormDto;
475
+ __decorate([
476
+ (0, class_validator_1.IsOptional)(),
477
+ (0, class_validator_1.IsIn)(exports.SETTLEMENT_FORMS),
478
+ __metadata("design:type", String)
479
+ ], UpdateSettlementFormDto.prototype, "settlementForm", void 0);