be-components 7.0.1 → 7.0.3

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.
Files changed (42) hide show
  1. package/lib/commonjs/Squares/api/index.js +10 -2
  2. package/lib/commonjs/Squares/api/index.js.map +1 -1
  3. package/lib/commonjs/Squares/index.js +63 -1
  4. package/lib/commonjs/Squares/index.js.map +1 -1
  5. package/lib/commonjs/SquaresManager/api/index.js +32 -1
  6. package/lib/commonjs/SquaresManager/api/index.js.map +1 -1
  7. package/lib/commonjs/SquaresManager/index.js +137 -16
  8. package/lib/commonjs/SquaresManager/index.js.map +1 -1
  9. package/lib/module/Squares/api/index.js +10 -2
  10. package/lib/module/Squares/api/index.js.map +1 -1
  11. package/lib/module/Squares/index.js +63 -1
  12. package/lib/module/Squares/index.js.map +1 -1
  13. package/lib/module/SquaresManager/api/index.js +32 -1
  14. package/lib/module/SquaresManager/api/index.js.map +1 -1
  15. package/lib/module/SquaresManager/index.js +137 -16
  16. package/lib/module/SquaresManager/index.js.map +1 -1
  17. package/lib/typescript/lib/commonjs/Squares/api/index.d.ts +1 -0
  18. package/lib/typescript/lib/commonjs/Squares/api/index.d.ts.map +1 -1
  19. package/lib/typescript/lib/commonjs/Squares/index.d.ts.map +1 -1
  20. package/lib/typescript/lib/commonjs/SquaresManager/api/index.d.ts +2 -1
  21. package/lib/typescript/lib/commonjs/SquaresManager/api/index.d.ts.map +1 -1
  22. package/lib/typescript/lib/commonjs/SquaresManager/index.d.ts +2 -1
  23. package/lib/typescript/lib/commonjs/SquaresManager/index.d.ts.map +1 -1
  24. package/lib/typescript/lib/module/Squares/api/index.d.ts +1 -0
  25. package/lib/typescript/lib/module/Squares/api/index.d.ts.map +1 -1
  26. package/lib/typescript/lib/module/Squares/index.d.ts.map +1 -1
  27. package/lib/typescript/lib/module/SquaresManager/api/index.d.ts +2 -1
  28. package/lib/typescript/lib/module/SquaresManager/api/index.d.ts.map +1 -1
  29. package/lib/typescript/lib/module/SquaresManager/index.d.ts +2 -1
  30. package/lib/typescript/lib/module/SquaresManager/index.d.ts.map +1 -1
  31. package/lib/typescript/src/Squares/api/index.d.ts +7 -0
  32. package/lib/typescript/src/Squares/api/index.d.ts.map +1 -1
  33. package/lib/typescript/src/Squares/index.d.ts.map +1 -1
  34. package/lib/typescript/src/SquaresManager/api/index.d.ts +2 -1
  35. package/lib/typescript/src/SquaresManager/api/index.d.ts.map +1 -1
  36. package/lib/typescript/src/SquaresManager/index.d.ts +2 -1
  37. package/lib/typescript/src/SquaresManager/index.d.ts.map +1 -1
  38. package/package.json +1 -1
  39. package/src/Squares/api/index.ts +8 -2
  40. package/src/Squares/index.tsx +38 -1
  41. package/src/SquaresManager/api/index.ts +20 -1
  42. package/src/SquaresManager/index.tsx +95 -20
@@ -2,6 +2,7 @@ export const __esModule: boolean;
2
2
  export namespace SquaresManagerApi {
3
3
  function setEnvironment(): void;
4
4
  function getLeagues(): Promise<any>;
5
+ function deleteCompetition(sq_comp_id: any): Promise<any>;
5
6
  function getEventsByEventIds(event_ids: any): Promise<any>;
6
7
  function getSquareCompetitionById(sq_comp_id: any): Promise<any>;
7
8
  function updateSquaresCompetition(squares_competition: any): Promise<any>;
@@ -14,6 +15,6 @@ export namespace SquaresManagerApi {
14
15
  function activateSquares(sq_comp_id: any): Promise<any>;
15
16
  }
16
17
  export namespace SquaresManagerHelpers {
17
- function isValid(draft_squares: any): string[];
18
+ function isValid(draft_squares: any, minimum_square_price: any, guaranteed_payout: any): string[];
18
19
  }
19
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commonjs/SquaresManager/api/index.js"],"names":[],"mappings":";;IAckB,gCAOf;IACW,oCAOX;IACoB,2DAapB;IACyB,iEAOzB;IACyB,0EASzB;IACe;;;OAUf;IACY,gDAUZ;IACyB,0EAUzB;IACgB,wDAShB;;;IAGQ,+CAmBR"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commonjs/SquaresManager/api/index.js"],"names":[],"mappings":";;IAckB,gCAOf;IACW,oCAOX;IACkB,0DASlB;IACoB,2DAapB;IACyB,iEAOzB;IACyB,0EASzB;IACe;;;OAUf;IACY,gDAUZ;IACyB,0EAUzB;IACgB,wDAShB;;;IAGQ,kGAwCR"}
@@ -1,12 +1,13 @@
1
1
  export const __esModule: boolean;
