Skip to content

Commit a207e9c

Browse files
fix: affiliate code validate (#84)
1 parent c6fd154 commit a207e9c

3 files changed

Lines changed: 31 additions & 2 deletions

File tree

src/api/affiliate/content-types/affiliate/lifecycles.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ const hasOwn = (obj: object, key: string) =>
5050
const trimAndLower = (value?: string | null) =>
5151
value ? value.trim().toLowerCase() : value;
5252

53+
const trimAndUpper = (value?: string | null) =>
54+
value ? value.trim().toUpperCase() : value;
55+
5356
function parseNumber(
5457
value: unknown,
5558
field: string,
@@ -145,7 +148,7 @@ export default {
145148
const data = event.params.data ?? {};
146149

147150
if (data.code) {
148-
const normalized = trimAndLower(String(data.code));
151+
const normalized = trimAndUpper(String(data.code));
149152
if (!normalized || !CODE_REGEX.test(normalized)) {
150153
throw new errors.ValidationError(
151154
codeErrorMsg

src/extensions/documentation/documentation/1.0.0/full_documentation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"name": "Apache 2.0",
1515
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
1616
},
17-
"x-generation-date": "2026-01-27T08:35:18.456Z"
17+
"x-generation-date": "2026-02-04T15:36:58.456Z"
1818
},
1919
"x-strapi-config": {
2020
"path": "/documentation",

src/gen/types.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,19 @@ export interface components {
958958
walletAddress: string;
959959
signedMessage?: string;
960960
enabled: boolean;
961+
/** Format: float */
962+
rewardAmount?: number;
963+
/** Format: float */
964+
triggerVolume?: number;
965+
timeCapDays?: number;
966+
/** Format: float */
967+
volumeCap?: number;
968+
/** Format: float */
969+
revenueSplitAffiliatePct?: number;
970+
/** Format: float */
971+
revenueSplitTraderPct?: number;
972+
/** Format: float */
973+
revenueSplitDaoPct?: number;
961974
};
962975
};
963976
AffiliateListResponseDataItem: {
@@ -980,6 +993,19 @@ export interface components {
980993
walletAddress: string;
981994
signedMessage?: string;
982995
enabled: boolean;
996+
/** Format: float */
997+
rewardAmount?: number;
998+
/** Format: float */
999+
triggerVolume?: number;
1000+
timeCapDays?: number;
1001+
/** Format: float */
1002+
volumeCap?: number;
1003+
/** Format: float */
1004+
revenueSplitAffiliatePct?: number;
1005+
/** Format: float */
1006+
revenueSplitTraderPct?: number;
1007+
/** Format: float */
1008+
revenueSplitDaoPct?: number;
9831009
/** Format: date-time */
9841010
createdAt?: string;
9851011
/** Format: date-time */

0 commit comments

Comments
 (0)