superlikers_core 0.3.0
superlikers_core: ^0.3.0 copied to clipboard
Servicios, entidades, repositorios y datasources compartidos entre las apps Flutter de Superlikers (mismo backend/ambientes, distinta campaign/apiKey por cliente).
0.3.0 #
- Add coupon services to
PrizeRepository/PrizesDatasource:redeemCoupon({couponId, distinctId})—POST /coupons/{id}/create, generates a coupon redemption and returnsCouponRedeemResult(the redeemedcouponas aReward, theredemptiondetails, and the redemptionmessage). The redemption code to hand off isCouponRedeemResult.code.getCouponInfo({code})—GET /coupons/info?campaign=...&code=...(withAuthorization: Bearer <apiKey>), returnsCouponInfowith the current state of a previously redeemed coupon.- New entities
CouponRedeemResult,CouponRedemption,CouponInfo. Non-breaking (purely additive).
0.2.0 #
-
Breaking:
ParticipantPublicInfo(returned bygetParticipantPublicInfo, the/microsite/participants/infoendpoint) no longer hardcodes campaign-specific fields (name,lastName,cellphoneNumber,idEmployed,region,tienda,plaza,nombreTienda,terms,rol,cargo,nivel,fcmToken,autorizationNumber,isPublisher). Real payloads from different campaigns showed this endpoint's schema varies as much aslogin/register's — some campaigns don't sendnombres/apellidos/id_empleadoat all (usingnombre_completo/numero_de_documentoinstead, ornamewith a completely different extra-fields set), which crashed parsing (nullinto a non-nullableString). Only fields confirmed stable across every observed campaign stay typed (uid,uidType,email,points,totalPoints,coins,totalCoins,state,badEmail,emailVerified,cellphoneVerified,unconfirmedEmail,unconfirmedCellphone,avatar,lastActivityAt,tags); everything else now lands in a newproperties: Map<String, dynamic>bag, same pattern already used byParticipant. -
FieldEntityField/FieldEntityModel(external form field definitions, returned by/external_forms/actions/fields_info) gain apropertiesbag too.format/choicesstay typed since they're common and useful, but afield_typenot seen yet could bring its own extra metadata key beyond those two — it now lands inpropertiesinstead of being silently dropped. Non-breaking (purely additive). -
Add
ExternalRepository.getExternalFormFieldByCategory({token, category}): a convenience that composesgetExternalFormListByCategory(to resolvecategory->external_action_id)getExternalFormFieldinto one call, for callers who only need the first external action matching a category. Throws if none exist for that category. The two original methods are unchanged and still independently callable. Non-breaking (purely additive).
0.1.1 #
- Fix
createPinnedDio/applyCertificatePinning: also trust ISRG Root X1 (Let's Encrypt), in addition to Amazon Root CA 1. The dev/labs host (api.superlikerslabs.com) serves a Let's Encrypt certificate, different from prod's (*.superlikers.com, Amazon-issued) — every network call against dev was failing the TLS handshake before this fix. Verified against both real hosts.
0.1.0 #
- Add
package:superlikers_core/inputs.dart: configurable Formz inputs shared across Superlikers apps (email, password, confirm password, phone number, username, OTP code, ID/document numbers, country code, terms and conditions, generic required text). Each input exposes its rules (min/max length, password complexity requirements, custom patterns, etc) as constructor parameters instead of hardcoding them.
0.0.1 #
- Initial release: shared Superlikers backend services for Flutter client apps — auth (login, 2FA email/SMS/TOTP, phone verification, password change), participant (search, points, redemption), ranking, goals, achievements, blog, external forms, prizes, referrals, documents, and comments.