2
2
  export default SquaresManager;
3
- declare function SquaresManager({ sq_comp_id, float, player, header_style, onFocusPosition, footer_style, onClose, onActivate }: {
3
+ declare function SquaresManager({ sq_comp_id, float, player, header_style, onFocusPosition, footer_style, onDelete, onClose, onActivate }: {
4
4
  sq_comp_id: any;
5
5
  float: any;
6
6
  player: any;
7
7
  header_style: any;
8
8
  onFocusPosition: any;
9
9
  footer_style: any;
10
+ onDelete: any;
10
11
  onClose: any;
11
12
  onActivate: any;
12
13
  }): any;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commonjs/SquaresManager/index.js"],"names":[],"mappings":";;AAoBA;;;;;;;;;QAimBC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commonjs/SquaresManager/index.js"],"names":[],"mappings":";;AAqBA;;;;;;;;;;QAytBC"}
@@ -1,5 +1,6 @@
1
1
  export namespace SquaresApi {
2
2
  function setEnvironment(): void;
3
+ function activateSquares(sq_comp_id: any): Promise<any>;
3
4
  function getSquareCompetitionById(sq_comp_id: any): Promise<any>;
4
5
  function getEventsByEventIds(event_ids: any): Promise<any>;
5
6
  function getLeagueById(league_id: any): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../module/Squares/api/index.js"],"names":[],"mappings":";IAUkB,gCAMf;IACyB,iEAGzB;IACoB,2DAMpB;IACc,qDAGd;IACgC,kGAUhC;IACW,4FAUX;IACa,uDAKb;IACa,sCAGb;IACsB,8DAQtB;;;IAGc,uGAkBd;IACqB,8CAarB;IACiB,oGAajB;IACgC,kFAKhC;IACoC,4FAKpC;IACsC,gGAQtC;IAC4C,4GAO5C;IACoC,2FAoBpC;IACmB;;;;;;;MAwFnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../module/Squares/api/index.js"],"names":[],"mappings":";IAUkB,gCAMf;IACgB,wDAShB;IACyB,iEAGzB;IACoB,2DAMpB;IACc,qDAGd;IACgC,kGAQhC;IACW,4FAUX;IACa,uDAKb;IACa,sCAGb;IACsB,8DAQtB;;;IAGc,uGAkBd;IACqB,8CAarB;IACiB,oGAajB;IACgC,kFAKhC;IACoC,4FAKpC;IACsC,gGAQtC;IAC4C,4GAO5C;IACoC,2FAoBpC;IACmB;;;;;;;MAwFnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../module/Squares/index.js"],"names":[],"mappings":";AAqBA;;;;;;;;;;;kGA45BC;kBAj7B0C,OAAO"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../module/Squares/index.js"],"names":[],"mappings":";AAqBA;;;;;;;;;;;kGA09BC;kBA/+B0C,OAAO"}
@@ -1,9 +1,10 @@
1
1
  export namespace SquaresManagerHelpers {
2
- function isValid(draft_squares: any): string[];
2
+ function isValid(draft_squares: any, minimum_square_price: any, guaranteed_payout: any): string[];
3
3
  }
4
4
  export namespace SquaresManagerApi {
5
5
  function setEnvironment(): void;
6
6
  function getLeagues(): Promise<any>;
7
+ function deleteCompetition(sq_comp_id: any): Promise<any>;
7
8
  function getEventsByEventIds(event_ids: any): Promise<any>;
8
9
  function getSquareCompetitionById(sq_comp_id: any): Promise<any>;
9
10
  function updateSquaresCompetition(squares_competition: any): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../module/SquaresManager/api/index.js"],"names":[],"mappings":";IAqGW,+CAmBR;;;IAhHe,gCAOf;IACW,oCAOX;IACoB,2DAapB;IACyB,iEAOzB;IACyB,0EASzB;IACe;;;OAUf;IACY,gDAUZ;IACyB,0EAUzB;IACgB,wDAShB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../module/SquaresManager/api/index.js"],"names":[],"mappings":";IA+GW,kGAwCR;;;IA/Ie,gCAOf;IACW,oCAOX;IACkB,0DASlB;IACoB,2DAapB;IACyB,iEAOzB;IACyB,0EASzB;IACe;;;OAUf;IACY,gDAUZ;IACyB,0EAUzB;IACgB,wDAShB"}
@@ -1,11 +1,12 @@
1
1
  export default SquaresManager;
2
- declare function SquaresManager({ sq_comp_id, float, player, header_style, onFocusPosition, footer_style, onClose, onActivate }: {
2
+ declare function SquaresManager({ sq_comp_id, float, player, header_style, onFocusPosition, footer_style, onDelete, onClose, onActivate }: {
3
3
  sq_comp_id: any;
4
4
  float: any;
5
5
  player: any;
6
6
  header_style: any;
7
7
  onFocusPosition: any;
8
8
  footer_style: any;
9
+ onDelete: any;
9
10
  onClose: any;
10
11
  onActivate: any;
11
12
  }): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../module/SquaresManager/index.js"],"names":[],"mappings":";AAYA;;;;;;;;;kGAimBC;kBA7mB0C,OAAO"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../module/SquaresManager/index.js"],"names":[],"mappings":";AAaA;;;;;;;;;;kGAytBC;kBAtuB0C,OAAO"}
@@ -2,6 +2,13 @@ import type { BuySquaresResponseProps, EventProps, LeagueProps, OfferResponsePro
2
2
  export { SquaresApi, SqauresHelpers };
3
3
  declare const SquaresApi: {
4
4
  setEnvironment: () => void;
5
+ activateSquares: (sq_comp_id: string) => Promise<undefined | {
6
+ squares_competition: SquaresCompetitionProps;
7
+ player_squares: PlayerSquareProps[];
8
+ squares: SquareProps[];
9
+ squares_payout_type: SquaresPayoutProps;
10
+ squares_type: SquaresTypeProps;
11
+ }>;
5
12
  getSquareCompetitionById: (sq_comp_id: string) => Promise<{
6
13
  squares_competition: SquaresCompetitionProps;
7
14
  square_results: SquareResultProps[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Squares/api/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAQtT,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAA;AAErC,QAAA,MAAM,UAAU;;2CAQ+B,MAAM,KAAE,OAAO,CAAC;QAAE,mBAAmB,EAAC,uBAAuB,CAAC;QAAC,cAAc,EAAC,iBAAiB,EAAE,CAAC;QAAC,OAAO,EAAC,WAAW,EAAE,CAAC;QAAC,cAAc,EAAC,iBAAiB,EAAE,CAAC;QAAC,aAAa,EAAC,gBAAgB,EAAE,CAAC;QAAC,YAAY,EAAC,gBAAgB,CAAC;QAAC,mBAAmB,EAAE,kBAAkB,CAAC;QAAC,qBAAqB,EAAC,iBAAiB,EAAE,CAAC;QAAC,aAAa,EAAC,gBAAgB,EAAE,CAAA;KAAE,CAAC;qCAI5V,MAAM,EAAE,KAAE,OAAO,CAAC,UAAU,EAAE,CAAC;+BAIrC,MAAM,KAAE,OAAO,CAAC,WAAW,CAAC;kDAIV,MAAM,UAAU,QAAQ,GAAC,QAAQ,UAAS,MAAM,KAAE,OAAO,CAAC,uBAAuB,EAAE,CAAC;6BAWxG,MAAM,kBAAiB,iBAAiB,EAAE,kBAAiB,OAAO,KAAE,OAAO,CAAC,uBAAuB,CAAC;iCAKhG,gBAAgB,KAAE,OAAO,CAAC,kBAAkB,CAA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,kBAAiB,iBAAiB,EAAE,wBAAuB,uBAAuB,cAAa,MAAM;;;;;;;;CAgDlJ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Squares/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAElD,OAAO,KAAK,EAAE,YAAY,EAA+G,iBAAiB,EAAsE,uBAAuB,EAAwC,MAAM,UAAU,CAAA;AAoB/S,KAAK,kBAAkB,GAAG;IACtB,SAAS,CAAC,EAAC,MAAM,CAAC;IAClB,WAAW,EAAC,MAAM,CAAC;IACnB,WAAW,CAAC,EAAC,OAAO,CAAC;IACrB,SAAS,EAAC,SAAS,GAAC,QAAQ,CAAC;IAC7B,UAAU,EAAC,MAAM,CAAC;IAClB,eAAe,CAAC,EAAC,CAAC,EAAE,EAAC,uBAAuB,KAAK,IAAI,CAAC;IACtD,MAAM,CAAC,EAAE;QAAE,GAAG,EAAC,MAAM,CAAC;QAAC,MAAM,EAAC,MAAM,CAAA;KAAE,CAAC;IACvC,qBAAqB,EAAE,CAAC,gBAAgB,CAAC,EAAC,MAAM,KAAK,IAAI,CAAC;IAC1D,kBAAkB,EAAC,CAAC,mBAAmB,EAAC,uBAAuB,KAAK,IAAI,CAAC;IACzE,cAAc,EAAC,CAAC,MAAM,EAAC,iBAAiB,KAAK,IAAI,CAAC;IAClD,OAAO,EAAC,CAAC,EAAE,EAAC,YAAY,KAAK,IAAI,CAAA;CACpC,CAAA;AAID,QAAA,MAAM,aAAa,GAAI,oJAAmJ,kBAAkB,sBAkoB3L,CAAA;AAED,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Squares/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAElD,OAAO,KAAK,EAAE,YAAY,EAA+G,iBAAiB,EAAsE,uBAAuB,EAAwC,MAAM,UAAU,CAAA;AAoB/S,KAAK,kBAAkB,GAAG;IACtB,SAAS,CAAC,EAAC,MAAM,CAAC;IAClB,WAAW,EAAC,MAAM,CAAC;IACnB,WAAW,CAAC,EAAC,OAAO,CAAC;IACrB,SAAS,EAAC,SAAS,GAAC,QAAQ,CAAC;IAC7B,UAAU,EAAC,MAAM,CAAC;IAClB,eAAe,CAAC,EAAC,CAAC,EAAE,EAAC,uBAAuB,KAAK,IAAI,CAAC;IACtD,MAAM,CAAC,EAAE;QAAE,GAAG,EAAC,MAAM,CAAC;QAAC,MAAM,EAAC,MAAM,CAAA;KAAE,CAAC;IACvC,qBAAqB,EAAE,CAAC,gBAAgB,CAAC,EAAC,MAAM,KAAK,IAAI,CAAC;IAC1D,kBAAkB,EAAC,CAAC,mBAAmB,EAAC,uBAAuB,KAAK,IAAI,CAAC;IACzE,cAAc,EAAC,CAAC,MAAM,EAAC,iBAAiB,KAAK,IAAI,CAAC;IAClD,OAAO,EAAC,CAAC,EAAE,EAAC,YAAY,KAAK,IAAI,CAAA;CACpC,CAAA;AAID,QAAA,MAAM,aAAa,GAAI,oJAAmJ,kBAAkB,sBAuqB3L,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -4,6 +4,7 @@ export { SquaresManagerApi };
4
4
  declare const SquaresManagerApi: {
5
5
  setEnvironment: () => void;
6
6
  getLeagues: () => Promise<LeagueProps[]>;
7
+ deleteCompetition: (sq_comp_id: string) => Promise<SquaresCompetitionProps | undefined>;
7
8
  getEventsByEventIds: (event_ids: string[]) => Promise<EventProps[]>;
8
9
  getSquareCompetitionById: (sq_comp_id: string) => Promise<undefined | {
9
10
  squares_competition: SquaresCompetitionProps;
@@ -31,6 +32,6 @@ declare const SquaresManagerApi: {
31
32
  }>;
32
33
  };
33
34
  export declare const SquaresManagerHelpers: {
34
- isValid: (draft_squares?: SquaresCompetitionProps) => string[];
35
+ isValid: (draft_squares?: SquaresCompetitionProps, minimum_square_price?: string, guaranteed_payout?: string) => string[];
35
36
  };
36
37
  //# sourceMappingURL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C;0BAQ9F,OAAO,CAAC;QAAC,SAAS,EAAC,YAAY,EAAE,CAAC;QAAC,eAAe,EAAC,kBAAkB,EAAE,CAAA;KAAC,CAAC;0BAKxE,MAAM,KAAE,OAAO,CAAC;QAAC,MAAM,EAAE,UAAU,EAAE,CAAC;QAAC,aAAa,EAAC,gBAAgB,EAAE,CAAA;KAAC,CAAC;oDAS/C,uBAAuB,KAAE,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC;kCASvF,MAAM,KAAE,OAAO,CAAC,SAAS,GAAG;QAAE,mBAAmB,EAAC,uBAAuB,CAAA;KAAE,CAAC;CAQjH,CAAA;AAGD,eAAO,MAAM,qBAAqB;8BACL,uBAAuB,yBAAwB,MAAM,sBAAqB,MAAM;CAoB5G,CAAA"}
@@ -7,10 +7,11 @@ type SquaresManagerProps = {
7
7
  float?: boolean;
8
8
  player?: MyPlayerProps;
9
9
  onActivate: (sq: SquaresCompetitionProps) => void;
10
+ onDelete: (sq: SquaresCompetitionProps) => void;
10
11
  onClose: () => void;
11
12
  header_style?: ViewStyle;
12
13
  footer_style?: ViewStyle;
13
14
  };
14
- declare const SquaresManager: ({ sq_comp_id, float, player, header_style, onFocusPosition, footer_style, onClose, onActivate }: SquaresManagerProps) => React.JSX.Element;
15
+ declare const SquaresManager: ({ sq_comp_id, float, player, header_style, onFocusPosition, footer_style, onDelete, onClose, onActivate }: SquaresManagerProps) => React.JSX.Element;
15
16
  export default SquaresManager;
16
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/SquaresManager/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAGlD,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAA4B,kBAAkB,EAA2B,aAAa,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAS9I,KAAK,mBAAmB,GAAG;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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "be-components",
3
- "version": "7.0.1",
3
+ "version": "7.0.3",
4
4
  "description": "Components for BettorEdge Apps",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -18,6 +18,14 @@ const SquaresApi = {
18
18
  //MK_SVC_API = endpoints['MK_SVC_API'] as string;
19
19
  AUTH_SVC_API = endpoints['AUTH_SVC_API'] as string;
20
20
  },
21
+ activateSquares: async(sq_comp_id:string):Promise<undefined | { squares_competition:SquaresCompetitionProps, player_squares:PlayerSquareProps[], squares:SquareProps[], squares_payout_type:SquaresPayoutProps, squares_type:SquaresTypeProps }> => {
22
+ try {
23
+ const resp = await axios.post(`${TP_SVC_API}/v1/squares/competition/activate`, { sq_comp_id });
24
+ return resp.data
25
+ } catch (e) {
26
+ return undefined
27
+ }
28
+ },
21
29
  getSquareCompetitionById: async(sq_comp_id:string):Promise<{ squares_competition:SquaresCompetitionProps, square_results:SquareResultProps[], squares:SquareProps[], player_squares:PlayerSquareProps[], square_offers:SquareOfferProps[], squares_type:SquaresTypeProps, squares_payout_type: SquaresPayoutProps, player_square_history:PlayerSquareProps[], square_prizes:SquarePrizeProps[] }> => {
22
30
  const resp = await axios.get(`${TP_SVC_API}/tp/squares/comp/details/${sq_comp_id}`)
23
31
  return resp.data
@@ -32,9 +40,7 @@ const SquaresApi = {
32
40
  },
33
41
  getSquaresCompetitionsByCompany:async(company_id:string, status: 'active'|'closed', offset:number):Promise<SquaresCompetitionProps[]> => {
34
42
  try {
35
- console.log(company_id, status, offset)
36
43
  const resp = await axios.get(`${TP_SVC_API}/v1/squares/competitions/company/${company_id}?status=${status}&offset=${offset}`);
37
- console.log(resp.data)
38
44
  return resp.data.squares_competitions
39
45
  } catch (e) {
40
46
  console.log(e);
@@ -34,7 +34,7 @@ type SquaresModuleProps = {
34
34
  onEvent:(ev:BEEventProps) => void
35
35
  }
36
36
 
37
- const squares_sections = ['header', 'offers', 'toggle', 'event', 'board', 'board_stats', 'my_stats', 'results', 'my_squares', 'winners','hidden_prizes','details', 'owners']
37
+ const squares_sections = ['header', 'activate', 'offers', 'toggle', 'event', 'board', 'board_stats', 'my_stats', 'results', 'my_squares', 'winners','hidden_prizes','details', 'owners']
38
38
 
39
39
  const SquaresModule = ({ sq_comp_id, info_header, view_mode, insets, player_id, distinct_id, onManageSquares, onRequestAuthenticate, onShareCompetition, onPlayerSelect }:SquaresModuleProps) => {
40
40
  const C = useColors();
@@ -334,6 +334,23 @@ const SquaresModule = ({ sq_comp_id, info_header, view_mode, insets, player_id,
334
334
  })
335
335
  }
336
336
 
337
+ const handleActivate = async() => {
338
+ if(!squares_competition || loading){ return }
339
+ if(squares_competition.status != 'pending'){ return }
340
+ setModuleData({ ...module_data, loading: true });
341
+ const activate_resp = await SquaresApi.activateSquares(squares_competition.sq_comp_id);
342
+ if(!activate_resp){ return alert('Unable to activate competition') }
343
+ setModuleData({
344
+ ...module_data,
345
+ squares_competition: activate_resp.squares_competition,
346
+ player_squares: activate_resp.player_squares,
347
+ squares: activate_resp.squares,
348
+ squares_type: activate_resp.squares_type,
349
+ squares_payout_type: activate_resp.squares_payout_type,
350
+ loading: true
351
+ });
352
+ }
353
+
337
354
  const handleUpdateBoardFromBuy = (data:BuySquaresResponseProps) => {
338
355
  //First remove squares
339
356
  //Now update squares
@@ -378,6 +395,25 @@ const SquaresModule = ({ sq_comp_id, info_header, view_mode, insets, player_id,
378
395
  </Button>
379
396
  </View>
380
397
  )
398
+ case 'activate':
399
+ if(squares_competition?.status != 'pending'){ return <></> }
400
+ if(player_id != squares_competition?.admin_id){ return <></> }
401
+ return (
402
+ <View type='row' style={{ padding:10 }}>
403
+ <View style={{ flex:1 }}>
404
+ <Text theme="h2">Squares competition is pending.</Text>
405
+ <Text theme="description" style={{ marginTop:3 }}>Press Activate to allow others to join!</Text>
406
+ </View>
407
+ <Button
408
+ disabled={loading ? true : false}
409
+ style={{ marginLeft:5, padding:10 }}
410
+ loading={loading}
411
+ title="ACTIVATE!"
412
+ type='success'
413
+ onPress={() => handleActivate()}
414
+ />
415
+ </View>
416
+ )
381
417
  case 'event':
382
418
  if(!event){ return <></> }
383
419
  return (
@@ -512,6 +548,7 @@ const SquaresModule = ({ sq_comp_id, info_header, view_mode, insets, player_id,
512
548
  )
513
549
  case 'board':
514
550
  if(!squares_competition){ return <></> }
551
+ if(squares_competition.status == 'pending'){ return <></> }
515
552
  return (
516
553
  <View style={{ alignItems:view_mode == 'desktop' ? 'center': undefined }}>
517
554
  <SquaresBoard
@@ -27,6 +27,14 @@ const SquaresManagerApi = {
27
27
  return []
28
28
  }
29
29
  },
30
+ deleteCompetition: async(sq_comp_id:string):Promise<SquaresCompetitionProps|undefined> => {
31
+ try {
32
+ const resp = await axios.post(`${TP_SVC_API}/v1/squares/competition/delete`, { sq_comp_id });
33
+ return resp.data.squares_competition
34
+ } catch (e) {
35
+ return undefined
36
+ }
37
+ },
30
38
  getEventsByEventIds: async(event_ids:string[]):Promise<EventProps[]> => {
31
39
  try {
32
40
  if(event_ids.length == 0){ return [] }
@@ -87,13 +95,24 @@ const SquaresManagerApi = {
87
95
 
88
96
 
89
97
  export const SquaresManagerHelpers = {
90
- isValid: (draft_squares?:SquaresCompetitionProps) => {
98
+ isValid: (draft_squares?:SquaresCompetitionProps, minimum_square_price?:string, guaranteed_payout?:string) => {
91
99
  if(!draft_squares){ return ['Invalid'] }
92
100
  let errors:string[] = []
93
101
  if(!draft_squares){ errors.push('Please complete steps'); return errors }
94
102
  if(!draft_squares.sq_comp_name){ errors.push('Please add a squares name') }
95
103
  if(!draft_squares.sq_comp_description){ errors.push('Please add a description') }
96
104
  if(!draft_squares.event_id){ errors.push('Please add an event') }
105
+ if(!minimum_square_price){ errors.push('Please add a square price') }
106
+ if(minimum_square_price){
107
+ let int_price = parseFloat(minimum_square_price)
108
+ if(isNaN(int_price)){ errors.push('Minimum square price is not valid') }
109
+ if(int_price < 0.5){ errors.push('Minimum square price must be at least 50 cents') }
110
+ }
111
+ if(guaranteed_payout){
112
+ let int_payout = parseFloat(guaranteed_payout)
113
+ if(isNaN(int_payout)){ errors.push('Guaranteed payout is not valid') }
114
+ if(int_payout < 0){ errors.push('Guaranteed payout cannot be negative') }
115
+ }
97
116
  return errors
98
117
  }
99
118
  }
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react"
2
2
  import { SquaresManagerApi, SquaresManagerHelpers } from "./api";
3
3
  import { Button, Text, TextInput, View } from "../Components/Themed";
4
4
  import { FlatList, Image, type ViewStyle } from "react-native";
5
- import type { CompanyProps, EventProps, FocusPositionProps, GroupProps, LeagueProps, MyPlayerProps, SquaresCompetitionProps } from "../types";
5
+ import type { CompanyProps, EventProps, FocusPositionProps, GroupProps, LeagueProps, MyPlayerProps, PlayerSquareProps, SquaresCompetitionProps } from "../types";
6
6
  import { useColors } from "../constants/useColors";
7
7
  import LeagueSchedule from "../MarketComponents/components/LeagueSchedule";
8
8
  import { Icons, Switch, Toggle } from "../Components";
@@ -10,6 +10,7 @@ import moment from "moment-mini";
10
10
  import ImageUploader from "../Components/ImageUploader";
11
11
  import GroupSelector from "../CompetitionManager/components/GroupSelector";
12
12
  import CompanySelector from "../CompetitionManager/components/CompanySelector";
13
+ import { showConfirmAlert } from "../Components/ConfirmAlert";
13
14
 
14
15
  type SquaresManagerProps = {
15
16
  sq_comp_id:string,
@@ -17,12 +18,13 @@ type SquaresManagerProps = {
17
18
  float?:boolean,
18
19
  player?:MyPlayerProps,
19
20
  onActivate:(sq:SquaresCompetitionProps) => void,
21
+ onDelete:(sq:SquaresCompetitionProps) => void,
20
22
  onClose:() => void,
21
23
  header_style?:ViewStyle,
22
24
  footer_style?:ViewStyle
23
25
  }
24
- const sections = ['header','toggle','info','event']
25
- const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPosition, footer_style, onClose, onActivate }:SquaresManagerProps) => {
26
+ const sections = ['header','activate','toggle','info','event','delete']
27
+ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPosition, footer_style, onDelete, onClose, onActivate }:SquaresManagerProps) => {
26
28
  const Colors = useColors();
27
29
  const [ my_data, setMyData ] = useState<{
28
30
  groups:GroupProps[],
@@ -34,11 +36,13 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
34
36
  const { groups, companies } = my_data;
35
37
  const [ sq_state, setState ] = useState<{
36
38
  loading: boolean,
37
- active_tab: 'info'|'event',
39
+ active_tab: 'info'|'event'|'danger',
38
40
  leagues_visible?:boolean,
39
41
  active_event?:EventProps,
40
42
  active_league?:LeagueProps,
43
+ player_squares:PlayerSquareProps[],
41
44
  min_square_price:string,
45
+ guaranteed_payout:string,
42
46
  leagues:LeagueProps[],
43
47
  league_schedule:boolean,
44
48
  draft_competition?:SquaresCompetitionProps,
@@ -49,19 +53,20 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
49
53
  leagues_visible:false,
50
54
  leagues:[],
51
55
  min_square_price: '0',
56
+ player_squares:[],
57
+ guaranteed_payout: '0',
52
58
  league_schedule: false
53
59
  });
54
- const { loading, squares_competition, min_square_price, active_tab, leagues, league_schedule, draft_competition, leagues_visible, active_event, active_league } = sq_state
60
+ const { loading, squares_competition, min_square_price, player_squares, guaranteed_payout, active_tab, leagues, league_schedule, draft_competition, leagues_visible, active_event, active_league } = sq_state
55
61
  const active_group = groups.find(g => g.group_id == draft_competition?.group_id)
56
62
  const active_company = companies.find(c => c.company_id == draft_competition?.company_id);
57
-
58
63
  useEffect(() => {
59
64
  SquaresManagerApi.setEnvironment();
60
65
  getData(sq_comp_id)
61
66
  if(player){ getMyData() }
62
67
  },[sq_comp_id, player]);
63
68
 
64
- const errors = SquaresManagerHelpers.isValid(draft_competition);
69
+ const errors = SquaresManagerHelpers.isValid(draft_competition, min_square_price, guaranteed_payout);
65
70
 
66
71
  const getMyData = async() => {
67
72
  const my_groups = await SquaresManagerApi.getMyGroups(0);
@@ -91,6 +96,7 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
91
96
  loading: false,
92
97
  leagues: lgs.filter(l => l.sport == 'Football'),
93
98
  active_event: active_ev,
99
+ player_squares: sq_data.player_squares,
94
100
  min_square_price: sq_data.squares_competition.minimum_square_price.toFixed(2),
95
101
  active_league: active_league,
96
102
  draft_competition: sq_data.squares_competition,
@@ -112,11 +118,32 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
112
118
  onActivate(activate_resp.squares_competition)
113
119
  }
114
120
 
121
+ const handleDelete = async() => {
122
+ setState({ ...sq_state, loading:true });
123
+ const deleted_comp = await SquaresManagerApi.deleteCompetition(sq_comp_id);
124
+ if(!deleted_comp){ return alert('Unable to delete competition. If any bids are active, you cannot delete this competition') }
125
+ setState({
126
+ ...sq_state,
127
+ squares_competition: deleted_comp,
128
+ draft_competition: deleted_comp,
129
+ loading:true
130
+ });
131
+ onDelete(deleted_comp)
132
+ }
133
+
134
+ const handleConfirmDelete = () => {
135
+ if(player_squares.length > 0){ return alert('Unable to delete competition with active bids') }
136
+ showConfirmAlert('Are you sure?', 'Once this is deleted you can no longer access it',
137
+ () => handleDelete(),
138
+ () => console.log('')
139
+ )
140
+ }
141
+
115
142
  const updateCompetition = async(sq_comp:SquaresCompetitionProps) => {
116
143
  if(errors.length > 0){ return alert(errors.map(e => e)) }
117
144
  if(loading){ return }//No mashy
118
145
  setState({ ...sq_state, loading:true });
119
- const new_comp = await SquaresManagerApi.updateSquaresCompetition({ ...sq_comp, minimum_square_price: parseFloat(min_square_price)});
146
+ const new_comp = await SquaresManagerApi.updateSquaresCompetition({ ...sq_comp, guaranteed_payout: parseFloat(guaranteed_payout), minimum_square_price: parseFloat(min_square_price)});
120
147
  if(!new_comp){ return alert('Unable to update squares competition') }
121
148
  setState({
122
149
  ...sq_state,
@@ -187,6 +214,24 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
187
214
  />
188
215
  </View>
189
216
  )
217
+ case 'activate':
218
+ if(squares_competition?.status != 'pending'){ return <></> }
219
+ return (
220
+ <View type='row' style={{ padding:10 }}>
221
+ <View style={{ flex:1 }}>
222
+ <Text theme="h2">Squares competition is pending.</Text>
223
+ <Text theme="description" style={{ marginTop:3 }}>Press Activate to allow others to join!</Text>
224
+ </View>
225
+ <Button
226
+ disabled={errors.length > 0 || loading ? true : false}
227
+ style={{ marginLeft:5, padding:10, opacity: errors.length > 0 ? 0.5: 1 }}
228
+ loading={loading}
229
+ title="ACTIVATE!"
230
+ type='success'
231
+ onPress={() => handleActivate()}
232
+ />
233
+ </View>
234
+ )
190
235
  case 'toggle':
191
236
  return (
192
237
  <View transparent>
@@ -197,9 +242,10 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
197
242
  options={[
198
243
  { key: 'info', label: 'Info', icon: <Icons.MenuIcon size={14} color={Colors.text.warning} /> },
199
244
  { key: 'event', label: 'Event', icon: <Icons.ActivityIcon size={14} color={Colors.text.warning} /> },
245
+ { key: 'danger', label: 'Danger', icon: <Icons.AlertIcon size={14} color={Colors.text.error} /> },
200
246
  ]}
201
247
  selected_option={active_tab}
202
- onSelectOption={(key) => setState({ ...sq_state, active_tab: key as 'info'|'event'})}
248
+ onSelectOption={(key) => setState({ ...sq_state, active_tab: key as 'info'|'event'|'danger'})}
203
249
  title_renderer={(option) => {
204
250
  const selected = option.key == active_tab ? true : false
205
251
  return (
@@ -214,6 +260,33 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
214
260
  />
215
261
  </View>
216
262
  )
263
+ case 'delete':
264
+ if(active_tab != 'danger'){ return <></> }
265
+ return (
266
+ <View>
267
+ <View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
268
+ <View transparent style={{ flex:1 }}>
269
+ <Text theme="h1">DELETE COMPETITION</Text>
270
+ <Text theme="description" style={{ marginTop:3 }}>Archive this competition</Text>
271
+ </View>
272
+ </View>
273
+ <View style={{ padding:10 }}>
274
+ {player_squares.length > 0 ?
275
+ <Text theme="warning">This competition cannot be archived as there are active bids on squares.</Text>
276
+ :
277
+ <Text theme="warning">Once archived you will no longer be able to edit or see this competition</Text>
278
+ }
279
+ <Button
280
+ title="DELETE"
281
+ disabled={player_squares.length > 0 ? true: false}
282
+ loading={loading}
283
+ onPress={() => handleConfirmDelete()}
284
+ type='error'
285
+ style={{ marginTop:10, opacity: player_squares.length > 0 || loading ? 0.5:1 }}
286
+ />
287
+ </View>
288
+ </View>
289
+ )
217
290
  case 'info':
218
291
  if(!draft_competition){ return <></> }
219
292
  if(active_tab != 'info'){ return <></> }
@@ -249,6 +322,18 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
249
322
  onChangeText={(text) => setState({ ...sq_state, min_square_price: text })}
250
323
  />
251
324
  </View>
325
+ {player?.role == 'admin' ?
326
+ <View style={{ padding:10 }}>
327
+ <Text theme='h1' style={{ marginBottom:10 }}>Guaranteed Payout</Text>
328
+ <TextInput
329
+ placeholder='1'
330
+ onFocusPosition={onFocusPosition}
331
+ value={guaranteed_payout}
332
+ style={{ textAlign:'center' }}
333
+ onChangeText={(text) => setState({ ...sq_state, guaranteed_payout: text })}
334
+ />
335
+ </View>
336
+ :<></>}
252
337
  <View type='row' nativeID="invite_only" style={{ flexWrap:'wrap', padding:20, borderBottomWidth:1, borderColor:Colors.borders.light }}>
253
338
  <View style={{ flex:1, marginRight:15 }}>
254
339
  <Text theme='h1'>Make Private</Text>
@@ -358,7 +443,7 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
358
443
  default: return <></>
359
444
  }
360
445
  }
361
- const is_changed = JSON.stringify(squares_competition) != JSON.stringify(draft_competition) ? true : parseFloat(min_square_price) != draft_competition?.minimum_square_price ? true : false
446
+ const is_changed = JSON.stringify(squares_competition) != JSON.stringify(draft_competition) ? true : parseFloat(min_square_price) != draft_competition?.minimum_square_price ? true : parseFloat(guaranteed_payout) != draft_competition?.guaranteed_payout ? true : false
362
447
  return (
363
448
  <View float={float} style={{ flex:1 }}>
364
449
  <View transparent style={{ flex:1 }}>
@@ -378,16 +463,6 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
378
463
  type='action'
379
464
  onPress={() => draft_competition ? updateCompetition(draft_competition) : console.log('')}
380
465
  />
381
- {squares_competition?.status == 'pending' ?
382
- <Button
383
- disabled={errors.length > 0 || loading ? true : false}
384
- style={{ flex:2, marginLeft:10, opacity: errors.length > 0 ? 0.5: 1 }}
385
- loading={loading}
386
- title="ACTIVATE!"
387
- type='success'
388
- onPress={() => handleActivate()}
389
- />
390
- :<></>}
391
466
  </View>
392
467
  </View>
393
468
  )