Fix on promo codes metadata
moved type attribute to array Change-Id: I2760ed10dcf5813caa813f262c31162439b12372
This commit is contained in:
parent
537eada594
commit
da4ff5a429
@ -142,7 +142,7 @@ class MemberSummitRegistrationPromoCode extends SummitRegistrationPromoCode
|
|||||||
'first_name' => 'string',
|
'first_name' => 'string',
|
||||||
'last_name' => 'string',
|
'last_name' => 'string',
|
||||||
'email' => 'string',
|
'email' => 'string',
|
||||||
'type' => "enum(VIP,ATC,MEDIA ANALYST,SPONSOR)",
|
'type' => ['VIP','ATC','MEDIA ANALYST','SPONSOR'],
|
||||||
'owner_id' => 'integer'
|
'owner_id' => 'integer'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -101,6 +101,7 @@ class SpeakerSummitRegistrationPromoCode extends SummitRegistrationPromoCode
|
|||||||
|
|
||||||
public static $metadata = [
|
public static $metadata = [
|
||||||
'class_name' => self::ClassName,
|
'class_name' => self::ClassName,
|
||||||
|
'type' => ["ACCEPTED", "ALTERNATE"],
|
||||||
'speaker_id' => 'integer'
|
'speaker_id' => 'integer'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ class SummitRegistrationPromoCode extends SilverstripeBaseModel
|
|||||||
'code' => 'string',
|
'code' => 'string',
|
||||||
'email_sent' => 'boolean',
|
'email_sent' => 'boolean',
|
||||||
'redeemed' => 'boolean',
|
'redeemed' => 'boolean',
|
||||||
'source' => "enum(CSV,ADMIN)",
|
'source' => ['CSV','ADMIN'],
|
||||||
'summit_id' => 'integer',
|
'summit_id' => 'integer',
|
||||||
'creator_id' => 'integer',
|
'creator_id' => 'integer',
|
||||||
];
|
];
|
||||||
|
@ -187,7 +187,7 @@ final class OAuth2PromoCodesApiTest extends ProtectedApiTest
|
|||||||
|
|
||||||
$response = $this->action(
|
$response = $this->action(
|
||||||
"GET",
|
"GET",
|
||||||
"OAuth2SummitPromoCodesApiController@addPromoCodeBySummit",
|
"OAuth2SummitPromoCodesApiController@getMetadata",
|
||||||
$params,
|
$params,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -197,8 +197,8 @@ final class OAuth2PromoCodesApiTest extends ProtectedApiTest
|
|||||||
|
|
||||||
$content = $response->getContent();
|
$content = $response->getContent();
|
||||||
$this->assertResponseStatus(200);
|
$this->assertResponseStatus(200);
|
||||||
$promo_code = json_decode($content);
|
$metadata = json_decode($content);
|
||||||
$this->assertTrue(!is_null($promo_code));
|
$this->assertTrue(!is_null($metadata));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAddPromoCode($code = "12344KG_SPEAKER"){
|
public function testAddPromoCode($code = "12344KG_SPEAKER"){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user